Пример #1
0
 protected override void OnClientConnected(TcpClient client)
 {
     base.OnClientConnected(client);
     AuthClient auth = new AuthClient(client);
     auth.ClientDisconnected += OnClientDisconnected;
     Clients.Add(auth);
 }
Пример #2
0
 public int GetPosition(AuthClient client)
 {
     if (queue.ToList().Contains(client))
     {
         return queue.ToList().IndexOf(client);
     }
     return -1;
 }
Пример #3
0
        public AuthentificationManager(AuthClient client)
        {
            this.client = client;
            servers = new ServersManager(client);
            client.Dispatcher.Register(this);

            SayHello();
        }
Пример #4
0
 public ServersManager(AuthClient client)
 {
     this.client = client;
     client.Dispatcher.Register(this);
 }
Пример #5
0
 public void Enqueue(AuthClient client)
 {
     client.State = AuthClientStateEnum.IN_QUEUE;
     queue.Enqueue(client);
     UpdatePosition();
 }
Пример #6
0
 public void Dequeue(AuthClient client)
 {
     client.Authentification.CheckAccount();
 }
Пример #7
0
 private void UpdatePosition(AuthClient client)
 {
     if (queue.Count > 0)
     {
         client.Send(new LoginQueueStatusMessage((ushort)GetPosition(client), (ushort)queue.Count));
     }
 }