[Kryonet] Getting indexOutOfBounds on Client.Update line 297

Hi guys,

I am working on a small client/server game using java and the Kryonet library.

I am recieving and sending packets just fine, but up to a limit it seems, but I am having a real hard time debugging this, as Eclipse really doesn’t give me anything to go by.

This is the print out from the debug window:

When I look up the Client class on the google code page all I see is a closing bracket at line 297, so I am not really sure what to make of it.

If any of you have any idea about where I should start looking, it will be greatly appreciated :slight_smile:

Peter

Window -> Show View -> Console

The console window will give you a trace of what’s going on. Also… Why would you go on Googles code page to find line 297 instead of just looking in your code?

Unfortunately there is no output in the console :confused:

I went to google, because this is not some code that I wrote, and Eclipse is for some reason not able to show it to me, so I went there to find it.
All I get where the code from my own classes usually is in the debug view is a: source not found. Thats why I went to google to find out what happens at line 297.

Ah, I see. The actual Client class from the Kryonet Library is throwing the error. I thought you meant that your client class was throwing the error. I apologize.

With the information given I couldn’t really tell you much other than what it’s already telling you. Can you post your code?

I feared it would be hard to tell anything from it, I could post my code, and I would not mind, but there is a lot of it and since I dont know where the error occurs, I cant seem to see where in the code the program was before it entered the client class and crashes, so I would not know what part to post unfortunately :confused:

I guess I was hoping that someone else had this error and had an idea how to start debugging it. I tried to limit the packets send, but that doesn’t seem to be it.

Peter

Are you sure the console isn’t showing anything? If you’re running the Server and the Client from Eclipse the console will switch back and forth between the 2. It’s possible that it’s staying on the Server’s console.

To show the client console just open the debug tab and double click the client process and then click back on the console tab.

It’ll most likely be called ’ Main [Java Application]’ or something like that since it’s crashing.

This is what I see, when the crash happens and I press “yes” to go in to debug view:

What you see in the background is the server running as build.

In the foreground is my client running in debug.

Does any of that help?

Peter

I found it !

Okay, so it turns out it actually does not have anything to do with kryonet, but it just crashes while doing some kryonet stuff in the background, or something like that.

It turns out that it was an index out of bounds in my “unresolved moves” list that I use for client side prediction. This list is one of the things that is checked up against when I recieve packets from the server, and the crash turned out to be trivial.

I ended up pinpointing it by running the game with the play button instead of the debug button, this game me a much more useful exception that lead me to find the crash reason.

Thanks for the help anyway, I love the response time on this forum

Peter