public bool TryGetClient(NetID ID, out Client GW2Client) { Client client; bool result = clientList.TryGetValue(ID, out client); GW2Client = client; return result; }
public void RemoveClient(NetID ID) { if (clientList.ContainsKey(ID) && NetIDManager.Instance.RemoveID(ID)) { clientList.Remove(ID); } }
public Client(Socket Socket, NetID ID) { this.Socket = Socket; this.ID = ID; PacketManager = new PacketManager(this); messageQueue = new List<NetworkMessage>(); }
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); } }
public bool RemoveID(NetID ID) { return idList.Remove(ID); }
public bool RemoveID(NetID ID) { return(idList.Remove(ID)); }
private void OnConnectionLost(NetID ID) { ClientDisconnected(ID); }
private void OnConnection(NetID ID) { ClientConnected(ID); }
public NetworkMessage(MemoryStream PacketStream, NetID ID) { packetStream = PacketStream; Client = ID; }
private static void ConnectionLost(NetID ID) { Console.WriteLine("Client disconnected [" + ID.Value.ToString() + "]"); }