Exemple #1
0
 public void DisconnectPlayer(string token)
 {
     Monitor.Enter(players);
     players[token].DisconnectFromLobby();
     players.Remove(token);
     Router.UnregisterLobbyRoute(token);
     Monitor.Exit(players);
     if ((status == LobbyStatus.StartedRun || status == LobbyStatus.Started) && players.Count < 2)
     {
         GM.KillCharacter(token);
     }
     else
     {
         status = LobbyStatus.WaitingForPlayer;
     }
     if (players.Count == 0)
     {
         FinishGame();
     }
 }