diff --git a/FFXIVClassic Map Server/packets/send/social/BlacklistAddedPacket.cs b/FFXIVClassic Map Server/packets/send/social/BlacklistAddedPacket.cs index f894fdd6..67c817c7 100644 --- a/FFXIVClassic Map Server/packets/send/social/BlacklistAddedPacket.cs +++ b/FFXIVClassic Map Server/packets/send/social/BlacklistAddedPacket.cs @@ -1,5 +1,7 @@ -using System; +using FFXIVClassic_Lobby_Server.packets; +using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -8,5 +10,23 @@ namespace FFXIVClassic_Map_Server.packets.send.social { class BlacklistAddedPacket { + public const ushort OPCODE = 0x01C9; + public const uint PACKET_SIZE = 0x048; + + public static SubPacket buildPacket(uint playerActorID, bool isSuccess, string nameToAdd) + { + 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(nameToAdd), 0, Encoding.ASCII.GetByteCount(nameToAdd) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(nameToAdd)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } } } diff --git a/FFXIVClassic Map Server/packets/send/social/BlacklistRemovedPacket.cs b/FFXIVClassic Map Server/packets/send/social/BlacklistRemovedPacket.cs index ee87f91f..c1466a72 100644 --- a/FFXIVClassic Map Server/packets/send/social/BlacklistRemovedPacket.cs +++ b/FFXIVClassic Map Server/packets/send/social/BlacklistRemovedPacket.cs @@ -1,5 +1,7 @@ -using System; +using FFXIVClassic_Lobby_Server.packets; +using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -8,5 +10,23 @@ namespace FFXIVClassic_Map_Server.packets.send.social { class BlacklistRemovedPacket { + public const ushort OPCODE = 0x01CA; + public const uint PACKET_SIZE = 0x048; + + public static SubPacket buildPacket(uint playerActorID, bool isSuccess, string nameToRemove) + { + 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)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } } } diff --git a/FFXIVClassic Map Server/packets/send/social/FriendlistAddedPacket.cs b/FFXIVClassic Map Server/packets/send/social/FriendlistAddedPacket.cs index 3f440dc7..620f3a5b 100644 --- a/FFXIVClassic Map Server/packets/send/social/FriendlistAddedPacket.cs +++ b/FFXIVClassic Map Server/packets/send/social/FriendlistAddedPacket.cs @@ -1,5 +1,7 @@ -using System; +using FFXIVClassic_Lobby_Server.packets; +using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -8,5 +10,26 @@ namespace FFXIVClassic_Map_Server.packets.send.social { class FriendlistAddedPacket { + public const ushort OPCODE = 0x01CC; + public const uint PACKET_SIZE = 0x067; + + public static SubPacket buildPacket(uint playerActorID, bool isSuccess, uint index, bool isOnline, string nameToAdd) + { + byte[] data = new byte[PACKET_SIZE - 0x20]; + + using (MemoryStream mem = new MemoryStream(data)) + { + using (BinaryWriter binWriter = new BinaryWriter(mem)) + { + binWriter.Write((UInt32)index); + binWriter.Write((UInt32)0); + binWriter.Write((byte)(isOnline ? 1 : 0)); + binWriter.Write((byte)(isSuccess ? 1 : 0)); + binWriter.Write(Encoding.ASCII.GetBytes(nameToAdd), 0, Encoding.ASCII.GetByteCount(nameToAdd) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(nameToAdd)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } } } diff --git a/FFXIVClassic Map Server/packets/send/social/FriendlistRemovedPacket.cs b/FFXIVClassic Map Server/packets/send/social/FriendlistRemovedPacket.cs index b91f5f8f..8fa68eb1 100644 --- a/FFXIVClassic Map Server/packets/send/social/FriendlistRemovedPacket.cs +++ b/FFXIVClassic Map Server/packets/send/social/FriendlistRemovedPacket.cs @@ -1,5 +1,7 @@ -using System; +using FFXIVClassic_Lobby_Server.packets; +using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -8,5 +10,23 @@ namespace FFXIVClassic_Map_Server.packets.send.social { class FriendlistRemovedPacket { + public const ushort OPCODE = 0x01CD; + public const uint PACKET_SIZE = 0x057; + + public static SubPacket buildPacket(uint playerActorID, bool isSuccess, string nameToRemove) + { + 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)); + } + } + + return new SubPacket(OPCODE, playerActorID, playerActorID, data); + } } }