Why does RestartGame fail to restart networked clients?

Hello everyone!

I’m currently working on getting the game I’m creating to restart properly, both on the server and on each of the clients. I’ve tried calling the RestartGame function in my custom GameMode class, and it manages to restart the server, but the clients just freeze and stop working.

Anyone who knows how to restart a networked game and that can help me?

Regards

FreeSirenety

I hope you get an answer to this. Mine is worse than freezing, the Editor crashes.
Edit I discovered that my PIE was crashing because I was also running the “RestartGame” code on the clients. So that’s bad. But I can repro this behavior if I call EndMatch then RestartGame on the server.

Oh man I might’ve gotten it!

GetWorld()->ServerTravel(TEXT("/Game/Maps/Example_Map?listen"), true);

The ?listen is very important - I saw in one of these answers somewhere that it puts the server in listen mode so that the clients can reconnect after it loads the map.

If I have bUseSeamlessTravel true or false, it doesn’t seem to matter, nor change the behavior. If I call SeamlessTravel instead of ServerTravel it crashes.

And this was the first time ServerTravel worked for me and didn’t crash - but I deleted a debug output … I think the debug output was causing the crash.

Anyway this worked for me. Good luck.

I try to investigate this problem and can RestartGame from Editor with single client without dedicated server.
Also I create minimal project for reproducing problem and pull my ugly workaround: https://github.com/EpicGames/UnrealEngine/pull/612.