private void recordFullSimulationState(int turn) { InfoLog.Write("\r\nTurn: " + turn, LogFiles.FullSimulationLog); foreach (Player player in this.Players.Values) { InfoLog.Write("Player: " + player.Id.ToString() + " - " + player.Name + ". Team id: " + player.TeamID, LogFiles.FullSimulationLog); InfoLog.Write("Player credits: " + player.Credits.ToString(), LogFiles.FullSimulationLog); InfoLog.Write("Player power: " + player.Power.ToString(), LogFiles.FullSimulationLog); InfoLog.Write("Player colour: " + player.Color.ToString(), LogFiles.FullSimulationLog); InfoLog.Write("\r\n", LogFiles.FullSimulationLog); InfoLog.Write("Player units info: ", LogFiles.FullSimulationLog); InfoLog.Write("Player units count: " + player.GetAllUnits().Count, LogFiles.FullSimulationLog); foreach (Unit unit in player.GetAllUnits()) { InfoLog.Write(unit.ToString(), LogFiles.FullSimulationLog); } InfoLog.Write("\r\nPlayer buildings info: "); foreach (Building b in player.GetAllBuildings()) { InfoLog.Write(b.ToString(), LogFiles.FullSimulationLog); } } foreach (UnitSandworm sandworm in sandworms.Values) { InfoLog.Write(sandworm.ToString(), LogFiles.FullSimulationLog); } }
private void ProcessGameEnd(GameEndMessage item) { _gameServer.Simulation.SetEndGame(item.SenderId, item.HasWon); if (_gameServer.Simulation.HasGameEnded()) { InfoLog.Write("Game " + _gameServer.Name + " has finished."); _gameServer.EndServerGame(); //_gameServer.StopGameServer(); } }