2016-06-08 22:29:04 +01:00
|
|
|
|
using System;
|
2015-10-16 21:30:49 -04:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2016-01-01 14:03:55 -05:00
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.events
|
2015-10-16 21:30:49 -04:00
|
|
|
|
{
|
2016-01-01 14:03:55 -05:00
|
|
|
|
class EndEventPacket
|
2015-10-16 21:30:49 -04:00
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x0131;
|
|
|
|
|
public const uint PACKET_SIZE = 0x50;
|
|
|
|
|
|
2016-01-01 14:03:55 -05:00
|
|
|
|
public static SubPacket buildPacket(uint playerActorID, uint eventOwnerActorID, string eventStarter)
|
2015-10-16 21:30:49 -04:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
2016-01-01 14:03:55 -05:00
|
|
|
|
int maxBodySize = data.Length - 0x80;
|
2015-10-16 21:30:49 -04:00
|
|
|
|
|
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
2016-01-01 14:03:55 -05:00
|
|
|
|
binWriter.Write((UInt32)playerActorID);
|
2016-01-24 17:11:35 -05:00
|
|
|
|
binWriter.Write((UInt32)0);
|
|
|
|
|
binWriter.Write((Byte)1);
|
2016-01-01 14:03:55 -05:00
|
|
|
|
binWriter.Write(Encoding.ASCII.GetBytes(eventStarter), 0, Encoding.ASCII.GetByteCount(eventStarter) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(eventStarter));
|
2015-10-16 21:30:49 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|