Ejemplo n.º 1
0
        protected void HandlePacket(ServerPacket packet)
        {
            if (_packetHandlers.ContainsKey(packet.OpCode))
            {
                var handlerData = _packetHandlers[packet.OpCode];
                handlerData.Item2(this, packet);
            }
            else
            {
                string dir = $"Packets/{packet.OpCode}";
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }

                string date = "_" + DateTime.Now.Day + DateTime.Now.Month + DateTime.Now.Year + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second;
                File.WriteAllText($"Packets/{packet.OpCode}/{date}_hex", Util.HexDump(packet.Data));
                File.WriteAllBytes($"Packets/{packet.OpCode}/{date}_byte", packet.Data);
            }
        }
Ejemplo n.º 2
0
 public void HandlePacket(BaseClient client, ServerPacket packet)
 {
     HandlePacket((TClient)client, packet);
 }
Ejemplo n.º 3
0
 public abstract void HandlePacket(TClient client, ServerPacket packet);