1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-21 20:27:47 +00:00

Fixed packet Console output

This commit is contained in:
deviltti 2016-06-10 21:14:28 -04:00
parent 33a52c4fa8
commit 554c8b5514
4 changed files with 33 additions and 17 deletions

View file

@ -335,10 +335,14 @@ namespace FFXIVClassic_Lobby_Server.packets
{ {
#if DEBUG #if DEBUG
Console.BackgroundColor = ConsoleColor.DarkYellow; Console.BackgroundColor = ConsoleColor.DarkYellow;
Log.Debug(String.Format("IsAuthed: {0}, IsEncrypted: {1}, Size: 0x{2:X}, Num Subpackets: {3}", header.isAuthenticated, header.isEncrypted, header.packetSize, header.numSubpackets));
Log.Debug(String.Format("{0}", Utils.ByteArrayToHex(getHeaderBytes()))); Log.Debug(String.Format("IsAuth: {0} IsEncrypted: {1}, Size: 0x{2:X}, NumSubpackets: {3}{4}{5}", header.isAuthenticated, header.isCompressed, header.packetSize, header.numSubpackets, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes())));
foreach (SubPacket sub in getSubpackets()) foreach (SubPacket sub in getSubpackets())
{
sub.debugPrintSubPacket(); sub.debugPrintSubPacket();
}
Console.BackgroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.Black;
#endif #endif
} }

View file

@ -141,14 +141,18 @@ namespace FFXIVClassic_Lobby_Server.packets
{ {
#if DEBUG #if DEBUG
Console.BackgroundColor = ConsoleColor.DarkRed; Console.BackgroundColor = ConsoleColor.DarkRed;
Log.Debug(String.Format("Size: 0x{0:X}", header.subpacketSize));
Log.Debug(String.Format("Size: 0x{0:X}{1}{2}", header.subpacketSize, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes())));
if (header.type == 0x03) if (header.type == 0x03)
Log.Debug(String.Format("Opcode: 0x{0:X}", gameMessage.opcode)); {
Log.Debug(String.Format("{0}", Utils.ByteArrayToHex(getHeaderBytes()))); Log.Debug(String.Format("Opcode: 0x{0:X}{1}{2}", gameMessage.opcode, Environment.NewLine, Utils.ByteArrayToHex(getGameMessageBytes(), SUBPACKET_SIZE)));
if (header.type == 0x03) }
Log.Debug(String.Format("{0}", Utils.ByteArrayToHex(getGameMessageBytes())));
Console.BackgroundColor = ConsoleColor.DarkMagenta; Console.BackgroundColor = ConsoleColor.DarkMagenta;
Log.Debug(String.Format("{0}", Utils.ByteArrayToHex(data)));
Log.Debug(String.Format("Data: {0}{1}", Environment.NewLine, Utils.ByteArrayToHex(data, SUBPACKET_SIZE + GAMEMESSAGE_SIZE)));
Console.BackgroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.Black;
#endif #endif
} }

View file

@ -333,10 +333,14 @@ namespace FFXIVClassic_Map_Server.packets
{ {
#if DEBUG #if DEBUG
Console.BackgroundColor = ConsoleColor.DarkYellow; Console.BackgroundColor = ConsoleColor.DarkYellow;
Log.Debug(String.Format("IsAuthed: {0}, IsEncrypted: {1}, Size: 0x{2:X}, Num Subpackets: {3}", header.isAuthenticated, header.isCompressed, header.packetSize, header.numSubpackets));
Log.Debug(String.Format("{0}", Utils.ByteArrayToHex(getHeaderBytes()))); Log.Debug(String.Format("IsAuth: {0} IsEncrypted: {1}, Size: 0x{2:X}, NumSubpackets: {3}{4}{5}", header.isAuthenticated, header.isCompressed, header.packetSize, header.numSubpackets, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes())));
foreach (SubPacket sub in getSubpackets()) foreach (SubPacket sub in getSubpackets())
{
sub.debugPrintSubPacket(); sub.debugPrintSubPacket();
}
Console.BackgroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.Black;
#endif #endif
} }

View file

@ -141,14 +141,18 @@ namespace FFXIVClassic_Map_Server.packets
{ {
#if DEBUG #if DEBUG
Console.BackgroundColor = ConsoleColor.DarkRed; Console.BackgroundColor = ConsoleColor.DarkRed;
Log.Debug(String.Format("Size: 0x{0:X}", header.subpacketSize));
Log.Debug(String.Format("Size: 0x{0:X}{1}{2}", header.subpacketSize, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes())));
if (header.type == 0x03) if (header.type == 0x03)
Log.Debug(String.Format("Opcode: 0x{0:X}", gameMessage.opcode)); {
Log.Debug(String.Format("{0}", Utils.ByteArrayToHex(getHeaderBytes()))); Log.Debug(String.Format("Opcode: 0x{0:X}{1}{2}", gameMessage.opcode, Environment.NewLine, Utils.ByteArrayToHex(getGameMessageBytes(), SUBPACKET_SIZE)));
if (header.type == 0x03) }
Log.Debug(String.Format("{0}", Utils.ByteArrayToHex(getGameMessageBytes())));
Console.BackgroundColor = ConsoleColor.DarkMagenta; Console.BackgroundColor = ConsoleColor.DarkMagenta;
Log.Debug(String.Format("{0}", Utils.ByteArrayToHex(data)));
Log.Debug(String.Format("Data: {0}{1}", Environment.NewLine, Utils.ByteArrayToHex(data, SUBPACKET_SIZE + GAMEMESSAGE_SIZE)));
Console.BackgroundColor = ConsoleColor.Black; Console.BackgroundColor = ConsoleColor.Black;
#endif #endif
} }