okay, here goes.. adding c4a client to your indie game/port/whatever, for a basic 'score only' leaderboard.
Summary:
- call 'sc'
- send me a conf file
Details...
- pull down the current sc client (todays build is
http://www.skeleton.org/tmp/c4a_spaghetti_client_20130404.zip )
- 'sc' is the client in the zip; drop it into your pnd somewhere you know how to run it (root of pnd, in a ./bin/ dir, whatever you want)
- invoke sc from your executable or shell script like this:
./sc MODE OPERATION GAMENAME PLATFORM SCORE
example: ./sc so push testpong pandora 123
'so' is 'scoreonly' plugin for the server
'push' means 'sending a score up, deal with it'
'testpong' was a test game I used; it doesn't exist
'pandora' is the platform for you to use for ALL thigns running on the pandora
'123' is the score I'm submitting to the server .. plaintext, no encryption or binary or funny business for this plugin
... thats it (for now.)
Assumptions:
- player has already used c4a mame (or the upcoming c4a profile editor standalone pnd) to create their profile. 'sc' will auto scan the guys /media/ devices to find a profile in the expected places.
- viewing the online score table can be done...
.. via online lame text website
http://skeezix.wallednetworks.com:13001/links_1
.. via milkshakes mega awesome website ... I've added some stuff to our protocol, so he can filter in/out indie titles versus arcade titles (or by game genre
.. up to him to filter or sort how he sees fit, if at all
.. via your own game! do a curl or wget against something like:
http://skeezix.wallednetworks.com:13001/json_1/GAMENAME/ <-- this will get you a JSON dump of the current score table, to display as you see fit!
.. via your own game lazier .. do a curl or wget against my lames text site, using the links it shows .. this would let you get my lame HTML-formatted version; you could just show _that_ as is, or strip out the <...> bits and show it as text. But parsing JSON is really really easy, especially since its not like I'm doing fancy JSON or nesting much. No need for a fancy JSON library, just parse it yourself. If needed, I can write a C and python parser for you .. doing it in javascript or python ir _trivial_. Doing it in C is an hours work.
Caveat:
- with _current_ c4a-mame client, if we add your game to the server.. it'll show up in c4a-mame as a playable game, that won't do anything when clicked. Don't worry, I'll update c4a-mame soon not to do that
Server:
- before your game can have scores registered to it, we need to add a conf-file to my server.. feel free to either:
a) let me create it for you, just send me the shortname gamename, and the long name, and genre and so on.., or
B) send me a completed config file attempt, and I'll use it or fix it as needed
The testpong conf looks like this. They're plain JSON btw: g_testpong.conf:
{
"active": true,
"plugin": "scoreonly",
"module": null,
"alltime": true,
"platforms": [ "pandora", "windows" ],
"league": "all",
"shortname": "testpong",
"longname": "Test Pong",
"ordering": "ascending",
"dispunit": "points",
"type": "int",
"field": "indie",
"genre": "test"
}
What that all means is:
"active": true, <- make it available to the engine; if false or omitted, the conf file might as well not exist
"plugin": "scoreonly", <- needed to make it work (Selects which plugin to handle the scoring)
"module": null, <- n/a for now; param to the plugins
"alltime": true, <- whethor you want an all-time scoreboard, or just monthlies
"platforms": [ "pandora", "windows" ], <- platforms to support the scoreboarding; for now, n/a
"league": "all", <- selecting which league(s) this game is supporting; for now, n/a
"shortname": "testpong", <- critical: this specifies the name used internally, and for you to submit scores to. Must be unique, one word, lowercase.
"longname": "Test Pong", <- critical: the display name for the game .. something people will see
"ordering": "ascending", <- not yet used, but will be .. tells order of score; usually ascending, but time-attack scores will be lower-is-better so "descending"
"dispunit": "points", <- right now I dont' show a unit, but if I do.. it'd say "points" after the number in the tables
"type": "int", <- type of score submission; right now, always "int"
"field": "indie", <- 'field' .. the type of game. Right now only "arcade" and "indie" are known, but feel free to recommend others. This is so milkshake (say) can provide a drop-down listing types to show.
"genre": "test" <- genre for the game; "platform", "shmup", "runngun", "beatemup", "maze" ... feel free to suggest others
Thats it.
the 'sc' client normally doesn't output damned near anything. I should build the debug version as well, but I dont' have it handy this second. If needed, ask me.. easy build. The debug version will at least say why things are failing.. the release version just fails with error codes. (When I first wrote it, code was part of the emus/games and not interactive at all, not intended to communicate...)
edit; I'd suggest also contacting milkshake about submitting a piece of artwork for the game, since (at least for now) it'll show up on his frontpage for c4a.openpandora.org ... he should put a form on the site to contact him or something
or perhaps my server should have the artwork and send links to it, to him... stick it into the conf file..