Fixed GMViewWarehouseWithdrawList clientpacket.

This commit is contained in:
MobiusDevelopment 2019-09-15 16:49:06 +00:00
parent 234e9a6a8f
commit 886453b46d
14 changed files with 175 additions and 70 deletions

View File

@ -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;
}

View File

@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class GMViewWarehouseWithdrawList extends AbstractItemPacket
{
private final int _sendType;
private final Collection<ItemInstance> _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;
}

View File

@ -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;
}

View File

@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class GMViewWarehouseWithdrawList extends AbstractItemPacket
{
private final int _sendType;
private final Collection<ItemInstance> _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;
}

View File

@ -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;
}

View File

@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class GMViewWarehouseWithdrawList extends AbstractItemPacket
{
private final int _sendType;
private final Collection<ItemInstance> _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;
}

View File

@ -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;
}

View File

@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class GMViewWarehouseWithdrawList extends AbstractItemPacket
{
private final int _sendType;
private final Collection<ItemInstance> _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;
}

View File

@ -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;
}

View File

@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class GMViewWarehouseWithdrawList extends AbstractItemPacket
{
private final int _sendType;
private final Collection<ItemInstance> _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;
}

View File

@ -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;
}

View File

@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class GMViewWarehouseWithdrawList extends AbstractItemPacket
{
private final int _sendType;
private final Collection<ItemInstance> _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;
}

View File

@ -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;
}

View File

@ -26,19 +26,22 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class GMViewWarehouseWithdrawList extends AbstractItemPacket
{
private final int _sendType;
private final Collection<ItemInstance> _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;
}