From c9e2128873c54536f333336d5972ace44761413e Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Tue, 27 Apr 2021 11:38:42 +0000 Subject: [PATCH] Proper limit shop packet structure. --- .../dist/game/data/LCoinShopSpecialCraft.xml | 2 +- .../ExPurchaseLimitShopItemListNew.java | 32 +++++++---------- .../dist/game/data/LCoinShopSpecialCraft.xml | 2 +- .../ExPurchaseLimitShopItemListNew.java | 36 ++++++++----------- 4 files changed, 30 insertions(+), 42 deletions(-) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/LCoinShopSpecialCraft.xml b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/LCoinShopSpecialCraft.xml index 23a418c9fc..b79eb74c15 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/LCoinShopSpecialCraft.xml +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/dist/game/data/LCoinShopSpecialCraft.xml @@ -7,7 +7,7 @@ - + diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/limitshop/ExPurchaseLimitShopItemListNew.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/limitshop/ExPurchaseLimitShopItemListNew.java index 869c89283d..05b9d2e39b 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/limitshop/ExPurchaseLimitShopItemListNew.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/limitshop/ExPurchaseLimitShopItemListNew.java @@ -35,21 +35,14 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket { private final int _shopType; // 3 = Lcoin Shop - 4 = Special Craft private final PlayerInstance _player; - private Collection _products; + private final Collection _products; public ExPurchaseLimitShopItemListNew(int shopType, PlayerInstance player) { _shopType = shopType; _player = player; - _products = null; - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_PURCHASE_LIMIT_SHOP_ITEM_LIST_NEW.writeId(packet); - switch (_shopType) + switch (shopType) // 3 = Lcoin Shop - 4 = Special Craft { case 3: // Normal Lcoin Shop { @@ -66,10 +59,15 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket _products = LCoinShopData.getInstance().getProducts(); } } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_PURCHASE_LIMIT_SHOP_ITEM_LIST_NEW.writeId(packet); packet.writeC(_shopType); // packet.writeD(_products.size()); - for (LCoinShopProductHolder product : _products) { packet.writeD(product.getId()); @@ -81,13 +79,9 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket packet.writeQ(product.getIngredientQuantities()[1]); packet.writeQ(product.getIngredientQuantities()[2]); - packet.writeH(0x00); // ? - - packet.writeC(-1); // remaining amount? - packet.writeC(-1); // remaining time? - - packet.writeC(-1); // ? - packet.writeC(-1); // ? + packet.writeH(0x00); // sCostItemEnchant 1 + packet.writeH(0x00); // sCostItemEnchant 2 + packet.writeH(0x00); // sCostItemEnchant 3 // Check limits. if (product.getAccountDailyLimit() > 0) // Sale period. @@ -124,8 +118,8 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket { packet.writeD(0x01); } - packet.writeD(0x00); - packet.writeD(0x00); + packet.writeD(0x00); // nRemainSec + packet.writeD(0x00); // nRemainServerItemAmount } return true; diff --git a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/LCoinShopSpecialCraft.xml b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/LCoinShopSpecialCraft.xml index 23a418c9fc..b79eb74c15 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/LCoinShopSpecialCraft.xml +++ b/L2J_Mobius_Essence_5.0_Sylph/dist/game/data/LCoinShopSpecialCraft.xml @@ -7,7 +7,7 @@ - + diff --git a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/limitshop/ExPurchaseLimitShopItemListNew.java b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/limitshop/ExPurchaseLimitShopItemListNew.java index 528a9aac60..00b9bded19 100644 --- a/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/limitshop/ExPurchaseLimitShopItemListNew.java +++ b/L2J_Mobius_Essence_5.0_Sylph/java/org/l2jmobius/gameserver/network/serverpackets/limitshop/ExPurchaseLimitShopItemListNew.java @@ -35,21 +35,14 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket { private final int _shopType; // 3 = Lcoin Shop - 4 = Special Craft private final PlayerInstance _player; - private Collection _products; + private final Collection _products; public ExPurchaseLimitShopItemListNew(int shopType, PlayerInstance player) { _shopType = shopType; _player = player; - _products = null; - } - - @Override - public boolean write(PacketWriter packet) - { - OutgoingPackets.EX_PURCHASE_LIMIT_SHOP_ITEM_LIST_NEW.writeId(packet); - switch (_shopType) + switch (shopType) // 3 = Lcoin Shop - 4 = Special Craft { case 3: // Normal Lcoin Shop { @@ -66,10 +59,15 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket _products = LCoinShopData.getInstance().getProducts(); } } + } + + @Override + public boolean write(PacketWriter packet) + { + OutgoingPackets.EX_PURCHASE_LIMIT_SHOP_ITEM_LIST_NEW.writeId(packet); packet.writeC(_shopType); // packet.writeD(_products.size()); - for (LCoinShopProductHolder product : _products) { packet.writeD(product.getId()); @@ -85,15 +83,11 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket packet.writeQ(product.getIngredientQuantities()[3]); // 306 packet.writeQ(product.getIngredientQuantities()[4]); // 306 - packet.writeH(0x00); // ? - packet.writeH(0x00); // ? 306 - packet.writeH(0x00); // ? 306 - - packet.writeC(-1); // remaining amount? - packet.writeC(-1); // remaining time? - - packet.writeC(-1); // ? - packet.writeC(-1); // ? + packet.writeH(0x00); // sCostItemEnchant 1 + packet.writeH(0x00); // sCostItemEnchant 2 + packet.writeH(0x00); // sCostItemEnchant 3 + packet.writeH(0x00); // sCostItemEnchant 4 (306) + packet.writeH(0x00); // sCostItemEnchant 5 (306) // Check limits. if (product.getAccountDailyLimit() > 0) // Sale period. @@ -130,8 +124,8 @@ public class ExPurchaseLimitShopItemListNew implements IClientOutgoingPacket { packet.writeD(0x01); } - packet.writeD(0x00); - packet.writeD(0x00); + packet.writeD(0x00); // nRemainSec + packet.writeD(0x00); // nRemainServerItemAmount } return true;