Added implementations of the event receive/send packets. Added lua scripting stuff. Added some utils.

This commit is contained in:
Filip Maj 2016-01-01 14:03:55 -05:00
parent d60938346b
commit 734a3f4e7f
15 changed files with 603 additions and 261 deletions

View file

@ -0,0 +1,35 @@
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.events
{
class EndEventPacket
{
public const ushort OPCODE = 0x0131;
public const uint PACKET_SIZE = 0x50;
public static SubPacket buildPacket(uint playerActorID, uint eventOwnerActorID, string eventStarter)
{
byte[] data = new byte[PACKET_SIZE - 0x20];
int maxBodySize = data.Length - 0x80;
using (MemoryStream mem = new MemoryStream(data))
{
using (BinaryWriter binWriter = new BinaryWriter(mem))
{
binWriter.Write((UInt32)playerActorID);
binWriter.Write((UInt32)eventOwnerActorID);
binWriter.Write((Byte)0);
binWriter.Write(Encoding.ASCII.GetBytes(eventStarter), 0, Encoding.ASCII.GetByteCount(eventStarter) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(eventStarter));
}
}
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
}
}
}