Jump to content

Additions to Nation API


dmjohnston
 Share

Recommended Posts

I would like to suggest that the following items be added to the nation API:

 

Defensive Slots open

Vacation mode status (yes/no and possibly turns left)

☾☆

Priest of Dio

º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸

¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸

¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

Link to comment
Share on other sites

/api/nations/ already has vacation mode, it is the number of turns left of vacation. You can find out that information there.

 

Though yes, it is missing from /api/nation/id=<nationid> and I agree that it should be available there.

 

As for including defensive slot count, too narrow. A better solution would be to include all wars for a nation in the individual nation api (see below for mock layout). Means you might have to do a bit of work to get aggressive/defensive counts. But at least you then also know other things like who is at war with whom (useful for tracking whether someone has attacked the proper target, for example).

 

nationdata{
  ...,
  wars: {
    {
      id: <warid>,
      attacker: <nationid>,
      defender: <nationid>
    },
    {
      id: <warid>,
      attacker: <nationid>,
      defender: <nationid>
    },
    ...
  }
}
EDIT: Also, linking similar request https://politicsandwar.com/forums/index.php?/topic/10522-nation-api-enhancement/ Edited by Shakyr

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

Or just have a war API like I've been begging for since forever.

 

You can already get war information by scraping but the code that I have to write for it is so nasty I want to cringe.

[22:37:51] <&Yosodog> Problem is, everyone is too busy deciding which top gun character they are that no decision has been made

 

BK in a nutshell

Link to comment
Share on other sites

Or just have a war API like I've been begging for since forever.

That was why I only had the bare minimum listed, for inclusion in the nation API. The actual war API could contain more details (referenced by <warid>).

 

:)

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

I asked specifically for the slots open simply because it's already being shown on the nations listing, so it should be an easy addition.

☾☆

Priest of Dio

º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

¨°º¤ø„¸ GOD EMPEROR DIO BRANDO¨°º¤ø„¸

¨°º¤ø„¸ DIO BRANDO GOD EMPEROR¨°º¤ø„¸

¨°º¤ø„¤¤º°¨ ø„¸¸„¨ ø„¸¸„ø¤º°¨¨°º¤ø„¸¸„ø¤º°¨¨°º¤ø„¸

Link to comment
Share on other sites

I asked specifically for the slots open simply because it's already being shown on the nations listing, so it should be an easy addition.

I'd be surprised if the number of open slots is being stored directly. More than likely, it's an SQL count of the war data (well that is how I'd do it) and there is little difference (in difficulty) between counting SQL rows to print out a count and printing out those rows instead.

 

That, combined with the fact that an API should not be too narrow (otherwise Sheepy will be forever adding in bits and pieces), meant I decided to extend your request :)

  • Upvote 1

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.