Editing Query game API

Jump to: navigation, search

Warning: You are not logged in.

Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
Warzone can provide programmatic access to the details about multi-player Warzone games.  This allows for the more technical users to write a program that can analyze information about games.  This data is only available for ladder games, tournament games, games created by the [[Create game API]], or games that you played in.
+
WarLight can provide programmatic access to the details about multi-player WarLight games.  This allows for the more technical users to write a program that can analyze information about games.  This data is only available for ladder games, tournament games, or games created by the [[Create Game API]].
  
 
There's nothing the feed can see that isn't already available through the game's normal interface.  This is just a way to write custom analyzers which allows for a broader analysis across games.  
 
There's nothing the feed can see that isn't already available through the game's normal interface.  This is just a way to write custom analyzers which allows for a broader analysis across games.  
 
The primary goals of this API is to enable tools that do statistical analysis of finished games and to enable custom ladders or custom tournaments to check on the winners of the game after it's over.
 
  
 
==Usage==
 
==Usage==
  
To access the data, use a URL like this: https://www.warzone.com/API/GameFeed?GameID=1212978
+
To access the data, use a URL like this: http://warlight.net/API/GameFeed?GameID=1212978
 
+
This will return data describing basic details(id, state, name, numberOfTurns, lastTurnTime, templateID, players) about the game.
+
 
+
If you want to get the entire turn history of the game, add an additional querystring parameter '''GetHistory=true'''.  Adding this will cause the API to return you details about every turn of the game assuming it's finished.
+
 
+
If you want to get a game's settings, add an additional querystring parameter '''GetSettings=true'''.  Adding this will cause the API to return you details about the settings of the game.
+
  
If you want to get a game's public chat message, add an additional querystring parameter '''GetChat=true'''.
+
This will return data describing basic details about the game.  If you want to get the entire turn history of the game, add an additional querystring parameter '''GetHistory=true'''.  Adding this will cause the API to return you details about every turn of the game.
  
 
==JSON Definition==
 
==JSON Definition==
Line 48: Line 40:
 
* Booted: This player was booted from the game.
 
* Booted: This player was booted from the game.
 
* Won: This player has won the game.  This state will only be present in games that have finished.
 
* Won: This player has won the game.  This state will only be present in games that have finished.
* EndedByVote: This player, along with the other remaining players in the game, have voted to end the game.  This state will only ever be present for games that are finished by voting-to-end.
+
* VotedToEnd: This player, along with the other remaining players in the game, have voted to end the game.
 
* Declined: This player declined the game and did not play.
 
* Declined: This player declined the game and did not play.
 
* RemovedByHost: This player was removed by the host via the "Add/Remove Players" button and did not play.  If you created the game via the Create Game API, you don't have to worry about this state since you're the host, and only you could remove players.
 
* RemovedByHost: This player was removed by the host via the "Add/Remove Players" button and did not play.  If you created the game via the Create Game API, you don't have to worry about this state since you're the host, and only you could remove players.
 +
 +
Each finished game is guaranteed to have at least one player with a Won state or a VotedToEnd state.
  
 
==Getting a list of Game IDs==
 
==Getting a list of Game IDs==
  
In order to use the game feed, you'll need to know the game ID.  This can be obtained through the graphical Warzone client by opening up the Settings panel and examining the "Link to Game" field.  At the end of this field, you'll see GameID= followed by a number.
+
In order to use the game feed, you'll need to know the game ID.  This can be obtained through the graphical WarLight client by opening up the Settings panel and examining the "Link to Game" field.  At the end of this field, you'll see GameID= followed by a number.
  
 
To find game IDs programmatically, you can use the [[Game ID feed API]].
 
To find game IDs programmatically, you can use the [[Game ID feed API]].

Please note that all contributions to Warzone Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Warzone Wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox