Fixed freight related packets.

This commit is contained in:
MobiusDev 2018-08-29 08:58:41 +00:00
parent 3d28468f73
commit dfce3605ac
3 changed files with 23 additions and 12 deletions

View File

@ -60,6 +60,7 @@ public class Freight implements IBypassHandler
} }
} }
activeChar.sendPacket(new WareHouseWithdrawalList(1, activeChar, WareHouseWithdrawalList.FREIGHT)); activeChar.sendPacket(new WareHouseWithdrawalList(1, activeChar, WareHouseWithdrawalList.FREIGHT));
activeChar.sendPacket(new WareHouseWithdrawalList(2, activeChar, WareHouseWithdrawalList.FREIGHT));
} }
else else
{ {

View File

@ -22,8 +22,7 @@ import com.l2jmobius.gameserver.network.L2GameClient;
import com.l2jmobius.gameserver.network.serverpackets.PackageSendableList; import com.l2jmobius.gameserver.network.serverpackets.PackageSendableList;
/** /**
* @author -Wooden- * @author Mobius
* @author UnAfraid Thanks mrTJO
*/ */
public class RequestPackageSendableItemList implements IClientIncomingPacket public class RequestPackageSendableItemList implements IClientIncomingPacket
{ {
@ -44,6 +43,7 @@ public class RequestPackageSendableItemList implements IClientIncomingPacket
{ {
return; return;
} }
client.sendPacket(new PackageSendableList(activeChar, _objectId)); client.sendPacket(new PackageSendableList(1, activeChar, _objectId));
client.sendPacket(new PackageSendableList(2, activeChar, _objectId));
} }
} }

View File

@ -24,17 +24,18 @@ import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
import com.l2jmobius.gameserver.network.OutgoingPackets; import com.l2jmobius.gameserver.network.OutgoingPackets;
/** /**
* @author -Wooden- * @author Mobius
* @author UnAfraid, mrTJO
*/ */
public class PackageSendableList extends AbstractItemPacket public class PackageSendableList extends AbstractItemPacket
{ {
private final Collection<L2ItemInstance> _items; private final Collection<L2ItemInstance> _items;
private final int _objectId; private final int _objectId;
private final long _adena; private final long _adena;
private final int _sendType;
public PackageSendableList(L2PcInstance player, int objectId) public PackageSendableList(int sendType, L2PcInstance player, int objectId)
{ {
_sendType = sendType;
_items = player.getInventory().getAvailableItems(true, true, true); _items = player.getInventory().getAvailableItems(true, true, true);
_objectId = objectId; _objectId = objectId;
_adena = player.getAdena(); _adena = player.getAdena();
@ -45,13 +46,22 @@ public class PackageSendableList extends AbstractItemPacket
{ {
OutgoingPackets.PACKAGE_SENDABLE_LIST.writeId(packet); OutgoingPackets.PACKAGE_SENDABLE_LIST.writeId(packet);
packet.writeD(_objectId); packet.writeC(_sendType);
packet.writeQ(_adena); if (_sendType == 2)
packet.writeD(_items.size());
for (L2ItemInstance item : _items)
{ {
writeItem(packet, item); packet.writeD(_items.size());
packet.writeD(item.getObjectId()); packet.writeD(_items.size());
for (L2ItemInstance item : _items)
{
writeItem(packet, item);
packet.writeD(item.getObjectId());
}
}
else
{
packet.writeD(_objectId);
packet.writeQ(_adena);
packet.writeD(_items.size());
} }
return true; return true;
} }