Jump to content

Small Alliances API Issue


Printer635
 Share

Recommended Posts

Hi Alex,

 

At around this time in the morning (11 am GMT), alliances that have recently deleted are still visible in the API but their score value disappears resulting in a key value error.

 

EG 1: {"id":"3936","founddate":"2016-12-19 19:04:37","name":"Mono","acronym":"","color":"aqua","continent":"Europe","rank":115,"avgscore":0,"flagurl":"https:\/\/politicsandwar.com\/img\/flags\/americansomoa.jpg","forumurl":"","ircchan":""}

 

EG 2: {"id":"3911","founddate":"2016-12-15 03:16:01","name":"Loner","acronym":"","color":"black","continent":"Europe","rank":112,"avgscore":0,"flagurl":"https:\/\/i.imgur.com\/ntCnXWy.png","forumurl":"","ircchan":""}

 

Given "avgscore" is still there it should be easy enough to include "score":0 until the API updates and removes the alliance entry.

 

Also as I'm here, you could annoy everyone by changing the "ircchan" key name to something discord related now *runs away*

 

Ta,

 

Printer

 

 

 

 

Link to comment
Share on other sites

You should be checking for the existence of the key first anyways, before referencing it. Keys have been renamed in the past.

 

Hopefully the issue with deleted alliances showing up in the API will get resolved soon, though.

sig_cybernations.PNG.8d49a01423f488a0f1b846927f5acc7e.PNG

Link to comment
Share on other sites

  • Administrators

Deleted alliances can't show up in the API. If you're seeing them in the API, they haven't been deleted yet.

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

Deleted alliances can't show up in the API. If you're seeing them in the API, they haven't been deleted yet.

 

Managed to nab some evidence, it says in game the alliances have been deleted when I follow the id given by the API(See Below)

 

{"id":"3922","founddate":"2016-12-16 16:13:11","name":"The Alliance of the Tri-force","acronym":"","color":"red","continent":"Europe","rank":154,"avgscore":0,"flagurl":"https:\/\/politicsandwar.com\/img\/flags\/canada.jpg","forumurl":"","ircchan":""}

 

yZz7Pmn.png

Link to comment
Share on other sites

  • Administrators

When you view an alliance page with no members, it deletes the alliance. If you try to look at the API after you've looked at the alliance, it won't be there.

Is there a bug? Report It | Not understanding game mechanics? Ask About It | Got a good idea? Suggest It

Forums Rules | Game Link

Link to comment
Share on other sites

When you view an alliance page with no members, it deletes the alliance. If you try to look at the API after you've looked at the alliance, it won't be there.

Is it possible to add a check then, if you request an alliance via the API, with no members, it deletes the alliance and serves back an error?

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.