4 Forum Posts by "zehfernando"
At 2/23/14 05:40 AM, MilitaryGenius wrote: but I still don't know how to access their API to use medals, ...
They don't have a Unity API per se. Using the "developer gateway" to make the calls you can use the API though.
I'm currently implementing their API in Unity. Not good enough to release publicly (very few features supported, no auto queueing) yet but it's working. I have my (super simple) LD game working with high scores for now, and medal support should be next:
-
Escape Drill by zehfernandoShort turn-based puzzle game. Get to the exit of each level without dying.
- Score
- 2.38 / 5.00
- Type
- Game
- Popularity
- 675 Views
- Rated
- Everyone
I'll upload the API to GitHub once it's in a better state.
I've been implementing the "Developer Gateway" (the rest API) and I've noticed some issues where the documentation is incorrect. Not sure where to post it, so here it goes for future reference:
1. In the encryption process page, the encrypted test string is incorrect.
It shows: `OtJ*u7|%%/j9BwQADNm1s)kiM4@Zq<NBN~#wq@t;w0g5&)riHI<7lPAgst+sLN9z+TmbwP2&@Ru#|DU1wN(3ZbWZIN&&gnnB6Tj#qv9&LZ/Otsr2Dt6g%3ZkxcG7vHr7b/ksctDze%I;Of1ZFQ6lRn6*F(B;G#FszM(Cc9(ufyy%QC~7hU`3bB
It should be:
`OtJ*u7|%%/j9BwQADNm1s)kiM4@Zq<NBN~#wq@t;w0g5&)riHI<7lPAgst+sLN9z+TmbwP2&@Ru#|DU1wN(3ZbWZIN&&gnnB6Tj#qv9&LZ/Otsr2Dt6g%3ZkxcG7vHr7b/ksctDze%I;Of1ZFQ6lRn6*F(B;G#FszM(Cc9(ufyy%QC~7hU`\3bB
Notice the "\" near the end.
Since all numbers are padded to be 4 digits, the last one should too. I've tested this string and verified it as correct using the API. This is also hinted at in the documentation, since the tail length value is 4 (string size 184). With the original string, the size would be 183 and the tail length would be 3. This is probably just a copy&paste error, but important if people are meant to verify that their rc4/encryption/basen conversions are correct in the future.
2. I believe all secure post services documented on the main gateway documentation are incorrect. That page shows the "seed" parameter being a parameter of the main variables, not the "secure" field. If you send your data like that, it's an invalid secure packed:
{"error_msg":"Malformed secure packet! Your encryption key may be missing or invalid.","error_code":0,"success":0,"command_id":"securePacket"}
If you send "seed" inside the secure *only*, it works as intended. When sending bogus data, I got an error message but it indicates the secure packet was properly parsed:
{"error_msg":"You must be logged in or provide an e-mail address to use postScore().","error_code":7,"success":0,"command_id":"postScore"}
--
Not sure how frequently someone uses that documentation. Granted, people will probably just use the specific high-level API for their game (AS3, etc) and be done with it. Still important to get it right IMO though.
I know Newgrounds accepts Unity games as "HTML" games, but I was wondering if they had a Unity version of the API planned (for scoreboards and such).
Ok, after further research and randomly clicking around I'm able to answer my own question: NewGrounds has a RESTful API. It's not advertised as such (never shows on Google searches, etc) but I've tested and it seems to work with simple POST requests:
http://www.newgrounds.com/wiki/creator-resources/newgrounds-apis/developer-gateway
Seems to work as intended and I think that's what the AS3 API uses. Documentation is not very clear (e.g. took me a while to understand the "track id" is the same as the "api id") but it should work for Unity.
Hey. I'm a Newgrounds newbie and I have some (probably stupid) questions.
I know Newgrounds accepts Unity games as "HTML" games, but I was wondering if they had a Unity version of the API planned (for scoreboards and such).
Failing that, does a supported RESTful version of the API exist? That'd be great not just for Unity but for other platforms. I know something like this should exist since it's *probably* what the AS3 version uses; unless it's just as a bridge to a website-only JS interface.
Failing that, is the source code to the AS3 API available somewhere? I couldn't find it. I'd like to have a look on how the communication is done, but don't want to rely on reverse-engineering that version of decompiling and dealing with disorganized decompiled code.

