public void OnPlayerDisconnectGame(Player player) { PlayerMissionsProgress.Remove(player.PlayerId); if (player.State == PlayerState.Professor) { ServerCompleteMatch(MatchResult.StudentsWin, MatchID); } else if (player.State == PlayerState.Student) { //If all players exit the game, then professor wins. if (PlayerMissionsProgress.Count == 0) { ServerCompleteMatch(MatchResult.ProfessorWins, MatchID); return; } ServerEvaluateMissionState(); } }
/// <summary> /// Call this when a Player is caught by professor and becomes assistant. /// Or in case student exits game. /// </summary> public void RemovePlayer(string playerId) { PlayerMissionsProgress.Remove(playerId); }