Finished SetCompletedAchievementsPacket and renamed CutsceneBookSetPacket to SetCutsceneBookPacket in line with other "set" packets. Moved a lot of the hardcoded packets into the coded login part under PacketProcessor.

This commit is contained in:
Filip Maj 2015-11-28 20:56:22 -05:00
parent 50659afc82
commit 9bb8cc816f
7 changed files with 143 additions and 169 deletions

View file

@ -118,5 +118,23 @@ namespace FFXIVClassic_Lobby_Server.common
return h;
}
public static byte[] ConvertBoolArrayToBinaryStream(bool[] array)
{
byte[] data = new byte[(array.Length/8)+(array.Length%8 != 0 ? 1 : 0)];
int dataCounter = 0;
for (int i = 0; i < array.Length; i+=8)
{
for (int bitCount = 0; bitCount < 8; bitCount++)
{
if (i + bitCount >= array.Length)
break;
data[dataCounter] = (byte)(((array[i + bitCount] ? 1 : 0) << 7-bitCount) | data[dataCounter]);
}
dataCounter++;
}
return data;
}
}
}