Editing Create 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:
The CreateGame API will create multi-player Warzone games programmatically.  You can specify the game settings, game name, and what players are invited to the game.
+
The CreateGame API will create multi-player WarLight games programmatically.  You can specify the game settings, game name, and what players are invited to the game.
  
 
==Usage==
 
==Usage==
Line 5: Line 5:
 
Using this can allow you to create a program that hosts your own tournaments or ladder-type systems.
 
Using this can allow you to create a program that hosts your own tournaments or ladder-type systems.
  
To create games via the API, you must POST some JSON to https://www.warzone.com/API/CreateGame that contains the details about the game you're creating.  Here's an example:
+
To create games via the API, you must POST some JSON to https://www.warlight.net/API/CreateGame that contains the details about the game you're creating.  Here's an example:
  
  
Line 31: Line 31:
 
* players:  This node defines the players that will be invited.  It consists of 'player' elements, each of which contains a 'token' attribute and a 'team' attribute:
 
* players:  This node defines the players that will be invited.  It consists of 'player' elements, each of which contains a 'token' attribute and a 'team' attribute:
 
** player team:  This can be the string 'None' if you're not creating a team game.  If you are creating a team game, then supply a number for each player identifying the team that they're on.  0 is team A, 1 is team B, 2 is team C, etc.
 
** player team:  This can be the string 'None' if you're not creating a team game.  If you are creating a team game, then supply a number for each player identifying the team that they're on.  0 is team A, 1 is team B, 2 is team C, etc.
** player token:  The token identifies the player you're inviting, or the string "OpenSeat".  Players can find their token by visiting https://www.warzone.com/InviteToken.  The invite token is the same as the number displayed in the address bar when you view a player's profile page.
+
** player token:  The token identifies the player you're inviting, or the string "OpenSeat".  Players can find their token by visiting https://www.warlight.net/InviteToken.  The invite token is the same as the number displayed in the address bar when you view a player's profile page.
** slot:  If you're making a game that uses a custom scenario, you must also provide a "slot" attribute on each player that let's Warzone know what scenario to give this player.  This should be an integer, where 0 is slot A, 1 is slot B, 2 is slot C, etc.
+
** slot:  If you're making a game that uses a custom scenario, you must also provide a "slot" attribute on each player that let's WarLight know what scenario to give this player.  This should be an integer, where 0 is slot A, 1 is slot B, 2 is slot C, etc.
 
* settings: Optionally, you can provide settings to customize the template you specified above.  To see a full list of settings, use the [[Query game API]] with GetSettings=true.
 
* settings: Optionally, you can provide settings to customize the template you specified above.  To see a full list of settings, use the [[Query game API]] with GetSettings=true.
  
Line 83: Line 83:
 
When creating games via this API, all players that are being invited to the game must have access to all features that your game uses.  For example, if you want to create a game that uses the spy card, then all players must have unlocked the ability to create games using the spy card.
 
When creating games via this API, all players that are being invited to the game must have access to all features that your game uses.  For example, if you want to create a game that uses the spy card, then all players must have unlocked the ability to create games using the spy card.
  
This restriction exists to prevent players from bypassing Warzone's member and level restrictions completely.  For example, if this restriction did not exist, someone could make a website that allowed any non-member to create a game for themselves using all of the member-only features.
+
This restriction exists to prevent players from bypassing WarLight's member and level restrictions completely.  For example, if this restriction did not exist, someone could make a website that allowed any non-member to create a game for themselves using all of the member-only features.
  
 
If you want to ensure that everyone you're inviting has access to the features you want to use, call the [[Validate invite token API]] and pass your template ID.
 
If you want to ensure that everyone you're inviting has access to the features you want to use, call the [[Validate invite token API]] and pass your template ID.

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