So I've tried to add gambling to my rsps and when I request the gamble, it kicks out the player that requested it and get a bunch of size 0 packets errors. Here are the packet's code and the error and the gif from what happens.
[13/04/17 2:47 PM]: java.lang.ArrayIndexOutOfBoundsException: 1
[13/04/17 2:47 PM]: at server.util.Stream.readSignedWordBigEndian(Stream.java:58)
[13/04/17 2:47 PM]: at server.model.players.packets.GambleResponse.processPacket(GambleResponse.java:15)
[13/04/17 2:47 PM]: at server.model.players.PacketHandler.processPacket(PacketHandler.java:142)
[13/04/17 2:47 PM]: at server.model.players.Client.processQueuedPackets(Client.java:4001)
[13/04/17 2:47 PM]: at server.model.players.PlayerHandler.process(PlayerHandler.java:270)
[13/04/17 2:47 PM]: at server.GameEngine.run(GameEngine.java:31)
[13/04/17 2:47 PM]: at server.Server$1.execute(Server.java:160)
[13/04/17 2:47 PM]: at server.task.Task.tick(Task.java:107)
[13/04/17 2:47 PM]: at server.task.TaskScheduler.run(TaskScheduler.java:125)
[13/04/17 2:47 PM]: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[13/04/17 2:47 PM]: at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
[13/04/17 2:47 PM]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
[13/04/17 2:47 PM]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
[13/04/17 2:47 PM]: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[13/04/17 2:47 PM]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[13/04/17 2:47 PM]: at java.lang.Thread.run(Unknown Source)
[13/04/17 2:47 PM]: Unhandled packet type: 222 - size: 0
[13/04/17 2:47 PM]: Unhandled packet type: 96 - size: 0
[13/04/17 2:47 PM]: Unhandled packet type: 48 - size: 0
[13/04/17 2:47 PM]: Unhandled packet type: 56 - size: 0
[13/04/17 2:47 PM]: Game saved for player test
[13/04/17 2:47 PM]: [DEREGISTERED]: test[/CODE]
That was the error and now the packet sizes
public static final int PACKET_SIZES[] = {
0, 0, 0, 1, -1, 0, 0, 0, 0, 0, //0
0, 0, 0, 0, 4, 0, 6, 2, 2, 0, //10
0, 2, 0, 6, 0, 12, 0, 0, 0, 0, //20
0, 0, 0, 0, 0, 8, 4, 0, 0, 2, //30
2, 6, 0, 6, 0, -1, 0, 0, 0, 0, //40
0, 0, 0, 12, 0, 0, 0, 8, 8, 12, //50
8, 8, 0, 0, 0, 0, 2, 4, 0, 0, //60
6, 0, 2, 2, 8, 6, 0, -1, 0, 6, //70
0, 0, 0, 0, 0, 1, 4, 6, 0, 0, //80
0, 0, 0, 0, 0, 3, 0, 0, -1, 0, //90
0, 13, 0, -1, 0, 0, 0, 0, 0, 0,//100
0, 0, 0, 0, 0, 0, 0, 6, 0, 0, //110
1, 0, 6, 0, 0, 0, -1, 0, 2, 6, //120
0, 4, 6, 8, 0, 6, 0, 0, 0, 2, //130
0, 0, 0, 0, 0, 6, 0, 0, 0, 0, //140
0, 0, 1, 2, 0, 2, 6, 0, 0, 0, //150
0, 0, 0, 0, -1, -1, 0, 0, 0, 0,//160
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //170
0, 8, 0, 3, 0, 2, 0, 0, 8, 1, //180
0, 0, 12, 0, 0, 0, 0, 0, 0, 0, //190
4, 2, 0, 0, 0, 0, 0, 0, 4, 0, //200
4, 0, 0, 0, 7, 8, 0, 0, 10, 0, //210
0, 0, 0, 0, 0, 0, -1, 0, 6, 0, //220
1, 0, 0, 0, 6, 0, 6, 8, 1, 0, //230
0, 4, 0, 0, 0, 0, -1, 0, -1, 4,//240
0, 0, 6, 6, 0, 0, 0 //250
};[/CODE]
And the gif, at last
http://prntscr.com/ey136q
If you need any other lines of code, just comment them !
Thanks,
Mathy
EDIT:
I changed the packet sizes of some packets and now I can get to the interface but I don't receive the "*** would like to gamble with you" message, I have to manually ask the other player, anyways here's a gif that explains the situation and I still get a bunch of 0 packet sizes.
Current packets:
[CODE] public static final int PACKET_SIZES[] = {
0, 0, 0, 1, -1, 0, 0, 0, 0, 0, //0
0, 0, 0, 0, 4, 0, 6, 2, 2, 0, //10
0, 2, 0, 6, 0, 12, 0, 0, 0, 0, //20
0, 0, 0, 0, 0, 8, 4, 0, 0, 2, //30
2, 6, 0, 6, 0, -1, 0, 0, 0, 0, //40
0, 0, 0, 12, 0, 0, 0, 8, 8, 12, //50
8, 8, 0, 0, 0, 0, 2, 4, 0, 0, //60
6, 0, 2, 2, 8, 6, 0, -1, 0, 6, //70
0, 0, 0, 0, 0, 1, 4, 6, 0, 0, //80
0, 0, 0, 0, 0, 3, 0, 0, -1, 0, //90
0, 13, 0, -1, 2, 4, 0, 0, 0, 0,//100
0, 0, 0, 0, 0, 0, 0, 6, 0, 0, //110
1, 0, 6, 0, 0, 0, -1, 0, 2, 6, //120
0, 4, 6, 8, 0, 6, 0, 0, 0, 2, //130
0, 4, 4, 4, 0, 6, 0, 0, 0, 0, //140
0, 0, 1, 2, 0, 2, 6, 0, 0, 0, //150
0, 0, 0, 0, -1, -1, 0, 0, 0, 0,//160
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //170
0, 8, 0, 3, 0, 2, 0, 0, 8, 1, //180
0, 0, 12, 0, 0, 0, 0, 0, 0, 0, //190
4, 2, 0, 0, 0, 0, 0, 0, 4, 0, //200
4, 0, 0, 0, 7, 8, 0, 0, 10, 0, //210
0, 0, 0, 0, 0, 0, -1, 0, 6, 0, //220
1, 0, 0, 0, 6, 0, 6, 8, 1, 0, //230
0, 4, 0, 0, 0, 0, -1, 0, -1, 4,//240
0, 0, 6, 6, 0, 0, 0 //250
};[/CODE]
These are the errors that I get after some time :
[CODE][14/04/17 4:56 AM]: java.lang.ArrayIndexOutOfBoundsException: 17413
[14/04/17 4:56 AM]: at server.model.players.packets.ItemOnNpc.processPacket(ItemOnNpc.java:17)
[14/04/17 4:56 AM]: at server.model.players.PacketHandler.processPacket(PacketHandler.java:142)
[14/04/17 4:56 AM]: at server.model.players.Client.processQueuedPackets(Client.java:4001)
[14/04/17 4:56 AM]: at server.model.players.PlayerHandler.process(PlayerHandler.java:270)
[14/04/17 4:56 AM]: at server.GameEngine.run(GameEngine.java:31)
[14/04/17 4:56 AM]: at server.Server$1.execute(Server.java:160)
[14/04/17 4:56 AM]: at server.task.Task.tick(Task.java:107)
[14/04/17 4:56 AM]: at server.task.TaskScheduler.run(TaskScheduler.java:125)
[14/04/17 4:56 AM]: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[14/04/17 4:56 AM]: at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
[14/04/17 4:56 AM]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
[14/04/17 4:56 AM]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
[14/04/17 4:56 AM]: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[14/04/17 4:56 AM]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[14/04/17 4:56 AM]: at java.lang.Thread.run(Unknown Source)
[14/04/17 4:56 AM]: Unhandled packet type: 48 - size: 0
[14/04/17 4:56 AM]: Unhandled packet type: 187 - size: 0
[14/04/17 4:56 AM]: Unhandled packet type: 107 - size: 0
[14/04/17 4:56 AM]: Unhandled packet type: 250 - size: 0
[14/04/17 4:56 AM]: Unhandled packet type: 234 - size: 6
[14/04/17 4:56 AM]: Game saved for player mathy
[14/04/17 4:56 AM]: [DEREGISTERED]: mathy
[14/04/17 4:57 AM]: objectId: 38117 ObjectX: 21730 objectY: 47877 Xoff: -19799 Yoff: -42875
[14/04/17 4:57 AM]: Unhandled packet type: 38 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 196 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 158 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 76 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 239 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 153 - size: 2
[14/04/17 4:57 AM]: Unhandled packet type: 239 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 151 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 127 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 96 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 203 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 52 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 2 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 89 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 203 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 193 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 123 - size: 0
[14/04/17 4:57 AM]: Unhandled packet type: 223 - size: 0
[14/04/17 4:57 AM]: Game saved for player test
[14/04/17 4:57 AM]: [DEREGISTERED]: test
[14/04/17 4:57 AM]: java.lang.ArrayIndexOutOfBoundsException: -2162
[14/04/17 4:57 AM]: at server.model.players.packets.ItemOnNpc.processPacket(ItemOnNpc.java:17)
[14/04/17 4:57 AM]: at server.model.players.PacketHandler.processPacket(PacketHandler.java:142)
[14/04/17 4:57 AM]: at server.model.players.Client.processQueuedPackets(Client.java:4001)
[14/04/17 4:57 AM]: at server.model.players.PlayerHandler.process(PlayerHandler.java:270)
[14/04/17 4:57 AM]: at server.GameEngine.run(GameEngine.java:31)
[14/04/17 4:57 AM]: at server.Server$1.execute(Server.java:160)
[14/04/17 4:57 AM]: at server.task.Task.tick(Task.java:107)
[14/04/17 4:57 AM]: at server.task.TaskScheduler.run(TaskScheduler.java:125)
[14/04/17 4:57 AM]: at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
[14/04/17 4:57 AM]: at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
[14/04/17 4:57 AM]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
[14/04/17 4:57 AM]: at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
[14/04/17 4:57 AM]: at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
[14/04/17 4:57 AM]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
[14/04/17 4:57 AM]: at java.lang.Thread.run(Unknown Source)
[14/04/17 4:58 AM]: Average Cycle Time: 8ms[/CODE]
And the gif:
http://prnt.sc/ey13hc
Thanks, still need help
Mathy