Velocity Server Manager
本项目是 Noah Fetz 的 BungeeServerManager 的一个分支,经过修改以适配 Velocity Proxies。
本项目遵循上游项目的 MIT 许可证,未做修改。
在此查看 SpigotMC 上的原始插件:BungeeServerManager [BungeeCord] [MySQL]
功能
- 无需重启即可从你的 Velocity Proxy 添加或移除服务器
- 通过权限限制特定服务器的加入者
- 跳转到任意玩家所在的服务器
- 服务器数据保存在 MySQL 数据库中
- 当服务器上线或离线时接收通知
- 将所有玩家从特定服务器踢出至随机大厅
- 管理服务器标志(Flags)以自定义服务器行为
- 使用 /hub 或 /lobby 命令前往大厅服务器
- 可配置的消息内容
已知问题
安装
前置条件
你需要:
- 一个正在运行 Velocity 的代理端(duh)
- 一个 MySQL 或 MariaDB 数据库
- 大约 5-10 分钟的时间来设置一切
设置步骤
- 下载 Velocity Server Manager 的最新发布版本。
- 将下载的
.jar 文件放入你的 Velocity Proxy 的 plugins 文件夹中。
- 启动你的 Proxy 以生成默认配置文件。由于缺少数据库连接,它将自动关闭。
- 用文本编辑器打开生成的
mysql.yml 文件,填入有效的数据库连接详细信息。
- 再次启动你的 Proxy。插件应能连接到数据库并创建必要的表。
- (可选,但**推荐**)从你的
velocity.toml 中移除所有非回退(fallback)服务器。改为在游戏中或通过控制台使用 /addserver 添加它们。请参阅 此处。
- (可选)根据你的喜好在
messages.yml 中配置消息。
你现在可以开始使用 Velocity Server Manager 了!享受动态、即时地管理你的服务器吧。
常见问题解答
如果你阅读了这部分,你可能遇到了问题或对某些其他内容感兴趣。以下是一些常见问题及解决方法:
- Proxy 启动后立即关闭!
- 确保
mysql.yml 中的数据库连接详细信息正确无误。
- 确保你的数据库服务器正在运行,并且可以从运行 Proxy 的机器访问。
- 如果上述情况均不适用,请检查 Proxy 日志中是否有任何与插件相关的错误消息。这很可能不是该插件的错。(希望如此)
- 我无法连接到我添加的服务器!
- 确保服务器处于在线状态,并且可以从 Proxy 访问。
- 检查
/server 以查看服务器是否已列出。如果没有列出,它可能设置了 DISABLED 标志。
- 检查服务器是否标记为
RESTRICTED,并确保你拥有加入它的必要权限。
- 插件似乎完全不起作用!
- 如果你很久没有更新,请更新 Velocity。
- 检查 Proxy 日志中是否有任何与插件相关的错误消息。
- 我发现了一个错误或有一个功能请求!
- 在 GitHub 上 这里 打开一个问题,描述你遇到的问题或希望看到的功能。
- 请不要通过任何其他平台就错误或功能联系我。GitHub 是我唯一想要并会跟踪这些事项的地方。曾经有人在一个不同的项目中通过 Reddit 私聊联系我。谁会那样做呢?
权限
尽情按照你的意愿进行配置。
servermanager.goto - 能够使用 /goto 和 /jumpto。
servermanager.help - 查看帮助列表。
servermanager.notify - 当有人管理服务器时接收通知。
servermanager.servers.add - 向你的网络添加服务器。
servermanager.servers.delete - 从你的网络删除服务器。
servermanager.servers.reload - 从数据库重新加载服务器数据并将其重新添加到代理中。
servermanager.servers.list - 列出你网络中的所有服务器。
servermanager.servers.kick - 将所有玩家从特定服务器踢出至随机大厅。
servermanager.ignorekick - 在服务器被清空时免于被踢出。
servermanager.servers.info - 查看特定服务器的信息。
servermanager.servers.flags - 管理服务器标志。更多信息请查看 此处。
servermanager.server.[servername] - 如果服务器具有 RESTRICTED 标志,则允许访问该特定服务器。
servermanager.server.* - 允许访问所有具有 RESTRICTED 标志的服务器。
servermanager.ignorerestriction - 同上,如果你的权限系统不支持通配符。
命令
[hub, lobby] - 前往大厅服务器
[goto, jumpto] - 前往玩家当前所在的服务器
[whereami, wai] - 查找你当前所在的服务器
[addserver] - 向你的网络添加服务器
[delserver] - 从你的网络删除服务器
[reloadserver] - 重新加载特定服务器或网络中所有服务器的数据
[serverlist, sl] - 列出你网络中的所有服务器
[serverinfo, si] - 显示特定服务器的部分信息
[flagserver] - 为服务器添加标志
[unflagserver] - 从服务器移除标志
[clearserver, kickserver] - 将所有玩家从特定服务器踢出至随机大厅
[servermanager] - 用于执行所有操作的统一命令
状态标志
状态标志是插件用于识别服务器及其运行状态的方式。部分标志是不可变的。
EMPTY (位值: 0) - 未设置任何标志
LOBBY (位值: 1) - 此服务器为大厅服务器。玩家加入代理或从其他服务器被踢出时,会被发送至此服务器。
RESTRICTED (位值: 2) - 此服务器受限。仅拥有 servermanager.server.* 或 servermanager.ignorerestriction 权限的玩家可加入。
DISABLED (位值: 4) - 此服务器已禁用。玩家无法加入此服务器,包括工作人员。若希望仅允许工作人员加入,请使用 RESTRICTED 标志。
PROXYMANAGED (位值: 9) - 此服务器由代理管理。此标志不可变,且适用于在 velocity.toml 文件中添加的所有服务器。如果存在此标志,则不能应用任何其他标志。
注意:位值 9 表示 PROXYMANAGED 标志是 LOBBY 标志与自身的组合。这是有意为之,旨在鼓励用户仅将回退服务器添加到 velocity.toml 文件中。
注意:服务器的标志存储在数据库中。除非你确切知道自己在做什么,否则请勿手动篡改数据库。对于因手动篡改数据库导致的任何问题,我将不予修复。请自行承担后果。
贡献说明
我制作这个项目作为一个小规模的副业项目,以便更深入地了解 Velocity Proxy 的编程。我近期可能不会处理 PR(拉取请求)。如果你愿意承担这项任务,你可以 Fork 本仓库。
只需确保遵守许可证协议即可。
另外,如果你想在经济上支持我,可以在我的 Ko-Fi 页面 捐赠!
许可证
本分支遵循上游 MIT 许可证——详情请参阅 LICENSE 文件或查看 上游仓库。
Velocity Server Manager
This project is a fork of BungeeServerManager by Noah Fetz, edited to work on Velocity Proxies.
This project follows the MIT License as per upstream, it has not been edited.
Check out the original Plugin on SpigotMC here: BungeeServerManager [BungeeCord] [MySQL]
Features
- Add or Remove Servers from your Velocity Proxy without restarting
- Restriction who can join specific servers with permissions
- Jump to any player's server you want
- Servers are saved in a MySQL Database
- Receive notifications when servers go online or offline
- Kick all players from a specific server to a random lobby
- Manage Server Flags to customize server behavior
- /hub or /lobby command to go to a lobby server
- Configurable messages
Known Issues.
- No known issues at this time.
Installation
Prerequisites
You'll need:
- A Proxy that is running Velocity (duh)
- A MySQL or MariaDB Database
- About 5-10 minutes of your time to set everything up
Setup
- Download the latest release of Velocity Server Manager.
- Place the downloaded
.jar file into your plugins folder of your Velocity Proxy.
- Start your Proxy to generate the default configuration files. It will shutdown automatically due to a missing database connection.
- Open the generated
mysql.yml file in a text editor and fill in the details for a valid database connection.
- Start your Proxy again. The plugin should connect to the database and create the necessary tables.
- (Optional, but encouraged) Remove all servers that are not fallback servers from your
velocity.toml. Instead, add them using /addserver either ingame or in the console. Refer to here.
- (Optional) Configure the messages in
messages.yml to your liking.
You are now ready to use Velocity Server Manager! Have fun managing your servers on the fly, dynamically.
FAQ
If you read this, you've probably encountered an issue or are interested in some other stuff. Here are some common things and what to do:
- The Proxy shuts down immediately after starting!
- Make sure your database connection details in
mysql.yml are correct.
- Ensure that your database server is running and accessible from the machine running the Proxy.
- If any of the above do not apply, check the Proxy logs for any error messages related to the plugin. It is probably not this plugin's fault. (Hopefully)
- I can't connect to a server that I added!
- Make sure the server is online and reachable from the Proxy.
- Check
/server to see if the server is listed. If it isn't, it probably has the DISABLED flag set.
- Check if the server is marked as
RESTRICTED and ensure you have the necessary permissions to join it.
- The plugin doesn't seem to be working at all!
- Update Velocity if you haven't updated in a while.
- Check the Proxy logs for any error messages related to the plugin.
- I found a bug or have a feature request!
- Open an issue here on GitHub describing the problem or feature you'd like to see.
- Please do not contact me on any other platform regarding bugs or features. GitHub is the only place where I want and will track these things. I've had somebody interested in a different project message me on Reddit in a Private Chat. Who does that?
Permissions
Have fun configuring to your heart's desire.
servermanager.goto - Be able to use /goto and /jumpto.
servermanager.help - See the help list.
servermanager.notify - Receive notifications when somebody manages servers.
servermanager.servers.add - Add servers to your network.
servermanager.servers.delete - Delete servers from your network.
servermanager.servers.reload - Reload server data from the database and re-add them to the proxy.
servermanager.servers.list - List all servers in your network.
servermanager.servers.kick - Kick all players from a specific server to a random lobby.
servermanager.ignorekick - Be exempt from being kicked when a server is cleared.
servermanager.servers.info - View information about a specific server.
servermanager.servers.flags - Manage Server flags. Check here for more info.
servermanager.server.[servername] - Access a specific server if it has the RESTRICTED flag.
servermanager.server.* - Access all servers that have the RESTRICTED flag.
servermanager.ignorerestriction - Ditto of the above, if your Permission system does not support wildcards.
Commands
[hub, lobby] - Go to a Lobby Server
[goto, jumpto] - Go to a player's current server
[whereami, wai] - Find which server you are currently on
[addserver] - Adds a server to your network
[delserver] - Deletes a server from your network
[reloadserver] - Reloads the data of a specific server or all servers in the network
[serverlist, sl] - Lists all servers in your network
[serverinfo, si] - Shows some information about a specific server
[flagserver] - Add a flag to a server
[unflagserver] - Remove a flag from a server
[clearserver, kickserver] - Kicks all players from the specific server to a random lobby
[servermanager] - A unified command for every action
Flags
Flags are how to plugin identifies servers and their conditions. Some are immutable.
EMPTY (Bitvalue: 0) - No flags set
LOBBY (Bitvalue: 1) - This server is a lobby server. Players will be sent here when they join the proxy or are kicked from another server.
RESTRICTED (Bitvalue: 2) - This server is restricted. Only players with the servermanager.server.* or servermanager.ignorerestriction permission can join.
DISABLED (Bitvalue: 4) - This server is disabled. Players cannot join this server, not even staff. If you want this server to be joinable by only staff, use RESTRICTED instead.
PROXYMANAGED (Bitvalue: 9) - This server is managed by the proxy. This flag is immutable and applies to all servers added in the velocity.toml file. If this flag is present, you cannot apply any other flags.
NOTE: Bitvalue 9 means that the PROXYMANAGED flag is a combination of the LOBBY flag and itself. This is intentional to encourage people to only put fallback servers into their velocity.toml file.
NOTE: Flags of Servers are stored in the database. Please do not tamper with the database manually unless you know exactly what you are doing. I will not fix any bugs where the database has been manually tampered with. You are on your own.
Contribution
I made this as a small side project to learn a tiny bit more about Programming for the Velocity Proxy. I will probably not look at PR Requests anytime soon. If you do feel up to the task, you can fork this repository instead.
Just make sure to follow the license.
Instead, if you'd like to support me financially, you can Donate on my Ko-Fi Page!
License
This fork is licensed under the upstream MIT License - see the LICENSE file here or upstream for details
评论 0
登录后参与评分
还没有评论,来抢沙发吧