服务器通知系统
Server Notify System 为 Paper 服务器添加了持久化通知和私人团队聊天功能。
可以向在线、离线或尚未加入的玩家发送消息。在线玩家会立即收到,而离线通知会被保存,并在他们下次连接时、进入服务器之前显示。
所有内容都存储在简单的收件箱中,并完全在服务器端运行。
功能
- 针对在线、离线和未来玩家的推送通知
- 支持发送给单个玩家、多个以逗号分隔的玩家,或整个服务器的群组
- 支持最多 2,000 字符的多行通知
- 收件箱、发送历史、已读状态、标记为已读、回复、撤回以及屏蔽功能
- 由玩家私管理的团队及实时团队聊天
- 可配置的限额,以及“所有人”、“仅限管理员”或“禁用”模式
- 重启后仍保留的通知、团队、草稿和设置
离线通知
(这是该模组最酷的功能之一)
如果玩家处于离线状态,其通知会等待他们上线。
当他们返回时,最早的一条未读通知会在他们进入服务器之前显示。如果有多个通知在等待,玩家可以重新连接并按顺序逐一查看。
这完全是服务器端运行的,使得玩家很难错过重要通知。
随时可以通过以下命令再次查看所有通知:
/notifications
发送通知
快速发送一条通知:
/notify Alex The event starts at 7 PM.
向多名玩家发送相同的通知:
/notify Alex,Sam,Jordan Meet at spawn.
省略消息内容即可打开多行编辑器:
/notify Alex
在编辑器中输入的每一条消息都会成为新的一行。输入 view message 查看草稿,send 发送,或 cancel 丢弃。
未完成的草稿在重新连接后继续存在。
通知收件箱
/notifications 会打开一个可点击的收件箱,玩家可以在其中阅读、回复、标记为已读、恢复、撤回、删除、静音或屏蔽通知。
不同的视图将未读、已发送、已标记为已读和已屏蔽的消息分类整理。已发送的通知还会显示其投递和已读状态。
来自被屏蔽玩家的通知会被静默移至“已屏蔽”收件箱。它们不会创建提醒,也不会出现在登录过程中,且发送者不会得知自己已被屏蔽。
团队消息
玩家可以创建私人团队,邀请他人,选择活跃团队,并与在线团队成员进行交流。
使用以下命令发送一条团队消息:
/tc Meet at the base!
使用 /teammsg chat 可将普通聊天路由到当前活跃的团队,直到离开服务器或手动禁用此功能为止。
团队支持多词名称、在线与离线邀请、自定义颜色、每个玩家加入多个团队以及成员管理功能。
团队消息是实时的,不会为离线成员保存。如果需要让某人稍后接收消息,请使用 /notify。
主要命令
/notify
/notifications
/teammsg
/tc
使用 /teammsg help 获取完整的游戏内指南。
推荐的 Paper 设置
阅读多条离线通知可能需要快速的重新连接操作。
为了获得更流畅的体验,建议将 Paper 的连接节流时间降低至约 400 毫秒:
settings:
connection-throttle: 400
SNS 会检查此项设置,并在检测到可能干扰通知重连的情况时提醒管理员。
潜在地,未来我可能会添加一项功能:如果有人收到通知,则对该次重连忽略 connection-throttle 设置(从而移除这个手动配置),但这可能需要一段时间才能实现,因此目前仍建议进行此设置。
需要 Paper 1.21.11 和 Java 21。
人们可以改进并分叉 SNS,但对其现有代码的改进不能简单地消失在一个闭源分叉中。
附注:这不是第一个此类模组,市面上还有其他类似模组,但这是我基于许多酷炫想法的个人版本 :D
它的设计宗旨是简单,并且完全在服务器端运行。
Server Notify System
Server Notify System adds persistent notifications and private team chat to Paper servers.
Send messages to players who are online, offline, or have not joined yet. Online players receive them immediately, while offline notifications are saved and shown the next time they connect, before they enter the server.
Everything is stored in a simple inbox and runs entirely server-side.
Features
- Notifications for online, offline, and future players
- Send to one player, several comma-separated players, or server-wide groups
- Multiline notifications up to 2,000 characters
- Inbox, sent history, read status, dismissal, replies, retracting, and blocking
- Private player-managed teams with live team chat
- Configurable limits and Everyone, Operators Only, or Disabled modes
- Persistent notifications, teams, drafts, and settings across restarts
Offline Notifications
(This is one of the coolest features of this mod)
If a player is offline, their notification waits for them.
When they return, the oldest unread notification is shown before they enter the server. If several notifications are waiting, the player can reconnect to continue through them in order.
This is FULLY server-side and makes it hard for players to miss important notifications.
Notifications can always be viewed again with:
/notifications
Sending Notifications
Send a quick notification:
/notify Alex The event starts at 7 PM.
Send the same notification to several players:
/notify Alex,Sam,Jordan Meet at spawn.
Leave out the message to open the multiline composer:
/notify Alex
Each message entered in the composer becomes a new line. Type view message to view the draft, send to send it, or cancel to discard it.
Unfinished drafts continue after reconnecting.
Notification Inbox
/notifications opens a clickable inbox where players can read, reply to, dismiss, restore, retract, delete, mute, or block notifications.
Separate views keep unread, sent, dismissed, and blocked messages organized. Sent notifications also show their delivery and read status.
Notifications from blocked players are quietly moved to the Blocked inbox. They do not create alerts or appear while joining, and the sender is not told that they were blocked.
Team Messaging
Players can create private teams, invite others, select an active team, and communicate with online team members.
Send one team message with:
/tc Meet at the base!
Use /teammsg chat to route normal chat into the active team until leaving the server or disabling it.
Teams support multiword names, online and offline invitations, custom colors, multiple teams per player, and member management.
Team messages are live and are not saved for offline members. Use /notify when someone needs to receive the message later.
Main Commands
/notify
/notifications
/teammsg
/tc
Use /teammsg help for the complete in-game guide.
Recommended Paper Setting
Reading several offline notifications may require quick reconnects.
For a smoother experience, lowering Paper's connection throttle to around 400 milliseconds is recommended:
settings:
connection-throttle: 400
SNS checks this setting and reminds operators if it may interfere with notification reconnects.
Potentially, in the future, I might add a feature where if someone gets a notification, connection-throttle is ignored for that rejoin (to remove this manual setting), but that may come in a while, so this setting is still recommended.
Requires Paper 1.21.11 and Java 21.
People may improve and fork SNS, but improvements to its existing code cannot simply disappear into a closed-source fork.
P.S. This is not the first mod like this, others exist, but it's my spin on it with many cool ideas that I added :D
It's designed to be simple, and fully server-side
评论 0
登录后参与评分
还没有评论,来抢沙发吧