mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-05-20 08:26:59 -04: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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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 InventoryRemoveX64Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x156;
|
||||
public const uint PACKET_SIZE = 0xA0;
|
||||
|
||||
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 <= 64)
|
||||
max = slots.Count - listOffset;
|
||||
else
|
||||
max = 64;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt16)slots[listOffset]);
|
||||
listOffset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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 Meteor.Common;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class InventorySetBeginPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0146;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint sourceActorId, ushort size, ushort code)
|
||||
{
|
||||
byte[] data = new byte[8];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt32)sourceActorId);
|
||||
binWriter.Write((UInt16)size);
|
||||
binWriter.Write((UInt16)code);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, sourceActorId, 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 InventorySetEndPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0147;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorId)
|
||||
{
|
||||
return new SubPacket(OPCODE, playerActorId, new byte[8]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -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 Meteor.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
||||
{
|
||||
class LinkedItemListX01Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x014D;
|
||||
public const uint PACKET_SIZE = 0x28;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorID, ushort position, InventoryItem linkedItem)
|
||||
{
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(data))
|
||||
{
|
||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||
{
|
||||
binWriter.Write((UInt16)position);
|
||||
binWriter.Write((UInt16)linkedItem.slot);
|
||||
binWriter.Write((UInt16)linkedItem.itemPackage);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorID, data);
|
||||
}
|
||||
}
|
||||
}
|
@@ -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 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 LinkedItemListX08Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x14E;
|
||||
public const uint PACKET_SIZE = 0x58;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] linkedItemList, List<ushort> slotsToUpdate, 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 (slotsToUpdate.Count - listOffset <= 8)
|
||||
max = slotsToUpdate.Count - listOffset;
|
||||
else
|
||||
max = 8;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt16)slotsToUpdate[i]); //LinkedItemPackageSlot
|
||||
binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].slot); //ItemPackage Slot
|
||||
binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].itemPackage); //ItemPackage Code
|
||||
listOffset++;
|
||||
}
|
||||
|
||||
binWriter.Seek(0x30, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)max);
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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 LinkedItemListX16Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x14F;
|
||||
public const uint PACKET_SIZE = 0x80;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] linkedItemList, List<ushort> slotsToUpdate, 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 (slotsToUpdate.Count - listOffset <= 16)
|
||||
max = slotsToUpdate.Count - listOffset;
|
||||
else
|
||||
max = 16;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt16)slotsToUpdate[i]); //LinkedItemPackageSlot
|
||||
binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].slot); //ItemPackage Slot
|
||||
binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].itemPackage); //ItemPackage Code
|
||||
listOffset++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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 LinkedItemListX32Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x150;
|
||||
public const uint PACKET_SIZE = 0xE0;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] linkedItemList, List<ushort> slotsToUpdate, 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 (slotsToUpdate.Count - listOffset <= 32)
|
||||
max = slotsToUpdate.Count - listOffset;
|
||||
else
|
||||
max = 32;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt16)slotsToUpdate[i]); //LinkedItemPackageSlot
|
||||
binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].slot); //ItemPackage Slot
|
||||
binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].itemPackage); //ItemPackage Code
|
||||
listOffset++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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 LinkedItemListX64Packet
|
||||
{
|
||||
public const ushort OPCODE = 0x151;
|
||||
public const uint PACKET_SIZE = 0x194;
|
||||
|
||||
public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] linkedItemList, List<ushort> slotsToUpdate, 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 (slotsToUpdate.Count - listOffset <= 64)
|
||||
max = slotsToUpdate.Count - listOffset;
|
||||
else
|
||||
max = 64;
|
||||
|
||||
for (int i = 0; i < max; i++)
|
||||
{
|
||||
binWriter.Write((UInt16)slotsToUpdate[i]); //LinkedItemPackageSlot
|
||||
binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].slot); //ItemPackage Slot
|
||||
binWriter.Write((UInt16)linkedItemList[slotsToUpdate[i]].itemPackage); //ItemPackage Code
|
||||
listOffset++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return new SubPacket(OPCODE, playerActorId, data);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
===========================================================================
|
||||
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_Lobby_Server.packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory
|
||||
{
|
||||
class SetInitialEquipmentPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x014E;
|
||||
public const uint PACKET_SIZE = 0x58;
|
||||
|
||||
public const uint UNEQUIPPED = 0xFFFFFFFF;
|
||||
|
||||
public const int SLOT_MAINHAND = 0x00;
|
||||
public const int SLOT_OFFHAND = 0x01;
|
||||
public const int SLOT_THROWINGWEAPON = 0x04;
|
||||
public const int SLOT_PACK = 0x05;
|
||||
public const int SLOT_POUCH = 0x06;
|
||||
public const int SLOT_HEAD = 0x08;
|
||||
public const int SLOT_UNDERSHIRT = 0x09;
|
||||
public const int SLOT_BODY = 0x0A;
|
||||
public const int SLOT_UNDERGARMENT = 0x0B;
|
||||
public const int SLOT_LEGS = 0x0C;
|
||||
public const int SLOT_HANDS = 0x0D;
|
||||
public const int SLOT_BOOTS = 0x0E;
|
||||
public const int SLOT_WAIST = 0x0F;
|
||||
public const int SLOT_NECK = 0x10;
|
||||
public const int SLOT_EARS = 0x11;
|
||||
public const int SLOT_WRISTS = 0x13;
|
||||
public const int SLOT_RIGHTFINGER = 0x15;
|
||||
public const int SLOT_LEFTFINGER = 0x16;
|
||||
|
||||
private uint[] equipment = new uint[0x17];
|
||||
|
||||
public SetInitialEquipmentPacket()
|
||||
{
|
||||
for (int i = 0; i < equipment.Length; i++)
|
||||
equipment[i] = UNEQUIPPED; //We will use this as "Unequipped"
|
||||
}
|
||||
|
||||
public void SetItem(int slot, uint itemSlot)
|
||||
{
|
||||
if (slot >= equipment.Length)
|
||||
return;
|
||||
|
||||
equipment[slot] = itemSlot;
|
||||
}
|
||||
|
||||
public List<SubPacket> BuildPackets(uint playerActorID)
|
||||
{
|
||||
List<SubPacket> packets = new List<SubPacket>();
|
||||
int packetCount = 0;
|
||||
int runningCount = 0;
|
||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||
MemoryStream mem = new MemoryStream(data);
|
||||
BinaryWriter binWriter = new BinaryWriter(mem);
|
||||
|
||||
for (int i = 0; i < equipment.Length; i++)
|
||||
{
|
||||
if (equipment[i] == UNEQUIPPED)
|
||||
continue;
|
||||
|
||||
binWriter.Write((UInt16)i);
|
||||
binWriter.Write((UInt32)equipment[i]);
|
||||
|
||||
packetCount++;
|
||||
runningCount++;
|
||||
|
||||
//Create another packet
|
||||
if (runningCount >= 8)
|
||||
{
|
||||
packetCount = 0;
|
||||
binWriter.Write((UInt32)8);
|
||||
binWriter.Dispose();
|
||||
mem.Dispose();
|
||||
packets.Add(new SubPacket(OPCODE, playerActorID, playerActorID, data));
|
||||
data = new byte[PACKET_SIZE - 0x20];
|
||||
mem = new MemoryStream(data);
|
||||
binWriter = new BinaryWriter(mem);
|
||||
}
|
||||
}
|
||||
|
||||
//Create any leftover subpacket
|
||||
binWriter.BaseStream.Seek(0x30, SeekOrigin.Begin);
|
||||
binWriter.Write((UInt32)packetCount);
|
||||
binWriter.Dispose();
|
||||
mem.Dispose();
|
||||
packets.Add(new SubPacket(OPCODE, playerActorID, playerActorID, data));
|
||||
|
||||
return packets;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user