in UnityProject/Assets/Scripts/Server/Server.cs [442:461]
public void TerminateGameSession()
{
// Check if we should already quit or host another session
Server.hostedGameSessions++;
if(Server.hostedGameSessions >= Server.totalGameSessionsToHost)
{
Debug.Log("Hosted max sessions, mark server as terminated to Redis and start waiting for other servers in the Task to terminate");
this.server.UpdateRedis(serverTerminated: true);
this.server.waitingForTermination = true;
}
else
{
Debug.Log("Restart the Server");
Server.messagesToProcess = new List<SimpleMessage>(); //Reset messages
this.server.players = new List<NetworkPlayer>(); //Reset players
this.ready = false;
this.server.UpdateRedis(serverTerminated: false); //Update to redis as not ready while waiting for restart
SceneManager.LoadScene("GameWorld"); // Reset world to restart everything
}
}