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 RemoveClient(NetID ID)
 {
     if (clientList.ContainsKey(ID) && NetIDManager.Instance.RemoveID(ID))
     {
         clientList.Remove(ID);
     }
 }
Exemplo n.º 3
0
        public Client(Socket Socket, NetID ID)
        {
            this.Socket = Socket;
            this.ID = ID;

            PacketManager = new PacketManager(this);
            messageQueue = new List<NetworkMessage>();
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 5
0
 public bool RemoveID(NetID ID)
 {
     return idList.Remove(ID);
 }
Exemplo n.º 6
0
 public bool RemoveID(NetID ID)
 {
     return(idList.Remove(ID));
 }
Exemplo n.º 7
0
 private void OnConnectionLost(NetID ID)
 {
     ClientDisconnected(ID);
 }
Exemplo n.º 8
0
 private void OnConnection(NetID ID)
 {
     ClientConnected(ID);
 }
Exemplo n.º 9
0
 public NetworkMessage(MemoryStream PacketStream, NetID ID)
 {
     packetStream = PacketStream;
     Client = ID;
 }
Exemplo n.º 10
0
 private static void ConnectionLost(NetID ID)
 {
     Console.WriteLine("Client disconnected [" + ID.Value.ToString() + "]");
 }
Exemplo n.º 11
0
 public NetworkMessage(MemoryStream PacketStream, NetID ID)
 {
     packetStream = PacketStream;
     Client       = ID;
 }