2016-06-08 22:29:04 +01:00
|
|
|
|
using FFXIVClassic_Map_Server.lua;
|
2016-03-23 01:27:12 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
2016-08-22 10:43:04 -04:00
|
|
|
|
using FFXIVClassic.Common;
|
|
|
|
|
|
2016-03-23 01:27:12 -04:00
|
|
|
|
namespace FFXIVClassic_Map_Server.packets.send.events
|
|
|
|
|
{
|
|
|
|
|
class KickEventPacket
|
|
|
|
|
{
|
|
|
|
|
public const ushort OPCODE = 0x012F;
|
|
|
|
|
public const uint PACKET_SIZE = 0x90;
|
|
|
|
|
|
2017-06-27 13:23:05 -04:00
|
|
|
|
public static SubPacket BuildPacket(uint sourcePlayerActorId, uint targetEventActorId, string conditionName, List<LuaParam> luaParams)
|
2016-03-23 01:27:12 -04:00
|
|
|
|
{
|
|
|
|
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
|
|
|
|
|
|
|
|
|
using (MemoryStream mem = new MemoryStream(data))
|
|
|
|
|
{
|
|
|
|
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
|
|
|
{
|
2017-06-27 13:23:05 -04:00
|
|
|
|
binWriter.Write((UInt32)sourcePlayerActorId);
|
|
|
|
|
binWriter.Write((UInt32)targetEventActorId);
|
2017-01-08 21:42:43 -05:00
|
|
|
|
|
2017-03-07 00:09:37 -05:00
|
|
|
|
int test = 0x75dc1705; //This will crash if set to 0 on pushCommand but not for mining which has to be 0????
|
2017-01-08 21:42:43 -05:00
|
|
|
|
|
|
|
|
|
binWriter.Write((UInt32)test);
|
2016-04-01 23:24:14 -04:00
|
|
|
|
binWriter.Write((UInt32)0x30400000);
|
2016-03-23 01:27:12 -04:00
|
|
|
|
binWriter.Write(Encoding.ASCII.GetBytes(conditionName), 0, Encoding.ASCII.GetByteCount(conditionName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(conditionName));
|
|
|
|
|
|
2016-04-01 23:24:14 -04:00
|
|
|
|
binWriter.Seek(0x30, SeekOrigin.Begin);
|
2016-03-28 11:31:21 -04:00
|
|
|
|
|
2016-06-14 21:29:10 +01:00
|
|
|
|
LuaUtils.WriteLuaParams(binWriter, luaParams);
|
2016-03-23 01:27:12 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-06-27 13:23:05 -04:00
|
|
|
|
return new SubPacket(OPCODE, sourcePlayerActorId, data);
|
2016-03-23 01:27:12 -04:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|