Print Page | Close Window

Trade XML feed

Printed From: Illyriad
Category: Miscellaneous
Forum Name: Technology & data
Forum Description: Discussions on data dumps, downloads, and third party applications.
URL: http://forum.illyriad.co.uk/forum_posts.asp?TID=10877
Printed Date: 24 Jul 2021 at 17:59
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


Topic: Trade XML feed
Posted By: GM Stormcrow
Subject: Trade XML feed
Date Posted: 06 May 2021 at 17:30
TRADE XML

Hey everyone,

Here's an example of a trade XML feed, based on real data.  I bought the first 1 wood order in the nearest hub to me Big smile and turned the underlying data into a parse-able format.

<trade_orders>
  <server>
    <name>elgea</name>
    <country_code>gb</country_code>
    <language_code>en</language_code>
    <live_date>2010-02-21T21:53:01.190</live_date>
    <data_generation_datetime>2021-05-06T16:19:25.207</data_generation_datetime>
  </server>
  <trade_order id="2900625">
    <transaction_datetime>2021-05-06T14:43:01.060</transaction_datetime>
    <location_type id="2">Hub</location_type>
    <order_type id="6">Collecting goods from trade hub offer</order_type>
    <trade_offer id="756706" />
    <offer_by>
      <player id="400767">
        <name>Lochlainn</name>
      </player>
      <town id="0" />
      <collectedfromhub id="198">
        <name>Memor</name>
      </collectedfromhub>
      <alliance id="2123">
        <name>Elves</name>
        <ticker>ELVES</ticker>
      </alliance>
    </offer_by>
    <accepted_by>
      <player id="1">
        <name>GM Stormcrow</name>
      </player>
      <town id="1">
        <name>Stormont</name>
      </town>
      <alliance id="18">
        <name>Band of Devs</name>
        <ticker>DEVS</ticker>
      </alliance>
    </accepted_by>
    <item id="17">
      <name>Wood</name>
      <quantity>1</quantity>
      <price_per_item>0.850000</price_per_item>
    </item>
  </trade_order>
</trade_orders>

The whole thing should be fairly self-explanatory, however:

trade_order_id is the unique reference for this purchase or sale of a specific quantity from a buy or sell order
trade_offer_id is the unique reference for the buy or sell order itself

location_type_id is the general location of the order being accepted, and will be either
1 = Town 
2 = Hub

order_type_id 
Values that could be returned are:
2 = Town Sell Order
5 = Town Buy Order
6 = Collecting goods from a trade hub sell order
7 = Delivering goods to a trade hub buy order

Comments welcome, additional information you want etc, please do let me know.

Thanks in advance,

SC





Replies:
Posted By: Jejune
Date Posted: 06 May 2021 at 18:57
This is fantastic, GM Stormcrow. Thank you! The individual XML files that accompany combat reports have proven to be incredibly useful and reliable for a number of inititives, and if we can have similar files for other actions that take place and are communicated via IGM, it will enhance gameplay.

One question: will all trade-related IGMs include an XML file? For example, when caravans are intercepted by a blockade, harvesters destroyed, etc.?


-------------
https://elgea.illyriad.co.uk/a/p/394156" rel="nofollow">


Posted By: GM Stormcrow
Date Posted: 07 May 2021 at 14:22
Originally posted by Jejune Jejune wrote:

One question: will all trade-related IGMs include an XML file? For example, when caravans are intercepted by a blockade, harvesters destroyed, etc.?
Hi Jejune,

Yes; though I'll be doing the action xmls one at a time.  Once people have had a look at this proposed format (above) and it's generally agreed to work for what people want, then I'll roll it out to live, check it's working, and start adding variants to other trade-related messages.

Cheers,

SC


Posted By: GM Stormcrow
Date Posted: 12 May 2021 at 18:58
If no other comments on the trade XML proposal, I'll implement it as suggested.  

Speak now, or forever hold your etc!

Best, 

SC


Posted By: Tensmoor
Date Posted: 12 May 2021 at 20:59
Sorry SC, been tied up (not literally) with some DurcTools stuff. The proposal looks like it has absolutely everything anyone could need.

Tens


Posted By: DarkenedHeart
Date Posted: 14 May 2021 at 14:44
Looks good.  Been a busy work for me.

Question I have is will this be expanded to track when buy / sell orders have been placed or removed at hubs/towns?  Or is this purely for transaction based tracking?


Posted By: GM Stormcrow
Date Posted: 20 May 2021 at 11:49
Originally posted by DarkenedHeart DarkenedHeart wrote:

Question I have is will this be expanded to track when buy / sell orders have been placed or removed at hubs/towns?  Or is this purely for transaction based tracking?
This is currently transaction-based tracking on an individual trade level.

If there is demand, I'm happy to expand it out to a proper higher-level feed linking to all individual-player trades at an API key level.  So far, the general consensus seems to be that the higher level 'listing' API isn't really a priority.

I totally get what you're asking about a global buy/sell orders feed, however there's a few issues with that conceptually, regarding asymmetry of information etc.  

ie, if there's a feed of all current order books in all hubs, then the idea of hub visibility range/radius is impaired, as everyone can theoretically have access to perfect pricing information across Illyria at all times.   My worry there is that traders who take advantage of price disparities between hubs could potentially find themselves out of a career if perfect knowledge is available to all.  There's still a price/quantity/distance/opportunity cost argument to be had, of course, even with perfect information.

Though, as always, am receptive to thoughts/discussion on this.

Best,

SC



Posted By: GM Stormcrow
Date Posted: 03 Jun 2021 at 11:31
This should now be live.  I'd be very grateful if players could test out that it's returning what's expected on pressing the XML button, and let me know of any issues soonest.

Best wishes,

SC


Posted By: Tensmoor
Date Posted: 03 Jun 2021 at 13:40
At first glance it looks OK SC but I'll do a more complete check in a bit.
Tens


Posted By: GM Stormcrow
Date Posted: 03 Jun 2021 at 13:48
Originally posted by Tensmoor Tensmoor wrote:

At first glance it looks OK SC but I'll do a more complete check in a bit.
Tens
Fab, thanks Tens.

SC



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net