mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-20 19:57:46 +00:00
Added first set of item search packets.
This commit is contained in:
parent
4e39b082f1
commit
b5054debea
4 changed files with 98 additions and 0 deletions
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.packets.send.search
|
||||||
|
{
|
||||||
|
class ItemSearchResult
|
||||||
|
{
|
||||||
|
|
||||||
|
public uint itemId;
|
||||||
|
public uint numItems;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
using FFXIVClassic.Common;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.packets.send.social
|
||||||
|
{
|
||||||
|
class ItemSearchResultsBeginPacket
|
||||||
|
{
|
||||||
|
public const ushort OPCODE = 0x01D7;
|
||||||
|
public const uint PACKET_SIZE = 0x028;
|
||||||
|
|
||||||
|
public static SubPacket BuildPacket(uint sourceActorId, bool isSuccess, string nameToAdd)
|
||||||
|
{
|
||||||
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
using System;
|
||||||
|
using FFXIVClassic.Common;
|
||||||
|
using FFXIVClassic_Map_Server.packets.send.search;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.packets.send.social
|
||||||
|
{
|
||||||
|
class ItemSearchResultsBodyPacket
|
||||||
|
{
|
||||||
|
public const ushort OPCODE = 0x01D8;
|
||||||
|
public const uint PACKET_SIZE = 0x228;
|
||||||
|
|
||||||
|
public static SubPacket BuildPacket(uint sourceActorId, List<ItemSearchResult> itemSearchResult, ref int listOffset)
|
||||||
|
{
|
||||||
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
|
int max;
|
||||||
|
if (itemSearchResult.Count - listOffset <= 64)
|
||||||
|
max = itemSearchResult.Count - listOffset;
|
||||||
|
else
|
||||||
|
max = 64;
|
||||||
|
|
||||||
|
using (MemoryStream mem = new MemoryStream(data))
|
||||||
|
{
|
||||||
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||||
|
{
|
||||||
|
binWriter.Write((UInt32)max);
|
||||||
|
|
||||||
|
foreach (ItemSearchResult item in itemSearchResult)
|
||||||
|
binWriter.Write((UInt32)item.itemId);
|
||||||
|
|
||||||
|
binWriter.Seek(0x104, SeekOrigin.Begin);
|
||||||
|
|
||||||
|
foreach (ItemSearchResult item in itemSearchResult)
|
||||||
|
binWriter.Write((UInt32)item.numItems);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
using System.IO;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
using FFXIVClassic.Common;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.packets.send.social
|
||||||
|
{
|
||||||
|
class ItemSearchResultsEndPacket
|
||||||
|
{
|
||||||
|
public const ushort OPCODE = 0x01D9;
|
||||||
|
public const uint PACKET_SIZE = 0x028;
|
||||||
|
|
||||||
|
public static SubPacket BuildPacket(uint sourceActorId, bool isSuccess, string nameToAdd)
|
||||||
|
{
|
||||||
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue