Proxy-Messages
适用于你的 Velocity/Paper 网络的统一系统与玩家消息系统
ProxyMessages 是一款强大的 Velocity 插件,旨在跨所有服务器统一你网络的消息系统。ProxyMessages 可配置为向所有服务器上的玩家发送消息,包括玩家聊天、代理连接、断开连接以及服务器切换。无论你运营的是小型网络还是大规模操作,ProxyMessages 都能通过在整个服务器网络中同步关键消息,帮助你为玩家提供无缝的体验。
加入 我的 Discord!

主要功能:
- 全局消息:即使玩家未连接到同一服务器,也能彼此交流。
- 可配置消息:轻松自定义加入、离开、服务器切换和玩家消息,使其符合你服务器网络的基调和风格。
- 可扩展的配置选项:支持 PlaceholderAPI!
- 多种消息变体:为每个事件创建多个潜在消息,增加多样性并保持玩家体验的新鲜感。
- 支持 HEX 的自定义颜色:使用 HEX 代码增强消息中的自定义颜色,以匹配服务器的品牌或美学风格。
- Kyori Adventure TextDecoration:超越单纯颜色的自定义文本格式!
- 能够部署全网资源包。
- 与 Discord 集成:让你的服务器网络在 Discord 上保持连通!
配置概览:
所有配置均在代理端管理,因此无需在各个后端服务器之间同步设置。只需编辑代理服务器上 plugins/proxymessages/ 目录中的 config.yml 文件即可开始使用。
Paper 插件说明:
Paper 插件的功能在本插件的 4.0.0 版本中得到了扩展。4.0.0 之后的 Paper 插件版本与之前未带版本的插件不兼容。
4.0.0 之前
ProxyMessages 可以在 Velocity 服务器上独立运行。然而,由于 Velocity API 的限制,它无法编辑或更改通常在服务器上显示的原版消息。这些包括原版的加入和离开消息,以及玩家所连接服务器上的原版聊天消息。如果你想移除原版的加入和离开消息并格式化聊天消息,请在所有后端服务器上使用提供的 Paper 插件。一旦安装了 Paper 插件,上述功能将自动生效。无需额外配置。
4.0.0 及之后
Paper 插件执行了 4.0.0 之前版本所做的所有工作,并新增了作为 PlaceholderAPI 支持的必要条件。如果代理配置中 enable-papi 为 true,则必须在所有后端服务器上安装 Paper 插件。如果你不需要 PlaceholderAPI 支持,请确保将 enable-papi 设置为 false,此时 Paper 插件将成为可选安装。尽管如此,仍强烈建议安装,因为它能提升用户体验。该选项供你选择。与前代一样,Paper 插件无需额外配置,直接安装即可。所有配置仍由 Velocity 插件管理。
enable-papi |
Paper 插件? |
Paper 插件版本 |
false |
可选 |
>= 4.0.0 |
true |
必需 |
>= 4.0.0 |
| N/A |
可选 |
< 4.0.0 |
表 1:Paper 插件需求概览
颜色 (COLOR):
在所有消息选项中,你可以在括号内插入 HEX 代码(例如:{#ff0066})。HEX 代码之后的所有文本(除玩家名称外)都将变为该颜色。你可以在一个字符串中多次使用此功能以实现多色消息。所有文本的默认颜色为黄色。
样式 (STYLING)
在所有消息选项中,你可以使用 Kyori Adventure TextDecoration 选项进一步美化文本。选项包括:
{bold} - 此标签后的文本加粗
{italic} - 此标签后的文本斜体
{strike} - 此标签后的文本带有删除线
{underline} - 此标签后的文本带有下划线
{obfuscate} - 此标签后的文本被混淆(随机字符显示)
这两组标签用于“打开”和“关闭”其样式。例如,你可以将一段文本夹在对应的标签之间进行样式化。
关键配置选项:
enable-papi:启用 PlaceholderAPI 支持,详见下文。
default-player-color:尚未为其名称设置颜色的玩家的默认颜色。
choose-color:是否允许玩家设置自己名称的颜色。
global-network-join:当玩家加入网络时,切换所有用户的全局加入消息。
global-network-leave:当玩家离开网络时,切换所有用户的全局离开消息。
global-network-switch:当玩家在服务器间移动时,切换所有用户的全局服务器切换消息。
global-messages:切换服务器向所有其他服务器发送玩家消息的能力。
join-message-options:定义一组潜在的加入消息列表。使用 {player} 作为玩家用户名的占位符。
leave-message-options:定义一组潜在的离开消息列表。使用 {player} 作为玩家用户名的占位符。
switch-message-options:定义一组潜在的切换消息列表。使用 {player} 作为玩家名,{prev} 作为前一个服务器,{cur} 作为当前服务器作为占位符。
global-message-prefix:发送给其他服务器的全局消息的前缀。使用 {player} 表示发送消息的玩家,使用 {cur} 表示他们发送消息所在的服务器。
玩家专属名称着色:
玩家可以单独自定义其名称的颜色。他们只需执行命令 set-color #xxxxxx,其中 #xxxxxx 是标准的 HEX 代码。
玩家的名称也可以由其他玩家更改(我计划很快将此功能设为仅管理员可用...),使用命令 set-color #xxxxxx playerName
配置重载
此插件的配置可以实时重载!
只需修改配置文件并使用 pmReload 或 reloadPM,配置更改即可生效!
全局玩家消息:
启用 global-messages 后,玩家可以使用以下任何命令在“全局”和“本地”消息之间切换(为了方便起见使用了别名):
global-message-defaults 用于设置玩家的消息默认是否为全局消息(如果为 true,他们仍然可以切换)
全局消息意味着用户发送的消息将在其连接的服务器的服务器上显示,以及网络上的所有其他服务器。
本地消息意味着用户发送的消息将仅在其连接的服务器上显示。
PlaceholderAPI 支持:
如上所述,此插件支持 PlaceholderAPI。此功能仅在 v4.0.0 及以上版本可用。
当 enable-papi 设置为 true 时,代理将尝试与后端上所需的 Paper 插件通信,以用实际值替换代理配置中的占位符。
ProxyMessages 默认使用其内置的占位符系统,如上面 {} 格式所示。当 enable-papi 为 true 时,这些占位符仍然有效,并且 应该 继续用于它们支持的选项。PlaceholderAPI 支持的目的是扩展现有的占位符系统,而不是替换它。
内置占位符提供的占位符保留与以前相同的语法 {},而 PlaceholderAPI 占位符将使用 %% 来包裹它们的占位符。除了 Paper ProxyMessages 插件外,还必须在每个后端服务器上安装 PlaceholderAPI。
数据流: 代理插件请求占位符被填充,Paper 插件与本地 PAPI 插件通信,并回复给代理插件。
注意事项: 由于有一个定义占位符的中心代理配置,这意味着如果使用 PAPI,您使用的占位符必须在所有后端服务器上可用。例如,您可以执行类似 {player} joined {cur} with %rank% 的操作,只要 %rank% 占位符能够被满足。您不能执行类似(这只是一个示例)的操作 {player} joined {cur} with %power%,因为只有一个服务器有 superpower 插件,所以这个占位符在其他服务器上无法完成。
如果您真的想要特定于服务器的占位符,请在 Discord 上联系我或在 GitHub 上打开一个问题,让我知道,我可以尝试为您开发一些东西。目前,我选择不支持这一点,因为此插件的理念之一是不必在所有后端服务器之间复制粘贴配置。不过,我是愿意改变的,只要它是可选的且默认为关闭状态。
资源包:
本节讨论在网络范围内实施资源包的功能
在您的 config.yml 的 network-resource-pack 部分下:
enabled: 开启或关闭资源包
注意: 如果 enabled 为 false,从这一刻起的所有配置都不起作用
url: 资源包的下载 URL
sha1-hash: 资源包的哈希值
注意:此时,哈希值不会有任何作用,因为我不知道如何正确将其转换为字节数组。如果您知道如何操作,请为此项目打开 PR 或 Issue 工单。
prompt: 用户将收到的提示,询问他们是否想要资源包
required: 是否在网络上玩游戏必须的资源包
except: 在向玩家发送资源包时要忽略的服务器列表。
Discord:
本节讨论 Discord 集成功能特性和可定制性。
在您的 config.yml 的 discord 部分下:
enabled: 切换 Discord 功能。
注意: 如果 enabled 为 false,从这一刻起的所有配置都不起作用
bot-token: 一个字符串,代表插件将尝试连接的机器人令牌。这与您在 DiscordSRV 插件中可能使用的相同。
proxy-channel-id: 您希望代理消息发送到的频道的 ID。
server-channel-ids: 服务器名称列表及其对应的 Discord 频道 ID。消息将在每个服务器及其对应的频道之间链接。
join-color: 用于加入消息的 Discord 嵌入的十六进制颜色代码。
leave-color: 用于离开消息的 Discord 嵌入的十六进制颜色代码。
switch-color: 用于切换消息的 Discord 嵌入的十六进制颜色代码。
text-configuration: 自定义发送的消息的选项。文本选项支持 Markdown 格式。
online-message: 代理启动时发送的消息。
offline-message: 代理关闭时发送的消息。
player-message-prefix: 发送给 Discord 的玩家消息的前缀 - 如果启用了全局消息,它将使用全局消息前缀
discord-role-color: 当为 true 时,来自 Discord 的任何消息都会使用其在 Discord 中的角色颜色为发送者的名字着色。
server-count: 切换是否在启动代理时打印活动服务器列表。
display-icon: 切换是否在启动和关闭时显示提供的图像。
注意: 如果你未提供图像,display-icon 将不会生效。你可以通过在 plugins/proxymessages 目录中放置一个名为 icon.jpg 的图像来实现。当设置为 true 时,插件会自动检测并使用该图像。
Proxy-Messages
Unified System and Player Messages for Your Velocity/Paper Network
ProxyMessages is a powerful Velocity plugin designed to unify your network’s messaging system across all servers. ProxyMessages can be configured to send messages to players across all servers for player chat messages, proxy connections, disconnections, and server changes. Whether you run a small network or a large-scale operation, ProxyMessages helps you deliver a seamless player experience by synchronizing key messages across your entire server network.
Join my Discord!

Key Features:
- Global messages so players can communicate with one another, even if they aren't connected to the same server.
- Configurable Messages: Customize join, leave, server switch, and player messages with ease, tailoring them to fit the tone and style of your server network.
- Extendable configuration options: PlaceholderAPI support!
- Multiple Message Variants: Create multiple potential messages for each event, allowing for variety and keeping the experience fresh for your players.
- Custom Colors with HEX Support: Enhance your messages with custom colors using HEX codes to match your server's branding or aesthetic.
- Kyori Adventure TextDecoration: custom text formatting beyond just color!
- Ability to instate network-wide resource packs.
- Integration with Discord to keep your sever network connected over discord!
Configuration Overview:
All configuration is managed on the proxy side, meaning there’s no need to synchronize settings across individual backend servers. Simply edit the config.yml file located in plugins/proxymessages/ on your proxy server to get started.
The Paper Plugin:
The paper plugin's role was extended in version 4.0.0 of this plugin. The versions after 4.0.0 of the paper plugin are not compatible with unversioned ones that came before it.
Pre 4.0.0
ProxyMessages can work standalone on a velocity server. However, due to limitations in the velocity API, it cannot edit or change the vanilla messages that normally appear on servers. These include the vanilla join and leave messages, as well as vanilla chat messages on the server that the player is connected to. If you'd like remove the vanilla join and leave messages, and format chat messages, please use the provided paper plugin on all of your backend servers. Once the paper plugin is installed, the aforementioned features will automatically start working. No extra configuration is needed.
4.0.0 and beyond
The paper plugin does everything that the pre-4.0.0 versions did, with the addition that they now are a requirement for PlaceholderAPI support. The paper plugin is required to be installed on all backend servers if enable-papi is true in the proxy config. If you do not care for PlaceholderAPI support, ensure that enable-papi is set to false, and the paper plugins will be optional. It is still highly recommended, as it improves the user experience. The option is there for you. In the same way as before, no additional configuration is needed on the paper plugin, simply install it. All configuration is still on the velocity plugin.
enable-papi |
Paper Plugin? |
Paper Plugin Version |
false |
Optional |
>= 4.0.0 |
true |
Required |
>= 4.0.0 |
| N/A |
Optional |
< 4.0.0 |
Table 1: Overview of paper plugin requirements
COLOR:
In all message options, you can insert a hex code inside brackets (example: {#ff0066}). All text after the hex code except player names will be turned into that color. You can use this multiple times in one string for a multicolored message. Default color for all text is yellow.
STYLING
In all message options, you can use Kyori Adventure TextDecoration options to further style your text. Options include:
{bold} - text after this tag is bold
{italic} - text after this tag is italic
{strike} - text after this tag has strikethroughs
{underline} - text after this tag is underlined
{obfuscate} - text after this tag is obfuscated
Two sets of these tags will "open" and "close" their style. For example, you can stylize a chunk of text by sandwiching it between the corresponding tags.
Key Configuration Options:
enable-papi: enable PlaceholderAPI support, see below for more information.
default-player-color: The default color for players who haven't set a color for their name.
choose-color: Whether or not players are allowed to set the color of their name.
global-network-join: Toggle the join message for all users when a player joins the network.
global-network-leave: Toggle the leave message for all users when a player leaves the network.
global-network-switch: Toggle the server switch message for all users when a player moves between servers.
global-messages: Toggle the server's ability to send player's messages across all servers.
join-message-options: Define a list of potential join messages. Use {player} as a placeholder for the player’s username.
leave-message-options: Define a list of potential leave messages. Use {player} as a placeholder for the player’s username.
switch-message-options: Define a list of potential switch messages. Use {player}, {prev} for the previous server, and {cur} for the current server as placeholders.
global-message-prefix: The prefix to global messages for other servers. Use {player} for the player sending the message, and {cur} as the server they're sending the message from.
Player Specific Name Coloring:
Players can customize the color of their name individually. They simply need to execute the command set-color #xxxxxx where #xxxxxx is a standard hex code.
Player's names can also be changed by another player (I'm planning on making this an operator only feature soon...) with the command set-color #xxxxxx playerName
Config Reloading
The configuration for this plugin can reload on the fly!
Simply make changes to your config file and use either pmReload or reloadPM, and the config changes will take effect!
Global Player Messaging:
Once global-messages is enabled, players can toggle their messages between "global" and "local" by using any of the following commands (aliases used for convenience):
global-message-defaults is whether or not player's messages will be global by default (they can still be toggled if true)
Global messages mean that the user's messages will be displayed in the server they are connected to, as well as all other servers on the network.
Local messages mean that the user's messages will only be displayed in the server they are connected to.
PlaceholderAPI Support:
As mentioned above, this plugin supports PlaceholderAPI. This feature is only available for v4.0.0 and up.
When enable-papi is true, the proxy will attempt to communicate with the required paper plugins on the backend to replace placeholders in the proxy config with their actual values.
ProxyMessages uses it's builtin placeholder system by default, as seen above with the {} formatting. These placeholders will still work when enable-papi is true, and they should still be used for the options that they support. The point of PlaceholderAPI support is to extend the existing placeholder system, not replace it.
The placeholders provided by the builtin placeholder will retain the same syntax as before, {}, and PlaceholderAPI placeholders will use %% to encapsulate it's placeholders. PlaceholderAPI must be installed on every backend server in addition to the paper ProxyMessages plugin.
The Flow of Data: The proxy plugin requests the placeholders to be filled by the paper plugin, the paper plugin talks to the local PAPI plugin, and replies to the proxy plugin.
The Caveat: Because there is one central configuration with the proxy where placehodlers are defined, this means that, if using PAPI, the placeholders you are using must be available on all of your backend servers. For example, you could do something like {player} joined {cur} with %rank%, so long as the %rank% placeholder is able to be fulfilled. You could not do something like (This is just to illustrate an example) {player} joined {cur} with %power%, for example, because only one of your servers has a superpower plugin, so this placeholder couldn't be completed on the other servers.
If server specific placeholders are something you really want, please message me in discord or open an issue on github and let me know and I can try to work on something for you. Currently, I choose to not support this because part of the philosophy with this plugin is to not have to copy paste a configuration across all of your backend servers. I am open to changing this though, so long as it is optional and off by default.
Resource Packs:
This section discusses the ability to instate a network-wide resource pack
Under the network-resource-pack section of your config.yml:
enabled: toggles the resource pack on and off
Note: None of the configuration from this point forward will not matter if enabled is false
url: The download url of your resource pack
sha1-hash: The hash of your resource pack
NOTE: At this time, a hash will do nothing, as I don't know how to properly translate it to a byte array. If you know how, please open a PR or Issue ticket on the github page for this project.
prompt: The prompt users will recieve, inquiring abotu whether they want the resource pack
required: Whether or not the resource pack is required to play on the network
except: A list of servers to ignore when sending resource packs to players.
Discord:
This section discusses the discord integration functionality features and customizability.
Under the discord section of your config.yml:
enabled: Toggles the discord functionality.
Note: None of the configuration from this point forward will not matter if enabled is false
bot-token: A string that represents the bot token that the plugin will attempt to connect to. This is the same as the one you might use in the DiscordSRV plugin.
proxy-channel-id: The ID of the channel you want the proxy's messages to be sent to.
server-channel-ids: A list of server names and a corresponding discord channel ID. Messages will be linked between each server and its corresponding channel.
join-color: Hex color code to be used for the Discord embed for join messages.
leave-color: Hex color code to be used for the Discord embed for leave messages.
switch-color: Hex color code to be used for the Discord embed for switch messages.
text-configuration: Options to customize the messages that get sent. Text options support markdown formatting.
online-message: The message to be sent when the proxy boots up.
offline-message: The message to be sent when the proxy shuts down.
player-message-prefix: The prefix to a player's message going to discord - if global messages are enabled, it will use the global messaging prefix instead
discord-role-color: When true, any messages from discord will color the name of the sender with the color of their role in discord.
server-count: Toggles whether a list of active servers will be printed when booting the proxy.
display-icon: Toggles whether or not to display a provided image on startup and shutdown.
Note: display-icon will not work unless you provide an image for it to display. You can do this by placing an image named icon.jpg in your plugins/proxymessages directory. When turned to true, the plugin will detect the image and use it automatically.
评论 0
登录后参与评分
还没有评论,来抢沙发吧