-
Notifications
You must be signed in to change notification settings - Fork 9
Games API
ted27 edited this page Jun 17, 2011
·
9 revisions
Not sure how this is going to turn out yet.
/api/game/:id/:type
Params you can pass: :id (Mandatory) The ID of the game you wish to retrieve information about :type (Mandatory) One of the following options: [players, info, squads, tree, heatmap, featuredhuman]
Type = players: Returns a JSON object (although as text/html when cached) containing an array of players. Each player has the following attributes:
-
id
- That player's unique out-of-game ID. -
current_faction
- The current faction of that player. (see Factions on this wiki) (Note: I'm not sure how often this is updated) Note: You can always (and should always) determine the player's current faction based on the current time (seenow
, below) and that player's state history. THIS MAY BE REMOVED. -
name
- The player's given name -
static_score
- The player's score based on all actions, achievements, etc. The only thing not included is score based on Time. To calculate this, seepoints_per_hour
below. -
state_history
- Gives, to the best of the game engine's knowledge, that player's state history. That is, the time that the player started being on the given faction. All players except OZ should have "human" set to the game's beginning. Note: deceased dates are set in the future for zombies. So, when populating a graph, make sure you don't populate it beyond the current time, or people might get confused. -
is_oz
- Whether that player is an Original Zombie. Note: When OZs have not been revealed, the true OZs will have this value set tofalse
and theirscore
to their score had they been a human the whole time. When OZs have not been revealed, fake player entries will be created with the name "????" but with the correct score.
Type = info: Returns a JSON object containing the following attributes:
-
game_begins
- Time that the game begins (should be UTC, but currently isn't) game_ends
registration_begins
registration_ends
-
oz_reveal
- The time that OZs will be revealed on the site and through the API. -
now
- The current "game time". Before the game starts, this is equal togame_begins
and after it ends, this is equal togame_ends
. So, use this if you're trying to determine anything involving the current time. -
points_per_hour
- The number of points that should be awarded client-side to players for remaining human.
Type = squads: An array of squads, each containing the following properties:
-
id
- The unique ID of this squad. -
leader_id
- The player's unique ID that is the Squad Administrator -
name
- The name chosen by the squad leader for the squad. -
members
- An array of the player IDs of the players which are members of this squad.
...more to come.