2016-06-08 22:29:04 +01:00
|
|
|
|
using System;
|
2015-10-12 00:42:28 -04:00
|
|
|
|
using System.IO;
|
2015-10-11 14:57:24 -04:00
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.player
|
|
|
|
|
{
|
|
|
|
|
class SetLatestAchievementsPacket
|
|
|
|
|
{
|
2015-10-12 00:42:28 -04:00
|
|
|
|
public const ushort OPCODE = 0x019B;
|
|
|
|
|
public const uint PACKET_SIZE = 0x40;
|
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
public static SubPacket BuildPacket(uint playerActorID, uint[] latestAchievementIDs)
|
2015-10-12 00:42:28 -04:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
2015-10-11 14:57:24 -04:00
|
|
|
|
|
2015-10-12 00:42:28 -04:00
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < 5; i++)
|
|
|
|
|
{
|
|
|
|
|
//Had less than 5
|
|
|
|
|
if (i > latestAchievementIDs.Length)
|
|
|
|
|
break;
|
|
|
|
|
binWriter.Write((UInt32)latestAchievementIDs[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-10-11 14:57:24 -04:00
|
|
|
|
|
2015-10-12 00:42:28 -04:00
|
|
|
|
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
2015-10-11 14:57:24 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|