Added new equipment change packet. Renamed ChangeEquipmentPacket to EquipmentChangePacket. Renamed folder Actor to actor.

This commit is contained in:
Filip Maj 2015-10-06 11:53:40 -04:00
parent a81d6bb26a
commit 0f80fa12dc
5 changed files with 151 additions and 62 deletions

View file

@ -0,0 +1,32 @@
using FFXIVClassic_Lobby_Server.packets;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
{
class EquipmentChangePacket
{
public const ushort OPCODE = 0x014D;
public const uint PACKET_SIZE = 0x28;
public static SubPacket buildPacket(uint playerActorID, ushort slot, uint itemSlot)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((UInt16)slot);
binWriter.Write((UInt32)itemSlot);
}
}
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
}
}
}