Reverted latest InventoryUpdate task addition.

This commit is contained in:
MobiusDevelopment
2022-06-23 23:19:50 +00:00
parent 2b11d5ab5b
commit dfe2bb033b
46 changed files with 69 additions and 644 deletions

View File

@ -434,8 +434,6 @@ public class Player extends Playable
private long _lastAccess;
private long _uptime;
private final Set<InventoryUpdate> _inventoryUpdates = ConcurrentHashMap.newKeySet(1);
private ScheduledFuture<?> _inventoryUpdateTask;
private ScheduledFuture<?> _itemListTask;
private ScheduledFuture<?> _skillListTask;
@ -13657,21 +13655,9 @@ public class Player extends Playable
public void sendInventoryUpdate(InventoryUpdate iu)
{
_inventoryUpdates.add(iu);
if (_inventoryUpdateTask == null)
{
_inventoryUpdateTask = ThreadPool.schedule(() ->
{
for (InventoryUpdate packet : _inventoryUpdates)
{
sendPacket(packet);
_inventoryUpdates.remove(packet);
}
sendPacket(new ExAdenaInvenCount(this));
sendPacket(new ExUserInfoInvenWeight(this));
_inventoryUpdateTask = null;
}, 300);
}
sendPacket(iu);
sendPacket(new ExAdenaInvenCount(this));
sendPacket(new ExUserInfoInvenWeight(this));
}
public void sendItemList(boolean open)

View File

@ -49,15 +49,4 @@ public class InventoryUpdate extends AbstractInventoryUpdate
writeItems(packet);
return true;
}
@Override
public boolean equals(Object obj)
{
if (obj instanceof InventoryUpdate)
{
final InventoryUpdate iu = (InventoryUpdate) obj;
return getItems().equals(iu.getItems());
}
return false;
}
}