Difference between revisions of "External Services and Tools/API Documentation"

From BattleMaster Wiki
Jump to navigation Jump to search
m
Line 1: Line 1:
 
All scripts are located at ''<nowiki>http://battlemaster.org/data/</nowiki>''. So, for example, to get the region data of [[Akesh Temple]], you would access the URL
 
All scripts are located at ''<nowiki>http://battlemaster.org/data/</nowiki>''. So, for example, to get the region data of [[Akesh Temple]], you would access the URL
 +
 
http://battlemaster.org/data/region.php?World=1&ID=1.
 
http://battlemaster.org/data/region.php?World=1&ID=1.
 +
  
 
== region.php ==
 
== region.php ==

Revision as of 15:55, 25 March 2009

All scripts are located at http://battlemaster.org/data/. So, for example, to get the region data of Akesh Temple, you would access the URL

http://battlemaster.org/data/region.php?World=1&ID=1.


region.php

Parameter Type Meaning
World integer Game world ID you access, see #World IDs
ID integer ID number of the region in question. You can find this for example by examining the URL of the "Details" link on the Region List page, or (if the page is already set up correctly) on the region's page here in the wiki.


Output:

<regiondata>
   <continent> string </continent>
   <name> string </name>
   <type> string </type>
   <area> string </area>
   <population> number </population>
   <economy> comma-seperated list of strings </economy>
   <realm> string </realm>
   <duchy> string </duchy>
   <lord> string </lord>
</regiondata>


realm.php

Parameter Type Meaning
World integer Game world ID you access, see #World IDs
ID integer ID number of the realm in question. You can find this for example by examining the URL of the "Details" link on the Realm List page, or (if the page is already set up correctly) on the realm's page here in the wiki.


Output:

<realmdata>
   <continent> string </continent>
   <colour> HTML colour value </colour>
   <name> string </name>
   <system> string </system>
   <rulertitle> string </rulertitle>
   <rulername> string </rulername>
   <generaltitle> string </generaltitle>
   <generalname> string </generalname>
   <judgetitle> string </judgetitle>
   <judgename> string </judgename>
   <bankertitle> string </bankertitle>
   <bankername> string </bankername>
</realmdata>


Additional Information

World IDs

The various game worlds of BattleMaster are internally accessed through ID numbers. Here is the mapping:

ID World
East Island
Atamara
Beluaterra
Colonies
Far East
Dwilight

Yes, 3 and 5 are missing. They used to be the IDs of South-West and South-East Island.


Output Values

Many values can be empty, e.g. when the realm currently has no banker, or if a region does not belong to a duchy (i.e. an imperial region). Empty values are always returned as empty strings, e.g.:

<bankername></bankername>

Nevertheless, external tools should fail gracefully if an expected tag is missing.


XML Tree

These data scripts were written with MediaWiki's External Data extension in mind. The extension does not parse an XML tree, but simply scans for key/value pairs. Therefore, we do not generate tree structures in our output. For example, in a pure XML environment, the output for realm governments would instead be something like

<ruler>
   <name> string </name>
   <title> string </title>
</ruler>

However, since the extension does not parse the tree, the next occurrance, say within the general tag would overwrite the variables "name" and "title".