public unsafe bool HandlePacket(ENetPeer* peer, byte[] data, Game game) { var request = new SwapItems(data); if (request.slotFrom > 6 || request.slotTo > 6) return false; game.getPeerInfo(peer).getChampion().getInventory().swapItems(request.slotFrom, request.slotTo); PacketNotifier.notifyItemsSwapped(game.getPeerInfo(peer).getChampion(), request.slotFrom, request.slotTo); return true; }
public static void notifyItemsSwapped(Champion c, byte fromSlot, byte toSlot) { var sia = new SwapItems(c, fromSlot, toSlot); PacketHandlerManager.getInstace().broadcastPacketVision(c, sia, Channel.CHL_S2C); }