Interserver portals #625
Replies: 10 comments 3 replies
-
I like this idea. It's a complex one though and just implementing a way to grab chunks and display them, as well as kicking a player and joining them to another server, would take a while. There's also no security in it, as there might be three servers with the mod. 1 and 2 are using this functionality together, but three is owned by some other guy. Someone on 2 might just make a portal to three and have everyone on servers one and two join it, causing server 3 to crash. There are a few ways to fix this, but the most simple would be using a unique key that each server has and a config option to enable and disable the mod. Each server would have to get the key for another server and add it to a list in the config that manages which servers can make a connection to them. Also, how would people make an inter-server portal different from an interdimensional portal? |
Beta Was this translation helpful? Give feedback.
-
Interserver portals require sending packets across servers, cross-server visibility check, a cross-server dimension id system, and entity transfer between servers. It's hard to implement. |
Beta Was this translation helpful? Give feedback.
-
If we agree on a specification maybe we can start implementing it. I'm up for it! |
Beta Was this translation helpful? Give feedback.
-
The idea is quite interesting, though I might want to note some things down.
But I'm nevertheless open to discussing this, maybe there's something coming around I didn't think of. |
Beta Was this translation helpful? Give feedback.
-
The first part of implementing this would be a cross-server dimension id system. We can use ip and port as the server id, then attach the server id and in-server dimension id together to get a inter-server dimension id. ImmPtl use The most difficult part would be synchronizing data between servers and players. This involves distributed system technologies. To do network synchronization, the server must do visibility tracking: knowing which players are seeing a specific chunk or a specific entity. The hard part is that the visibility is determined by the portals near that player. If a player is in server A, and seeing a portal pointing to server B, then there are two ways to do communication:
We don't want the whole server cluster to close if only one server is closed. Then we need a mechanism to detect whether a server is closed and disable the cross-server portal in each server. There are a lot of corner cases, for example the player crossed a cross-server portal pointing to a server just closed but due to network latency the original server didn't know the target server is closed. It may require a distributed consensus framework such as Zookeeper (Or we can manually implement RAFT protocol in Minecraft). |
Beta Was this translation helpful? Give feedback.
-
MC also uses Networking delay makes the sequence of events vary between different observers. If a player |
Beta Was this translation helpful? Give feedback.
-
Currently MC uses TCP to do network synchronization to the player. TCP ensures that every message is being received in order as long as the connection is alive. The packet of unloading a chunk always comes after the packet that loads a chunk. And the packet of unloading a chunk will be reliably received, or the client will have a memory leak. An easy way of hacking this is to make the same player to join every server and only make one player instance "real" while other player instance are temporaray disabled. The disabled player can also do network synchrnozation in the server, but the visibility is being told by other servers peroidcally. Each server sends "visibility events" to other servers to update the status that in that server a "disabled" player sees a chunk or entity in that server. If there is no visibility event given some time (for example 30 seconds) the visibility is removed. |
Beta Was this translation helpful? Give feedback.
-
ImmPtl is already very hacky. It's possible to do more hack and achieve this, but the more hacking it is the harder to develop. It's better to rewrite Minecraft in a distributed manner. |
Beta Was this translation helpful? Give feedback.
-
What about creating a fake-client implementation and sending a packet to the target server that tells this is our portal fake client. The auth process might be tricky for sure. Also, we might need to hook into packet sending to whitelist only relevant packets for us, that way we avoid heavy networking that won't ever be used. When this fake client receives the world it should update the origin server local world to ensure its up to date. |
Beta Was this translation helpful? Give feedback.
-
This all sounds so crazy. |
Beta Was this translation helpful? Give feedback.
-
An idea/suggestion/inquiry I had after remembering dan200's now defunct mod qCraft. Very old review by direwolf20: https://m.youtube.com/watch?v=jTLb_vMVM7c
A controller could set the IP of the mod's quantum portal and admins could approve connections or even allow players total freedom in making portals to other servers. Connections were limited to servers sharing the same mods and configs. Missing items were turned into placeholders. Entities could not pass through. Just an idea but judging by just how far this project has come I would really like to see just how doable it is and how far you could take it beyond the pale (as you've already done, very impressively).
Clearly, seamless interserver transport is a level of technical complexity way, way beyond even seamless in-world teleportation. For this reason I'm sure it'd be very valuable to admins of servers who want to do hub worlds, expand the capacity of their modded servers, etc. Also curious if you ever had this in mind and what you think it would involve.
Food for thought. Really blown away by this mod. Been playing this game for many years and stuff like this keeps be captivated. ✌️
Beta Was this translation helpful? Give feedback.
All reactions