透過 BungeeCord 來使用 Sponge

BungeeCord is a piece of server proxy software written by md_5 and the SpigotMC team that allows server owners to link Minecraft servers together so that players can jump between servers without having to disconnect and re-connect. BungeeCord is typically used by server networks that offer many game modes.

For more information about BungeeCord, what it is, how to set it up and how it works, have a look at the BungeeCord website. This page will focus on Sponge specific steps.

警告

In order to connect servers to BungeeCord, you must run the servers in offline mode. In offline mode, without the proper precautions, anyone can log into the server using any name they wish, including those who have admin permissions. Make sure you protect your servers using firewalls. If you are using Linux, there is an IPTables guide at SpigotMC Firewall guide, alternatively, some distributions come with UncomplicatedFirewall 「ufw」.

If you are not comfortable with tinkering with Linux, or you are unsure as to how to prevent unauthorized access to your servers, consider consulting with someone who has more experience to ensure the security of your server.

備註

Be sure that if you use SSH to make sure port 22 is ALLOWED, otherwise you run a very real risk of locking yourself out of your server!

IP 轉發

BungeeCord has a mode called IP Forwarding, which allows BungeeCord to pass the player’s UUID and IP address to any connected server, even though the servers are being run in offline mode.

警告

SpongeForge modded servers that require modded clients, will only work if you use a BungeeCord fork like Waterfall, or a BungeeCord plugin like SpongePls. SpongePowered does not officially support these products, although they are developed by trusted members of the community.

For SpongeVanilla or Vanilla clients connecting to unmodded SpongeForge, IP Forwarding works out of the box. Pull requests were made to BungeeCord for modded SpongeForge support, but these haven’t been accepted. Other solutions (mentioned above) include these patches and should be used instead.

搭配 IP 轉發使用 BungeeCord

如果你想使用 IP 轉發:

  • 在 BungeeCord 的 config.yml 中,將 ip_forward 設定為 true
  • 在 Sponge 的設定檔(config/sponge/global.conf)中,將 modules.bungeecord 設定為 true,並將 bungeecord.ip-forwarding 設定為 true
  • 如果你有任何其他伺服器軟體,請查閱該伺服器的文件。

This must be done for all servers that are connected to the BungeeCord network. Then, just follow the instructions for using BungeeCord without IP Forwarding.

不搭配 IP 轉發使用 BungeeCord

It is recommended that you use IP Forwarding wherever possible, if you do not wish to do so, simply ensure that online-mode is set to false in your server.properties file and add the server details to Bungee’s config.yml file. Bungee will then forward any connections to the server when required.

這將適用於 Sponge 的所有實作,包含模組。