Bustikated

Equal parts geeknobabble & jackassery

WeeWar API Games

Posted by BM5k on February 24, 2008 at 09:41 PM

If you haven’t already, see parts 1 and 2

This script will request information about a game, and output it nicely. You can see the returned xml data here.

Example Output

Game Info
map => lakes1187102532212
type => Pro
pace => 1 day
cbp => 150
round => 14
credits => 100
name => One if by land
started => Mon Feb 25 02:54:46 UTC 2008

Players
BM5k, bowerman4875, sbowerman’s turn

The API Game Object

Game attributes
idIntegerUnique identifier

|_\3. Sub elements|
|name|String|The name of the game|
|round|Integer|Round number|
|state|String|Text info about this game|
|pendingInvites|Boolean|Any invited players haven’t responded yet|
|pace|Integer|Turn length in seconds|
|type|String|Pro or basic|
|url|String|URL of game page|
|players|Array of Players|Same as before|
|map|String|Name of Map|
|mapUrl|String|URL of map page|
|creditsPerBase|Integer|Credits each base generates per turn|
|initialCredits|Integer|Starting credits per player|
|playingSince|DateTime|Time stamp of game start|This script will request information about a game, and output it nicely

Example Output

Game Info
map => lakes1187102532212
type => Pro
pace => 1 day
cbp => 150
round => 14
credits => 100
name => One if by land
started => Mon Feb 25 02:54:46 UTC 2008

Players
BM5k, bowerman4875, sbowerman’s turn

Tags: API, Ruby, WeeWar
Hierarchy: previous, next

Comments

There are 0 comments on this post. Post yours →

Post a comment

Required fields in bold.