Moved SendItemPackage to character class. Added a flag check after a bazaar purchase is made. Discovered a flag in InventoryBeginChangePacket that either modifies the client package or clears and refills it. Implemented this mode for a bunch of "SendFullInventory" methods.

This commit is contained in:
Filip Maj
2017-12-10 15:13:33 -05:00
parent f5ea82f735
commit 08c5980b22
6 changed files with 24 additions and 25 deletions

View File

@@ -552,7 +552,7 @@ namespace FFXIVClassic_Map_Server.Actors
//GetSpawnPackets(actorId, spawnType).DebugPrintPacket();
#region Inventory & Equipment
QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId));
QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true));
itemPackages[Inventory.NORMAL].SendFullInventory(this);
itemPackages[Inventory.CURRENCY_CRYSTALS].SendFullInventory(this);
itemPackages[Inventory.KEYITEMS].SendFullInventory(this);
@@ -1630,7 +1630,9 @@ namespace FFXIVClassic_Map_Server.Actors
public void SendMyTradeToPlayer(Player player)
{
Inventory tradeInventory = new Inventory(this, 4, Inventory.TRADE);
player.QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId, true));
tradeInventory.SendFullInventory(player);
player.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId));
}
public void SendDataPacket(params object[] parameters)
@@ -1817,16 +1819,6 @@ namespace FFXIVClassic_Map_Server.Actors
chocoboAppearance = appearanceId;
}
public void SendItemPackage(Player player, uint id)
{
if (!itemPackages.ContainsKey((ushort)id))
return;
player.QueuePacket(InventoryBeginChangePacket.BuildPacket(actorId));
itemPackages[(ushort)id].SendFullInventory(player);
player.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId));
}
public Retainer SpawnMyRetainer(Npc bell, int retainerIndex)
{
Retainer retainer = Database.LoadRetainer(this, retainerIndex);