Rock Hard C++ Library

Forum Listing » Game Achievements Forum » View Topic


  • In celebration of all things that are rock hard, or become rock hard, here's my C++ Game Jolt Achievements library in its current state.

    Current Version: 0.5

    Source Code: https://github.com/hworld/gj-cpp-api

    Current Issues 

    It is Windows only, which is really lame, mainly because it relies on Windows networking libraries. I will hopefully change this in the future.

    No support for player status at the moment.

    All calls are synchronous and blocking.

    Last edited on July 30, 2012 - 07:01 PM by CROS

  • CROS, any chance you can supply up to date DLL versions of this lib ?

  • Any plans for Linux?

  • Definitely.

    Does Linux have native headers/libraries for URL calls? Maybe you could lead something like this yourself?! :) Shouldn't be too hard with all the existing code we have! Perhaps something cross-platform using libCURL?

    Last edited on July 29, 2012 - 07:50 AM by Ashley

  • Sorry, I only know how to make games with C++, making a library like this is just beyond my skills.

  • I was thinking up updating this to use ASIO, this way everything could be done asynchronously, unless you explicitly wanted synchronicity. It would also be cross platform, then. http://think-async.com/

  • I've now put all the code in GitHub, in case anyone wants to contribute, they can fork and submit a pull request.

  • So hey, I just now had a look at this and it looks like I can't use this API if I don't have a Visual Studio? I only have access to Linux and apparently Wine can't run it. I did install Wine Development package which contains at least some of the libraries the API requires but I'm still left with many, many errors.

    I'm using Code::Blocks as IDE and MinGW as a compiler.

    edit. I think the problem is in StdString.h included in the API. From comments you see it's clearly writen with Visual Studio in mind. Any recommendation for replacement or workaround?

    edit2. Never mind about above, I found this to replace the old StdString.h file, seeing as this one has MinGW compability. Now only a couple of errors remaining...

    Last edited on April 27, 2013 - 07:40 AM by erakko

  • Yeah, erakko, I believe this is still Windows only. Somebody was working on a Linux version, but I can't remember who. Ouch!

    As I said about a year ago, your best bet is to use the libCURL library and look specifically at the following 4 curl_easy_* functions.

    curl_easy_init
    curl_easy_setopt
    curl_easy_perform
    curl_easy_getinfo

    Have your C++ skills improved since then? There are plenty of examples on the web of how to use libCURL, so it shouldn't be too hard, but I understand if this would be too much for you. Hope this helps!

  • Huh, it was surprisingly easy. For what I know my C++ skills haven't really improved so I guess the library was just so easy to use.

    So in other words I've got this API working on Linux. I'll post a zip once I just get this all cleaned up...

  • This makes me super happy. Do you have github? Any way you'd be able to fork it off and send me a pull request if you do? I would love to get away from the windows-only thing. I actually do most of my development on Linux now as well.

  • Sorry, not github here.

    Anyway, here's a zip. Just like the little readme I wrote says, it's basically the same as the original API, this one is just formated for not to be dependant on Windows libraries and instead of WinHTTP it uses libCURL. In other words it works on Linux. I think it should work on Windows too but I have yet to try that.

  • I'm currently updating the C++ interface. If someone else is working on it, please tell me.
    It should be finished next week.

    Last edited on June 21, 2013 - 12:47 PM by Maus

  • Looking forward to this!

  • After some delay I finished the first iteration of the new library ... but I think I over-engineered it a bit. @_@

    Here is the current documentation: http://www.maus-games.at/files/gamejolt/cpp/
    and here the full library: http://gamejolt.com/games/other/game-jolt-api-c-library/15490/

    ---

    The current main features are:

    Game Jolt API Access 
    Non-Blocking Transfer
    Data Caching and Prefetching 
    File Download 
    Base64url Integration
    Cross-Platform Support

    I also mentioned multi-threading last time, but now it only uses the multi-interface from cURL to keep it more stable and easier to use.

    If anything is wrong, bad or should be changed please let me know, especially about licensing parts and name calling (I initially used the zlib-license with reference to the terms of Game Jolt, and I mentioned all major contributors from this thread for special thanks).

    Also I would like to update it from time to time (ongoing support), especially when the next API version is released. If anybody else wants to contribute, just message me, the whole thing is Open Source.

    ---

    I also found some bugs and odd behaviors, the two major are:

    http://gamejolt.com/api/doc/game/scores/tables/ returns deleted score tables and there is no way to identify them, except if you try to use them, then the API returns a failure-message.

    http://gamejolt.com/api/doc/game/data-store/ The other one is the max size of a data store item. I tried different values, and came to a max size of around 8kb per item, but the API doc says 16mb per item. If I try to send more data with one call the API returns success but does not display the item, and returns an error if I want to retrieve it (so it may not save it). 
    This is a problem within the C++ library and will be updated soon.

    ---

    Hope I did not forget anything and that everything is alright.

    Again special thanks to CROS, erakko and Ashley.

     

    Last edited on June 22, 2014 - 06:53 PM by Maus

Friends {{client.onlineFriendsCount}}/{{client.offlineFriendsCount}}

People Online:

Room Users {{client.usersOnline.length}}

: