World Host
无需运行服务器或设置端口转发,即可托管你的单人世界! 未来,我们还计划通过使用 Geyser 来支持基岩版客户端。
如果我的朋友没有安装该模组怎么办?
如果你的朋友没有安装该模组,你就无法与他们使用好友系统。不过,你可以运行命令 /worldhost ip 来获取一个可用于隧道连接的 IP 地址。请注意,不使用好友系统可能会导致延迟(ping)增加。如果你不希望延迟增加,可以运行 /worldhost tempip 获取一个 临时 服务器 IP,该 IP 至少有效 60 秒。在 60 秒内连接的客户端将保持连接。如果你计划永远不使用好友系统,可以在模组设置中将其禁用。
这个模组是如何工作的?
该模组包含一个服务端,你的客户端会连接到该服务器,此服务器用于通过 World Host 与其他客户端进行通信。
- 当你的朋友想要加入你时,其客户端会向服务器请求一个连接用的 IP 地址。
- 服务器随后要求你的客户端创建一个加入模式(协议中的
JoinType)。有两种加入模式:UPnP 和 Proxy(代理)。
- 首先尝试 UPnP 模式。你的客户端尝试在路由器上打开一个临时端口转发,以便朋友的客户端可以直接连接到你。
- 如果 UPnP 成功,你的客户端会将使用的端口告知服务器,然后服务器将你的 IP 和端口号告知你朋友的客户端。
- 如果 UPnP 失败,则你的客户端指示服务器使用 Proxy(代理)模式。服务器随后会向你朋友的客户端提供与
/worldhost ip 相同的“代理 IP”。
/worldhost tempip 会优先尝试 UPnP,而不是直接给你代理 IP。
许可证
该模组为开源项目,并根据 MIT 许可证 授权。
World Host
Host your singleplayer worlds without having to run a server or setup port forwarding! In the future, we also plan to support Bedrock Edition clients
through the use of Geyser.
What if my friend doesn't have the mod installed?
If your friend doesn't have the mod installed, you cannot use the friends system with them. However, you can run the command /worldhost ip to get an IP that can be used with tunneling. Do note, however, that not using the friends system could increase ping. If you don't want the ping increase, you can run /worldhost tempip to get a temporary server IP that lasts for at least 60 seconds. Clients who connect within the 60 seconds will remain connected. If you plan to never use the friends system, you can disable it in the mod settings.
How does this mod work?
This mod has a server that your client connects to, this server is used to communicate with other clients using World Host.
- When your friend wants to join you, your friend's client asks the server for an IP address to connect to.
- The server then asks your client to create a join mode (
JoinType in the protocol). There are two join mods: UPnP and Proxy.
- UPnP mode is tried first. Your client tries to open a temporary port forward in your router that your friends client can use to connect to you directly.
- If UPnP succeeds, your client tells the server the port to use, then the server tells your friend's client your IP and the port number.
- If UPnP fails, then your client tells the server to use Proxy mode. The server will then give your friend's client the same "proxy IP" as
/worldhost ip does.
/worldhost tempip tries to do UPnP first instead of just giving you the proxy IP straightaway.
License
The mod is open source and licensed under the MIT License.
评论 0
登录后参与评分
还没有评论,来抢沙发吧