Exemplo n.º 1
0
 public bool TryGetClient(NetID ID, out Client GW2Client)
 {
     Client client;
     bool result = clientList.TryGetValue(ID, out client);
     GW2Client = client;
     return result;
 }
Exemplo n.º 2
0
 public void AddClient(Client GW2Client)
 {
     if (!clientList.ContainsValue(GW2Client) && !clientList.ContainsKey(GW2Client.ID))
     {
         clientList.Add(GW2Client.ID, GW2Client);
     }
 }
Exemplo n.º 3
0
 internal PacketManager(Client Client)
 {
     this.Client = Client;
 }
Exemplo n.º 4
0
        public void ProcessActions()
        {
            if (Pending)
            {
                var client = new Client(sListener.AcceptTcpClient().Client, NetIDManager.Instance.GenerateID());
                client.Connected += OnConnection;
                client.Disconnected += OnConnectionLost;
                sClients.AddClient(client);
            }

            foreach (Client client in sClients.ToArray())
            {
                if (!client.IsConnected())
                    client.Disconnect();

                client.CheckForIncoming();
                client.ProcessPackets();
                client.ClearQueue();
            }
        }