public void AddClient(Client client) { lock (m_dictionary) { m_dictionary.Add(client.ID,client); } }
public PacketBuffer(Client owner) { m_owner = owner; m_inputQueue = new Queue<byte>(); m_outputQueue = new Queue<byte[]>(); m_currentPacket = new ArrayList(); }
public void RemoveClient(Client client) { if (m_dictionary.ContainsKey(client.ID)) { lock (m_dictionary) m_dictionary.Remove(client.ID); } }
private void Process(Client c) { c.packetBuffer.working = true; PacketHandler handler; while (c.packetBuffer.Available) { byte[] packet = c.packetBuffer.Dequeue(); handler = Packets.GetHandler(packet[0]); if (handler != null) handler.onReceieve(packet,c); } c.packetBuffer.working = false; }
public static void NewPacket(Client c) { m_packetProcessor.Enqueue(c); }
public void Enqueue(Client c) { lock (m_processQueue) m_processQueue.Enqueue(c); }
/* Packet Action */ private static void DummyPacket(byte[] buffer, Client c) { }
private byte[] ProcessFrame(Client c) { throw new NotImplementedException(); }
public void NewClient(Socket s) { Client c = new Client(s); masterList.Add(c.ID, c); clientNotifications.AddClient(c); }