/// <summary> /// Creates an instance from a connected client SocketState. /// </summary> /// <param name="gameServerController">The SpaceWars server instance.</param> /// <param name="state">The client's SocketState.</param> public ClientCommunicator(GameServerController gameServerController, SocketState state) { _gameServerController = gameServerController; _state = state; // Listen for socket state events. _state.DataReceived += OnDataReceived; _state.Disconnected += OnDisconnected; }
/// <summary> /// Initializes the game server controller and logger. /// </summary> internal GameServer() { var configuration = InitializeProperties(); // Configure and create server instance. _gameServerController = new GameServerController(configuration); Logger.Log(LogLevel.Info, Resources.GameServer_Log_ServerConnected); InitializeLoggingListeners(); }