Fixed emotes not being sent to the emoter. Fixed appearance packets' gloves/legs being ordered wrong. Chat is implemented. Changed commands to start with '!'.

This commit is contained in:
Filip Maj 2016-02-18 22:38:54 -05:00
parent c6ac8b2f14
commit a47d5f96a5
8 changed files with 86 additions and 43 deletions

View file

@ -13,26 +13,27 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
public const ushort OPCODE = 0x00E1;
public const uint PACKET_SIZE = 0x30;
public static SubPacket buildPacket(uint playerActorID, uint targetActorID, uint emoteID)
public static SubPacket buildPacket(uint sourceActorId, uint targetActorId, uint targettedActorId, uint emoteID)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
if (targetActorID == 0xC0000000)
targetActorID = playerActorID;
if (targettedActorId == 0xC0000000)
targettedActorId = sourceActorId;
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
uint realAnimID = 0x5000000 | ((emoteID - 100) << 12);
uint realDescID = 20000 + ((emoteID - 1) * 10) + (targetActorID == playerActorID ? (uint)2 : (uint)1);
uint realDescID = 20000 + ((emoteID - 1) * 10) + (targettedActorId == sourceActorId ? (uint)2 : (uint)1);
binWriter.Write((UInt32)realAnimID);
binWriter.Write((UInt32)targetActorID);
binWriter.Write((UInt32)targettedActorId);
binWriter.Write((UInt32)realDescID);
}
}
SubPacket packet = new SubPacket(OPCODE, playerActorID, targetActorID, data);
SubPacket packet = new SubPacket(OPCODE, sourceActorId, targetActorId, data);
packet.debugPrintSubPacket();
return packet;
}
}

View file

@ -21,19 +21,19 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
public const int WEAPON1 = 5;
public const int WEAPON2 = 6;
public const int WEAPON3 = 7;
public const int HEADGEAR = 8;
public const int BODYGEAR = 9;
public const int LEGSGEAR = 10;
public const int HANDSGEAR = 11;
public const int FEETGEAR = 12;
public const int WAISTGEAR = 13;
public const int UNKNOWN1 = 14;
public const int R_EAR = 15;
public const int L_EAR = 16;
public const int UNKNOWN2 = 17;
public const int UNKNOWN3 = 18;
public const int R_FINGER = 19;
public const int L_FINGER = 20;
public const int HEADGEAR = 12;
public const int BODYGEAR = 13;
public const int LEGSGEAR = 14;
public const int HANDSGEAR = 15;
public const int FEETGEAR = 16;
public const int WAISTGEAR = 17;
public const int UNKNOWN1 = 18;
public const int R_EAR = 19;
public const int L_EAR = 20;
public const int UNKNOWN2 = 21;
public const int UNKNOWN3 = 22;
public const int R_FINGER = 23;
public const int L_FINGER = 24;
public uint modelID;
public uint[] appearanceIDs;