Handling server migration?

Hey!

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 :slight_smile:
Lets say you save everything about world/level in every 1 min on clients too like a save game or something :slight_smile:

If session / connection closed simply you just restart the map as single player :slight_smile:
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 :slight_smile:

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. :slight_smile:

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.

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?

If important data is replicated to clients, we probably won’t even need to utilize USaveGame at all. And I like the idea of having a master server backend, keeping track of sessions and disconnections, however

I’m actually utilizing the Steam OSS, so I’m not sure if a master server is possible to implement… Originally, I attempted to have an authoritative dedicated server architecture working with OnlineSubsystemNull, which worked wonderfully until I tried to implement non-LAN session searching/joining. I was forced to move to OnlineSubsystemSteam, but then I couldn’t find sessions with a dedicated server, so I moved to the standard client-server architecture. Now I’m able to find sessions both online and on LAN, but at the cost of not having a dedicated server.

And the issue still exists on how to tell a client “you are the new server”, and somehow actually get the engine to believe this.

Doesn’t seem like an issue to me: you replicate an array of players in Game State, adding them to the array on event post-login. The first player in the array is the new server, fires up a new game instance, and then all other clients attempt to join. They all Know who’s the new server. This is just one of many ways to do it.

I’m still vague on what the function calls to do this are, and what info needs to be saved. If anyone knows

Why would every client’s game crash upon host disconnect? That’s not what happens. It just boots them back to the main menu, or whatever you as the coder prefers.