/// <summary> /// Creates the and start client. /// </summary> /// <param name="clientId">The client identifier.</param> /// <param name="connection">The connection.</param> internal void CreateAndStartClient(uint clientId, ConnectionInformation connection) { var gameClient = new GameClient(clientId, connection); Clients.AddOrUpdate(clientId, gameClient, (key, value) => gameClient); gameClient.StartConnection(); }
public void CreateAndStartClient(int clientID, ConnectionInformation connection) { var Client = new GameClient(clientID, connection); if (_clients.TryAdd(Client.ConnectionId, Client)) { Client.StartConnection(); } else { connection.Dispose(); } }
public void CreateAndStartClient(int clientID, ConnectionInformation connection) { GameClient Client = new GameClient(clientID, connection); if (this._clients.TryAdd(Client.ConnectionID, Client)) Client.StartConnection(); else connection.Dispose(); }