// override in GameChannelList, SqlGameList protected virtual bool RemoveGameState(GameState gameState) { if (log.IsDebugEnabled) { LogGameState("RemoveGameState:", gameState); } if (this.nextJoinRandomStartNode != null && this.nextJoinRandomStartNode.Value == gameState) { this.AdvanceNextJoinRandomStartNode(); } this.PlayerCount -= gameState.PlayerCount; gameState.OnRemoved(); var gameId = gameState.Id; this.gameDict.Remove(gameId); this.changedGames.Remove(gameId); if (gameState.IsVisbleInLobby) { this.removedGames.Add(gameId); } if (this.PlayerCount < 0) { log.WarnFormat("Got negative player count for lobby:'{0}/{1}', appId:{2}/{3}, PlayerCount:{4}, GameStage:{5}", this.Lobby.LobbyName, this.Lobby.LobbyType, this.Lobby.Application.ApplicationId, this.Lobby.Application.Version, this.PlayerCount, gameState.GetDebugData()); this.PlayerCount = 0; } if (log.IsDebugEnabled) { log.DebugFormat("PlayerCount changed after game remove. New Value={0}", this.PlayerCount); } return(true); }
// override in GameChannelList, SqlGameList protected virtual bool RemoveGameState(GameState gameState) { if (log.IsDebugEnabled) { LogGameState("RemoveGameState:", gameState); } if (this.nextJoinRandomStartNode != null && this.nextJoinRandomStartNode.Value == gameState) { this.AdvanceNextJoinRandomStartNode(); } gameState.OnRemoved(); var gameId = gameState.Id; this.gameDict.Remove(gameId); this.changedGames.Remove(gameId); this.removedGames.Add(gameId); this.PlayerCount -= gameState.PlayerCount; return(true); }
// override in GameChannelList, SqlGameList protected virtual bool RemoveGameState(GameState gameState) { if (log.IsDebugEnabled) { LogGameState("RemoveGameState:", gameState); } if (this.nextJoinRandomStartNode != null && this.nextJoinRandomStartNode.Value == gameState) { this.AdvanceNextJoinRandomStartNode(); } gameState.OnRemoved(); var gameId = gameState.Id; this.gameDict.Remove(gameId); this.changedGames.Remove(gameId); this.removedGames.Add(gameId); this.PlayerCount -= gameState.PlayerCount; return true; }