/// <summary> /// Resets the server. /// </summary> public virtual void Restart() { MessageHandlerThread.Abort(); MessageHandlerThread = new Thread(new ThreadStart(MessageHandlingLoop)); if (_History != null) { _History.Save(); _History = null; } Executor.CurrentGameState = null; Socket.Stop(); PlayersInGame.Clear(); StateChanged.Invoke(CurrentState = ServerState.BEFORE_LOBBY); }
/// <summary> /// Sets file that the game history should be written to. /// </summary> /// <param name="filename">Path to the file.</param> public void SetSaveFile(string filename) { _History = new GameHistoryCreator(); _History.SetFileName(filename); _History.SetSimulation(Executor); }