Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Games4J Highscore API issue  (Read 1302 times)
0 Members and 1 Guest are viewing this topic.
Offline WildChild88

JGO n00b
*

Posts: 2



« on: 2012-01-22 14:36:16 »

Hi guys!

Had a look around the interwebs but couldn't find anything!

I have tried uploading a game to Games4J, the game itself worked absolutely fine on my server prior to implementing the Highscore API, however when trying to retrieve the high scores list using:
1  
2  
highscores = Highscore.getHighscores(applet, 10, 1);
(highscores is declared as a private static List in the class as per the Game4J guidance, and applet is a reference to my game applet)


I get the following error in the console:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
java.lang.NumberFormatException: For input string: "<?xml version="1.0" encoding="UTF-8" ?>"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.games4j.webAPI.Highscore.a(SourceFile:115)
at com.games4j.webAPI.Highscore.getHighscores(SourceFile:93)
at com.games4j.webAPI.Highscore.getHighscores(SourceFile:75)
at alieninvaders.GamePanel.<init>(GamePanel.java:87)
at alieninvaders.GameApplet.init(GameApplet.java:31)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Which would suggest that it is trying to read the wrong part of the XML file which I assume stores the high scores...  It doesn't seem like the sort of thing which would point to a mistake I have made, but the fact that everyone else seems to manage is making me think i've done something silly!

Furthermore, I am using the code that "saves" the high scores, which isn't giving me an error.... but equally it's not actually sending the scores... well they're not showing on the page anyway, and also the "isLoggedIn()" code returns false, regardless of whether I am logged in or not, which makes me think that nothing in the Highscores API is actually working.

Has anybody else come across this problem and found how to fix it?  I'm sure i've just missed something simple but its driving me mad now!

Thanks
Dave

Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.099 seconds with 20 queries.