Hey,
The problem is that the default size of an unused packet is 0, and since this has a fixed (predefined) size you must state that where packet size is defined.
|
Hell so im more of a client guy and i never worked with packets before but anyways
So today was adding a new drop option so i decided to make a new packet for it
So i did the following
i went to where my other droppacket is called and added this
Code:packetId[90] = new DropItemAll();
NOTE: The drop all method is the same as my drop packet
and i extended it here
and added this client sided for the clicking option
Code:if (comp == 1135) { stream.createFrame(90); stream.method432(i1); stream.writeWord(componentId); stream.method432(j); atInventoryLoopCycle = 0; atInventoryInterface = componentId; atInventoryIndex = j; atInventoryInterfaceType = 2; if (RSInterface.interfaceCache[componentId].parentID == openInterfaceID) atInventoryInterfaceType = 1; if (RSInterface.interfaceCache[componentId].parentID == backDialogID) atInventoryInterfaceType = 3; }
now when i go to use the option i get this error
Code:java.lang.ArrayIndexOutOfBoundsException: 0 at server.util.Stream.readUnsignedWordA(Stream.java:87) at server.model.players.packets.DropItemAll.processPacket(DropItemAll.java:15) at server.model.players.PacketHandler.processPacket(PacketHandler.java:138) at server.model.players.Client.processQueuedPackets(Client.java:668) at server.core.PlayerHandler.process(PlayerHandler.java:166) at server.Server$2.execute(Server.java:108) at server.core.GameEngine$1.run(GameEngine.java:103) at server.core.GameEngine$5.run(GameEngine.java:176) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Unhandled packet type: 156 - size: 6
Have i missed something out ill rep if u can help thanks a lot
Hey,
The problem is that the default size of an unused packet is 0, and since this has a fixed (predefined) size you must state that where packet size is defined.
hey so in the client i defined it in the array of packetSizes[] but i can not seem to find anything in the server for that
Code:public static final int[] packetSizes = { 0, 0, 0, 0, 6, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 4, 3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 6, 0, 0, 9, 0, 0, -2, 0, 0, 0, 0, 0, 0, -2, 1, 0, 0, 2, -2, 0, 0, 0, 0, 6, 3, 2, 4, 2, 4, 0, 0, 0, 4, 0, -2, 0, 0, 7, 2, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 2, 0, 0, -1, 4, 1, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 15, 0, 0, 0, 4, 4, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 14, 0, 0, 0, 4, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 2, 0, 6, 0, 0, 0, 0, 3, 0, 0, 5, 0, 10, 6, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 4, 0, 0, 0, 0, 0, 3, 0, 2, 0, 0, 0, 0, 0, -2, 7, 0, -2, 2, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0, 0, 6, 0, 4, 3, 0, 0, 0, -1, 6, 0, 0,0 };
the big number is the new one i added in the client
The index of the array that the value is defined within is also the packet ID number. That being said you created a packet with the ID packetSizes.length - 2 which is not 90. You would replace the size of the packet which is zero with the size of the data being sent (which is not zero) In the 10th row and the 1st column.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |