欢迎来到 HiMCBBS 论坛~

想在这里休息会么?和我们共度美好时光吧~

加入QQ群:879016948 获得最新公告,并与群友们一起聊天吹水!

注册 登录
[1.20.2-1.21.8] 虚拟主机命令插件

转载 开源 免费 管理 [1.20.2-1.21.8] 虚拟主机命令插件 1.0

请注册登录并激活账号后下载
有没有想过为同一个 Minecraft/Bukkit 服务器拥有不同的域/子域,并且根据玩家加入的域提供不同的设置?这个插件有点像 Apache 虚拟主机,用于 Minecraft 服务器
版权类型
转载
插件中文名称
虚拟主机命令插件
插件英文名称
Virtual Host Command Plugin
支持的核心
  1. Bukkit
  2. Spigot
  3. Paper
  4. Purpur
  5. 其他Spigot下游
  6. 其他Paper下游
版权链接
https://modrinth.com/plugin/virtual-host-command-plugin
资源语言
  1. 英语
  2. 其他
支持版本(Java)
  1. 1.20
  2. 1.21
开源许可证
保留所有权益/无许可证

支持信息​

Minecraft版本:1.21–1.21.8, 1.20.2–1.20.6

支持平台:Bukkit, Paper, Spigot

简介​

有没有想过为同一个 Minecraft/Bukkit 服务器拥有不同的域/子域,并且根据玩家加入的域提供不同的设置?这个插件有点像 Apache 虚拟主机,用于 Minecraft 服务器

详细描述​

Bukkit/Minecraft 的虚拟主机命令插件​

有没有想过为同一个 Minecraft/Bukkit 服务器拥有不同的域/子域,并且根据玩家加入的域提供不同的设置?这个插件有点像 apache 虚拟主机,检测玩家使用的 Minecraft 服务器的主机名 (CNAME)。您可以根据主机名配置在加入服务器时要运行的命令。例如,您可以拥有一个具有多元宇宙和子域 hub.example.com 和 pvp.example.com 的服务器,然后根据玩家用于连接到服务器的域将玩家直接发送到中心世界或竞技场世界。

注意: 带有间歇泉的基岩代理在加入时不提供主机名,因此它不适用于虚拟主机。它仅提供 IP 地址,因此您需要为通过间歇泉/代理连接的每个域提供不同的 IP 地址。修复将以下内容添加到您的间歇泉config.yml:
# Forward the hostname that the Bedrock client used to connect over to the Java server<br> # This is designed to be used for forced hosts on proxies<br> forward-hostname: true<br>
注意: 我们严重依赖提供的主机名。这并不总是在 PingServerList 列表事件中给出,因此每个虚拟主机的 motdicon 并不总是适用于所有服务器实现。对于 paper-mc,我们添加了一种解决方法来获取用于 ping 的主机名。
下面是一个示例,即在具有相同 IP 地址的同一服务器上运行的四个虚拟主机,但通过不同的 CNAME 使用不同的虚拟主机进行访问:



更新 0.9.2​

  • 小修、清理、内务
  • 添加了 ifInWorldifNotInWorld 条件(请参阅示例配置)

更新 0.9.3​

  • 小修复
  • 添加了虚拟主机的 motd图标配置(参见示例配置)

示例配置​

请参阅 plugins/VirtualHostCommandPlugin/config.yml 中的 up2date 文件

# Example config file for VirtualHostCommand bukkit plugin<br># Location: plugins/VirtualHostCommandPlugin/config.yml<br><br>vhosts:<br> host_example:<br> # the hoostname is matched agains the joining hostname via starts-with, so parts work as well<br> # you can also add the port, sub.domain.com:port<br> # it's mandatory, and always case-insensitive<br> hostname: example.com<br> # (optional) only run if player joined this world(s) <br> ifInWorld: "world_some_regex"<br> # (optional) only run if player did not join this world(s)<br> # if ifInWorld and ifNotInWorld present, they must be both true<br> ifNotInWorld: "world_some_regex"<br> # (optional) MOTD for this vhost<br> # NOTE: this only works if you server implementation returns a hostname in the ping event, many don't :(<br> # for paper-mc we have added a workaround to fetch the vhost hostname pinged via reflection.<br> motd: "some colorfull MOTD server message\nmultiline if you like!"<br> # (optional) server icon filename, format like server-icon.png, same root directory<br> # NOTE: same restrictions as for 'motd' config option apply <br> icon: server-icon-example.png <br> # List of commands to be executed if joining via this hostname <br> commands:<br> # he following placeholders are allowd:<br> # %player% , %hostname% and %port%<br> - some command ...<br> - another cmmand with %player% to replace with player name<br> - msg %player% haha it works from %hostname%<br><br> host_example2:<br> # example with an IP<br> hostname: "123.45.67.89"<br> commands:<br> - some command ...<br> - another cmmand with %player% to replace with player name<br> - msg %player% haha it works<br><br> host_hub:<br> hostname: hub.myworld.com<br> ifNotInWorld: "^world_hub"<br> commands:<br> - gamemode %player% survival<br> - msg %player% crazy shit<br> - mv tp %player% world_hub


https://github.com/cgaffga/mc-vhost/tree/main/docs

源​

源代码可以在 https://github.com/cgaffga/mc-vhost/

下载​

作者
Kimonomc
下载
0
查看
133
首次发布
最后更新

评论

0.00 星 0 星

来自Kimonomc的更多资源

分享资源

后退
顶部