服务器传输命令
此模组添加了使用 24w03a 中新增的传输数据包将自己或其他玩家传输到不同服务器的命令。这些命令和配置大致基于 BungeeCord,因此如果您之前使用过它或类似的代理,应该会感到熟悉。
此模组不暴露用于传输玩家或设置/获取 Cookie 的 API;它仅发送数据包。不过,这可能在不久的将来添加。
命令
目前实现了以下命令:
/server <server>:前往一个已配置且未受限制或您拥有权限访问的服务器。
/send <players> <server>:将一个或多个玩家发送到已配置的服务器。不考虑任何限制。
/send-ip <players> <hostname> [<port>]:将一个或多个玩家发送到指定的主机名和端口。如果未指定端口,则默认为 25565。
尚未添加像 /glist 和 /find 这样查询服务器的命令,但它们正在开发中。
权限
可以通过配置文件中的组或使用支持 Fabric Permissions API 的任何模组来设置权限。如果您想完全禁用某个命令,可以将其添加到配置文件中的 disabled_commands 列表中。
server-transfer-commands.command.server
server-transfer-commands.command.send
server-transfer-commands.command.send-ip
server-transfer-commands.server.<server>:允许使用 /server 进入启用了 restricted 设置的服务器的权限。/send 和 /send-ip 不考虑此限制。
配置
带注释的默认配置如下:
# 可以使用 /server 或 /send 访问的服务器列表。
# 如果 "restricted" 为 true,则需要 "server-transfer-commands.server.<server>" 权限才能通过 /server 访问它。
servers:
lobby:
address: localhost:25565
restricted: false
survival:
address: localhost:25564
restricted: false
# 当您尝试传输到该服务器时,应显示“您已经连接到此服务器!”的服务器。
this_server: lobby
# 不应注册的命令。
disabled_commands:
- disabledcommandhere
# 分配给玩家或权限级别的权限组。
permissions:
default:
- server-transfer-commands.command.server
admin:
- server-transfer-commands.command.send
- server-transfer-commands.command.send-ip
# 分配给特定玩家的权限组。
groups:
4win:
- admin
# 分配给 Minecraft 权限级别的权限组,通常从 1 到 4。
# 级别 3 允许使用诸如 /kick 等多人管理命令。
level_groups:
3:
- admin
Server Transfer Commands
This mod adds commands to transfer yourself or another player to a different server using the new transfer packet added in 24w03a. The commands and config are loosely based on BungeeCord, so they should be familiar if you've used it or a similar proxy before.
This mod does not expose an API for transferring players or setting/getting cookies; it just sends the packet. This is something that may be added in the near future, though.
Commands
Currently, the following commands are implemented:
/server <server>: Go to a configured server that isn't restricted or you have permission to access.
/send <players> <server>: Sends one or more players to a configured server. Restrictions are not considered.
/send-ip <players> <hostname> [<port>]: Sends one or more players to the specified hostname and port. If no port is specified, it defaults to 25565.
Commands that would query the servers like /glist and /find have not been added yet but are in progress.
Permissions
Permissions can be set with groups in the config file or with any mod that supports the Fabric Permissions API. If you would like to disable a command entirely, you can add it to the disabled_commands list in the config.
server-transfer-commands.command.server
server-transfer-commands.command.send
server-transfer-commands.command.send-ip
server-transfer-commands.server.<server>: Permission to use /server to go to a server that has restricted enabled. /send and /send-ip do not consider this.
Config
The commented default config is as follows:
# The list of servers that can be accessed with /server or /send.
# If "restricted" is true, the "server-transfer-commands.server.<server>" permission is required to access it with /server.
servers:
lobby:
address: localhost:25565
restricted: false
survival:
address: localhost:25564
restricted: false
# A server that should show "You are already connected to this server!" when you attempt to transfer to it.
this_server: lobby
# Commands that should not be registered.
disabled_commands:
- disabledcommandhere
# Permission groups for assigning to players or permission levels.
permissions:
default:
- server-transfer-commands.command.server
admin:
- server-transfer-commands.command.send
- server-transfer-commands.command.send-ip
# Permission groups assigned to specific players.
groups:
4win:
- admin
# Permission groups assigned to Minecraft permission levels, normally from 1 to 4.
# Level 3 is what allows use of multiplayer management commands such as /kick.
level_groups:
3:
- admin
评论 0
登录后参与评分
还没有评论,来抢沙发吧