1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-24 05:37:46 +00:00
project-meteor-server/FFXIVClassic Map Server/packets/send/Actor/events/SetEventStatus.cs

32 lines
1 KiB
C#
Raw Normal View History

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))
{
binWriter.Write((UInt32)(enabled ? 1 : 0));
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
}
}
}