2016-06-08 22:29:04 +01:00
|
|
|
|
using System;
|
2016-01-23 20:12:04 -05:00
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
|
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
2016-01-23 20:12:04 -05:00
|
|
|
|
{
|
|
|
|
|
class SetEventStatus
|
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x0136;
|
|
|
|
|
public const uint PACKET_SIZE = 0x48;
|
|
|
|
|
|
2017-06-27 13:52:47 -04:00
|
|
|
|
public static SubPacket BuildPacket(uint sourceActorId, bool enabled, byte unknown2, string conditionName)
|
2016-01-23 20:12:04 -05:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
|
|
|
|
|
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
2016-04-01 23:24:14 -04:00
|
|
|
|
binWriter.Write((UInt32)(enabled ? 1 : 0));
|
2016-01-23 22:11:45 -05:00
|
|
|
|
binWriter.Write((Byte)unknown2);
|
|
|
|
|
binWriter.Write(Encoding.ASCII.GetBytes(conditionName), 0, Encoding.ASCII.GetByteCount(conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(conditionName));
|
2016-01-23 20:12:04 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 13:52:47 -04:00
|
|
|
|
return new SubPacket(OPCODE, sourceActorId, data);
|
2016-01-23 20:12:04 -05:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|