示例#1
0
 // called from NetworkManager
 public void LeaveGame()
 {
     unitCounts = new Dictionary <short, int> ();
     if (!inGame)
     {
         return;
     }
     if (gameView == View.Global)
     {
         gui.KeybindMenu();
     }
     gameView = View.Lobby;
     isServer = false;
     inGame   = false;
     CleanObjects();
     CancelBuild();
     readyClients      = 0;
     selection.enabled = false;
     //show Lobby UI
     gui.Cleanup();
 }
示例#2
0
 public void RecieveDisconnected(short playerid)
 {
     if (playerid < 4)
     {
         if (state.isServer)
         {
             SetPlayerConnected(playerid, false);
             for (int i = 0; i < mapState.voteables.Length; ++i)
             {
                 mapState.voteables[i].ClearVotes(playerid);
             }
             SendSync();
         }
         else
         {
             gui.Cleanup();
         }
     }
     else
     {
         Debug.Log("A user was disconnected due to your full room.");
     }
 }