Пример #1
0
 public bool TryGetClient(NetID ID, out Client GW2Client)
 {
     Client client;
     bool result = clientList.TryGetValue(ID, out client);
     GW2Client = client;
     return result;
 }
Пример #2
0
 public void RemoveClient(NetID ID)
 {
     if (clientList.ContainsKey(ID) && NetIDManager.Instance.RemoveID(ID))
     {
         clientList.Remove(ID);
     }
 }
Пример #3
0
        public Client(Socket Socket, NetID ID)
        {
            this.Socket = Socket;
            this.ID = ID;

            PacketManager = new PacketManager(this);
            messageQueue = new List<NetworkMessage>();
        }
Пример #4
0
        public NetID GenerateID()
        {
            if (idList.Count < 10000 && idList.Count >= 0)
            {
                NetID tmp = new NetID(idList.Count);
                idList.Add(tmp);
                return tmp;
            }

            else
            {
                return new NetID(-1);
            }
        }
Пример #5
0
 public bool RemoveID(NetID ID)
 {
     return idList.Remove(ID);
 }
Пример #6
0
 public bool RemoveID(NetID ID)
 {
     return(idList.Remove(ID));
 }
Пример #7
0
 private void OnConnectionLost(NetID ID)
 {
     ClientDisconnected(ID);
 }
Пример #8
0
 private void OnConnection(NetID ID)
 {
     ClientConnected(ID);
 }
Пример #9
0
 public NetworkMessage(MemoryStream PacketStream, NetID ID)
 {
     packetStream = PacketStream;
     Client = ID;
 }
Пример #10
0
 private static void ConnectionLost(NetID ID)
 {
     Console.WriteLine("Client disconnected [" + ID.Value.ToString() + "]");
 }
Пример #11
0
 public NetworkMessage(MemoryStream PacketStream, NetID ID)
 {
     packetStream = PacketStream;
     Client       = ID;
 }