From 886453b46d2f38715be04b87b3b23ecff349b76e Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Sun, 15 Sep 2019 16:49:06 +0000 Subject: [PATCH] Fixed GMViewWarehouseWithdrawList clientpacket. --- .../clientpackets/RequestGMCommand.java | 6 ++-- .../GMViewWarehouseWithdrawList.java | 29 ++++++++++++++----- .../clientpackets/RequestGMCommand.java | 6 ++-- .../GMViewWarehouseWithdrawList.java | 29 ++++++++++++++----- .../clientpackets/RequestGMCommand.java | 6 ++-- .../GMViewWarehouseWithdrawList.java | 29 ++++++++++++++----- .../clientpackets/RequestGMCommand.java | 6 ++-- .../GMViewWarehouseWithdrawList.java | 29 ++++++++++++++----- .../clientpackets/RequestGMCommand.java | 6 ++-- .../GMViewWarehouseWithdrawList.java | 29 ++++++++++++++----- .../clientpackets/RequestGMCommand.java | 6 ++-- .../GMViewWarehouseWithdrawList.java | 29 ++++++++++++++----- .../clientpackets/RequestGMCommand.java | 6 ++-- .../GMViewWarehouseWithdrawList.java | 29 ++++++++++++++----- 14 files changed, 175 insertions(+), 70 deletions(-) diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java index 2ca14dc1f4..5fb2e060ff 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java @@ -103,12 +103,14 @@ public class RequestGMCommand implements IClientIncomingPacket // gm warehouse view to be implemented if (player != null) { - client.sendPacket(new GMViewWarehouseWithdrawList(player)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, player)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, player)); // clan warehouse } else { - client.sendPacket(new GMViewWarehouseWithdrawList(clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, clan)); } break; } diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java index 4d921426b0..5db311d672 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java @@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class GMViewWarehouseWithdrawList extends AbstractItemPacket { + private final int _sendType; private final Collection _items; private final String _playerName; private final long _money; - public GMViewWarehouseWithdrawList(PlayerInstance player) + public GMViewWarehouseWithdrawList(int sendType, PlayerInstance player) { + _sendType = sendType; _items = player.getWarehouse().getItems(); _playerName = player.getName(); _money = player.getWarehouse().getAdena(); } - public GMViewWarehouseWithdrawList(Clan clan) + public GMViewWarehouseWithdrawList(int sendType, Clan clan) { + _sendType = sendType; _playerName = clan.getLeaderName(); _items = clan.getWarehouse().getItems(); _money = clan.getWarehouse().getAdena(); @@ -48,13 +51,23 @@ public class GMViewWarehouseWithdrawList extends AbstractItemPacket public boolean write(PacketWriter packet) { OutgoingPackets.GM_VIEW_WAREHOUSE_WITHDRAW_LIST.writeId(packet); - packet.writeS(_playerName); - packet.writeQ(_money); - packet.writeH(_items.size()); - for (ItemInstance item : _items) + + packet.writeC(_sendType); + if (_sendType == 2) { - writeItem(packet, item); - packet.writeD(item.getObjectId()); + packet.writeD(_items.size()); + packet.writeD(_items.size()); + for (ItemInstance item : _items) + { + writeItem(packet, item); + packet.writeD(item.getObjectId()); + } + } + else + { + packet.writeS(_playerName); + packet.writeQ(_money); + packet.writeD(_items.size()); } return true; } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java index 2ca14dc1f4..5fb2e060ff 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java @@ -103,12 +103,14 @@ public class RequestGMCommand implements IClientIncomingPacket // gm warehouse view to be implemented if (player != null) { - client.sendPacket(new GMViewWarehouseWithdrawList(player)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, player)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, player)); // clan warehouse } else { - client.sendPacket(new GMViewWarehouseWithdrawList(clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, clan)); } break; } diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java index 4d921426b0..5db311d672 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java @@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class GMViewWarehouseWithdrawList extends AbstractItemPacket { + private final int _sendType; private final Collection _items; private final String _playerName; private final long _money; - public GMViewWarehouseWithdrawList(PlayerInstance player) + public GMViewWarehouseWithdrawList(int sendType, PlayerInstance player) { + _sendType = sendType; _items = player.getWarehouse().getItems(); _playerName = player.getName(); _money = player.getWarehouse().getAdena(); } - public GMViewWarehouseWithdrawList(Clan clan) + public GMViewWarehouseWithdrawList(int sendType, Clan clan) { + _sendType = sendType; _playerName = clan.getLeaderName(); _items = clan.getWarehouse().getItems(); _money = clan.getWarehouse().getAdena(); @@ -48,13 +51,23 @@ public class GMViewWarehouseWithdrawList extends AbstractItemPacket public boolean write(PacketWriter packet) { OutgoingPackets.GM_VIEW_WAREHOUSE_WITHDRAW_LIST.writeId(packet); - packet.writeS(_playerName); - packet.writeQ(_money); - packet.writeH(_items.size()); - for (ItemInstance item : _items) + + packet.writeC(_sendType); + if (_sendType == 2) { - writeItem(packet, item); - packet.writeD(item.getObjectId()); + packet.writeD(_items.size()); + packet.writeD(_items.size()); + for (ItemInstance item : _items) + { + writeItem(packet, item); + packet.writeD(item.getObjectId()); + } + } + else + { + packet.writeS(_playerName); + packet.writeQ(_money); + packet.writeD(_items.size()); } return true; } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java index 2ca14dc1f4..5fb2e060ff 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java @@ -103,12 +103,14 @@ public class RequestGMCommand implements IClientIncomingPacket // gm warehouse view to be implemented if (player != null) { - client.sendPacket(new GMViewWarehouseWithdrawList(player)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, player)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, player)); // clan warehouse } else { - client.sendPacket(new GMViewWarehouseWithdrawList(clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, clan)); } break; } diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java index 4d921426b0..5db311d672 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java @@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class GMViewWarehouseWithdrawList extends AbstractItemPacket { + private final int _sendType; private final Collection _items; private final String _playerName; private final long _money; - public GMViewWarehouseWithdrawList(PlayerInstance player) + public GMViewWarehouseWithdrawList(int sendType, PlayerInstance player) { + _sendType = sendType; _items = player.getWarehouse().getItems(); _playerName = player.getName(); _money = player.getWarehouse().getAdena(); } - public GMViewWarehouseWithdrawList(Clan clan) + public GMViewWarehouseWithdrawList(int sendType, Clan clan) { + _sendType = sendType; _playerName = clan.getLeaderName(); _items = clan.getWarehouse().getItems(); _money = clan.getWarehouse().getAdena(); @@ -48,13 +51,23 @@ public class GMViewWarehouseWithdrawList extends AbstractItemPacket public boolean write(PacketWriter packet) { OutgoingPackets.GM_VIEW_WAREHOUSE_WITHDRAW_LIST.writeId(packet); - packet.writeS(_playerName); - packet.writeQ(_money); - packet.writeH(_items.size()); - for (ItemInstance item : _items) + + packet.writeC(_sendType); + if (_sendType == 2) { - writeItem(packet, item); - packet.writeD(item.getObjectId()); + packet.writeD(_items.size()); + packet.writeD(_items.size()); + for (ItemInstance item : _items) + { + writeItem(packet, item); + packet.writeD(item.getObjectId()); + } + } + else + { + packet.writeS(_playerName); + packet.writeQ(_money); + packet.writeD(_items.size()); } return true; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java index 2ca14dc1f4..5fb2e060ff 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java @@ -103,12 +103,14 @@ public class RequestGMCommand implements IClientIncomingPacket // gm warehouse view to be implemented if (player != null) { - client.sendPacket(new GMViewWarehouseWithdrawList(player)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, player)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, player)); // clan warehouse } else { - client.sendPacket(new GMViewWarehouseWithdrawList(clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, clan)); } break; } diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java index 4d921426b0..5db311d672 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java @@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class GMViewWarehouseWithdrawList extends AbstractItemPacket { + private final int _sendType; private final Collection _items; private final String _playerName; private final long _money; - public GMViewWarehouseWithdrawList(PlayerInstance player) + public GMViewWarehouseWithdrawList(int sendType, PlayerInstance player) { + _sendType = sendType; _items = player.getWarehouse().getItems(); _playerName = player.getName(); _money = player.getWarehouse().getAdena(); } - public GMViewWarehouseWithdrawList(Clan clan) + public GMViewWarehouseWithdrawList(int sendType, Clan clan) { + _sendType = sendType; _playerName = clan.getLeaderName(); _items = clan.getWarehouse().getItems(); _money = clan.getWarehouse().getAdena(); @@ -48,13 +51,23 @@ public class GMViewWarehouseWithdrawList extends AbstractItemPacket public boolean write(PacketWriter packet) { OutgoingPackets.GM_VIEW_WAREHOUSE_WITHDRAW_LIST.writeId(packet); - packet.writeS(_playerName); - packet.writeQ(_money); - packet.writeH(_items.size()); - for (ItemInstance item : _items) + + packet.writeC(_sendType); + if (_sendType == 2) { - writeItem(packet, item); - packet.writeD(item.getObjectId()); + packet.writeD(_items.size()); + packet.writeD(_items.size()); + for (ItemInstance item : _items) + { + writeItem(packet, item); + packet.writeD(item.getObjectId()); + } + } + else + { + packet.writeS(_playerName); + packet.writeQ(_money); + packet.writeD(_items.size()); } return true; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java index 2ca14dc1f4..5fb2e060ff 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java @@ -103,12 +103,14 @@ public class RequestGMCommand implements IClientIncomingPacket // gm warehouse view to be implemented if (player != null) { - client.sendPacket(new GMViewWarehouseWithdrawList(player)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, player)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, player)); // clan warehouse } else { - client.sendPacket(new GMViewWarehouseWithdrawList(clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, clan)); } break; } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java index 4d921426b0..5db311d672 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java @@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class GMViewWarehouseWithdrawList extends AbstractItemPacket { + private final int _sendType; private final Collection _items; private final String _playerName; private final long _money; - public GMViewWarehouseWithdrawList(PlayerInstance player) + public GMViewWarehouseWithdrawList(int sendType, PlayerInstance player) { + _sendType = sendType; _items = player.getWarehouse().getItems(); _playerName = player.getName(); _money = player.getWarehouse().getAdena(); } - public GMViewWarehouseWithdrawList(Clan clan) + public GMViewWarehouseWithdrawList(int sendType, Clan clan) { + _sendType = sendType; _playerName = clan.getLeaderName(); _items = clan.getWarehouse().getItems(); _money = clan.getWarehouse().getAdena(); @@ -48,13 +51,23 @@ public class GMViewWarehouseWithdrawList extends AbstractItemPacket public boolean write(PacketWriter packet) { OutgoingPackets.GM_VIEW_WAREHOUSE_WITHDRAW_LIST.writeId(packet); - packet.writeS(_playerName); - packet.writeQ(_money); - packet.writeH(_items.size()); - for (ItemInstance item : _items) + + packet.writeC(_sendType); + if (_sendType == 2) { - writeItem(packet, item); - packet.writeD(item.getObjectId()); + packet.writeD(_items.size()); + packet.writeD(_items.size()); + for (ItemInstance item : _items) + { + writeItem(packet, item); + packet.writeD(item.getObjectId()); + } + } + else + { + packet.writeS(_playerName); + packet.writeQ(_money); + packet.writeD(_items.size()); } return true; } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java index 2ca14dc1f4..5fb2e060ff 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java @@ -103,12 +103,14 @@ public class RequestGMCommand implements IClientIncomingPacket // gm warehouse view to be implemented if (player != null) { - client.sendPacket(new GMViewWarehouseWithdrawList(player)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, player)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, player)); // clan warehouse } else { - client.sendPacket(new GMViewWarehouseWithdrawList(clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, clan)); } break; } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java index 4d921426b0..5db311d672 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java @@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class GMViewWarehouseWithdrawList extends AbstractItemPacket { + private final int _sendType; private final Collection _items; private final String _playerName; private final long _money; - public GMViewWarehouseWithdrawList(PlayerInstance player) + public GMViewWarehouseWithdrawList(int sendType, PlayerInstance player) { + _sendType = sendType; _items = player.getWarehouse().getItems(); _playerName = player.getName(); _money = player.getWarehouse().getAdena(); } - public GMViewWarehouseWithdrawList(Clan clan) + public GMViewWarehouseWithdrawList(int sendType, Clan clan) { + _sendType = sendType; _playerName = clan.getLeaderName(); _items = clan.getWarehouse().getItems(); _money = clan.getWarehouse().getAdena(); @@ -48,13 +51,23 @@ public class GMViewWarehouseWithdrawList extends AbstractItemPacket public boolean write(PacketWriter packet) { OutgoingPackets.GM_VIEW_WAREHOUSE_WITHDRAW_LIST.writeId(packet); - packet.writeS(_playerName); - packet.writeQ(_money); - packet.writeH(_items.size()); - for (ItemInstance item : _items) + + packet.writeC(_sendType); + if (_sendType == 2) { - writeItem(packet, item); - packet.writeD(item.getObjectId()); + packet.writeD(_items.size()); + packet.writeD(_items.size()); + for (ItemInstance item : _items) + { + writeItem(packet, item); + packet.writeD(item.getObjectId()); + } + } + else + { + packet.writeS(_playerName); + packet.writeQ(_money); + packet.writeD(_items.size()); } return true; } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java index 2ca14dc1f4..5fb2e060ff 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/RequestGMCommand.java @@ -103,12 +103,14 @@ public class RequestGMCommand implements IClientIncomingPacket // gm warehouse view to be implemented if (player != null) { - client.sendPacket(new GMViewWarehouseWithdrawList(player)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, player)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, player)); // clan warehouse } else { - client.sendPacket(new GMViewWarehouseWithdrawList(clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(1, clan)); + client.sendPacket(new GMViewWarehouseWithdrawList(2, clan)); } break; } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java index 4d921426b0..5db311d672 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/GMViewWarehouseWithdrawList.java @@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class GMViewWarehouseWithdrawList extends AbstractItemPacket { + private final int _sendType; private final Collection _items; private final String _playerName; private final long _money; - public GMViewWarehouseWithdrawList(PlayerInstance player) + public GMViewWarehouseWithdrawList(int sendType, PlayerInstance player) { + _sendType = sendType; _items = player.getWarehouse().getItems(); _playerName = player.getName(); _money = player.getWarehouse().getAdena(); } - public GMViewWarehouseWithdrawList(Clan clan) + public GMViewWarehouseWithdrawList(int sendType, Clan clan) { + _sendType = sendType; _playerName = clan.getLeaderName(); _items = clan.getWarehouse().getItems(); _money = clan.getWarehouse().getAdena(); @@ -48,13 +51,23 @@ public class GMViewWarehouseWithdrawList extends AbstractItemPacket public boolean write(PacketWriter packet) { OutgoingPackets.GM_VIEW_WAREHOUSE_WITHDRAW_LIST.writeId(packet); - packet.writeS(_playerName); - packet.writeQ(_money); - packet.writeH(_items.size()); - for (ItemInstance item : _items) + + packet.writeC(_sendType); + if (_sendType == 2) { - writeItem(packet, item); - packet.writeD(item.getObjectId()); + packet.writeD(_items.size()); + packet.writeD(_items.size()); + for (ItemInstance item : _items) + { + writeItem(packet, item); + packet.writeD(item.getObjectId()); + } + } + else + { + packet.writeS(_playerName); + packet.writeQ(_money); + packet.writeD(_items.size()); } return true; }