private void SendInventoryPackets(int startOffset) { int currentIndex = startOffset; while (true) { if (list.Count - currentIndex >= 64) { owner.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, list, ref currentIndex)); } else if (list.Count - currentIndex >= 32) { owner.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, list, ref currentIndex)); } else if (list.Count - currentIndex >= 16) { owner.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, list, ref currentIndex)); } else if (list.Count - currentIndex > 1) { owner.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, list, ref currentIndex)); } else if (list.Count - currentIndex == 1) { owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, list[currentIndex])); currentIndex++; } else { break; } } }
private void SendInventoryPackets(List <InventoryItem> items) { int currentIndex = 0; while (true) { if (items.Count - currentIndex >= 64) { owner.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex)); } else if (items.Count - currentIndex >= 32) { owner.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex)); } else if (items.Count - currentIndex >= 16) { owner.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex)); } else if (items.Count - currentIndex > 1) { owner.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex)); } else if (items.Count - currentIndex == 1) { owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex])); currentIndex++; } else { break; } } }