Editing Set map details 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 '''set map details API''' can be used by map creators to assist in creating their [[map]].  This API can do the things that the built-in Warzone map UI can do, such as setting [[Territories|territory]] names, setting territory center points, defining the connections between territories, etc.
+
The '''set map details API''' can be used by map creators to assist in creating their [[map]].  This API can do the things that the built-in WarLight map UI can do, such as setting [[Territories|territory]] names, setting territory center points, defining the connections between territories, etc.
  
 
== Preparation ==
 
== Preparation ==
Line 5: Line 5:
 
To use the API, you must first have uploaded your SVG file via the [[Map Making|normal process]].  After it's uploaded, click the button named "Get link for sharing" and you'll get a URL such as:
 
To use the API, you must first have uploaded your SVG file via the [[Map Making|normal process]].  After it's uploaded, click the button named "Get link for sharing" and you'll get a URL such as:
  
https://www.warzone.com/play?PreviewMap=5859
+
https://www.warlight.net/play?PreviewMap=5859
  
 
The number at the end of the URL is your map ID.  In the example shown, the map ID is 5859.
 
The number at the end of the URL is your map ID.  In the example shown, the map ID is 5859.
Line 11: Line 11:
 
==Usage==
 
==Usage==
  
To enter the details of your map without using the UI, you POST some JSON to https://www.warzone.com/API/SetMapDetails
+
To enter the details of your map without using the UI, you POST some JSON to https://www.warlight.net/API/SetMapDetails
  
 
The beginning of the JSON should look like this:
 
The beginning of the JSON should look like this:
Line 27: Line 27:
  
  
Your Warzone account's e-mail address and API token are always required, as is the map ID you're modifying.  You may get your API token using the [[Get API Token API]].  You may only enter the ID of a map you own, and the map must be in development mode (the same restrictions apply to editing the map with the UI.)
+
Your WarLight account's e-mail address and API token are always required, as is the map ID you're modifying.  You may get your API token using the [[Get API Token API]].  You may only enter the ID of a map you own, and the map must be in development mode (the same restrictions apply to editing the map with the UI.)
  
 
Note that after updating a map with the API, your browser may need to be refreshed to see the changes reflected in the UI.
 
Note that after updating a map with the API, your browser may need to be refreshed to see the changes reflected in the UI.
Line 53: Line 53:
 
   { command: 'addTerritoryConnection', id1: 56, id2:78, wrap: "WrapHorizontally" }
 
   { command: 'addTerritoryConnection', id1: 56, id2:78, wrap: "WrapHorizontally" }
  
Specify the two territory IDs as id1 and id2 attributes.  It does not matter which territory is 1 and which is 2, since all connections in Warzone are two-way.  
+
Specify the two territory IDs as id1 and id2 attributes.  It does not matter which territory is 1 and which is 2, since all connections in WarLight are two-way.  
  
As the wrap attribute, specify either Normal, WrapHorizontally, or WrapVertically to tell Warzone whether or not the connections wrap around the edge of the map.
+
As the wrap attribute, specify either Normal, WrapHorizontally, or WrapVertically to tell WarLight whether or not the connections wrap around the edge of the map.
  
 
Connections cannot be removed via the API, only added.  If you accidentally add a mistaken connection, it can be removed through the UI or you can delete the map and start over.
 
Connections cannot be removed via the API, only added.  If you accidentally add a mistaken connection, it can be removed through the UI or you can delete the map and start over.

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