Handling server migration?
So in a typical UE4 non-dedicated networking architecture (where one player is the authoritative host that other clients can connect to), when the host disconnects, it seems to kick all players from the map. What is the recommended way to handle this if you wish to keep the game going? Is there some way to intercept this behavior and transfer authority over to one of the clients, effectively making them the new server? Or is the game mode/instance/state broken to the point of no return, and all server-side data lost forever?
Im sure Engine has events when a player gets disconnected from server so maybe that will be a good point to start investigate possibilities there..
But im sure you can not save anything from server except if you save before disconnect happens...
Lets say server suddenly crash, at that moment all data will be purged from memory, everything stop right? No access, no data except if you do some datasave system maybe, but i have several issues with this... But first the concept:
For restart server in other client you need save everything on clients, which cause some security questions.. but forgot this :) Lets say you save everything about world/level in every 1 min on clients too like a save game or something :)
If session / connection closed simply you just restart the map as single player :) It is one solution, but how can other players join to this maybe or something?
This is the hardest part, because without backend you cant do something like this and actually im not sure with backend you can do this but again one idea :)
Lets say you implement a master server backend in your architecture. Some player host a new game, new game is registered and every data maybe collected (who is connected, who was server etc.) Clients saving the world in every min, so they have map data.
Server disconnects, master server notified we lost connection with server. Master server notify clients , maybe select a new server, forcing to start new listen server and a few sec later command other clients to rejoin. :)
But for this you need implement master server backend into your clients, server code etc and you need run a backend for your master server.
answered Jul 14 '17 at 07:25 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here