Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (527)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (594)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  [Kryonet] Getting indexOutOfBounds on Client.Update line 297  (Read 1307 times)
0 Members and 1 Guest are viewing this topic.
Offline The Boat

Junior Newbie





« Posted 2013-04-01 15:51:54 »

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 Smiley

Peter
Offline Slyntax

Junior Devvie


Medals: 3



« Reply #1 - Posted 2013-04-01 16:02:46 »

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?
Offline The Boat

Junior Newbie





« Reply #2 - Posted 2013-04-01 16:07:04 »

Unfortunately there is no output in the console :/

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.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Slyntax

Junior Devvie


Medals: 3



« Reply #3 - Posted 2013-04-01 16:30:50 »

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?
Offline The Boat

Junior Newbie





« Reply #4 - Posted 2013-04-01 16:39:57 »

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 :/

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
Offline Slyntax

Junior Devvie


Medals: 3



« Reply #5 - Posted 2013-04-01 17:00:29 »

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 '<terminated> Main [Java Application]' or something like that since it's crashing.
Offline The Boat

Junior Newbie





« Reply #6 - Posted 2013-04-01 17:23:48 »

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
Offline The Boat

Junior Newbie





« Reply #7 - Posted 2013-04-01 19:24:05 »

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
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

PocketCrafter7 (14 views)
2014-11-28 16:25:35

PocketCrafter7 (10 views)
2014-11-28 16:25:09

PocketCrafter7 (10 views)
2014-11-28 16:24:29

toopeicgaming1999 (76 views)
2014-11-26 15:22:04

toopeicgaming1999 (67 views)
2014-11-26 15:20:36

toopeicgaming1999 (17 views)
2014-11-26 15:20:08

SHC (30 views)
2014-11-25 12:00:59

SHC (28 views)
2014-11-25 11:53:45

Norakomi (32 views)
2014-11-25 11:26:43

Gibbo3771 (28 views)
2014-11-24 19:59:16
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!