mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-20 17:45:57 +02:00
Cleaned up namespaces (still have to do Map Project) and removed references to FFXIV Classic from the code. Removed the Launcher Editor project as it is no longer needed (host file editing is cleaner).
This commit is contained in:
parent
7587a6e142
commit
0f61c4c0e1
544 changed files with 54548 additions and 55498 deletions
52
Map Server/packets/WorldPackets/Receive/ErrorPacket.cs
Normal file
52
Map Server/packets/WorldPackets/Receive/ErrorPacket.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive
|
||||
{
|
||||
class ErrorPacket
|
||||
{
|
||||
public uint errorCode;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public ErrorPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
errorCode = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive
|
||||
{
|
||||
class LinkshellResultPacket
|
||||
{
|
||||
public int resultCode;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public LinkshellResultPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
resultCode = binReader.ReadInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
60
Map Server/packets/WorldPackets/Receive/PartySyncPacket.cs
Normal file
60
Map Server/packets/WorldPackets/Receive/PartySyncPacket.cs
Normal file
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive
|
||||
{
|
||||
class PartySyncPacket
|
||||
{
|
||||
public ulong partyGroupId;
|
||||
public uint owner;
|
||||
public uint[] memberActorIds;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public PartySyncPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
partyGroupId = binReader.ReadUInt64();
|
||||
owner = binReader.ReadUInt32();
|
||||
uint numMembers = binReader.ReadUInt32();
|
||||
memberActorIds = new uint[numMembers];
|
||||
|
||||
for (int i = 0; i < numMembers; i++)
|
||||
memberActorIds[i] = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive
|
||||
{
|
||||
class SessionBeginPacket
|
||||
{
|
||||
public bool isLogin;
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public SessionBeginPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
isLogin = binReader.ReadByte() != 0;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
62
Map Server/packets/WorldPackets/Receive/SessionEndPacket.cs
Normal file
62
Map Server/packets/WorldPackets/Receive/SessionEndPacket.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Receive
|
||||
{
|
||||
class SessionEndPacket
|
||||
{
|
||||
public uint destinationZoneId;
|
||||
public ushort destinationSpawnType;
|
||||
public float destinationX;
|
||||
public float destinationY;
|
||||
public float destinationZ;
|
||||
public float destinationRot;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public SessionEndPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
destinationZoneId = binReader.ReadUInt32();
|
||||
destinationSpawnType = binReader.ReadUInt16();
|
||||
destinationX = binReader.ReadSingle();
|
||||
destinationY = binReader.ReadSingle();
|
||||
destinationZ = binReader.ReadSingle();
|
||||
destinationRot = binReader.ReadSingle();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class CreateLinkshellPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1025;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, string name, ushort crest, uint master)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||
binWriter.BaseStream.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt16)crest);
|
||||
binWriter.Write((UInt32)master);
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class DeleteLinkshellPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1027;
|
||||
public const uint PACKET_SIZE = 0x40;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, string name)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class GroupInviteResultPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1023;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, uint groupType, uint result)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)groupType);
|
||||
binWriter.Write((UInt32)result);
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class LinkshellChangePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1028;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, string lsName)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(lsName), 0, Encoding.ASCII.GetByteCount(lsName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(lsName));
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class LinkshellInviteCancelPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1030;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(Session session)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class LinkshellInvitePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1029;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, uint actorId, string linkshellName)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)actorId);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(linkshellName), 0, Encoding.ASCII.GetByteCount(linkshellName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(linkshellName));
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class LinkshellLeavePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1031;
|
||||
public const uint PACKET_SIZE = 0x68;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, string lsName, string kickedName, bool isKicked)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)(isKicked ? 1 : 0));
|
||||
if (kickedName != null && isKicked)
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(kickedName), 0, Encoding.ASCII.GetByteCount(kickedName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(kickedName));
|
||||
binWriter.Seek(0x22, SeekOrigin.Begin);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(lsName), 0, Encoding.ASCII.GetByteCount(lsName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(lsName));
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class LinkshellRankChangePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1032;
|
||||
public const uint PACKET_SIZE = 0x68;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, string name, string lsName, byte rank)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(lsName), 0, Encoding.ASCII.GetByteCount(lsName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(lsName));
|
||||
binWriter.Seek(0x40, SeekOrigin.Begin);
|
||||
binWriter.Write((Byte)rank);
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class ModifyLinkshellPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1026;
|
||||
public const uint PACKET_SIZE = 0x60;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, ushort changeArg, string name, string newName, ushort crest, uint master)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||
binWriter.Write((UInt16)changeArg);
|
||||
switch (changeArg)
|
||||
{
|
||||
case 0:
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(newName), 0, Encoding.ASCII.GetByteCount(newName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(newName));
|
||||
break;
|
||||
case 1:
|
||||
binWriter.Write((UInt16)crest);
|
||||
break;
|
||||
case 2:
|
||||
binWriter.Write((UInt32)master);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class PartyInvitePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1022;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, string name)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)0);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(Session session, uint actorId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)1);
|
||||
binWriter.Write((UInt32)actorId);
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class PartyLeavePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1021;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, bool isDisband)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)(isDisband ? 1 : 0));
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
||||
{
|
||||
class PartyModifyPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1020;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, ushort command, string name)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)command);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(Session session, ushort command, uint actorId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)(command + 2));
|
||||
binWriter.Write((UInt32)actorId);
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send
|
||||
{
|
||||
class SessionBeginConfirmPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1000;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, ushort errorCode = 0)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)session.id);
|
||||
binWriter.Write((UInt16)errorCode);
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send
|
||||
{
|
||||
class SessionEndConfirmPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1001;
|
||||
public const uint PACKET_SIZE = 0x30;
|
||||
|
||||
public static SubPacket BuildPacket(Session session, uint destinationZone, ushort errorCode = 0)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)session.id);
|
||||
binWriter.Write((UInt16)errorCode);
|
||||
binWriter.Write((UInt32)destinationZone);
|
||||
}
|
||||
}
|
||||
return new SubPacket(true, OPCODE, session.id, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send
|
||||
{
|
||||
class WorldRequestZoneChangePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x1002;
|
||||
public const uint PACKET_SIZE = 0x048;
|
||||
|
||||
public static SubPacket BuildPacket(uint sessionId, uint destinationZoneId, byte spawnType, float spawnX, float spawnY, float spawnZ, float spawnRotation)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)sessionId);
|
||||
binWriter.Write((UInt32)destinationZoneId);
|
||||
binWriter.Write((UInt16)spawnType);
|
||||
binWriter.Write((Single)spawnX);
|
||||
binWriter.Write((Single)spawnY);
|
||||
binWriter.Write((Single)spawnZ);
|
||||
binWriter.Write((Single)spawnRotation);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sessionId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class AchievementProgressRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public uint achievementId;
|
||||
public uint responseType;
|
||||
|
||||
public AchievementProgressRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
achievementId = binReader.ReadUInt32();
|
||||
responseType = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
63
Map Server/packets/receive/ChatMessagePacket.cs
Normal file
63
Map Server/packets/receive/ChatMessagePacket.cs
Normal file
|
@ -0,0 +1,63 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class ChatMessagePacket
|
||||
{
|
||||
public float posX;
|
||||
public float posY;
|
||||
public float posZ;
|
||||
public float posRot;
|
||||
|
||||
public uint logType;
|
||||
|
||||
public string message;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public ChatMessagePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
binReader.ReadUInt64();
|
||||
posX = binReader.ReadSingle();
|
||||
posY = binReader.ReadSingle();
|
||||
posZ = binReader.ReadSingle();
|
||||
posRot = binReader.ReadSingle();
|
||||
logType = binReader.ReadUInt32();
|
||||
message = Encoding.ASCII.GetString(binReader.ReadBytes(0x200)).Trim(new [] { '\0' });
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
51
Map Server/packets/receive/CountdownRequestPacket.cs
Normal file
51
Map Server/packets/receive/CountdownRequestPacket.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class CountdownRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public byte countdownLength;
|
||||
public ulong syncTime;
|
||||
|
||||
public CountdownRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
countdownLength = binReader.ReadByte();
|
||||
binReader.BaseStream.Seek(8, SeekOrigin.Begin);
|
||||
syncTime = binReader.ReadUInt64();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
53
Map Server/packets/receive/GroupCreatedPacket.cs
Normal file
53
Map Server/packets/receive/GroupCreatedPacket.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class GroupCreatedPacket
|
||||
{
|
||||
public ulong groupId;
|
||||
public string workString;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public GroupCreatedPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
groupId = binReader.ReadUInt64();
|
||||
workString = Encoding.ASCII.GetString(binReader.ReadBytes(0x20)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
51
Map Server/packets/receive/HandshakePacket.cs
Normal file
51
Map Server/packets/receive/HandshakePacket.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class HandshakePacket
|
||||
{
|
||||
bool invalidPacket = false;
|
||||
|
||||
public uint actorID;
|
||||
|
||||
public HandshakePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
binReader.BaseStream.Seek(4, SeekOrigin.Begin);
|
||||
actorID = UInt32.Parse(Encoding.ASCII.GetString(binReader.ReadBytes(10)));
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
Map Server/packets/receive/LangaugeCodePacket.cs
Normal file
49
Map Server/packets/receive/LangaugeCodePacket.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class LangaugeCodePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint languageCode;
|
||||
|
||||
public LangaugeCodePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
binReader.ReadUInt32();
|
||||
languageCode = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
Map Server/packets/receive/LockTargetPacket.cs
Normal file
50
Map Server/packets/receive/LockTargetPacket.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class LockTargetPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint actorID;
|
||||
public uint otherVal; //Camera related?
|
||||
|
||||
public LockTargetPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
actorID = binReader.ReadUInt32();
|
||||
otherVal = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
62
Map Server/packets/receive/ParameterDataRequestPacket.cs
Normal file
62
Map Server/packets/receive/ParameterDataRequestPacket.cs
Normal file
|
@ -0,0 +1,62 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class ParameterDataRequestPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x012F;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public uint actorID;
|
||||
public string paramName;
|
||||
|
||||
public ParameterDataRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
actorID = binReader.ReadUInt32();
|
||||
List<byte> strList = new List<byte>();
|
||||
byte curByte;
|
||||
while ((curByte = binReader.ReadByte()) != 0 && strList.Count<=0x20)
|
||||
{
|
||||
strList.Add(curByte);
|
||||
}
|
||||
paramName = Encoding.ASCII.GetString(strList.ToArray());
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
Map Server/packets/receive/PingPacket.cs
Normal file
49
Map Server/packets/receive/PingPacket.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class PingPacket
|
||||
{
|
||||
bool invalidPacket = false;
|
||||
|
||||
public uint time;
|
||||
|
||||
public PingPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
time = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
Map Server/packets/receive/SetTargetPacket.cs
Normal file
50
Map Server/packets/receive/SetTargetPacket.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class SetTargetPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint actorID;
|
||||
public uint attackTarget; //Usually 0xE0000000
|
||||
|
||||
public SetTargetPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
actorID = binReader.ReadUInt32();
|
||||
attackTarget = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
Map Server/packets/receive/UpdateItemPackagePacket.cs
Normal file
50
Map Server/packets/receive/UpdateItemPackagePacket.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class UpdateItemPackagePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint actorID;
|
||||
public uint packageId;
|
||||
|
||||
public UpdateItemPackagePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
actorID = binReader.ReadUInt32();
|
||||
packageId = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
57
Map Server/packets/receive/UpdatePlayerPositionPacket.cs
Normal file
57
Map Server/packets/receive/UpdatePlayerPositionPacket.cs
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class UpdatePlayerPositionPacket
|
||||
{
|
||||
bool invalidPacket = false;
|
||||
|
||||
public ulong time;
|
||||
public float x, y, z, rot;
|
||||
public ushort moveState; //0: Standing, 1: Walking, 2: Running
|
||||
|
||||
public UpdatePlayerPositionPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
time = binReader.ReadUInt64();
|
||||
x = binReader.ReadSingle();
|
||||
y = binReader.ReadSingle();
|
||||
z = binReader.ReadSingle();
|
||||
rot = binReader.ReadSingle();
|
||||
moveState = binReader.ReadUInt16();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
50
Map Server/packets/receive/ZoneInCompletePacket.cs
Normal file
50
Map Server/packets/receive/ZoneInCompletePacket.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class ZoneInCompletePacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint timestamp;
|
||||
public int unknown;
|
||||
|
||||
public ZoneInCompletePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
timestamp = binReader.ReadUInt32();
|
||||
unknown = binReader.ReadInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
51
Map Server/packets/receive/_0x02ReceivePacket.cs
Normal file
51
Map Server/packets/receive/_0x02ReceivePacket.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive
|
||||
{
|
||||
class _0x02ReceivePacket
|
||||
{
|
||||
bool invalidPacket = false;
|
||||
uint unknown;
|
||||
|
||||
public _0x02ReceivePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
binReader.BaseStream.Seek(0x14, SeekOrigin.Begin);
|
||||
unknown = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
99
Map Server/packets/receive/events/EventStartPacket.cs
Normal file
99
Map Server/packets/receive/events/EventStartPacket.cs
Normal file
|
@ -0,0 +1,99 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.events
|
||||
{
|
||||
class EventStartPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x012D;
|
||||
public const uint PACKET_SIZE = 0xD8;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public uint actorID;
|
||||
public uint scriptOwnerActorID;
|
||||
public uint val1;
|
||||
public uint val2;
|
||||
public byte val3;
|
||||
|
||||
public uint errorIndex;
|
||||
public uint errorNum;
|
||||
public string error = null;
|
||||
|
||||
public string triggerName;
|
||||
|
||||
public List<LuaParam> luaParams;
|
||||
|
||||
public EventStartPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
actorID = binReader.ReadUInt32();
|
||||
scriptOwnerActorID = binReader.ReadUInt32();
|
||||
val1 = binReader.ReadUInt32();
|
||||
val2 = binReader.ReadUInt32();
|
||||
val3 = binReader.ReadByte();
|
||||
/*
|
||||
//Lua Error Dump
|
||||
if (val1 == 0x39800010)
|
||||
{
|
||||
errorIndex = actorID;
|
||||
errorNum = scriptOwnerActorID;
|
||||
error = ASCIIEncoding.ASCII.GetString(binReader.ReadBytes(0x80)).Replace("\0", "");
|
||||
|
||||
if (errorIndex == 0)
|
||||
Program.Log.Error("LUA ERROR:");
|
||||
|
||||
return;
|
||||
}
|
||||
*/
|
||||
List<byte> strList = new List<byte>();
|
||||
byte curByte;
|
||||
while ((curByte = binReader.ReadByte())!=0)
|
||||
{
|
||||
strList.Add(curByte);
|
||||
}
|
||||
triggerName = Encoding.ASCII.GetString(strList.ToArray());
|
||||
|
||||
binReader.BaseStream.Seek(0x31, SeekOrigin.Begin);
|
||||
|
||||
if (binReader.PeekChar() == 0x1)
|
||||
luaParams = new List<LuaParam>();
|
||||
else
|
||||
luaParams = LuaUtils.ReadLuaParams(binReader);
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
64
Map Server/packets/receive/events/EventUpdatePacket.cs
Normal file
64
Map Server/packets/receive/events/EventUpdatePacket.cs
Normal file
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.events
|
||||
{
|
||||
class EventUpdatePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x012E;
|
||||
public const uint PACKET_SIZE = 0x78;
|
||||
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public uint actorID;
|
||||
public uint scriptOwnerActorID;
|
||||
public uint val1;
|
||||
public uint val2;
|
||||
public byte step;
|
||||
public List<LuaParam> luaParams;
|
||||
|
||||
public EventUpdatePacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
actorID = binReader.ReadUInt32();
|
||||
scriptOwnerActorID = binReader.ReadUInt32();
|
||||
val1 = binReader.ReadUInt32();
|
||||
val2 = binReader.ReadUInt32();
|
||||
step = binReader.ReadByte();
|
||||
luaParams = LuaUtils.ReadLuaParams(binReader);
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.recruitment
|
||||
{
|
||||
class RecruitmentDetailsRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public ulong recruitmentId;
|
||||
|
||||
public RecruitmentDetailsRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
recruitmentId = binReader.ReadUInt64();
|
||||
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.recruitment
|
||||
{
|
||||
class RecruitmentSearchRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public uint purposeId;
|
||||
public uint locationId;
|
||||
|
||||
public uint discipleId;
|
||||
public uint classjobId;
|
||||
|
||||
public byte unknown1;
|
||||
public byte unknown2;
|
||||
|
||||
public string text;
|
||||
|
||||
public RecruitmentSearchRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
purposeId = binReader.ReadUInt32();
|
||||
locationId = binReader.ReadUInt32();
|
||||
discipleId = binReader.ReadUInt32();
|
||||
classjobId = binReader.ReadUInt32();
|
||||
|
||||
unknown1 = binReader.ReadByte();
|
||||
unknown2 = binReader.ReadByte();
|
||||
|
||||
text = Encoding.ASCII.GetString(binReader.ReadBytes(0x20));
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.recruitment
|
||||
{
|
||||
class StartRecruitingRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
|
||||
public uint purposeId;
|
||||
public uint locationId;
|
||||
public uint subTaskId;
|
||||
|
||||
public uint[] discipleId = new uint[4];
|
||||
public uint[] classjobId = new uint[4];
|
||||
public byte[] minLvl = new byte[4];
|
||||
public byte[] maxLvl = new byte[4];
|
||||
public byte[] num = new byte[4];
|
||||
|
||||
public string comment;
|
||||
|
||||
public StartRecruitingRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
purposeId = binReader.ReadUInt32();
|
||||
locationId = binReader.ReadUInt32();
|
||||
subTaskId = binReader.ReadUInt32();
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
discipleId[i] = binReader.ReadUInt32();
|
||||
classjobId[i] = binReader.ReadUInt32();
|
||||
minLvl[i] = binReader.ReadByte();
|
||||
maxLvl[i] = binReader.ReadByte();
|
||||
num[i] = binReader.ReadByte();
|
||||
binReader.ReadByte();
|
||||
}
|
||||
|
||||
comment = Encoding.ASCII.GetString(binReader.ReadBytes(0x168));
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
49
Map Server/packets/receive/social/AddRemoveSocialPacket.cs
Normal file
49
Map Server/packets/receive/social/AddRemoveSocialPacket.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.social
|
||||
{
|
||||
class AddRemoveSocialPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public string name;
|
||||
|
||||
public AddRemoveSocialPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
name = Encoding.ASCII.GetString(binReader.ReadBytes(0x20));
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
50
Map Server/packets/receive/social/FriendlistRequestPacket.cs
Normal file
50
Map Server/packets/receive/social/FriendlistRequestPacket.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.social
|
||||
{
|
||||
class FriendlistRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint num1;
|
||||
public uint num2;
|
||||
|
||||
public FriendlistRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
num1 = binReader.ReadUInt32();
|
||||
num2 = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.supportdesk
|
||||
{
|
||||
class FaqBodyRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint faqIndex;
|
||||
public uint langCode;
|
||||
|
||||
public FaqBodyRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
faqIndex = binReader.ReadUInt32();
|
||||
langCode = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.supportdesk
|
||||
{
|
||||
class FaqListRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint langCode;
|
||||
public uint unknown;
|
||||
|
||||
public FaqListRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
langCode = binReader.ReadUInt32();
|
||||
unknown = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.supportdesk
|
||||
{
|
||||
class GMSupportTicketPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public string ticketTitle, ticketBody;
|
||||
public uint ticketIssueIndex;
|
||||
public uint langCode;
|
||||
|
||||
public GMSupportTicketPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try
|
||||
{
|
||||
langCode = binReader.ReadUInt32();
|
||||
ticketIssueIndex = binReader.ReadUInt32();
|
||||
ticketTitle = Encoding.ASCII.GetString(binReader.ReadBytes(0x80)).Trim(new[] { '\0' });
|
||||
ticketBody = Encoding.ASCII.GetString(binReader.ReadBytes(0x800)).Trim(new[] { '\0' });
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.receive.supportdesk
|
||||
{
|
||||
class GMTicketIssuesRequestPacket
|
||||
{
|
||||
public bool invalidPacket = false;
|
||||
public uint langCode;
|
||||
|
||||
public GMTicketIssuesRequestPacket(byte[] data)
|
||||
{
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
{
|
||||
try{
|
||||
langCode = binReader.ReadUInt32();
|
||||
}
|
||||
catch (Exception){
|
||||
invalidPacket = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
61
Map Server/packets/send/Actor/ActorDoEmotePacket.cs
Normal file
61
Map Server/packets/send/Actor/ActorDoEmotePacket.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class ActorDoEmotePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00E1;
|
||||
public const uint PACKET_SIZE = 0x30;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint targettedActorId, uint animationId, uint descriptionId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
if (targettedActorId == 0)
|
||||
{
|
||||
targettedActorId = sourceActorId;
|
||||
if (descriptionId != 10105)
|
||||
descriptionId++;
|
||||
}
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
uint realAnimID = 0x5000000 | (animationId << 12);
|
||||
binWriter.Write((UInt32)realAnimID);
|
||||
binWriter.Write((UInt32)targettedActorId);
|
||||
binWriter.Write((UInt32)descriptionId);
|
||||
}
|
||||
}
|
||||
|
||||
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||
packet.DebugPrintSubPacket();
|
||||
return packet;
|
||||
}
|
||||
}
|
||||
}
|
61
Map Server/packets/send/Actor/ActorInstantiatePacket.cs
Normal file
61
Map Server/packets/send/Actor/ActorInstantiatePacket.cs
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class ActorInstantiatePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00CC;
|
||||
public const uint PACKET_SIZE = 0x128;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, string objectName, string className, List<LuaParam> initParams)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int value1 = 0x00; //Instance ID?
|
||||
int value2 = 0x3040;
|
||||
binWriter.Write((Int16)value1);
|
||||
binWriter.Write((Int16)value2);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(objectName), 0, Encoding.ASCII.GetByteCount(objectName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(objectName));
|
||||
binWriter.BaseStream.Seek(0x24, SeekOrigin.Begin);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(className), 0, Encoding.ASCII.GetByteCount(className) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(className));
|
||||
binWriter.BaseStream.Seek(0x44, SeekOrigin.Begin);
|
||||
LuaUtils.WriteLuaParams(binWriter, initParams);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
54
Map Server/packets/send/Actor/ActorSpecialGraphicPacket.cs
Normal file
54
Map Server/packets/send/Actor/ActorSpecialGraphicPacket.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorQuestGraphicPacket
|
||||
{
|
||||
public const int NONE = 0x0;
|
||||
public const int QUEST = 0x2;
|
||||
public const int NOGRAPHIC = 0x3;
|
||||
public const int QUEST_IMPORTANT = 0x4;
|
||||
|
||||
public const ushort OPCODE = 0x00E3;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, int iconCode)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Int32)iconCode);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
40
Map Server/packets/send/Actor/AddActorPacket.cs
Normal file
40
Map Server/packets/send/Actor/AddActorPacket.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class AddActorPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00CA;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, byte val)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE-0x20];
|
||||
data[0] = val; //Why?
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
36
Map Server/packets/send/Actor/DeleteAllActorsPacket.cs
Normal file
36
Map Server/packets/send/Actor/DeleteAllActorsPacket.cs
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class DeleteAllActorsPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0007;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId)
|
||||
{
|
||||
return new SubPacket(OPCODE, sourceActorId, new byte[8]);
|
||||
}
|
||||
}
|
||||
}
|
56
Map Server/packets/send/Actor/MoveActorToPositionPacket.cs
Normal file
56
Map Server/packets/send/Actor/MoveActorToPositionPacket.cs
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class MoveActorToPositionPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00CF;
|
||||
public const uint PACKET_SIZE = 0x50;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, float x, float y, float z, float rot, ushort moveState)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.BaseStream.Seek(0x8, SeekOrigin.Begin);
|
||||
binWriter.Write((Single)x);
|
||||
binWriter.Write((Single)y);
|
||||
binWriter.Write((Single)z);
|
||||
binWriter.Write((Single)rot);
|
||||
binWriter.Write((ushort)moveState);
|
||||
}
|
||||
}
|
||||
|
||||
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
37
Map Server/packets/send/Actor/PlayAnimationOnActorPacket.cs
Normal file
37
Map Server/packets/send/Actor/PlayAnimationOnActorPacket.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class PlayAnimationOnActorPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00DA;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint animationID)
|
||||
{
|
||||
return new SubPacket(OPCODE, sourceActorId, BitConverter.GetBytes((ulong)animationID));
|
||||
}
|
||||
}
|
||||
}
|
49
Map Server/packets/send/Actor/PlayBGAnimation.cs
Normal file
49
Map Server/packets/send/Actor/PlayBGAnimation.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class PlayBGAnimation
|
||||
{
|
||||
public const ushort OPCODE = 0x00D9;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, string animName)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(animName), 0, Encoding.ASCII.GetByteCount(animName) > 0x8 ? 0x8 : Encoding.ASCII.GetByteCount(animName));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
50
Map Server/packets/send/Actor/RemoveActorPacket.cs
Normal file
50
Map Server/packets/send/Actor/RemoveActorPacket.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class RemoveActorPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00CB;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
103
Map Server/packets/send/Actor/SetActorAppearancePacket.cs
Normal file
103
Map Server/packets/send/Actor/SetActorAppearancePacket.cs
Normal file
|
@ -0,0 +1,103 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorAppearancePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00D6;
|
||||
public const uint PACKET_SIZE = 0x128;
|
||||
|
||||
public const int SIZE = 0;
|
||||
public const int COLORINFO = 1;
|
||||
public const int FACEINFO = 2;
|
||||
public const int HIGHLIGHT_HAIR = 3;
|
||||
public const int VOICE = 4;
|
||||
public const int MAINHAND = 5;
|
||||
public const int OFFHAND = 6;
|
||||
public const int SPMAINHAND = 7;
|
||||
public const int SPOFFHAND = 8;
|
||||
public const int THROWING = 9;
|
||||
public const int PACK = 10;
|
||||
public const int POUCH = 11;
|
||||
public const int HEADGEAR = 12;
|
||||
public const int BODYGEAR = 13;
|
||||
public const int LEGSGEAR = 14;
|
||||
public const int HANDSGEAR = 15;
|
||||
public const int FEETGEAR = 16;
|
||||
public const int WAISTGEAR = 17;
|
||||
public const int NECKGEAR = 18;
|
||||
public const int L_EAR = 19;
|
||||
public const int R_EAR = 20;
|
||||
public const int R_WRIST = 21;
|
||||
public const int L_WRIST = 22;
|
||||
public const int R_RINGFINGER = 23;
|
||||
public const int L_RINGFINGER = 24;
|
||||
public const int R_INDEXFINGER = 25;
|
||||
public const int L_INDEXFINGER = 26;
|
||||
public const int UNKNOWN = 27;
|
||||
|
||||
public uint modelID;
|
||||
public uint[] appearanceIDs;
|
||||
|
||||
public SetActorAppearancePacket(uint modelID)
|
||||
{
|
||||
this.modelID = modelID;
|
||||
appearanceIDs = new uint[28];
|
||||
}
|
||||
|
||||
public SetActorAppearancePacket(uint modelID, uint[] appearanceTable)
|
||||
{
|
||||
this.modelID = modelID;
|
||||
appearanceIDs = appearanceTable;
|
||||
}
|
||||
|
||||
public SubPacket BuildPacket(uint sourceActorId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((uint)modelID);
|
||||
for (int i = 0; i < appearanceIDs.Length; i++)
|
||||
{
|
||||
binWriter.Write((uint)i);
|
||||
binWriter.Write((uint)appearanceIDs[i]);
|
||||
}
|
||||
|
||||
binWriter.Seek(0x100, SeekOrigin.Begin);
|
||||
binWriter.Write(appearanceIDs.Length);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
50
Map Server/packets/send/Actor/SetActorBGPropertiesPacket.cs
Normal file
50
Map Server/packets/send/Actor/SetActorBGPropertiesPacket.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorBGPropertiesPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00D8;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint val1, uint val2)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)val1);
|
||||
binWriter.Write((UInt32)val2);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
53
Map Server/packets/send/Actor/SetActorIconPacket.cs
Normal file
53
Map Server/packets/send/Actor/SetActorIconPacket.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorIconPacket
|
||||
{
|
||||
public const uint DISCONNECTING = 0x00010000;
|
||||
public const uint ISGM = 0x00020000;
|
||||
public const uint ISAFK = 0x00000100;
|
||||
|
||||
public const ushort OPCODE = 0x0145;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint iconCode)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)iconCode);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
38
Map Server/packets/send/Actor/SetActorIsZoningPacket.cs
Normal file
38
Map Server/packets/send/Actor/SetActorIsZoningPacket.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorIsZoningPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x017B;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, bool isDimmed)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
data[0] = (byte)(isDimmed ? 1 : 0);
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
58
Map Server/packets/send/Actor/SetActorNamePacket.cs
Normal file
58
Map Server/packets/send/Actor/SetActorNamePacket.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorNamePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x013D;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint displayNameID, string customName)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)displayNameID);
|
||||
|
||||
if (customName != null && (displayNameID == 0 || displayNameID == 0xFFFFFFFF))
|
||||
{
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(customName), 0, Encoding.ASCII.GetByteCount(customName) >= 0x20 ? 0x19 : Encoding.ASCII.GetByteCount(customName));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
69
Map Server/packets/send/Actor/SetActorPositionPacket.cs
Normal file
69
Map Server/packets/send/Actor/SetActorPositionPacket.cs
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorPositionPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00CE;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public const ushort SPAWNTYPE_FADEIN = 0;
|
||||
public const ushort SPAWNTYPE_PLAYERWAKE = 1;
|
||||
public const ushort SPAWNTYPE_WARP_DUTY = 2;
|
||||
public const ushort SPAWNTYPE_WARP2 = 3;
|
||||
public const ushort SPAWNTYPE_WARP3 = 4;
|
||||
public const ushort SPAWNTYPE_WARP_YELLOW = 5;
|
||||
public const ushort SPAWNTYPE_WARP_DUTY2 = 6;
|
||||
public const ushort SPAWNTYPE_WARP_LIGHT = 7;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint actorId, float x, float y, float z, float rotation, ushort spawnType, bool isZoningPlayer)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE-0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Int32)0);
|
||||
binWriter.Write((Int32)actorId);
|
||||
binWriter.Write((Single)x);
|
||||
binWriter.Write((Single)y);
|
||||
binWriter.Write((Single)z);
|
||||
binWriter.Write((Single)rotation);
|
||||
|
||||
binWriter.BaseStream.Seek(0x24, SeekOrigin.Begin);
|
||||
|
||||
binWriter.Write((UInt16)spawnType);
|
||||
binWriter.Write((UInt16)(isZoningPlayer ? 1 : 0));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
243
Map Server/packets/send/Actor/SetActorPropetyPacket.cs
Normal file
243
Map Server/packets/send/Actor/SetActorPropetyPacket.cs
Normal file
|
@ -0,0 +1,243 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorPropetyPacket
|
||||
{
|
||||
|
||||
public const ushort OPCODE = 0x0137;
|
||||
public const uint PACKET_SIZE = 0xA8;
|
||||
|
||||
private const ushort MAXBYTES = 0x7D;
|
||||
|
||||
private ushort runningByteTotal = 0;
|
||||
private byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
private bool isArrayMode = false;
|
||||
private bool isMore = false;
|
||||
|
||||
string currentTarget;
|
||||
|
||||
private MemoryStream mem;
|
||||
private BinaryWriter binWriter;
|
||||
|
||||
public SetActorPropetyPacket(string startingTarget)
|
||||
{
|
||||
mem = new MemoryStream(data);
|
||||
binWriter = new BinaryWriter(mem);
|
||||
binWriter.Seek(1, SeekOrigin.Begin);
|
||||
currentTarget = startingTarget;
|
||||
}
|
||||
|
||||
public void CloseStreams()
|
||||
{
|
||||
binWriter.Dispose();
|
||||
mem.Dispose();
|
||||
}
|
||||
|
||||
public bool AddByte(uint id, byte value)
|
||||
{
|
||||
if (runningByteTotal + 6 + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)1);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write((byte)value);
|
||||
runningByteTotal+=6;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AddShort(uint id, ushort value)
|
||||
{
|
||||
if (runningByteTotal + 7 + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)2);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write((UInt16)value);
|
||||
runningByteTotal+=7;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AddInt(uint id, uint value)
|
||||
{
|
||||
if (runningByteTotal + 9 + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)4);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write((UInt32)value);
|
||||
runningByteTotal+=9;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AddBuffer(uint id, byte[] buffer)
|
||||
{
|
||||
if (runningByteTotal + 5 + buffer.Length + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)buffer.Length);
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write(buffer);
|
||||
runningByteTotal += (ushort)(5 + buffer.Length);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AddBuffer(uint id, byte[] buffer, int index, int length, int page)
|
||||
{
|
||||
if (runningByteTotal + 5 + length + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES)
|
||||
return false;
|
||||
|
||||
binWriter.Write((byte)(length + 1));
|
||||
binWriter.Write((UInt32)id);
|
||||
binWriter.Write(buffer, index, length);
|
||||
binWriter.Write((byte)page);
|
||||
runningByteTotal += (ushort)(6 + length);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool AddProperty(FFXIVClassic_Map_Server.Actors.Actor actor, string name)
|
||||
{
|
||||
string[] split = name.Split('.');
|
||||
int arrayIndex = 0;
|
||||
|
||||
if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork") || split[0].Equals("guildleveWork")))
|
||||
return false;
|
||||
|
||||
Object curObj = actor;
|
||||
for (int i = 0; i < split.Length; i++)
|
||||
{
|
||||
//For arrays
|
||||
if (split[i].Contains('['))
|
||||
{
|
||||
if (split[i].LastIndexOf(']') - split[i].IndexOf('[') <= 0)
|
||||
return false;
|
||||
|
||||
arrayIndex = Convert.ToInt32(split[i].Substring(split[i].IndexOf('[') + 1, split[i].LastIndexOf(']') - split[i].LastIndexOf('[')-1));
|
||||
split[i] = split[i].Substring(0, split[i].IndexOf('['));
|
||||
}
|
||||
|
||||
FieldInfo field = curObj.GetType().GetField(split[i]);
|
||||
if (field == null)
|
||||
return false;
|
||||
|
||||
curObj = field.GetValue(curObj);
|
||||
if (curObj == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (curObj == null)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
//Array, we actually care whats inside
|
||||
if (curObj.GetType().IsArray)
|
||||
{
|
||||
if (((Array)curObj).Length <= arrayIndex)
|
||||
return false;
|
||||
curObj = ((Array)curObj).GetValue(arrayIndex);
|
||||
}
|
||||
|
||||
if (curObj == null)
|
||||
return false;
|
||||
|
||||
//Cast to the proper object and Add to packet
|
||||
uint id = Utils.MurmurHash2(name, 0);
|
||||
if (curObj is bool)
|
||||
return AddByte(id, (byte)(((bool)curObj) ? 1 : 0));
|
||||
else if (curObj is byte)
|
||||
return AddByte(id, (byte)curObj);
|
||||
else if (curObj is sbyte)
|
||||
return AddByte(id, (byte)(sbyte)curObj);
|
||||
else if (curObj is ushort)
|
||||
return AddShort(id, (ushort)curObj);
|
||||
else if (curObj is short)
|
||||
return AddShort(id, (ushort)(short)curObj);
|
||||
else if (curObj is uint)
|
||||
return AddInt(id, (uint)curObj);
|
||||
else if (curObj is int)
|
||||
return AddInt(id, (uint)(int)curObj);
|
||||
else if (curObj is float)
|
||||
return AddBuffer(id, BitConverter.GetBytes((float)curObj));
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetIsArrayMode(bool flag)
|
||||
{
|
||||
isArrayMode = flag;
|
||||
}
|
||||
|
||||
public void SetIsMore(bool flag)
|
||||
{
|
||||
isMore = flag;
|
||||
}
|
||||
|
||||
public void SetTarget(string target)
|
||||
{
|
||||
currentTarget = target;
|
||||
}
|
||||
|
||||
public void AddTarget()
|
||||
{
|
||||
if (isArrayMode)
|
||||
binWriter.Write((byte)(0xA4 + currentTarget.Length));
|
||||
else
|
||||
binWriter.Write((byte)(isMore ? 0x60 + currentTarget.Length : 0x82 + currentTarget.Length));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(currentTarget));
|
||||
runningByteTotal += (ushort)(1 + Encoding.ASCII.GetByteCount(currentTarget));
|
||||
}
|
||||
|
||||
public void AddTarget(string newTarget)
|
||||
{
|
||||
binWriter.Write((byte)(isMore ? 0x60 + currentTarget.Length : 0x82 + currentTarget.Length));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(currentTarget));
|
||||
runningByteTotal += (ushort)(1 + Encoding.ASCII.GetByteCount(currentTarget));
|
||||
currentTarget = newTarget;
|
||||
}
|
||||
|
||||
public SubPacket BuildPacket(uint sourceActorId)
|
||||
{
|
||||
binWriter.Seek(0, SeekOrigin.Begin);
|
||||
binWriter.Write((byte)runningByteTotal);
|
||||
|
||||
CloseStreams();
|
||||
|
||||
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||
return packet;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
96
Map Server/packets/send/Actor/SetActorSpeedPacket.cs
Normal file
96
Map Server/packets/send/Actor/SetActorSpeedPacket.cs
Normal file
|
@ -0,0 +1,96 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorSpeedPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00D0;
|
||||
public const uint PACKET_SIZE = 0xA8;
|
||||
|
||||
public const float DEFAULT_STOP = 0.0f;
|
||||
public const float DEFAULT_WALK = 2.0f;
|
||||
public const float DEFAULT_RUN = 5.0f;
|
||||
public const float DEFAULT_ACTIVE = 5.0f;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Single)DEFAULT_STOP);
|
||||
binWriter.Write((UInt32)0);
|
||||
|
||||
binWriter.Write((Single)DEFAULT_WALK);
|
||||
binWriter.Write((UInt32)1);
|
||||
|
||||
binWriter.Write((Single)DEFAULT_RUN);
|
||||
binWriter.Write((UInt32)2);
|
||||
|
||||
binWriter.Write((Single)DEFAULT_ACTIVE);
|
||||
binWriter.Write((UInt32)3);
|
||||
|
||||
binWriter.BaseStream.Seek(0x80, SeekOrigin.Begin);
|
||||
|
||||
binWriter.Write((UInt32)4);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, float stopSpeed, float walkSpeed, float runSpeed, float activeSpeed)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Single)stopSpeed);
|
||||
binWriter.Write((UInt32)0);
|
||||
|
||||
binWriter.Write((Single)walkSpeed);
|
||||
binWriter.Write((UInt32)1);
|
||||
|
||||
binWriter.Write((Single)runSpeed);
|
||||
binWriter.Write((UInt32)2);
|
||||
|
||||
binWriter.Write((Single)activeSpeed);
|
||||
binWriter.Write((UInt32)3);
|
||||
|
||||
binWriter.BaseStream.Seek(0x80, SeekOrigin.Begin);
|
||||
|
||||
binWriter.Write((UInt32)4);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
58
Map Server/packets/send/Actor/SetActorStatePacket.cs
Normal file
58
Map Server/packets/send/Actor/SetActorStatePacket.cs
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorStatePacket
|
||||
{
|
||||
public const int MAIN_STATE_PASSIVE = 0;
|
||||
public const int MAIN_STATE_DEAD = 1;
|
||||
public const int MAIN_STATE_ACTIVE = 2;
|
||||
public const int MAIN_STATE_DEAD2 = 3;
|
||||
|
||||
public const int MAIN_STATE_SITTING_OBJECT = 11;
|
||||
public const int MAIN_STATE_SITTING_FLOOR = 13;
|
||||
|
||||
public const int MAIN_STATE_MOUNTED = 15;
|
||||
|
||||
public const int MAIN_STATE_UNKNOWN1 = 0x0E;
|
||||
public const int MAIN_STATE_UNKNOWN2 = 0x1E;
|
||||
public const int MAIN_STATE_UNKNOWN3 = 0x1F;
|
||||
public const int MAIN_STATE_UNKNOWN4 = 0x20;
|
||||
|
||||
//What is this for?
|
||||
public const int SUB_STATE_NONE = 0x00;
|
||||
public const int SUB_STATE_PLAYER = 0xBF;
|
||||
public const int SUB_STATE_MONSTER = 0x03;
|
||||
|
||||
public const ushort OPCODE = 0x134;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint mainState, uint subState)
|
||||
{
|
||||
ulong combined = (mainState & 0xFF) | ((subState & 0xFF) << 8);
|
||||
return new SubPacket(OPCODE, sourceActorId, BitConverter.GetBytes(combined));
|
||||
}
|
||||
}
|
||||
}
|
54
Map Server/packets/send/Actor/SetActorStatusAllPacket.cs
Normal file
54
Map Server/packets/send/Actor/SetActorStatusAllPacket.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorStatusAllPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0179;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, ushort[] statusIds)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
for (int i = 0; i < statusIds.Length; i++)
|
||||
{
|
||||
if (i >= 20)
|
||||
break;
|
||||
binWriter.Write((UInt16)statusIds[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||
return packet;
|
||||
}
|
||||
}
|
||||
}
|
49
Map Server/packets/send/Actor/SetActorStatusPacket.cs
Normal file
49
Map Server/packets/send/Actor/SetActorStatusPacket.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorStatusPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0177;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, ushort index, ushort statusCode)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)index);
|
||||
binWriter.Write((UInt16)statusCode);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
66
Map Server/packets/send/Actor/SetActorSubStatePacket.cs
Normal file
66
Map Server/packets/send/Actor/SetActorSubStatePacket.cs
Normal file
|
@ -0,0 +1,66 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.actors.chara;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorSubStatePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x144;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
enum SubStat : int
|
||||
{
|
||||
Breakage = 0x00, // (index goes high to low, bitflags)
|
||||
Chant = 0x01, // [Nibbles: left / right hand = value]) (AKA SubStatObject)
|
||||
Guard = 0x02, // [left / right hand = true] 0,1,2,3) ||| High byte also defines how many bools to use as flags for byte 0x4.
|
||||
Waste = 0x03, // (High Nibble)
|
||||
Mode = 0x04, // ???
|
||||
Unknown = 0x05, // ???
|
||||
SubStatMotionPack = 0x06,
|
||||
Unknown2 = 0x07,
|
||||
}
|
||||
public static SubPacket BuildPacket(uint sourceActorId, SubState substate)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((byte)substate.breakage);
|
||||
binWriter.Write((byte)substate.chantId);
|
||||
binWriter.Write((byte)(substate.guard & 0xF));
|
||||
binWriter.Write((byte)(substate.waste));
|
||||
binWriter.Write((byte)(substate.mode));
|
||||
binWriter.Write((byte)0);
|
||||
binWriter.Write((ushort)substate.motionPack);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorTargetAnimatedPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00D3;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint targetID)
|
||||
{
|
||||
return new SubPacket(OPCODE, sourceActorId, BitConverter.GetBytes((ulong)targetID));
|
||||
}
|
||||
}
|
||||
}
|
37
Map Server/packets/send/Actor/SetActorTargetPacket.cs
Normal file
37
Map Server/packets/send/Actor/SetActorTargetPacket.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class SetActorTargetPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x00DB;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint targetID)
|
||||
{
|
||||
return new SubPacket(OPCODE, sourceActorId, BitConverter.GetBytes((ulong)targetID));
|
||||
}
|
||||
}
|
||||
}
|
53
Map Server/packets/send/Actor/StartCountdownPacket.cs
Normal file
53
Map Server/packets/send/Actor/StartCountdownPacket.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class StartCountdownPacket
|
||||
{
|
||||
public const ushort OPCODE = 0xE5;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, byte countdownLength, ulong syncTime, string message)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Byte)countdownLength);
|
||||
binWriter.Seek(8, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt64)syncTime);
|
||||
binWriter.Seek(18, SeekOrigin.Begin);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(message), 0, Encoding.ASCII.GetByteCount(message) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(message));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
50
Map Server/packets/send/Actor/_0x132Packet.cs
Normal file
50
Map Server/packets/send/Actor/_0x132Packet.cs
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class _0x132Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x132;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, ushort number, string function)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)number);
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(function), 0, Encoding.ASCII.GetByteCount(function) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(function));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
48
Map Server/packets/send/Actor/_0xFPacket.cs
Normal file
48
Map Server/packets/send/Actor/_0xFPacket.cs
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||
{
|
||||
class _0xFPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x000F;
|
||||
public const uint PACKET_SIZE = 0x38;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActor)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActor, data);
|
||||
}
|
||||
}
|
||||
}
|
33
Map Server/packets/send/Actor/battle/BattleAction.cs
Normal file
33
Map Server/packets/send/Actor/battle/BattleAction.cs
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class BattleAction
|
||||
{
|
||||
public uint targetId;
|
||||
public ushort amount;
|
||||
public ushort worldMasterTextId;
|
||||
public uint effectId;
|
||||
public byte param;
|
||||
public byte unknown;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class BattleActionX10Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x013A;
|
||||
public const uint PACKET_SIZE = 0xD8;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint animationId, ushort commandId, BattleAction[] actionList)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
binWriter.Write((UInt32)animationId);
|
||||
|
||||
//Missing... last value is float, string in here as well?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32) actionList.Length); //Num actions (always 1 for this)
|
||||
binWriter.Write((UInt16)commandId);
|
||||
binWriter.Write((UInt16)810); //?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((UInt32)action.targetId);
|
||||
|
||||
binWriter.Seek(0x50, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((UInt16)action.amount);
|
||||
|
||||
binWriter.Seek(0x64, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((UInt16)action.worldMasterTextId);
|
||||
|
||||
binWriter.Seek(0x78, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((UInt32)action.effectId);
|
||||
|
||||
binWriter.Seek(0xA0, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((Byte)action.param);
|
||||
|
||||
binWriter.Seek(0xAA, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((Byte)action.unknown);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class BattleActionX18Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x013B;
|
||||
public const uint PACKET_SIZE = 0x148;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint animationId, ushort commandId, BattleAction[] actionList)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
binWriter.Write((UInt32)animationId);
|
||||
|
||||
//Missing... last value is float, string in here as well?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32) actionList.Length); //Num actions (always 1 for this)
|
||||
binWriter.Write((UInt16)commandId);
|
||||
binWriter.Write((UInt16)810); //?
|
||||
|
||||
binWriter.Seek(0x58, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((UInt32)action.targetId);
|
||||
|
||||
binWriter.Seek(0xA0, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((UInt16)action.amount);
|
||||
|
||||
binWriter.Seek(0xC4, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((UInt16)action.worldMasterTextId);
|
||||
|
||||
binWriter.Seek(0xE8, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((UInt32)action.effectId);
|
||||
|
||||
binWriter.Seek(0x130, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((Byte)action.param);
|
||||
|
||||
binWriter.Seek(0x142, SeekOrigin.Begin);
|
||||
foreach (BattleAction action in actionList)
|
||||
binWriter.Write((Byte)action.unknown);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
425
Map Server/packets/send/Actor/battle/CommandResult.cs
Normal file
425
Map Server/packets/send/Actor/battle/CommandResult.cs
Normal file
|
@ -0,0 +1,425 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai.utils;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
//These flags can be stacked and mixed, but the client will prioritize certain flags over others.
|
||||
[Flags]
|
||||
public enum HitEffect : uint
|
||||
{
|
||||
//This is used for physical attacks
|
||||
HitEffectType = 8 << 24,
|
||||
//This is used for additioanl effect hits. Only difference from HitEffectType is that it does not play audio.
|
||||
AdditionalEffectType = 24 << 24,
|
||||
//Status effects use 32 << 24
|
||||
StatusEffectType = 32 << 24,
|
||||
//When losing a status effect while using a skill, this prevents the hit effect from playing on the actor playing the animation
|
||||
StatusLossType = 40 << 24,
|
||||
//Magic effects use 48 << 24, this is also used for when statuses are lost on attack
|
||||
MagicEffectType = 48 << 24,
|
||||
//This places the number on the user regardless of the target this hit effect is for, used for things like bloodbath
|
||||
SelfHealType = 72 << 24,
|
||||
//Plays the effect animation with no text or additional effects. Unsure if there are any flags. Used for things like Convert
|
||||
AnimationEffectType = 96 << 24,
|
||||
|
||||
//Each Type has it's own set of flags. These should be split into their own enums,
|
||||
//but for now just keep them all under HitEffect so we don't have to change anything.
|
||||
|
||||
//HitEffectType flags
|
||||
|
||||
//Not setting RecoilLv2 or RecoilLv3 results in the weaker RecoilLv1.
|
||||
//These are the recoil animations that play on the target, ranging from weak to strong.
|
||||
//The recoil that gets set was likely based on the percentage of HP lost from the attack.
|
||||
//These also have a visual effect with heals and spells but in reverse. RecoilLv1 has a large effect, Lv3 has none. Crit is very large
|
||||
//For spells they represent resists. Lv0 is a max resist, Lv3 is no resist. Crit is still used for crits.
|
||||
//Heals used the same effects sometimes but it isn't clear what for, it seems random? Possibly something like a trait proccing or even just a bug
|
||||
RecoilLv1 = 0,
|
||||
RecoilLv2 = 1 << 0,
|
||||
RecoilLv3 = 1 << 1,
|
||||
|
||||
//Setting both recoil flags triggers the "Critical!" pop-up text and hit visual effect.
|
||||
CriticalHit = RecoilLv2 | RecoilLv3,
|
||||
|
||||
//Hit visual and sound effects when connecting with the target.
|
||||
//Mixing these flags together will yield different results.
|
||||
//Each visual likely relates to a specific weapon.
|
||||
//Ex: HitVisual4 flag alone appears to be the visual and sound effect for hand-to-hand attacks.
|
||||
|
||||
//HitVisual is probably based on attack property.
|
||||
//HitVisual1 is for slashing attacks
|
||||
//HitVisual2 is for piercing attacks
|
||||
//HitVisual1 | Hitvisual2 is for blunt attacks
|
||||
//HitVisual3 is for projectile attacks
|
||||
//Basically take the attack property of a weapon and shift it left 2
|
||||
//For auto attacks attack property is weapon's damageAttributeType1
|
||||
//Still not totally sure how this works with weaponskills or what hitvisual4 or the other combinations are for
|
||||
HitVisual1 = 1 << 2,
|
||||
HitVisual2 = 1 << 3,
|
||||
HitVisual3 = 1 << 4,
|
||||
HitVisual4 = 1 << 5,
|
||||
|
||||
//An additional visual effect that plays on the target when attacked if:
|
||||
//The attack is physical and they have the protect buff on.
|
||||
//The attack is magical and they have the shell buff on.
|
||||
//Special Note: Shell was removed in later versions of the game.
|
||||
//Another effect plays when both Protect and Shell flags are activated.
|
||||
//Not sure what this effect is.
|
||||
//Random guess: if the attack was a hybrid of both physical and magical and the target had both Protect and Shell buffs applied.
|
||||
Protect = 1 << 6,
|
||||
Shell = 1 << 7,
|
||||
ProtectShellSpecial = Protect | Shell,
|
||||
|
||||
//If only HitEffect1 is set out of the hit effects, the "Evade!" pop-up text triggers along with the evade visual.
|
||||
//If no hit effects are set, the "Miss!" pop-up is triggered and no hit visual is played.
|
||||
HitEffect1 = 1 << 9,
|
||||
HitEffect2 = 1 << 10, //Plays the standard hit visual effect, but with no sound if used alone.
|
||||
HitEffect3 = 1 << 11, //Yellow effect, crit?
|
||||
HitEffect4 = 1 << 12, //Plays the blocking animation
|
||||
HitEffect5 = 1 << 13,
|
||||
GustyHitEffect = HitEffect3 | HitEffect2,
|
||||
GreenTintedHitEffect = HitEffect4 | HitEffect1,
|
||||
|
||||
//For specific animations
|
||||
Miss = 0,
|
||||
Evade = HitEffect1,
|
||||
Hit = HitEffect1 | HitEffect2,
|
||||
Crit = HitEffect3,
|
||||
Parry = Hit | HitEffect3,
|
||||
Block = HitEffect4,
|
||||
|
||||
//Knocks you back away from the attacker.
|
||||
KnockbackLv1 = HitEffect4 | HitEffect2 | HitEffect1,
|
||||
KnockbackLv2 = HitEffect4 | HitEffect3,
|
||||
KnockbackLv3 = HitEffect4 | HitEffect3 | HitEffect1,
|
||||
KnockbackLv4 = HitEffect4 | HitEffect3 | HitEffect2,
|
||||
KnockbackLv5 = HitEffect4 | HitEffect3 | HitEffect2 | HitEffect1,
|
||||
|
||||
//Knocks you away from the attacker in a counter-clockwise direction.
|
||||
KnockbackCounterClockwiseLv1 = HitEffect5,
|
||||
KnockbackCounterClockwiseLv2 = HitEffect5 | HitEffect1,
|
||||
|
||||
//Knocks you away from the attacker in a clockwise direction.
|
||||
KnockbackClockwiseLv1 = HitEffect5 | HitEffect2,
|
||||
KnockbackClockwiseLv2 = HitEffect5 | HitEffect2 | HitEffect1,
|
||||
|
||||
//Completely drags target to the attacker, even across large distances.
|
||||
DrawIn = HitEffect5 | HitEffect3,
|
||||
|
||||
//An additional visual effect that plays on the target based on according buff.
|
||||
UnknownShieldEffect = HitEffect5 | HitEffect4,
|
||||
Stoneskin = HitEffect5 | HitEffect4 | HitEffect1,
|
||||
|
||||
//A special effect when performing appropriate skill combos in succession.
|
||||
//Ex: Thunder (SkillCombo1 Effect) -> Thundara (SkillCombo2 Effect) -> Thundaga (SkillCombo3 Effect)
|
||||
//Special Note: SkillCombo4 was never actually used in 1.0 since combos only chained up to 3 times maximum.
|
||||
SkillCombo1 = 1 << 15,
|
||||
SkillCombo2 = 1 << 16,
|
||||
SkillCombo3 = SkillCombo1 | SkillCombo2,
|
||||
SkillCombo4 = 1 << 17,
|
||||
|
||||
//This is used in the absorb effect for some reason
|
||||
Unknown = 1 << 19,
|
||||
|
||||
//AdditionalEffectType flags
|
||||
//The AdditionalEffectType is used for the additional effects some weapons have.
|
||||
//These effect ids do not repeat the effect of the attack and will not show without a preceding HitEffectType or MagicEffectType
|
||||
|
||||
//It's unclear what this is for. The ifrit fight capture has a BLM using the garuda weapon
|
||||
//and this flag is set every time but has no apparent effect.
|
||||
UnknownAdditionalFlag = 1,
|
||||
|
||||
//These play effects on the target
|
||||
FireEffect = 1 << 10,
|
||||
IceEffect = 2 << 10,
|
||||
WindEffect = 3 << 10,
|
||||
EarthEffect = 4 << 10,
|
||||
LightningEffect = 5 << 10,
|
||||
WaterEffect = 6 << 10,
|
||||
AstralEffect = 7 << 10, //Possibly for blind?
|
||||
UmbralEffect = 8 << 10, //Posibly for poison?
|
||||
|
||||
//Unknown status effect effects
|
||||
StatusEffect1 = 12 << 10,
|
||||
StatusEffect2 = 13 << 10,
|
||||
|
||||
HPAbsorbEffect = 14 << 10,
|
||||
MPAbsorbEffect = 15 << 10,
|
||||
TPAbsorbEffect = 16 << 10,
|
||||
TripleAbsorbEffect = 17 << 10, //Not sure about this
|
||||
MoogleEffect = 18 << 10,
|
||||
|
||||
//MagicEffectType Flags
|
||||
//THese are used for magic effects that deal or heal damage as well as damage over time effects
|
||||
//Crit is the same as HitEffectType
|
||||
FullResist = 0,
|
||||
WeakResist = 1 << 0, //Used for level 1, 2, and 3 resists probably
|
||||
NoResist = 1 << 1,
|
||||
|
||||
MagicShell = 1 << 4, //Used when casting on target with shell effects. MagicEffectType doesnt have a flag for protect or stoneskin
|
||||
MagicShield = 1 << 5, //When used with an command that has an animation, this plays a purple shield effect. DoTs also have this flag set (at least on ifrit) but they have no animations so it doesnt show
|
||||
|
||||
// Required for heal text to be blue, not sure if that's all it's used for
|
||||
Heal = 1 << 8,
|
||||
MP = 1 << 9, //Causes "MP" text to appear when used with MagicEffectType. | with Heal to make text blue
|
||||
TP = 1 << 10, //Causes "TP" text to appear when used with MagicEffectType. | with Heal to make text blue
|
||||
|
||||
//SelfHealType flags
|
||||
//This category causes numbers to appear on the user rather regardless of the target associated with the hit effect and do not play an animation
|
||||
//These determine the text that displays (HP has no text)
|
||||
SelfHealHP = 0,
|
||||
SelfHealMP = 1 << 0, //Shows MP text on self. | with SelfHeal to make blue
|
||||
SelfHealTP = 1 << 1, //Shows TP text on self. | with SelfHeal to make blue
|
||||
|
||||
//Causes self healing numbers to be blue
|
||||
SelfHeal = 1 << 10,
|
||||
}
|
||||
|
||||
//Mixing some of these flags will cause the client to crash.
|
||||
//Setting a flag higher than Left (0x10-0x80) will cause the client to crash.
|
||||
[Flags]
|
||||
public enum HitDirection : byte
|
||||
{
|
||||
None = 0,
|
||||
Front = 1 << 0,
|
||||
Right = 1 << 1,
|
||||
Rear = 1 << 2,
|
||||
Left = 1 << 3
|
||||
}
|
||||
|
||||
public enum HitType : ushort
|
||||
{
|
||||
Miss = 0,
|
||||
Evade = 1,
|
||||
Parry = 2,
|
||||
Block = 3,
|
||||
SingleResist = 4,
|
||||
DoubleResist = 5,
|
||||
TripleResist = 6,
|
||||
FullResist = 7,
|
||||
Hit = 8,
|
||||
Crit = 9
|
||||
}
|
||||
|
||||
//Type of action
|
||||
public enum ActionType : ushort
|
||||
{
|
||||
None = 0,
|
||||
Physical = 1,
|
||||
Magic = 2,
|
||||
Heal = 3,
|
||||
Status = 4
|
||||
}
|
||||
|
||||
//There's are two columns in gamecommand that are for action property and action element respectively and both have percentages next to them
|
||||
//the percentages are for what percent that property or element factors into the attack. Astral and Umbral are always 33% because they are both 3 elments combined
|
||||
//ActionProperty and ActionElement are slightly different. Property defines whta type of attack it is, and 11-13 are used for "sonic, breath, neutral". Neutral is always used for magic
|
||||
//For Element 11-13 are used for astral, umbral, and healing magic.
|
||||
//Right now we aren't actually using these but when things like resists get better defined we'll have to
|
||||
public enum ActionProperty : ushort
|
||||
{
|
||||
None = 0,
|
||||
Slashing = 1,
|
||||
Piercing = 2,
|
||||
Blunt = 3,
|
||||
Projectile = 4,
|
||||
|
||||
Fire = 5,
|
||||
Ice = 6,
|
||||
Wind = 7,
|
||||
Earth = 8,
|
||||
Lightning = 9,
|
||||
Water = 10,
|
||||
|
||||
//These I'm not sure about. Check gameCommand.csv
|
||||
Astral = 11,
|
||||
Umbral = 12,
|
||||
Heal = 13
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public enum ActionProperty : ushort
|
||||
{
|
||||
None = 0,
|
||||
Slashing = 1,
|
||||
Piercing = 2,
|
||||
Blunt = 3,
|
||||
Projectile = 4,
|
||||
|
||||
Fire = 5,
|
||||
Ice = 6,
|
||||
Wind = 7,
|
||||
Earth = 8,
|
||||
Lightning = 9,
|
||||
Water = 10,
|
||||
|
||||
Sonic = 11,
|
||||
Breath = 12,
|
||||
Neutral = 13,
|
||||
Astral = 14,
|
||||
Umbral = 15
|
||||
}
|
||||
|
||||
public enum ActionElement : ushort
|
||||
{
|
||||
None = 0,
|
||||
Slashing = 1,
|
||||
Piercing = 2,
|
||||
Blunt = 3,
|
||||
Projectile = 4,
|
||||
|
||||
Fire = 5,
|
||||
Ice = 6,
|
||||
Wind = 7,
|
||||
Earth = 8,
|
||||
Lightning = 9,
|
||||
Water = 10,
|
||||
|
||||
//These I'm not sure about. Check gameCommand.csv
|
||||
Astral = 11,
|
||||
Umbral = 12,
|
||||
Heal = 13
|
||||
}*/
|
||||
|
||||
|
||||
class CommandResult
|
||||
{
|
||||
public uint targetId;
|
||||
public ushort amount;
|
||||
public ushort amountMitigated; //Amount that got blocked/evaded or resisted
|
||||
public ushort enmity; //Seperate from amount for abilities that cause a different amount of enmity than damage
|
||||
public ushort worldMasterTextId;
|
||||
public uint effectId; //Impact effect, damage/heal/status numbers or name
|
||||
public byte param; //Which side the battle action is coming from
|
||||
public byte hitNum; //Which hit in a sequence of hits this is
|
||||
|
||||
/// <summary>
|
||||
/// these fields are not actually part of the packet struct
|
||||
/// </summary>
|
||||
public uint animation;
|
||||
public CommandType commandType; //What type of command was used (ie weaponskill, ability, etc)
|
||||
public ActionProperty actionProperty; //Damage type of the action
|
||||
public ActionType actionType; //Type of this action (ie physical, magic, heal)
|
||||
public HitType hitType;
|
||||
|
||||
//Rates, I'm not sure if these need to be stored like this but with the way some buffs work maybe they do?
|
||||
//Makes things like Blindside easy at least.
|
||||
public double parryRate = 0.0;
|
||||
public double blockRate = 0.0;
|
||||
public double resistRate = 0.0;
|
||||
public double hitRate = 0.0;
|
||||
public double critRate = 0.0;
|
||||
|
||||
public CommandResult(uint targetId, ushort worldMasterTextId, uint effectId, ushort amount = 0, byte param = 0, byte hitNum = 1)
|
||||
{
|
||||
this.targetId = targetId;
|
||||
this.worldMasterTextId = worldMasterTextId;
|
||||
this.effectId = effectId;
|
||||
this.amount = amount;
|
||||
this.param = param;
|
||||
this.hitNum = hitNum;
|
||||
this.hitType = HitType.Hit;
|
||||
this.enmity = amount;
|
||||
this.commandType = (byte) CommandType.None;
|
||||
}
|
||||
|
||||
public CommandResult(uint targetId, BattleCommand command, byte param = 0, byte hitNum = 1)
|
||||
{
|
||||
this.targetId = targetId;
|
||||
this.worldMasterTextId = command.worldMasterTextId;
|
||||
this.param = param;
|
||||
this.hitNum = hitNum;
|
||||
this.commandType = command.commandType;
|
||||
this.actionProperty = command.actionProperty;
|
||||
this.actionType = command.actionType;
|
||||
}
|
||||
|
||||
//Order of what (probably) happens when a skill is used:
|
||||
//Buffs that alter things like recast times or that only happen once per skill usage like Power Surge are activated
|
||||
//Script calculates damage and handles any special requirements
|
||||
//Rates are calculated
|
||||
//Buffs that impact indiviudal hits like Blindside or Blood for Blood are activated
|
||||
//The final hit type is determined
|
||||
//Stoneskin takes damage
|
||||
//Final damage amount is calculated using the hit type and defender's stats
|
||||
//Buffs that activate or respond to damage like Rampage. Stoneskin gets removed AFTER damage if it falls off.
|
||||
//Additional effects that are a part of the skill itself or weapon in case of auto attacks take place like status effects
|
||||
//Certain buffs that alter the whole skill fall off (Resonance, Excruciate)
|
||||
|
||||
public void DoAction(Character caster, Character target, BattleCommand skill, CommandResultContainer results)
|
||||
{
|
||||
//First calculate rates for hit/block/etc
|
||||
CalcRates(caster, target, skill);
|
||||
|
||||
//Next, modify those rates based on preaction buffs
|
||||
//Still not sure how we shouldh andle these
|
||||
PreAction(caster, target, skill, results);
|
||||
|
||||
BattleUtils.DoAction(caster, target, skill, this, results);
|
||||
}
|
||||
|
||||
|
||||
//Calculate the chance of hitting/critting/etc
|
||||
public void CalcRates(Character caster, Character target, BattleCommand skill)
|
||||
{
|
||||
hitRate = BattleUtils.GetHitRate(caster, target, skill, this);
|
||||
critRate = BattleUtils.GetCritRate(caster, target, skill, this);
|
||||
blockRate = BattleUtils.GetBlockRate(caster, target, skill, this);
|
||||
parryRate = BattleUtils.GetParryRate(caster, target, skill, this);
|
||||
resistRate = BattleUtils.GetResistRate(caster, target, skill, this);
|
||||
}
|
||||
|
||||
//These are buffs that activate before the action hits. Usually they change things like hit or crit rates or damage
|
||||
public void PreAction(Character caster, Character target, BattleCommand skill, CommandResultContainer results)
|
||||
{
|
||||
target.statusEffects.CallLuaFunctionByFlag((uint)StatusEffectFlags.ActivateOnPreactionTarget, "onPreAction", caster, target, skill, this, results);
|
||||
|
||||
caster.statusEffects.CallLuaFunctionByFlag((uint)StatusEffectFlags.ActivateOnPreactionCaster, "onPreAction", caster, target, skill, this, results);
|
||||
}
|
||||
|
||||
//Try and apply a status effect
|
||||
public void TryStatus(Character caster, Character target, BattleCommand skill, CommandResultContainer results, bool isAdditional = true)
|
||||
{
|
||||
BattleUtils.TryStatus(caster, target, skill, this, results, isAdditional);
|
||||
}
|
||||
|
||||
public ushort GetHitType()
|
||||
{
|
||||
return (ushort)hitType;
|
||||
}
|
||||
|
||||
public void SetTextId(ushort id)
|
||||
{
|
||||
worldMasterTextId = id;
|
||||
}
|
||||
|
||||
//Whether this action didn't miss, and wasn't evaded or resisted
|
||||
public bool ActionLanded()
|
||||
{
|
||||
return hitType > HitType.Evade && hitType != HitType.SingleResist && hitType != HitType.DoubleResist && hitType != HitType.FullResist;
|
||||
}
|
||||
}
|
||||
}
|
120
Map Server/packets/send/Actor/battle/CommandResultContainer.cs
Normal file
120
Map Server/packets/send/Actor/battle/CommandResultContainer.cs
Normal file
|
@ -0,0 +1,120 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class CommandResultContainer
|
||||
{
|
||||
private List<CommandResult> actionsList = new List<CommandResult>();
|
||||
|
||||
//EXP messages are always the last mesages in battlea ction packets, so they get appended after all the rest of the actions are done.
|
||||
private List<CommandResult> expActionList = new List<CommandResult>();
|
||||
|
||||
public CommandResultContainer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void AddAction(uint targetId, ushort worldMasterTextId, uint effectId, ushort amount = 0, byte param = 0, byte hitNum = 0)
|
||||
{
|
||||
AddAction(new CommandResult(targetId, worldMasterTextId, effectId, amount, param, hitNum));
|
||||
}
|
||||
|
||||
//Just to make scripting simpler
|
||||
//These have to be split into the normal actions and absorb actions because they use different flags
|
||||
//AddMP/HP/TPAction are for actions where the targetID is the person being targeted by command. Like Sanguine Rite would use AddMPAction
|
||||
public void AddMPAction(uint targetId, ushort worldMasterTextId, ushort amount)
|
||||
{
|
||||
uint effectId = (uint) (HitEffect.MagicEffectType | HitEffect.MP | HitEffect.Heal);
|
||||
AddAction(targetId, worldMasterTextId, effectId, amount);
|
||||
}
|
||||
|
||||
public void AddHPAction(uint targetId, ushort worldMasterTextId, ushort amount)
|
||||
{
|
||||
uint effectId = (uint) (HitEffect.MagicEffectType | HitEffect.Heal);
|
||||
AddAction(targetId, worldMasterTextId, effectId, amount);
|
||||
}
|
||||
|
||||
public void AddTPAction(uint targetId, ushort worldMasterTextId, ushort amount)
|
||||
{
|
||||
uint effectId = (uint) (HitEffect.MagicEffectType | HitEffect.TP | HitEffect.Heal);
|
||||
AddAction(targetId, worldMasterTextId, effectId, amount);
|
||||
}
|
||||
|
||||
//These are used for skills where the targetId is the person using a command. For example casting with parsimony would use AddMPAbsorbAction
|
||||
public void AddMPAbsorbAction(uint targetId, ushort worldMasterTextId, ushort amount)
|
||||
{
|
||||
uint effectId = (uint) (HitEffect.SelfHealType | HitEffect.SelfHealMP | HitEffect.SelfHeal);
|
||||
AddAction(targetId, worldMasterTextId, effectId, amount);
|
||||
}
|
||||
|
||||
public void AddHPAbsorbAction(uint targetId, ushort worldMasterTextId, ushort amount)
|
||||
{
|
||||
uint effectId = (uint) (HitEffect.SelfHealType | HitEffect.SelfHeal | HitEffect.SelfHeal);
|
||||
AddAction(targetId, worldMasterTextId, effectId, amount);
|
||||
}
|
||||
|
||||
public void AddTPAbsorbAction(uint targetId, ushort worldMasterTextId, ushort amount)
|
||||
{
|
||||
uint effectId = (uint) (HitEffect.SelfHealType | HitEffect.SelfHealTP | HitEffect.SelfHeal);
|
||||
AddAction(targetId, worldMasterTextId, effectId, amount);
|
||||
}
|
||||
|
||||
public void AddHitAction(uint targetId, ushort worldMasterTextId, ushort amount)
|
||||
{
|
||||
uint effectId = (uint) (HitEffect.HitEffectType | HitEffect.Hit);
|
||||
AddAction(targetId, worldMasterTextId, effectId, amount);
|
||||
}
|
||||
|
||||
public void AddAction(CommandResult action)
|
||||
{
|
||||
if (action != null)
|
||||
actionsList.Add(action);
|
||||
}
|
||||
|
||||
public void AddActions(List<CommandResult> actions)
|
||||
{
|
||||
actionsList.AddRange(actions);
|
||||
}
|
||||
|
||||
public void AddEXPAction(CommandResult action)
|
||||
{
|
||||
expActionList.Add(action);
|
||||
}
|
||||
|
||||
public void AddEXPActions(List<CommandResult> actionList)
|
||||
{
|
||||
expActionList.AddRange(actionList);
|
||||
}
|
||||
|
||||
public void CombineLists()
|
||||
{
|
||||
actionsList.AddRange(expActionList);
|
||||
}
|
||||
|
||||
public List<CommandResult> GetList()
|
||||
{
|
||||
return actionsList;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class CommandResultX00Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x013C;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint animationId, ushort commandId)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
binWriter.Write((UInt32)animationId);
|
||||
|
||||
//Missing... last value is float, string in here as well?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)0); //Num actions (always 0 for this)
|
||||
binWriter.Write((UInt16)commandId);
|
||||
binWriter.Write((UInt16)810); //?
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
// see xtx_command
|
||||
enum CommandResultX01PacketCommand : ushort
|
||||
{
|
||||
Disengage = 12002,
|
||||
Attack = 22104,
|
||||
}
|
||||
|
||||
class CommandResultX01Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0139;
|
||||
public const uint PACKET_SIZE = 0x58;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint animationId, ushort commandId, CommandResult action)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
|
||||
binWriter.Write((UInt32)animationId);
|
||||
|
||||
//Missing... last value is float, string in here as well?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)1); //Num actions (always 1 for this)
|
||||
binWriter.Write((UInt16)commandId);
|
||||
binWriter.Write((UInt16)0x810); //?
|
||||
|
||||
binWriter.Write((UInt32)action.targetId);
|
||||
|
||||
binWriter.Write((UInt16)action.amount);
|
||||
binWriter.Write((UInt16)action.worldMasterTextId);
|
||||
|
||||
binWriter.Write((UInt32)action.effectId);
|
||||
binWriter.Write((Byte)action.param);
|
||||
binWriter.Write((Byte)action.hitNum);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
148
Map Server/packets/send/Actor/battle/CommandResultX10Packet.cs
Normal file
148
Map Server/packets/send/Actor/battle/CommandResultX10Packet.cs
Normal file
|
@ -0,0 +1,148 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class CommandResultX10Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x013A;
|
||||
public const uint PACKET_SIZE = 0xD8;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint animationId, ushort commandId, CommandResult[] actionList, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (actionList.Length - listOffset <= 10)
|
||||
max = actionList.Length - listOffset;
|
||||
else
|
||||
max = 10;
|
||||
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
binWriter.Write((UInt32)animationId);
|
||||
|
||||
//Missing... last value is float, string in here as well?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)max); //Num actions
|
||||
binWriter.Write((UInt16)commandId);
|
||||
binWriter.Write((UInt16)0x810); //?
|
||||
|
||||
//binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt32)actionList[listOffset + i].targetId);
|
||||
|
||||
binWriter.Seek(0x50, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt16)actionList[listOffset + i].amount);
|
||||
|
||||
binWriter.Seek(0x64, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt16)actionList[listOffset + i].worldMasterTextId);
|
||||
|
||||
binWriter.Seek(0x78, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt32)actionList[listOffset + i].effectId);
|
||||
|
||||
binWriter.Seek(0xA0, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte)actionList[listOffset + i].param);
|
||||
|
||||
binWriter.Seek(0xAA, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte)actionList[listOffset + i].hitNum);
|
||||
|
||||
listOffset += max;
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint animationId, ushort commandId, List<CommandResult> actionList, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (actionList.Count - listOffset <= 10)
|
||||
max = actionList.Count - listOffset;
|
||||
else
|
||||
max = 10;
|
||||
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
binWriter.Write((UInt32)animationId);
|
||||
|
||||
//Missing... last value is float, string in here as well?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)max); //Num actions
|
||||
binWriter.Write((UInt16)commandId);
|
||||
binWriter.Write((UInt16)0x810); //?
|
||||
|
||||
//binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt32)actionList[listOffset + i].targetId);
|
||||
|
||||
binWriter.Seek(0x50, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt16)actionList[listOffset + i].amount);
|
||||
|
||||
binWriter.Seek(0x64, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt16)actionList[listOffset + i].worldMasterTextId);
|
||||
|
||||
binWriter.Seek(0x78, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt32)actionList[listOffset + i].effectId);
|
||||
}
|
||||
|
||||
binWriter.Seek(0xA0, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte)actionList[listOffset + i].param);
|
||||
|
||||
binWriter.Seek(0xAA, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte) actionList[listOffset + i].hitNum);
|
||||
|
||||
listOffset += max;
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
145
Map Server/packets/send/Actor/battle/CommandResultX18Packet.cs
Normal file
145
Map Server/packets/send/Actor/battle/CommandResultX18Packet.cs
Normal file
|
@ -0,0 +1,145 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||
{
|
||||
class CommandResultX18Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x013B;
|
||||
public const uint PACKET_SIZE = 0x148;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint animationId, ushort commandId, CommandResult[] actionList, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (actionList.Length - listOffset <= 18)
|
||||
max = actionList.Length - listOffset;
|
||||
else
|
||||
max = 18;
|
||||
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
binWriter.Write((UInt32)animationId);
|
||||
|
||||
//Missing... last value is float, string in here as well?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)max); //Num actions
|
||||
binWriter.Write((UInt16)commandId);
|
||||
binWriter.Write((UInt16)0x810); //?
|
||||
|
||||
binWriter.Seek(0x28, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt32)actionList[listOffset + i].targetId);
|
||||
|
||||
binWriter.Seek(0x70, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt16)actionList[listOffset + i].amount);
|
||||
|
||||
binWriter.Seek(0x94, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt16)actionList[listOffset + i].worldMasterTextId);
|
||||
|
||||
binWriter.Seek(0xB8, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt32)actionList[listOffset + i].effectId);
|
||||
|
||||
binWriter.Seek(0x100, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte)actionList[listOffset + i].param);
|
||||
|
||||
binWriter.Seek(0x112, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte)actionList[listOffset + i].hitNum);
|
||||
|
||||
listOffset += max;
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, uint animationId, ushort commandId, List<CommandResult> actionList, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (actionList.Count - listOffset <= 18)
|
||||
max = actionList.Count - listOffset;
|
||||
else
|
||||
max = 18;
|
||||
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
binWriter.Write((UInt32)animationId);
|
||||
|
||||
//Missing... last value is float, string in here as well?
|
||||
|
||||
binWriter.Seek(0x20, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)max); //Num actions
|
||||
binWriter.Write((UInt16)commandId);
|
||||
binWriter.Write((UInt16)0x818); //?
|
||||
|
||||
binWriter.Seek(0x28, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt32)actionList[listOffset + i].targetId);
|
||||
|
||||
binWriter.Seek(0x70, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt16)actionList[listOffset + i].amount);
|
||||
|
||||
binWriter.Seek(0x94, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt16)actionList[listOffset + i].worldMasterTextId);
|
||||
|
||||
binWriter.Seek(0xB8, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((UInt32)actionList[listOffset + i].effectId);
|
||||
|
||||
binWriter.Seek(0x100, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte)actionList[listOffset + i].param);
|
||||
|
||||
binWriter.Seek(0x112, SeekOrigin.Begin);
|
||||
for (int i = 0; i < max; i++)
|
||||
binWriter.Write((Byte)actionList[listOffset + i].hitNum);
|
||||
|
||||
listOffset += max;
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetEmoteEventCondition
|
||||
{
|
||||
public const ushort OPCODE = 0x016C;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, EventList.EmoteEventCondition condition)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Byte)condition.unknown1); //4
|
||||
binWriter.Write((UInt16)condition.emoteId); //82, 76, 6E
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
52
Map Server/packets/send/Actor/events/SetEventStatus.cs
Normal file
52
Map Server/packets/send/Actor/events/SetEventStatus.cs
Normal file
|
@ -0,0 +1,52 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetEventStatus
|
||||
{
|
||||
public const ushort OPCODE = 0x0136;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, bool enabled, byte unknown2, string conditionName)
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetNoticeEventCondition
|
||||
{
|
||||
public const ushort OPCODE = 0x016B;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, EventList.NoticeEventCondition condition)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Byte)condition.unknown1); //Seen: 0, 1, E
|
||||
binWriter.Write((Byte)condition.unknown2); //Seen: 0, 1
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetPushEventConditionWithCircle
|
||||
{
|
||||
public const ushort OPCODE = 0x016F;
|
||||
public const uint PACKET_SIZE = 0x58;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, EventList.PushCircleEventCondition condition)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Single)condition.radius);
|
||||
binWriter.Write((UInt32)0x44533088);
|
||||
binWriter.Write((Single)100.0f);
|
||||
binWriter.Seek(4, SeekOrigin.Current);
|
||||
binWriter.Write((Byte)(condition.outwards ? 0x11 : 0x1)); //If == 0x10, Inverted Bounding Box
|
||||
binWriter.Write((Byte)0);
|
||||
binWriter.Write((Byte)(condition.silent ? 0x1 : 0x0)); //Silent Trigger
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetPushEventConditionWithFan
|
||||
{
|
||||
public const ushort OPCODE = 0x0170;
|
||||
public const uint PACKET_SIZE = 0x60;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, EventList.PushFanEventCondition condition)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((Single)condition.radius);
|
||||
binWriter.Write((UInt32)0xbfc90fdb);
|
||||
binWriter.Write((UInt32)0x3f860a92);
|
||||
binWriter.Write((UInt32)sourceActorId); //Actor Id
|
||||
binWriter.Write((Single)10.0f);
|
||||
binWriter.Seek(4, SeekOrigin.Current);
|
||||
binWriter.Write((Byte)(condition.outwards ? 0x11 : 0x1)); //If == 0x10, Inverted Bounding Box
|
||||
binWriter.Write((Byte)0);
|
||||
binWriter.Write((Byte)(condition.silent ? 0x1 : 0x0)); //Silent Trigger
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));
|
||||
}
|
||||
}
|
||||
new SubPacket(OPCODE, sourceActorId, data).DebugPrintSubPacket();
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetPushEventConditionWithTriggerBox
|
||||
{
|
||||
public const ushort OPCODE = 0x0175;
|
||||
public const uint PACKET_SIZE = 0x60;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, EventList.PushBoxEventCondition condition)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)condition.size);
|
||||
binWriter.Write((UInt32)0x1A5);
|
||||
binWriter.Write((UInt32)4);
|
||||
binWriter.Seek(8, SeekOrigin.Current);
|
||||
binWriter.Write((Byte)(condition.outwards ? 0x11 : 0x0)); //If == 0x10, Inverted Bounding Box
|
||||
binWriter.Write((Byte)3);
|
||||
binWriter.Write((Byte)(condition.silent ? 0x1 : 0x0)); //Silent Trigger;
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
||||
{
|
||||
class SetTalkEventCondition
|
||||
{
|
||||
public const ushort OPCODE = 0x012E;
|
||||
public const uint PACKET_SIZE = 0x48;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, EventList.TalkEventCondition condition)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
condition.unknown1 = 4;
|
||||
binWriter.Write((Byte)condition.unknown1);
|
||||
binWriter.Write((Byte)(condition.isDisabled ? 0x1 : 0x0));
|
||||
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryBeginChangePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x016D;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, bool clearItemPackage = false)
|
||||
{
|
||||
byte[] data = new byte[8];
|
||||
|
||||
if (clearItemPackage)
|
||||
data[0] = 2;
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryEndChangePacket
|
||||
{
|
||||
public const ushort OPCODE = 0x016E;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId)
|
||||
{
|
||||
return new SubPacket(OPCODE, sourceActorId, new byte[8]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryItemEndPacket
|
||||
{
|
||||
|
||||
public const ushort OPCODE = 0x0149;
|
||||
public const uint PACKET_SIZE = 0x90;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset)
|
||||
{
|
||||
byte[] data;
|
||||
|
||||
using (MemoryStream mem = new MemoryStream())
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
for (int i = listOffset; i < items.Count; i++)
|
||||
{
|
||||
binWriter.Write(items[i].ToPacketBytes());
|
||||
listOffset++;
|
||||
}
|
||||
}
|
||||
|
||||
data = mem.GetBuffer();
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryItemPacket
|
||||
{
|
||||
|
||||
public const ushort OPCODE = 0x014A;
|
||||
public const uint PACKET_SIZE = 0x90;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset)
|
||||
{
|
||||
byte[] data;
|
||||
|
||||
using (MemoryStream mem = new MemoryStream())
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
for (int i = listOffset; i < items.Count; i++)
|
||||
{
|
||||
binWriter.Write(items[i].ToPacketBytes());
|
||||
listOffset++;
|
||||
}
|
||||
}
|
||||
|
||||
data = mem.GetBuffer();
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX01Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0148;
|
||||
public const uint PACKET_SIZE = 0x90;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, InventoryItem item)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write(item.ToPacketBytes());
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX08Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0149;
|
||||
public const uint PACKET_SIZE = 0x3A8;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, List<InventoryItem> items, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (items.Count - listOffset <= 8)
|
||||
max = items.Count - listOffset;
|
||||
else
|
||||
max = 8;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write(items[listOffset].ToPacketBytes());
|
||||
listOffset++;
|
||||
}
|
||||
|
||||
binWriter.Seek(0x380, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)max);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX16Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x014A;
|
||||
public const uint PACKET_SIZE = 0x720;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, List<InventoryItem> items, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (items.Count - listOffset <= 16)
|
||||
max = items.Count - listOffset;
|
||||
else
|
||||
max = 16;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write(items[listOffset].ToPacketBytes());
|
||||
listOffset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX32Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x014B;
|
||||
public const uint PACKET_SIZE = 0xE20;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (items.Count - listOffset <= 32)
|
||||
max = items.Count - listOffset;
|
||||
else
|
||||
max = 32;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write(items[listOffset].ToPacketBytes());
|
||||
listOffset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryListX64Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x014C;
|
||||
public const uint PACKET_SIZE = 0x1C20;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (items.Count - listOffset <= 64)
|
||||
max = items.Count - listOffset;
|
||||
else
|
||||
max = 64;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write(items[listOffset].ToPacketBytes());
|
||||
listOffset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX01Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0152;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
public static SubPacket BuildPacket(uint playerActorID, ushort slot)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)slot);
|
||||
}
|
||||
}
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using Meteor.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX08Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0153;
|
||||
public const uint PACKET_SIZE = 0x38;
|
||||
public static SubPacket BuildPacket(uint playerActorID, List<ushort> slots, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (slots.Count - listOffset <= 8)
|
||||
max = slots.Count - listOffset;
|
||||
else
|
||||
max = 8;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt16)slots[listOffset]);
|
||||
listOffset++;
|
||||
}
|
||||
|
||||
binWriter.Seek(0x10, SeekOrigin.Begin);
|
||||
binWriter.Write((Byte)max);
|
||||
}
|
||||
}
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX16Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x154;
|
||||
public const uint PACKET_SIZE = 0x40;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, List<ushort> slots, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (slots.Count - listOffset <= 16)
|
||||
max = slots.Count - listOffset;
|
||||
else
|
||||
max = 16;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt16)slots[listOffset]);
|
||||
listOffset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
===========================================================================
|
||||
Copyright (C) 2015-2019 Project Meteor Dev Team
|
||||
|
||||
This file is part of Project Meteor Server.
|
||||
|
||||
Project Meteor Server is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
Project Meteor Server is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
||||
===========================================================================
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventoryRemoveX32Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x0155;
|
||||
public const uint PACKET_SIZE = 0x60;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, List<ushort> slots, ref int listOffset)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
int max;
|
||||
if (slots.Count - listOffset <= 32)
|
||||
max = slots.Count - listOffset;
|
||||
else
|
||||
max = 32;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt16)slots[listOffset]);
|
||||
listOffset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue