Difference between revisions of "Compo4AllSDK"

From Pandora Wiki
Jump to: navigation, search
(Spaghetti Client)
(SC Exec Return Values)
Line 97: Line 97:
 
! -1
 
! -1
 
! General error (such as bad arguments to sc); maybe failure to get RAM; possibly a problem with plugins (scoreonly module submissions.)
 
! General error (such as bad arguments to sc); maybe failure to get RAM; possibly a problem with plugins (scoreonly module submissions.)
!
+
!-
 
! -2
 
! -2
 
! Could not write file that was pulled; coudl not find player profile
 
! Could not write file that was pulled; coudl not find player profile

Revision as of 14:38, 3 May 2013

Compo4All API Guide

Overview

All information from the server is transfered by the HTTP protocol, so you can use libraries such as libcurl to handle all that work. Information is passed using the JSON markup language


Launcher Developer

Getting the Games List

Sending a HTTP GET request to /curgamelist_1 will return you a list of games, and details of those games

The JSON response will be an array of dictionairies (one dictionairy per game.)

The dictionaries will include at least the following fields for each game:

 - gamename -> the 'short name' of the game; for MAME, it is the driver name ('dkong') and not generally for display; it is a unique-id (unique within C4A)
 - longname -> the readable display name ('Donkey Kong')
 - status -> current status options include:
   - available -> show in frontends, available for scoring etc
   - active -> show in frontends (and highlight or in their own tab?), is actively in the ROT tournament or highlight right now (but is otherwise same as available)
   - wip -> do not show in frontend; available for scoring and functionality identical to 'active', but for developers to test their code prior to finalization
 - genre -> the 'type' of game (at a high level); current values are..
   - platform
   - maze
   - runngun
   - shmup
   - strategy
   - ... we can add more - to be determined
 - field -> the 'kind' of game it is, the platform; current values are
   - arcade -> implies c4a-mame will be used
   - indie -> means standalone; it will contact c4a, but not be part of c4a-mame
   - TBD

Getting the Score Board

Requesting /json_1/(gamename) will return you scoreboard details

 - You can also pull a simple HTML (ASCII) dump: skeezix.wallednetworks.com:13001/scoreboard_1/mspacman/
 - Getting previous months can use backdating for both JSON and ASCII pulls; for example: skeezix.wallednetworks.com:13001/scoreboard_1/mspacman/201304/

The scoreboard is an array of dictionairies, one dict per score entry.

The dictionairies will include at least:

 - shortname -> the player's shortname (initials)
 - longname -> the player's long name (display name)
 - hi -> the actual score number (for single-score style of games); TBD for time-attack, and other kinds of games
 - time -> the epoch time the event occured

Game Developer

Spaghetti Client

The Spaghetti Client can be downloaded from the thread, and you can easily submit scores by starting a process with the following command line (assuming sc is bundled in your working directory)

The paramater's vary by module;

An example for the 'scoreonly' simple module is:

./sc MODULE OPERATION GAMENAME PLATFORM SCORE

Platform: Currently 'pandora' should be specified

SC Modes

Mode Description
so Sends the Score only

SC Operations

Operation Description
push Sending data to the server
pull Get data from the server (not implemented)

SC Exec Return Values

Value Description
0 All seemed well
-1 General error (such as bad arguments to sc); maybe failure to get RAM; possibly a problem with plugins (scoreonly module submissions.) - -2 Could not write file that was pulled; coudl not find player profile
-3 For a file dependancy (such as MAEM ./hi file), file could not be found/opened