Seamless reconnection system
Opened this issue · 3 comments
Is your feature request related to a problem? Please describe.
Vertical scaling
Describe the solution you'd like
There’s no any sense or points to make cluster of servers, but there's a feature which I think is needed.
But, some tricks about this I want to suggest.
The trick is seamless connections.
The point:
Make a master-slave scheme to allow people to make a “shadow” reconnect to slave servers. The master and slaves will share the key for establishing encryption s2s connection.
Slave servers won't be visible in ASE and won’t allow players to connect from anywhere except the master server.
On the master server there need to implement features such as:
- Function for getting the table of current slave servers
- Function to reconnect player to another slave server
- Events for detecting state of reconnecting for player
- Message broker or another RPC between master and slaves
After reconnecting to the child server shouldn’t remove the player from players counter on the master server. And the reconnect function must allow the transfer of payload data to the slave server.
Another games practice:
- Roblox - https://create.roblox.com/docs/reference/engine/classes/TeleportService
- Valve (CS2/DOTA) has a game coordinator server who finds teammates for match making. After finding it, gameserver sends them to any fill server and starts a matchmaking game.
- Final Fantasy XIV, has the common world servers, and has other servers for dungeons/bosses/pvp fights.
Examples in MTA:
- Session games, similar to CSGO/DOTA, master server is the game coordinator which finding players and making lobbies, slaves are game space servers
- Geolocation balancing. In open world servers, there is a solution to make one big server with internal division on regions.
I'm sure my idea isn't simple to implementation, but I try to find the people who really need this, because after all I think it is possible to implement. Ready to answer any question and make this issue as a main issue for future implementations of this.
Describe alternatives you've considered
Additional context
Security Policy
- I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.
I would also add time limits for reconnection tokens, because without this the system becomes vulnerable to attacks with stolen tokens. Players should reconnect within 30-60 seconds, otherwise their state gets reset.
I would also add handling for situations when the master server crashes during the reconnection process, because players could lose all their data and get stuck in a suspended state. We need a fallback mechanism with backup master servers or local state caching on slave servers.
Would the master server show the entire playerbase from all the slave servers to ASE or only the ones that are currently connected to the master server?
Would the master server show the entire playerbase from all the slave servers to ASE or only the ones that are currently connected to the master server?
from all the slave servers. It's logic, because people need know how many people play on the server at all.