// 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(); }
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."); } }