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

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