Java API

Forum Listing » Game Achievements Forum » View Topic

  • Use this one instead.

    api = new GameJoltAPI(GAME_ID, GAME_PRIVATE_KEY, username, userToken);

  • Thank you, you sir are a god-send :). That did the trick.

  • I've moved this over to Github so people can contribute to the project easier.

    https://github.com/ashleygwinnell/Game-Jolt-Java-Game-API

  • I'm trying to integrate my game with the Game Jolt API so that I can have high scores for players.   But I get an exception when the game starts:

     

    java.security.AccessControlException: access denied ("java.io.FilePermission" "gjapi-credentials.txt" "read")
        at java.security.AccessControlContext.checkPermission(Unknown Source)
        at java.security.AccessController.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkPermission(Unknown Source)
        at java.lang.SecurityManager.checkRead(Unknown Source)
        at java.io.File.exists(Unknown Source)
        at org.gamejolt.GameJoltAPI.<init>(GameJoltAPI.java:68)
        at eggz.GameCore.<init>(GameCore.java:32)
        at eggz.Eggz.init(Eggz.java:31)
        at com.sun.deploy.uitoolkit.impl.awt.AWTAppletAdapter.init(Unknown Source)
        at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Ignored exception: java.security.AccessControlException: access denied ("java.io.FilePermission" "gjapi-credentials.txt" "read")
    basic: Dialog type is not candidate for embedding
    basic: Removed progress listener: sun.plugin.util.ProgressMonitorAdapter@1022eb0
    security: Reset deny session certificate store
    basic: Dialog type is not candidate for embedding

     

      Any suggestions?

  • never mind, there was a clue.

  • Hey Ashley,

    Sorry if this is blindingly obvious, but I was looking through your API and I was wondering if you'd built in support for multiple highscore tables yet? Also, have you written or are you considering writing a short tutorial for implementing your API in a Java application/applet? I'm still new to GameJolt and would appreciate any help you could possibly provide in integrating GameJolt functions into my game. Thanks! :)

  • I wrote this library so long ago, there's definitely a bunch I would change. There's no support for multiple highscores, but I (or you! :D) can patch this. What do you think? 

    I don't see a tutorial coming at any point soon, but there should be an example of how to use it in the project? src/org/ag/test/GJAPITester.java

    For a quickplay or downloadable application you use the constructor:
    public GameJoltAPI(int gameId, String privateKey)

    For an applet you use the constructor:
    public GameJoltAPI(int gameId, String privateKey, String username, String userToken)

    Last edited on November 14, 2012 - 08:27 AM by Ashley

  • Ah I see, I forgot to look in the ag folder! Tell you what, I'll take a closer look at the API in the next few days to see if I can figure out how to implement it in my game and maybe fork your repo to see if I can add support for multiple leaderboards? Expect at least some cries for help from me in the near future though! :)

  • Since I want to create multiple Highscoretables for my Nine Men's Morris project and the api did not support it I decided to implement it. I created a pull-request for you so you can decide if you want to use it or not.

    https://github.com/ashleygwinnell/Game-Jolt-Java-Game-API/pull/2

    Last edited on May 3, 2013 - 03:47 PM by 125_m_125

People Online