mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-10 14:34:32 +02:00
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:
parent
50659afc82
commit
9bb8cc816f
7 changed files with 143 additions and 169 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue