Beispiel #1
0
 private static void PacketLogConsole(SWPacket p, bool outgoing)
 {
     if (p.ID == 0x0106 || p.PacketType() == PacketType.ClientCharacterUpdateSpecialOptionList)
     {
         return;                                                                                         //keepalive-ish stuff
     }
     if ((p.ID & 0xFF00) == 0x0500)
     {
         return;                             //movement
     }
     Console.WriteLine($"{(outgoing ? "[OUT]" : "[IN] ")} {p}");
 }
Beispiel #2
0
        private static void PacketLogDisk(SWPacket p, bool outgoing)
        {
            if (p.ID == 0x0106 || p.PacketType() == PacketType.ClientCharacterUpdateSpecialOptionList)
            {
                return;                                                                                         //keepalive-ish stuff
            }
            if ((p.ID & 0xFF00) == 0x0500)
            {
                return;                             //movement
            }
            if (!Directory.Exists(_dirLog))
            {
                Directory.CreateDirectory(_dirLog);
            }

            string fileName = $"{(int)(DateTime.Now - _startTime).TotalMilliseconds:D7}ms_{(outgoing ? "Out" : "In_")}_{p.IDString()}_len{p.Data.Length}.bin";

            File.WriteAllBytes(Path.Combine(_dirLog, fileName), p.Data);
        }