1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-22 12:47:46 +00:00

Fixed packet ByteArrayToHex output

This commit is contained in:
deviltti 2016-06-10 22:40:46 -04:00
parent 554c8b5514
commit 16d4779970
4 changed files with 29 additions and 25 deletions

View file

@ -38,16 +38,18 @@ namespace FFXIVClassic_Lobby_Server.common
StringBuilder sb = new StringBuilder(numLines * lineLength);
for (int i = offset; i < bytes.Length; i += bytesPerLine)
for (int i = 0; i < bytes.Length; i += bytesPerLine)
{
line[0] = hexChars[(i >> 28) & 0xF];
line[1] = hexChars[(i >> 24) & 0xF];
line[2] = hexChars[(i >> 20) & 0xF];
line[3] = hexChars[(i >> 16) & 0xF];
line[4] = hexChars[(i >> 12) & 0xF];
line[5] = hexChars[(i >> 8) & 0xF];
line[6] = hexChars[(i >> 4) & 0xF];
line[7] = hexChars[(i >> 0) & 0xF];
int h = i + offset;
line[0] = hexChars[(h >> 28) & 0xF];
line[1] = hexChars[(h >> 24) & 0xF];
line[2] = hexChars[(h >> 20) & 0xF];
line[3] = hexChars[(h >> 16) & 0xF];
line[4] = hexChars[(h >> 12) & 0xF];
line[5] = hexChars[(h >> 8) & 0xF];
line[6] = hexChars[(h >> 4) & 0xF];
line[7] = hexChars[(h >> 0) & 0xF];
int hexColumn = offsetBlock;
int charColumn = byteBlock;

View file

@ -336,7 +336,7 @@ namespace FFXIVClassic_Lobby_Server.packets
#if DEBUG
Console.BackgroundColor = ConsoleColor.DarkYellow;
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())));
Log.Debug(String.Format("IsAuth: {0} Size: 0x{1:X}, NumSubpackets: {2}{3}{4}", header.isAuthenticated, header.packetSize, header.numSubpackets, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes())));
foreach (SubPacket sub in getSubpackets())
{

View file

@ -39,16 +39,18 @@ namespace FFXIVClassic_Map_Server.common
StringBuilder sb = new StringBuilder(numLines * lineLength);
for (int i = offset; i < bytes.Length; i += bytesPerLine)
for (int i = 0; i < bytes.Length; i += bytesPerLine)
{
line[0] = hexChars[(i >> 28) & 0xF];
line[1] = hexChars[(i >> 24) & 0xF];
line[2] = hexChars[(i >> 20) & 0xF];
line[3] = hexChars[(i >> 16) & 0xF];
line[4] = hexChars[(i >> 12) & 0xF];
line[5] = hexChars[(i >> 8) & 0xF];
line[6] = hexChars[(i >> 4) & 0xF];
line[7] = hexChars[(i >> 0) & 0xF];
int h = i + offset;
line[0] = hexChars[(h >> 28) & 0xF];
line[1] = hexChars[(h >> 24) & 0xF];
line[2] = hexChars[(h >> 20) & 0xF];
line[3] = hexChars[(h >> 16) & 0xF];
line[4] = hexChars[(h >> 12) & 0xF];
line[5] = hexChars[(h >> 8) & 0xF];
line[6] = hexChars[(h >> 4) & 0xF];
line[7] = hexChars[(h >> 0) & 0xF];
int hexColumn = offsetBlock;
int charColumn = byteBlock;

View file

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