Disconnect player but maintain the state

Hello,

I am trying to disconnect my players at the end of a round to re-use the server for other rounds, but the problem is at the end of the round I want players to see a scoreboard, so the server sends to the players that we are in a scoreboard state but then the server gets recycled and kicks the players.

The clients go back to the main menu when they are disconnected automatically, how do I prevent that from happening ? What would be the correct solution to be able to display the scoreboard once the game completes but still be able to recycle the server as quickly as possible ?

Thanks,
Max

you put players in spactate mode while they see the score board. Disconnect a player only when he clicks a “leave” button himself… Also with a timer to auto disconnect all players from finished match after a minute or so.

It’s not a viable solution to have the server hang for so long, my load balancer will launch new instances of the game server if it finds no server available, launching a new instance is expensive, players don’t need to be connected to the server to look at the scoreboard.

Make the game state contain the score board. Send a message to each player that makes them copy the game state to some local game instance state. Then kick them. Have the main menu level know that, if the game instance state contains scoreboard information, it displays that scoreboard rather than the main menu.