mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-21 20:27:47 +00:00
Moved packet structures to common.
This commit is contained in:
parent
d5f0cbef8c
commit
c67f74130f
169 changed files with 3939 additions and 919 deletions
|
@ -3,11 +3,10 @@ using System.Collections.Generic;
|
|||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using FFXIVClassic.Common;
|
||||
using NLog;
|
||||
using NLog.Targets;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets
|
||||
namespace FFXIVClassic.Common
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct BasePacketHeader
|
|
@ -54,12 +54,14 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BasePacket.cs" />
|
||||
<Compile Include="Bitfield.cs" />
|
||||
<Compile Include="Blowfish.cs" />
|
||||
<Compile Include="EfficientHashTables.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Sql.cs" />
|
||||
<Compile Include="STA_INIFile.cs" />
|
||||
<Compile Include="SubPacket.cs" />
|
||||
<Compile Include="Utils.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -4,7 +4,7 @@ using FFXIVClassic.Common;
|
|||
using NLog;
|
||||
using NLog.Targets;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets
|
||||
namespace FFXIVClassic.Common
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SubPacketHeader
|
|
@ -1,6 +1,5 @@
|
|||
using System;
|
||||
using System.Net.Sockets;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic.Common;
|
||||
using System.Collections.Concurrent;
|
||||
using Cyotek.Collections.Generic;
|
||||
|
|
|
@ -89,7 +89,6 @@
|
|||
<Compile Include="Database.cs" />
|
||||
<Compile Include="dataobjects\World.cs" />
|
||||
<Compile Include="PacketProcessor.cs" />
|
||||
<Compile Include="packets\BasePacket.cs" />
|
||||
<Compile Include="packets\receive\CharacterModifyPacket.cs" />
|
||||
<Compile Include="packets\receive\SecurityHandshakePacket.cs" />
|
||||
<Compile Include="packets\receive\SelectCharacterPacket.cs" />
|
||||
|
@ -99,7 +98,6 @@
|
|||
<Compile Include="packets\send\ErrorPacket.cs" />
|
||||
<Compile Include="packets\HardCoded_Packets.cs" />
|
||||
<Compile Include="packets\send\SelectCharacterConfirmPacket.cs" />
|
||||
<Compile Include="packets\SubPacket.cs" />
|
||||
<Compile Include="packets\send\CharacterListPacket.cs" />
|
||||
<Compile Include="packets\send\ImportListPacket.cs" />
|
||||
<Compile Include="packets\send\AccountListPacket.cs" />
|
||||
|
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using NLog;
|
||||
|
||||
|
|
|
@ -1,361 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using FFXIVClassic.Common;
|
||||
using NLog;
|
||||
using NLog.Targets;
|
||||
|
||||
namespace FFXIVClassic_Lobby_Server.packets
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct BasePacketHeader
|
||||
{
|
||||
public byte isAuthenticated;
|
||||
public byte isEncrypted;
|
||||
public ushort connectionType;
|
||||
public ushort packetSize;
|
||||
public ushort numSubpackets;
|
||||
public ulong timestamp; //Miliseconds
|
||||
}
|
||||
|
||||
public class BasePacket
|
||||
{
|
||||
public const int TYPE_ZONE = 1;
|
||||
public const int TYPE_CHAT = 2;
|
||||
public const int BASEPACKET_SIZE = 0x10;
|
||||
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
||||
public byte[] data;
|
||||
|
||||
public BasePacketHeader header;
|
||||
|
||||
//Loads a sniffed packet from a file
|
||||
public unsafe BasePacket(string path)
|
||||
{
|
||||
var bytes = File.ReadAllBytes(path);
|
||||
|
||||
if (bytes.Length < BASEPACKET_SIZE)
|
||||
throw new OverflowException("Packet Error: Packet was too small");
|
||||
|
||||
fixed (byte* pdata = &bytes[0])
|
||||
{
|
||||
header = (BasePacketHeader) Marshal.PtrToStructure(new IntPtr(pdata), typeof(BasePacketHeader));
|
||||
}
|
||||
|
||||
if (bytes.Length < header.packetSize)
|
||||
throw new OverflowException("Packet Error: Packet size didn't equal given size");
|
||||
|
||||
int packetSize = header.packetSize;
|
||||
|
||||
if (packetSize - BASEPACKET_SIZE != 0)
|
||||
{
|
||||
data = new byte[packetSize - BASEPACKET_SIZE];
|
||||
Array.Copy(bytes, BASEPACKET_SIZE, data, 0, packetSize - BASEPACKET_SIZE);
|
||||
}
|
||||
else
|
||||
data = new byte[0];
|
||||
}
|
||||
|
||||
//Loads a sniffed packet from a byte array
|
||||
public unsafe BasePacket(byte[] bytes)
|
||||
{
|
||||
if (bytes.Length < BASEPACKET_SIZE)
|
||||
throw new OverflowException("Packet Error: Packet was too small");
|
||||
|
||||
fixed (byte* pdata = &bytes[0])
|
||||
{
|
||||
header = (BasePacketHeader) Marshal.PtrToStructure(new IntPtr(pdata), typeof(BasePacketHeader));
|
||||
}
|
||||
|
||||
if (bytes.Length < header.packetSize)
|
||||
throw new OverflowException("Packet Error: Packet size didn't equal given size");
|
||||
|
||||
int packetSize = header.packetSize;
|
||||
|
||||
data = new byte[packetSize - BASEPACKET_SIZE];
|
||||
Array.Copy(bytes, BASEPACKET_SIZE, data, 0, packetSize - BASEPACKET_SIZE);
|
||||
}
|
||||
|
||||
public unsafe BasePacket(byte[] bytes, ref int offset)
|
||||
{
|
||||
if (bytes.Length < offset + BASEPACKET_SIZE)
|
||||
throw new OverflowException("Packet Error: Packet was too small");
|
||||
|
||||
fixed (byte* pdata = &bytes[offset])
|
||||
{
|
||||
header = (BasePacketHeader) Marshal.PtrToStructure(new IntPtr(pdata), typeof(BasePacketHeader));
|
||||
}
|
||||
|
||||
int packetSize = header.packetSize;
|
||||
|
||||
if (bytes.Length < offset + header.packetSize)
|
||||
throw new OverflowException("Packet Error: Packet size didn't equal given size");
|
||||
|
||||
data = new byte[packetSize - BASEPACKET_SIZE];
|
||||
Array.Copy(bytes, offset + BASEPACKET_SIZE, data, 0, packetSize - BASEPACKET_SIZE);
|
||||
|
||||
offset += packetSize;
|
||||
}
|
||||
|
||||
public BasePacket(BasePacketHeader header, byte[] data)
|
||||
{
|
||||
this.header = header;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public List<SubPacket> GetSubpackets()
|
||||
{
|
||||
var subpackets = new List<SubPacket>(header.numSubpackets);
|
||||
|
||||
var offset = 0;
|
||||
|
||||
while (offset < data.Length)
|
||||
subpackets.Add(new SubPacket(data, ref offset));
|
||||
|
||||
return subpackets;
|
||||
}
|
||||
|
||||
public static unsafe BasePacketHeader GetHeader(byte[] bytes)
|
||||
{
|
||||
BasePacketHeader header;
|
||||
if (bytes.Length < BASEPACKET_SIZE)
|
||||
throw new OverflowException("Packet Error: Packet was too small");
|
||||
|
||||
fixed (byte* pdata = &bytes[0])
|
||||
{
|
||||
header = (BasePacketHeader) Marshal.PtrToStructure(new IntPtr(pdata), typeof(BasePacketHeader));
|
||||
}
|
||||
|
||||
return header;
|
||||
}
|
||||
|
||||
public byte[] GetHeaderBytes()
|
||||
{
|
||||
var size = Marshal.SizeOf(header);
|
||||
var arr = new byte[size];
|
||||
|
||||
var ptr = Marshal.AllocHGlobal(size);
|
||||
Marshal.StructureToPtr(header, ptr, true);
|
||||
Marshal.Copy(ptr, arr, 0, size);
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
return arr;
|
||||
}
|
||||
|
||||
public byte[] GetPacketBytes()
|
||||
{
|
||||
var outBytes = new byte[header.packetSize];
|
||||
Array.Copy(GetHeaderBytes(), 0, outBytes, 0, BASEPACKET_SIZE);
|
||||
Array.Copy(data, 0, outBytes, BASEPACKET_SIZE, data.Length);
|
||||
return outBytes;
|
||||
}
|
||||
|
||||
//Replaces all instances of the sniffed actorID with the given one
|
||||
public void ReplaceActorID(uint actorID)
|
||||
{
|
||||
using (var mem = new MemoryStream(data))
|
||||
{
|
||||
using (var binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
using (var binreader = new BinaryReader(mem))
|
||||
{
|
||||
while (binreader.BaseStream.Position + 4 < data.Length)
|
||||
{
|
||||
var read = binreader.ReadUInt32();
|
||||
if (read == 0x029B2941 || read == 0x02977DC7 || read == 0x0297D2C8 || read == 0x0230d573 ||
|
||||
read == 0x23317df || read == 0x23344a3 || read == 0x1730bdb) //Original ID
|
||||
{
|
||||
binWriter.BaseStream.Seek(binreader.BaseStream.Position - 0x4, SeekOrigin.Begin);
|
||||
binWriter.Write(actorID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Replaces all instances of the sniffed actorID with the given one
|
||||
public void ReplaceActorID(uint fromActorID, uint actorID)
|
||||
{
|
||||
using (var mem = new MemoryStream(data))
|
||||
{
|
||||
using (var binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
using (var binreader = new BinaryReader(mem))
|
||||
{
|
||||
while (binreader.BaseStream.Position + 4 < data.Length)
|
||||
{
|
||||
var read = binreader.ReadUInt32();
|
||||
if (read == fromActorID) //Original ID
|
||||
{
|
||||
binWriter.BaseStream.Seek(binreader.BaseStream.Position - 0x4, SeekOrigin.Begin);
|
||||
binWriter.Write(actorID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void DebugPrintPacket()
|
||||
{
|
||||
#if DEBUG
|
||||
logger.ColorDebug(
|
||||
string.Format("IsAuth:{0} Size:0x{1:X}, NumSubpackets:{2}{3}{4}",
|
||||
header.isAuthenticated, header.packetSize, header.numSubpackets,
|
||||
Environment.NewLine, Utils.ByteArrayToHex(GetHeaderBytes())), ConsoleOutputColor.DarkYellow);
|
||||
|
||||
foreach (var sub in GetSubpackets())
|
||||
{
|
||||
sub.DebugPrintSubPacket();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#region Utility Functions
|
||||
|
||||
public static BasePacket CreatePacket(List<SubPacket> subpackets, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
//Create Header
|
||||
var header = new BasePacketHeader();
|
||||
byte[] data = null;
|
||||
|
||||
header.isAuthenticated = isAuthed ? (byte) 1 : (byte) 0;
|
||||
header.isEncrypted = isEncrypted ? (byte) 1 : (byte) 0;
|
||||
header.numSubpackets = (ushort) subpackets.Count;
|
||||
header.packetSize = BASEPACKET_SIZE;
|
||||
header.timestamp = Utils.MilisUnixTimeStampUTC();
|
||||
|
||||
//Get packet size
|
||||
foreach (var subpacket in subpackets)
|
||||
header.packetSize += subpacket.header.subpacketSize;
|
||||
|
||||
data = new byte[header.packetSize - 0x10];
|
||||
|
||||
//Add Subpackets
|
||||
var offset = 0;
|
||||
foreach (var subpacket in subpackets)
|
||||
{
|
||||
var subpacketData = subpacket.GetBytes();
|
||||
Array.Copy(subpacketData, 0, data, offset, subpacketData.Length);
|
||||
offset += (ushort) subpacketData.Length;
|
||||
}
|
||||
|
||||
Debug.Assert(data != null && offset == data.Length && header.packetSize == 0x10 + offset);
|
||||
|
||||
var packet = new BasePacket(header, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static BasePacket CreatePacket(SubPacket subpacket, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
//Create Header
|
||||
var header = new BasePacketHeader();
|
||||
byte[] data = null;
|
||||
|
||||
header.isAuthenticated = isAuthed ? (byte) 1 : (byte) 0;
|
||||
header.isEncrypted = isEncrypted ? (byte) 1 : (byte) 0;
|
||||
header.numSubpackets = 1;
|
||||
header.packetSize = BASEPACKET_SIZE;
|
||||
header.timestamp = Utils.MilisUnixTimeStampUTC();
|
||||
|
||||
//Get packet size
|
||||
header.packetSize += subpacket.header.subpacketSize;
|
||||
|
||||
data = new byte[header.packetSize - 0x10];
|
||||
|
||||
//Add Subpackets
|
||||
var subpacketData = subpacket.GetBytes();
|
||||
Array.Copy(subpacketData, 0, data, 0, subpacketData.Length);
|
||||
|
||||
Debug.Assert(data != null);
|
||||
|
||||
var packet = new BasePacket(header, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static BasePacket CreatePacket(byte[] data, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
Debug.Assert(data != null);
|
||||
|
||||
//Create Header
|
||||
var header = new BasePacketHeader();
|
||||
|
||||
header.isAuthenticated = isAuthed ? (byte) 1 : (byte) 0;
|
||||
header.isEncrypted = isEncrypted ? (byte) 1 : (byte) 0;
|
||||
header.numSubpackets = 1;
|
||||
header.packetSize = BASEPACKET_SIZE;
|
||||
header.timestamp = Utils.MilisUnixTimeStampUTC();
|
||||
|
||||
//Get packet size
|
||||
header.packetSize += (ushort) data.Length;
|
||||
|
||||
var packet = new BasePacket(header, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
public static unsafe void EncryptPacket(Blowfish blowfish, BasePacket packet)
|
||||
{
|
||||
var data = packet.data;
|
||||
int size = packet.header.packetSize;
|
||||
|
||||
var offset = 0;
|
||||
while (offset < data.Length)
|
||||
{
|
||||
if (data.Length < offset + SubPacket.SUBPACKET_SIZE)
|
||||
throw new OverflowException("Packet Error: Subpacket was too small");
|
||||
|
||||
SubPacketHeader header;
|
||||
fixed (byte* pdata = &data[offset])
|
||||
{
|
||||
header = (SubPacketHeader) Marshal.PtrToStructure(new IntPtr(pdata), typeof(SubPacketHeader));
|
||||
}
|
||||
|
||||
if (data.Length < offset + header.subpacketSize)
|
||||
throw new OverflowException("Packet Error: Subpacket size didn't equal subpacket data");
|
||||
|
||||
blowfish.Encipher(data, offset + 0x10, header.subpacketSize - 0x10);
|
||||
|
||||
offset += header.subpacketSize;
|
||||
}
|
||||
}
|
||||
|
||||
public static unsafe void DecryptPacket(Blowfish blowfish, ref BasePacket packet)
|
||||
{
|
||||
var data = packet.data;
|
||||
int size = packet.header.packetSize;
|
||||
|
||||
var offset = 0;
|
||||
while (offset < data.Length)
|
||||
{
|
||||
if (data.Length < offset + SubPacket.SUBPACKET_SIZE)
|
||||
throw new OverflowException("Packet Error: Subpacket was too small");
|
||||
|
||||
SubPacketHeader header;
|
||||
fixed (byte* pdata = &data[offset])
|
||||
{
|
||||
header = (SubPacketHeader) Marshal.PtrToStructure(new IntPtr(pdata), typeof(SubPacketHeader));
|
||||
}
|
||||
|
||||
if (data.Length < offset + header.subpacketSize)
|
||||
throw new OverflowException("Packet Error: Subpacket size didn't equal subpacket data");
|
||||
|
||||
blowfish.Decipher(data, offset + 0x10, header.subpacketSize - 0x10);
|
||||
|
||||
offset += header.subpacketSize;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public static class LoggerExtensions
|
||||
{
|
||||
public static void ColorDebug(this Logger logger, string message, ConsoleOutputColor color)
|
||||
{
|
||||
var logEvent = new LogEventInfo(LogLevel.Debug, logger.Name, message);
|
||||
logEvent.Properties["color"] = (int) color;
|
||||
logger.Log(logEvent);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,163 +0,0 @@
|
|||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using FFXIVClassic.Common;
|
||||
using NLog;
|
||||
using NLog.Targets;
|
||||
|
||||
namespace FFXIVClassic_Lobby_Server.packets
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SubPacketHeader
|
||||
{
|
||||
public ushort subpacketSize;
|
||||
public ushort type;
|
||||
public uint sourceId;
|
||||
public uint targetId;
|
||||
public uint unknown1;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GameMessageHeader
|
||||
{
|
||||
public ushort unknown4; //Always 0x14
|
||||
public ushort opcode;
|
||||
public uint unknown5;
|
||||
public uint timestamp;
|
||||
public uint unknown6;
|
||||
}
|
||||
|
||||
public class SubPacket
|
||||
{
|
||||
public const int SUBPACKET_SIZE = 0x10;
|
||||
public const int GAMEMESSAGE_SIZE = 0x10;
|
||||
private static readonly Logger logger = LogManager.GetCurrentClassLogger();
|
||||
public byte[] data;
|
||||
public GameMessageHeader gameMessage;
|
||||
|
||||
public SubPacketHeader header;
|
||||
|
||||
public unsafe SubPacket(byte[] bytes, ref int offset)
|
||||
{
|
||||
if (bytes.Length < offset + SUBPACKET_SIZE)
|
||||
throw new OverflowException("Packet Error: Subpacket was too small");
|
||||
|
||||
fixed (byte* pdata = &bytes[offset])
|
||||
{
|
||||
header = (SubPacketHeader) Marshal.PtrToStructure(new IntPtr(pdata), typeof(SubPacketHeader));
|
||||
}
|
||||
|
||||
if (header.type == 0x3)
|
||||
{
|
||||
fixed (byte* pdata = &bytes[offset + SUBPACKET_SIZE])
|
||||
{
|
||||
gameMessage =
|
||||
(GameMessageHeader) Marshal.PtrToStructure(new IntPtr(pdata), typeof(GameMessageHeader));
|
||||
}
|
||||
}
|
||||
|
||||
if (bytes.Length < offset + header.subpacketSize)
|
||||
throw new OverflowException("Packet Error: Subpacket size didn't equal subpacket data");
|
||||
|
||||
if (header.type == 0x3)
|
||||
{
|
||||
data = new byte[header.subpacketSize - SUBPACKET_SIZE - GAMEMESSAGE_SIZE];
|
||||
Array.Copy(bytes, offset + SUBPACKET_SIZE + GAMEMESSAGE_SIZE, data, 0, data.Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
data = new byte[header.subpacketSize - SUBPACKET_SIZE];
|
||||
Array.Copy(bytes, offset + SUBPACKET_SIZE, data, 0, data.Length);
|
||||
}
|
||||
|
||||
offset += header.subpacketSize;
|
||||
}
|
||||
|
||||
public SubPacket(ushort opcode, uint sourceId, uint targetId, byte[] data)
|
||||
{
|
||||
header = new SubPacketHeader();
|
||||
gameMessage = new GameMessageHeader();
|
||||
|
||||
gameMessage.opcode = opcode;
|
||||
header.sourceId = sourceId;
|
||||
header.targetId = targetId;
|
||||
|
||||
gameMessage.timestamp = Utils.UnixTimeStampUTC();
|
||||
|
||||
header.type = 0x03;
|
||||
header.unknown1 = 0x00;
|
||||
gameMessage.unknown4 = 0x14;
|
||||
gameMessage.unknown5 = 0x00;
|
||||
gameMessage.unknown6 = 0x00;
|
||||
|
||||
this.data = data;
|
||||
|
||||
header.subpacketSize = (ushort) (SUBPACKET_SIZE + GAMEMESSAGE_SIZE + data.Length);
|
||||
}
|
||||
|
||||
public SubPacket(SubPacket original, uint newTargetId)
|
||||
{
|
||||
header = new SubPacketHeader();
|
||||
gameMessage = original.gameMessage;
|
||||
header.subpacketSize = original.header.subpacketSize;
|
||||
header.type = original.header.type;
|
||||
header.sourceId = original.header.sourceId;
|
||||
header.targetId = newTargetId;
|
||||
data = original.data;
|
||||
}
|
||||
|
||||
public byte[] GetHeaderBytes()
|
||||
{
|
||||
var size = Marshal.SizeOf(header);
|
||||
var arr = new byte[size];
|
||||
|
||||
var ptr = Marshal.AllocHGlobal(size);
|
||||
Marshal.StructureToPtr(header, ptr, true);
|
||||
Marshal.Copy(ptr, arr, 0, size);
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
return arr;
|
||||
}
|
||||
|
||||
public byte[] GetGameMessageBytes()
|
||||
{
|
||||
var size = Marshal.SizeOf(gameMessage);
|
||||
var arr = new byte[size];
|
||||
|
||||
var ptr = Marshal.AllocHGlobal(size);
|
||||
Marshal.StructureToPtr(gameMessage, ptr, true);
|
||||
Marshal.Copy(ptr, arr, 0, size);
|
||||
Marshal.FreeHGlobal(ptr);
|
||||
return arr;
|
||||
}
|
||||
|
||||
public byte[] GetBytes()
|
||||
{
|
||||
var outBytes = new byte[header.subpacketSize];
|
||||
Array.Copy(GetHeaderBytes(), 0, outBytes, 0, SUBPACKET_SIZE);
|
||||
|
||||
if (header.type == 0x3)
|
||||
Array.Copy(GetGameMessageBytes(), 0, outBytes, SUBPACKET_SIZE, GAMEMESSAGE_SIZE);
|
||||
|
||||
Array.Copy(data, 0, outBytes, SUBPACKET_SIZE + (header.type == 0x3 ? GAMEMESSAGE_SIZE : 0), data.Length);
|
||||
return outBytes;
|
||||
}
|
||||
|
||||
public void DebugPrintSubPacket()
|
||||
{
|
||||
#if DEBUG
|
||||
logger.ColorDebug(
|
||||
string.Format("Size:0x{0:X} Opcode:0x{1:X}{2}{3}", header.subpacketSize, gameMessage.opcode,
|
||||
Environment.NewLine,
|
||||
Utils.ByteArrayToHex(GetHeaderBytes())), ConsoleOutputColor.DarkRed);
|
||||
|
||||
if (header.type == 0x03)
|
||||
{
|
||||
logger.ColorDebug(Utils.ByteArrayToHex(GetGameMessageBytes(), SUBPACKET_SIZE),
|
||||
ConsoleOutputColor.DarkRed);
|
||||
|
||||
logger.ColorDebug(Utils.ByteArrayToHex(data, SUBPACKET_SIZE + GAMEMESSAGE_SIZE),
|
||||
ConsoleOutputColor.DarkMagenta);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Net.Sockets;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Net;
|
||||
|
|
|
@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
|||
using System.Threading;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using System.IO;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server;
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.utils;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic_Map_Server.packets.send.player;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
|
|
|
@ -121,7 +121,6 @@
|
|||
<Compile Include="lua\LuaPlayer.cs" />
|
||||
<Compile Include="lua\LuaScript.cs" />
|
||||
<Compile Include="PacketProcessor.cs" />
|
||||
<Compile Include="packets\BasePacket.cs" />
|
||||
<Compile Include="packets\receive\ChatMessagePacket.cs" />
|
||||
<Compile Include="packets\receive\events\EventUpdatePacket.cs" />
|
||||
<Compile Include="packets\receive\events\EventStartPacket.cs" />
|
||||
|
@ -255,7 +254,6 @@
|
|||
<Compile Include="packets\send\_0x02Packet.cs" />
|
||||
<Compile Include="packets\send\_0x10Packet.cs" />
|
||||
<Compile Include="packets\send\_0xE2Packet.cs" />
|
||||
<Compile Include="packets\SubPacket.cs" />
|
||||
<Compile Include="packets\receive\PingPacket.cs" />
|
||||
<Compile Include="packets\receive\UpdatePlayerPositionPacket.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.Net;
|
|||
using System.Net.Sockets;
|
||||
using System.Threading;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using NLog;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using FFXIVClassic_Map_Server;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic_Map_Server.actors.area;
|
||||
using FFXIVClassic_Map_Server.actors.chara.npc;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using FFXIVClassic_Map_Server;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic_Map_Server.actors.chara.npc;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors.Chara;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ using FFXIVClassic_Map_Server.actors;
|
|||
using FFXIVClassic_Map_Server.Actors.Chara;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic_Map_Server.packets.receive.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server.utils;
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.inventory;
|
||||
using FFXIVClassic_Map_Server.packets.send.Actor.inventory;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.chara.player
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.inventory;
|
||||
using FFXIVClassic_Map_Server.packets.send.Actor.inventory;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic_Map_Server.actors.chara.player;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
|
@ -7,8 +7,6 @@ using FFXIVClassic_Map_Server.dataobjects.chara;
|
|||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.Actor.inventory;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.list;
|
||||
using FFXIVClassic_Map_Server.packets.send.player;
|
||||
|
@ -17,7 +15,8 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using MoonSharp.Interpreter;
|
||||
using FFXIVClassic_Map_Server.packets.receive.events;
|
||||
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.inventory;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.Actors
|
||||
{
|
||||
class Player : Character
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System.Collections.Generic;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using FFXIVClassic_Map_Server;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.packets;
|
||||
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
|
@ -70,7 +70,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||
}
|
||||
|
||||
public void QueuePacket(SubPacket subPacket, bool isAuthed, bool isEncrypted)
|
||||
{
|
||||
{
|
||||
zoneConnection.QueuePacket(subPacket, isAuthed, isEncrypted);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,207 +1,208 @@
|
|||
using FFXIVClassic_Map_Server.packets;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.packets.receive.events;
|
||||
using FFXIVClassic_Map_Server.packets.send;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using MoonSharp.Interpreter;
|
||||
using MoonSharp.Interpreter.Interop;
|
||||
using MoonSharp.Interpreter.Loaders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.lua
|
||||
{
|
||||
class LuaEngine
|
||||
{
|
||||
const string FILEPATH_PLAYER = "./scripts/player.lua";
|
||||
const string FILEPATH_ZONE = "./scripts/zones/{0}/zone.lua";
|
||||
const string FILEPATH_COMMANDS = "./scripts/commands/{0}.lua";
|
||||
const string FILEPATH_DIRECTORS = "./scripts/directors/{0}.lua";
|
||||
const string FILEPATH_NPCS = "./scripts/zones/{0}/npcs/{1}.lua";
|
||||
|
||||
public LuaEngine()
|
||||
{
|
||||
UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic;
|
||||
}
|
||||
|
||||
public static List<LuaParam> DoActorInstantiate(Player player, Actor target)
|
||||
{
|
||||
string luaPath;
|
||||
|
||||
if (target is Npc)
|
||||
{
|
||||
luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName());
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return null;
|
||||
|
||||
DynValue result = script.Call(script.Globals["init"], target);
|
||||
List<LuaParam> lparams = LuaUtils.CreateLuaParamList(result);
|
||||
return lparams;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.packets.receive.events;
|
||||
using FFXIVClassic_Map_Server.packets.send;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using MoonSharp.Interpreter;
|
||||
using MoonSharp.Interpreter.Interop;
|
||||
using MoonSharp.Interpreter.Loaders;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.lua
|
||||
{
|
||||
class LuaEngine
|
||||
{
|
||||
const string FILEPATH_PLAYER = "./scripts/player.lua";
|
||||
const string FILEPATH_ZONE = "./scripts/zones/{0}/zone.lua";
|
||||
const string FILEPATH_COMMANDS = "./scripts/commands/{0}.lua";
|
||||
const string FILEPATH_DIRECTORS = "./scripts/directors/{0}.lua";
|
||||
const string FILEPATH_NPCS = "./scripts/zones/{0}/npcs/{1}.lua";
|
||||
|
||||
public LuaEngine()
|
||||
{
|
||||
UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic;
|
||||
}
|
||||
|
||||
public static Coroutine DoActorOnEventStarted(Player player, Actor target, EventStartPacket eventStart)
|
||||
{
|
||||
string luaPath;
|
||||
|
||||
if (target is Command)
|
||||
{
|
||||
luaPath = String.Format(FILEPATH_COMMANDS, target.GetName());
|
||||
}
|
||||
else if (target is Director)
|
||||
{
|
||||
luaPath = String.Format(FILEPATH_DIRECTORS, target.GetName());
|
||||
}
|
||||
else
|
||||
luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return null;
|
||||
|
||||
if (!script.Globals.Get("onEventStarted").IsNil())
|
||||
return script.CreateCoroutine(script.Globals["onEventStarted"]).Coroutine;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
return null;
|
||||
public static List<LuaParam> DoActorInstantiate(Player player, Actor target)
|
||||
{
|
||||
string luaPath;
|
||||
|
||||
if (target is Npc)
|
||||
{
|
||||
luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName());
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return null;
|
||||
|
||||
DynValue result = script.Call(script.Globals["init"], target);
|
||||
List<LuaParam> lparams = LuaUtils.CreateLuaParamList(result);
|
||||
return lparams;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DoActorOnSpawn(Player player, Npc target)
|
||||
{
|
||||
string luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onSpawn").IsNil())
|
||||
script.Call(script.Globals["onSpawn"], player, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DoActorOnEventUpdated(Player player, Actor target, EventUpdatePacket eventUpdate)
|
||||
{
|
||||
if (target is Npc)
|
||||
{
|
||||
((Npc)target).DoEventUpdate(player, eventUpdate);
|
||||
return;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Coroutine DoActorOnEventStarted(Player player, Actor target, EventStartPacket eventStart)
|
||||
{
|
||||
string luaPath;
|
||||
|
||||
if (target is Command)
|
||||
luaPath = String.Format(FILEPATH_COMMANDS, target.GetName());
|
||||
else if (target is Director)
|
||||
luaPath = String.Format(FILEPATH_DIRECTORS, target.GetName());
|
||||
else
|
||||
luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Have to Do this to combine LuaParams
|
||||
List<Object> objects = new List<Object>();
|
||||
objects.Add(player);
|
||||
objects.Add(target);
|
||||
objects.Add(eventUpdate.val2);
|
||||
objects.AddRange(LuaUtils.CreateLuaParamObjectList(eventUpdate.luaParams));
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onEventUpdate").IsNil())
|
||||
script.Call(script.Globals["onEventUpdate"], objects.ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
{
|
||||
luaPath = String.Format(FILEPATH_COMMANDS, target.GetName());
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnZoneIn(Player player)
|
||||
{
|
||||
else if (target is Director)
|
||||
{
|
||||
luaPath = String.Format(FILEPATH_DIRECTORS, target.GetName());
|
||||
}
|
||||
else
|
||||
luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return null;
|
||||
|
||||
if (!script.Globals.Get("onEventStarted").IsNil())
|
||||
return script.CreateCoroutine(script.Globals["onEventStarted"]).Coroutine;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DoActorOnSpawn(Player player, Npc target)
|
||||
{
|
||||
string luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onSpawn").IsNil())
|
||||
script.Call(script.Globals["onSpawn"], player, target);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DoActorOnEventUpdated(Player player, Actor target, EventUpdatePacket eventUpdate)
|
||||
{
|
||||
if (target is Npc)
|
||||
{
|
||||
((Npc)target).DoEventUpdate(player, eventUpdate);
|
||||
return;
|
||||
}
|
||||
|
||||
string luaPath;
|
||||
|
||||
if (target is Command)
|
||||
luaPath = String.Format(FILEPATH_COMMANDS, target.GetName());
|
||||
else if (target is Director)
|
||||
luaPath = String.Format(FILEPATH_DIRECTORS, target.GetName());
|
||||
else
|
||||
luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Have to Do this to combine LuaParams
|
||||
List<Object> objects = new List<Object>();
|
||||
objects.Add(player);
|
||||
objects.Add(target);
|
||||
objects.Add(eventUpdate.val2);
|
||||
objects.AddRange(LuaUtils.CreateLuaParamObjectList(eventUpdate.luaParams));
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onEventUpdate").IsNil())
|
||||
script.Call(script.Globals["onEventUpdate"], objects.ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName()));
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnZoneIn(Player player)
|
||||
{
|
||||
string luaPath = String.Format(FILEPATH_ZONE, player.GetZone().actorId);
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onZoneIn").IsNil())
|
||||
script.Call(script.Globals["onZoneIn"], player);
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onZoneIn").IsNil())
|
||||
script.Call(script.Globals["onZoneIn"], player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnBeginLogin(Player player)
|
||||
{
|
||||
if (File.Exists(FILEPATH_PLAYER))
|
||||
{
|
||||
LuaScript script = LoadScript(FILEPATH_PLAYER);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onBeginLogin").IsNil())
|
||||
script.Call(script.Globals["onBeginLogin"], player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnLogin(Player player)
|
||||
{
|
||||
if (File.Exists(FILEPATH_PLAYER))
|
||||
{
|
||||
LuaScript script = LoadScript(FILEPATH_PLAYER);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onLogin").IsNil())
|
||||
script.Call(script.Globals["onLogin"], player);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void OnBeginLogin(Player player)
|
||||
{
|
||||
if (File.Exists(FILEPATH_PLAYER))
|
||||
{
|
||||
LuaScript script = LoadScript(FILEPATH_PLAYER);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onBeginLogin").IsNil())
|
||||
script.Call(script.Globals["onBeginLogin"], player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void OnLogin(Player player)
|
||||
{
|
||||
if (File.Exists(FILEPATH_PLAYER))
|
||||
{
|
||||
LuaScript script = LoadScript(FILEPATH_PLAYER);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onLogin").IsNil())
|
||||
script.Call(script.Globals["onLogin"], player);
|
||||
}
|
||||
}
|
||||
|
||||
#region RunGMCommand
|
||||
public static void RunGMCommand(Player player, String cmd, string[] param, bool help = false)
|
||||
{
|
||||
|
@ -336,22 +337,22 @@ namespace FFXIVClassic_Map_Server.lua
|
|||
LuaScript.Log.Error("LuaEngine.RunGMCommand: Unable to find script {0}", path);
|
||||
return;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static LuaScript LoadScript(string filename)
|
||||
{
|
||||
LuaScript script = LoadGlobals();
|
||||
|
||||
try
|
||||
{
|
||||
script.DoFile(filename);
|
||||
}
|
||||
catch (SyntaxErrorException e)
|
||||
{
|
||||
Program.Log.Error("LUAERROR: {0}.", e.DecoratedMessage);
|
||||
return null;
|
||||
}
|
||||
return script;
|
||||
#endregion
|
||||
|
||||
public static LuaScript LoadScript(string filename)
|
||||
{
|
||||
LuaScript script = LoadGlobals();
|
||||
|
||||
try
|
||||
{
|
||||
script.DoFile(filename);
|
||||
}
|
||||
catch (SyntaxErrorException e)
|
||||
{
|
||||
Program.Log.Error("LUAERROR: {0}.", e.DecoratedMessage);
|
||||
return null;
|
||||
}
|
||||
return script;
|
||||
}
|
||||
|
||||
public static LuaScript LoadGlobals(LuaScript script = null)
|
||||
|
@ -367,57 +368,57 @@ namespace FFXIVClassic_Map_Server.lua
|
|||
|
||||
script.Options.DebugPrint = s => { Program.Log.Debug(s); };
|
||||
return script;
|
||||
}
|
||||
|
||||
public static void SendError(Player player, string message)
|
||||
{
|
||||
List<SubPacket> SendError = new List<SubPacket>();
|
||||
SendError.Add(EndEventPacket.BuildPacket(player.actorId, player.currentEventOwner, player.currentEventName));
|
||||
player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", message);
|
||||
player.playerSession.QueuePacket(BasePacket.CreatePacket(SendError, true, false));
|
||||
}
|
||||
|
||||
|
||||
internal static void DoDirectorOnTalked(Director director, Player player, Npc npc)
|
||||
{
|
||||
string luaPath = String.Format(FILEPATH_DIRECTORS, director.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onTalked").IsNil())
|
||||
script.Call(script.Globals["onTalked"], player, npc);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.GetName()));
|
||||
}
|
||||
}
|
||||
|
||||
internal static void DoDirectorOnCommand(Director director, Player player, Command command)
|
||||
{
|
||||
string luaPath = String.Format(FILEPATH_DIRECTORS, director.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onCommand").IsNil())
|
||||
script.Call(script.Globals["onCommand"], player, command);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.GetName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void SendError(Player player, string message)
|
||||
{
|
||||
List<SubPacket> SendError = new List<SubPacket>();
|
||||
SendError.Add(EndEventPacket.BuildPacket(player.actorId, player.currentEventOwner, player.currentEventName));
|
||||
player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", message);
|
||||
player.playerSession.QueuePacket(BasePacket.CreatePacket(SendError, true, false));
|
||||
}
|
||||
|
||||
|
||||
internal static void DoDirectorOnTalked(Director director, Player player, Npc npc)
|
||||
{
|
||||
string luaPath = String.Format(FILEPATH_DIRECTORS, director.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onTalked").IsNil())
|
||||
script.Call(script.Globals["onTalked"], player, npc);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.GetName()));
|
||||
}
|
||||
}
|
||||
|
||||
internal static void DoDirectorOnCommand(Director director, Player player, Command command)
|
||||
{
|
||||
string luaPath = String.Format(FILEPATH_DIRECTORS, director.GetName());
|
||||
|
||||
if (File.Exists(luaPath))
|
||||
{
|
||||
LuaScript script = LoadScript(luaPath);
|
||||
|
||||
if (script == null)
|
||||
return;
|
||||
|
||||
//Run Script
|
||||
if (!script.Globals.Get("onCommand").IsNil())
|
||||
script.Call(script.Globals["onCommand"], player, command);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.GetName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class ActorDoEmotePacket
|
||||
{
|
||||
|
|
|
@ -4,7 +4,9 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class ActorInstantiatePacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorQuestGraphicPacket
|
||||
{
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class AddActorPacket
|
||||
{
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
using System.IO;
|
||||
using FFXIVClassic.Common;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class BattleAction1Packet
|
||||
{
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class DeleteAllActorsPacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class MoveActorToPositionPacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class RemoveActorPacket
|
||||
{
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorAppearancePacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorIconPacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorIdleAnimationPacket
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorIsZoningPacket
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorNamePacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorPositionPacket
|
||||
{
|
||||
|
|
|
@ -5,7 +5,9 @@ using System.Linq;
|
|||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorPropetyPacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorSpeedPacket
|
||||
{
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorStatePacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorStatusAllPacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorStatusPacket
|
||||
{
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
using System;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorTargetAnimatedPacket
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class _0x132Packet
|
||||
{
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class _0xFPacket
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class BattleAction
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class BattleActionX00Packet
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class BattleActionX01Packet
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class BattleActionX10Packet
|
||||
{
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class BattleActionX18Packet
|
||||
{
|
||||
|
|
|
@ -1,9 +1,12 @@
|
|||
using FFXIVClassic_Map_Server.actors;
|
||||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetEmoteEventCondition
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetEventStatus
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetNoticeEventCondition
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetPushEventConditionWithCircle
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetPushEventConditionWithFan
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetPushEventConditionWithTriggerBox
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetTalkEventCondition
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class EquipmentListX01Packet
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class EquipmentListX08Packet
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class EquipmentListX16Packet
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class EquipmentListX32Packet
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class EquipmentListX64Packet
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryBeginChangePacket
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryEndChangePacket
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryItemEndPacket
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryItemPacket
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX01Packet
|
||||
{
|
||||
|
|
|
@ -3,7 +3,9 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX08Packet
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX16Packet
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX32Packet
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX64Packet
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX01Packet
|
||||
{
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX08Packet
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX16Packet
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX32Packet
|
||||
{
|
||||
|
|
|
@ -2,7 +2,9 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX64Packet
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventorySetBeginPacket
|
||||
{
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventorySetEndPacket
|
||||
{
|
||||
|
|
|
@ -4,6 +4,8 @@ using System.Collections.Generic;
|
|||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send
|
||||
{
|
||||
class GameMessagePacket
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
namespace FFXIVClassic_Map_Server.packets.send
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send
|
||||
{
|
||||
class LogoutPacket
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue