public Player(GameMasterSvc gameSession, string clientId, EndpointDiscoveryMetadata playerMetadata) { this.Locker = new Semaphore(1, 1); this.Locker.WaitOne(); Task.Run(() => Init(gameSession, clientId, playerMetadata)); }
private void Init(GameMasterSvc gameSession, string clientId, EndpointDiscoveryMetadata playerMetadata) { Console.WriteLine("Player " + "(" + clientId + ") has logged in"); Console.WriteLine(); this.ClientId = clientId; this.GameSession = gameSession; this.RemoteMetadata = playerMetadata; this.Client = null; this.DisplayName = null; this.CurrentMatch = null; this.Locker.Release(); }