Play Now Login Create Account
illyriad
  New Posts New Posts RSS Feed - 03OCT15 - XML API update, notifications
  FAQ FAQ  Forum Search   Register Register  Login Login

03OCT15 - XML API update, notifications

 Post Reply Post Reply
Author
GM Stormcrow View Drop Down
Moderator Group
Moderator Group
Avatar
GM

Joined: 23 Feb 2010
Location: Illyria
Status: Offline
Points: 3926
Post Options Post Options   Thanks (0) Thanks(0)   Quote GM Stormcrow Quote  Post ReplyReply Direct Link To This Post Topic: 03OCT15 - XML API update, notifications
    Posted: 03 Oct 2015 at 23:36
Hi everyone,

Live, immediately, some additions and changes to the API XML (with thanks to Kubluntu for flagging these up) and notifications.

Combat API XML
  1. New entries on the XML combat API list ( /external/combatreportsapi/[yourkeyhere] )

    The attacker only will now get entries for individual reports where combat does not occur upon arrival for:

    a) Usage of the Feint stratagem

    b) Friendly-fire incidents ("arrived at x under orders to y-hostile-act but found friendly units...")

    c) Timed Orders to:
      i) Occupy
      ii) Siege
      iii) Blockade

  2. Addition of a new field: <occupationlengthsecs>

    This field is only populated via the Attacker's XML Key (ie Occupier, Sieger or Blockader).

    The field appears in the <combatoverview>...<datetime>... XML block
  • If blank or not supplied, then it is not available in this XML report
  • If zero, then the order given is not capable of a timer (ie Attack or Raid)
  • It non-zero & non-blank, contains an integer reflecting the length of time in seconds that the army has been ordered to perform this occupying/sieging/blockading task
Please note that complete sets of this new XML data is only available for arrivals from now on - historic data will either not be available or will be incomplete.

SAMPLE XML OUTPUT
Of a non-contested occupation report.

This XML file does not appear to have any style information associated with it. The document tree is shown below.
<combatevent>
<script/>
<server>
<name>elgea</name>
<servercountrycode>gb</servercountrycode>
<serverlanguagecode>en</serverlanguagecode>
<serverlivedate>2010-02-21T21:53:01.190</serverlivedate>
<datagenerationdatetime>2015-10-03T22:09:48.110</datagenerationdatetime>
</server>
<personalcombatkey id="XXXXXXXXXXXXXXX"/>
<uniquecombatidentifier>
<server id="elgea"/>
<combatguid id="XXXXXXXXXXXXXXX"/>
<troopmovementevent id="XXXXXXXXXXXXXXX" occurrence_datetime="2015-10-03T22:03:41.987"/>
<datacomplete id="1"/>
</uniquecombatidentifier>
<combatoverview>
<location>
<X>384</X>
<Y>-1814</Y>
<terrainspecifictype id="50">Landslip</terrainspecifictype>
<terraincombattype id="4">Small Hill</terraincombattype>
</location>
<datetime>
<armymovementbegandate>2015-10-03T21:55:38.990</armymovementbegandate>
<combatoccurrencedate>2015-10-03T22:03:41.987</combatoccurrencedate>
<occupationlengthsecs>600</occupationlengthsecs>
</datetime>
<stratagem>
<armyaction id="6">Occupying</armyaction>
<feint>No</feint>
</stratagem>
<defensedataincluded>Yes</defensedataincluded>
</combatoverview>
<participants>
<participant>
<role>Attacker</role>
<player>
<playername id="1">GM Stormcrow</playername>
<troopsfromtown id="1">Stormont</troopsfromtown>
<alliance id="18">
<allianceticker>DEVS</allianceticker>
<alliancename>Band of Devs</alliancename>
</alliance>
</player>
<armies>
<army>
<armyname id="514810">Test Army 1</armyname>
<divisions>
<division>
<divisionname id="791189"/>
<commandername id="29130">Mantoa Beringer</commandername>
<commanderhealth>400</commanderhealth>
<units>
<unit>
<unitname id="123">Elite Praetorian Guardsmen</unitname>
<unitquantity>500000</unitquantity>
</unit>
</units>
</division>
</divisions>
</army>
</armies>
</participant>
</participants>
</combatevent>

NOTIFICATION ADDITIONS
  1. Army Arrival Notification

    There is now a notification supplied when your army arrives at a location under orders to occupy, siege or blockade.  

    This notification now appears ingame, and is also supplied with the notifications XML feed, with a notificationtype_id of 42 "Unit Army Arrives".

    Sample:
    <notification>
    <notification id="123456789"/>
    <notificationtype id="42">Unit Army Arrives</notificationtype>
    <notificationoveralltype id="4">Military</notificationoveralltype>
    <notificationtown id="0"/>
    <notificationdetail>
    [@ps=GM Stormcrow|1|DEVS|18|1|0|740-746-755-0-0-0-0-0-0-0-0-0-0|Illyriad Dev Team|Game Master|10-456-294-72] units from [@t=Stormont|1|383|-1815|13360|1|1|1|51|1|GM Stormcrow|DEVS|1|5-4 wall] arrive at [@l=384|-1814|51|50|5] with orders to occupy
    </notificationdetail>
    <notificationoccurrencedate>2015-10-03T22:03:42.823</notificationoccurrencedate>
    </notification>

    The final word will read "occupy", "siege" or "blockade", depending on the order type.

  2. Messenger Notifications

    Upon arrival, messengers currently provide a notification (type 33) - however this has now been modified to include the name of the town they were sent from.

    As above, this appears in both the ingame notifications interface as well as in the XML.

    Sample:

    <notification>
    <notification id="123456789"/>
    <notificationtype id="33">Diplomatic Mission Arrived - Messengers</notificationtype>
    <notificationoveralltype id="5">Diplomatic</notificationoveralltype>
    <notificationtown id="1"/>
    <notificationdetail>
    [@ps=GM Stormcrow|1|DEVS|18|1|0|740-746-755-0-0-0-0-0-0-0-0-0-0|Illyriad Dev Team|Game Master|10-456-294-72] messengers from [@t=Stormont|1|383|-1815|13360|1|1|1|51|1|GM Stormcrow|DEVS|1|5-4 wall] arrive at [@l=384|-1814|51|50|5]
    </notificationdetail>
    <notificationoccurrencedate>2015-10-03T22:29:22.333</notificationoccurrencedate>
    </notification>
    </notifications>
    </notificationsapi>

Please do let me know of any issues you run into with these data feeds.

Regards,

SC
Back to Top
ubluntu View Drop Down
Forum Warrior
Forum Warrior


Joined: 24 Aug 2013
Status: Offline
Points: 324
Post Options Post Options   Thanks (0) Thanks(0)   Quote ubluntu Quote  Post ReplyReply Direct Link To This Post Posted: 04 Oct 2015 at 00:27
Thank You!
Back to Top
Rill View Drop Down
Postmaster General
Postmaster General
Avatar
Player Council - Geographer

Joined: 17 Jun 2011
Location: California
Status: Offline
Points: 7078
Post Options Post Options   Thanks (0) Thanks(0)   Quote Rill Quote  Post ReplyReply Direct Link To This Post Posted: 04 Oct 2015 at 03:24
This is awesome, will help with ubluntu's planned king of the hill style tournament, I imagine?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.03
Copyright ©2001-2019 Web Wiz Ltd.