Play Now Login Create Account
illyriad
  New Posts New Posts RSS Feed - Proposed Change to Notifications XML feed
  FAQ FAQ  Forum Search   Register Register  Login Login

Proposed Change to Notifications XML feed

 Post Reply Post Reply
Author
DarkenedHeart View Drop Down
New Poster
New Poster
Avatar

Joined: 05 Mar 2021
Location: Montana
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote DarkenedHeart Quote  Post ReplyReply Direct Link To This Post Topic: Proposed Change to Notifications XML feed
    Posted: 27 Apr 2021 at 23:13
Good Afternoon Stormcrow.  Just wanted to check in. Will there be a notification when this change has been made?  I will need to validate the existing code works and then look at modifying my code to pick up the new title with harvester type in the name.  No rush, just wanted to make sure I didn't miss this being implemented.
Back to Top
DarkenedHeart View Drop Down
New Poster
New Poster
Avatar

Joined: 05 Mar 2021
Location: Montana
Status: Offline
Points: 19
Post Options Post Options   Thanks (1) Thanks(1)   Quote DarkenedHeart Quote  Post ReplyReply Direct Link To This Post Posted: 07 Apr 2021 at 19:53
Also I noticed in your examples you added Miners to the front of the message.  If you do add "Miners" or "Herbalists" to the message it will help me eliminate another dive into the notification detail to pick up the code and determine the type of harvester.




Edited by DarkenedHeart - 07 Apr 2021 at 19:53
Back to Top
DarkenedHeart View Drop Down
New Poster
New Poster
Avatar

Joined: 05 Mar 2021
Location: Montana
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote DarkenedHeart Quote  Post ReplyReply Direct Link To This Post Posted: 07 Apr 2021 at 19:01
I've had a few busy days with work as well as interview prep for a career move soon.  My application currently pivots in the notification type id to go into different RegEx parsers of the detail.  While long term the number being different for the different types of messages whether successful or not would be the most beneficial.  How I am setup it wouldn't be a big issue to just change the wording rather than the number.  I can then do a match on the wording to determine if I need to parse for remaining resources on grid or not.  It is also beneficial for you guys so it doesn't require a larger build / development effort to resolve the issue.

Appreciate you seeking feedback on the solution.
Back to Top
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 Posted: 07 Apr 2021 at 09:37
Originally posted by Tensmoor Tensmoor wrote:

I do think this will be a big help for the desktop app that DarkenedHeart is working on. I'm a bit surprised he hasn't posted...
DarkenedHeart initially brought the "Caravans always disappointed" issue to my attention, and I've pointed him to this thread in case he has a definitive preference.

Thanks, Tens.
Back to Top
Tensmoor View Drop Down
Postmaster General
Postmaster General
Avatar

Joined: 07 Apr 2015
Location: Scotland
Status: Offline
Points: 1829
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tensmoor Quote  Post ReplyReply Direct Link To This Post Posted: 07 Apr 2021 at 09:27
Just had a look at some of my code in DurcTools - no idea what 90% of it is meant to be doing Shocked

I do think this will be a big help for the desktop app that DarkenedHeart is working on. I'm a bit surprised he hasn't posted...

Back to Top
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 Posted: 07 Apr 2021 at 09:20
Originally posted by Tensmoor Tensmoor wrote:

My first thoughts were that having the separate id codes would be the best as it would probably lead to cleaner code on my end but thinking about it I don't think it would really (ignoring my naturally messy code style Wink).
That was pretty much my own thought (about my own, also naturally messy, code style Embarrassed )
Back to Top
Tensmoor View Drop Down
Postmaster General
Postmaster General
Avatar

Joined: 07 Apr 2015
Location: Scotland
Status: Offline
Points: 1829
Post Options Post Options   Thanks (1) Thanks(1)   Quote Tensmoor Quote  Post ReplyReply Direct Link To This Post Posted: 06 Apr 2021 at 21:28
Personally, either option would be good from my point of view.

Without delving into the code for my notifications monitoring extension I don't think it checks any of the possibly affected areas and (at present) it doesn't offer any filtering either. I do need to do some work on the extension anyway (it doesn't display the part where it tells you if there are still items for that harvester on the tile) so I may well take advantage of this to update it.

My first thoughts were that having the separate id codes would be the best as it would probably lead to cleaner code on my end but thinking about it I don't think it would really (ignoring my naturally messy code style Wink).




Back to Top
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 Posted: 06 Apr 2021 at 19:32
Hi everyone,

Following discussions with a few of the excellent third-party toolmakers, I have a proposed change to the Notifications XML feed, and wanted to run it by the forum before deciding on which way to go.

There's a weirdness in the Notifications XML, in that if I send harvesters out to gather things, and they succeed in their job, the front-end UI says they did a good job, but the XML gives incorrect information.

THE WEIRDNESS

As an example, here's me sending some cotters out to harvest something.

Front-end UI (in reverse order):




... which is very much a successful mission for a cotter.

However, the Notifications XML for the actual harvesting report reads:


... which certainly says - in the <notificationdetail> field that they were successful in their gathering endeavours.  But in the <notificationtype> text, reads "Harvesting - Caravans Disappointed", when clearly they should not be.

THE PROPOSAL
I don't know who, if anyone, has code that relies on a <notificationtypeid> of 45 meaning "caravans disappointed", or if anyone compiles or has compiled a lookup table based on the match between the <notificationtypeid> and the text accompanying it...

What I can do is either:

a) continue to provide a <notificationtypeid> of 45 but with different text, depending on the outcome.  This could then use the text to say (eg) "Harvesting - Caravans Disappointed Entirely" (if they got nothing) or (eg) "Harvesting - Miners Gather Minerals" (if the miners got some),

or...

b) create new notificationtype ids for different outcomes.  

The advantage of a) is that it'll be quicker to implement, and may not involve much code/parser changes for those reading the notifications XML - but give some additional information at a higher level than parsing the notification detail.  The disadvantage of a) is that notificationtypeid = 45 becomes a catch-all for "something happened with harvesting".

The advantage of b) is that it continues to provide a clear one-to-one relationship between a notificationtypeid and the accompanying text.  The disadvantage is that it adds a bunch more new notificationtypeids that may require existing tools that read from the Notifications XML to alter their codebase, and will take a bit longer for us to implement at our end.

CONCLUSION
Those of you great folk who write code that reads the APIs have probably long known that this header wasn't right!  However, in fixing it, I don't want to make you do extra work.  So, if you're a Tensmoor-type (or Tensmoor himself!) and have a preference for the way I should 'make this right', please do let me know in this thread.

Otherwise, I'll probably do a) and vary the text flexibly, essentially changing notificationtypeid = 45 to a "Something happened with harvesting" broad brush, and providing the 'what happened' in the accompanying notificationdetail text.

Thanks for your time.

SC





Edited by GM Stormcrow - 06 Apr 2021 at 19:34
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.