2016-06-08 22:29:04 +01:00
|
|
|
|
using System.IO;
|
2015-12-04 23:39:39 -05:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
|
2015-12-04 23:39:39 -05:00
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.social
|
|
|
|
|
{
|
|
|
|
|
class FriendlistRemovedPacket
|
|
|
|
|
{
|
2015-12-05 00:05:09 -05:00
|
|
|
|
public const ushort OPCODE = 0x01CD;
|
|
|
|
|
public const uint PACKET_SIZE = 0x057;
|
|
|
|
|
|
2017-06-27 13:23:05 -04:00
|
|
|
|
public static SubPacket BuildPacket(uint sourceActorId, bool isSuccess, string nameToRemove)
|
2015-12-05 00:05:09 -05:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
|
|
|
|
|
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
|
|
|
|
binWriter.Write((byte)(isSuccess ? 1 : 0));
|
|
|
|
|
binWriter.Write(Encoding.ASCII.GetBytes(nameToRemove), 0, Encoding.ASCII.GetByteCount(nameToRemove) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(nameToRemove));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 13:23:05 -04:00
|
|
|
|
return new SubPacket(OPCODE, sourceActorId, data);
|
2015-12-05 00:05:09 -05:00
|
|
|
|
}
|
2015-12-04 23:39:39 -05:00
|
|
|
|
}
|
|
|
|
|
}
|