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; }
private int GetPacketLength(byte packetID) { return(Packets.GetPacketLength(packetID)); }