Jump to content
Game-Labs Forum
raskolnikoff

Public "API" for Naval Action

Recommended Posts

raskolnikoff    124

Recently we've finished preparing server data for public access and now we are ready to share it with community

Currently we prefer to avoid extra load on our servers so "API" does not contain run-time information, instead we're making dump of all data each time when we do maintenance and export it to google storage

All information about shard contained in 4 files:
- ItemTemplates_*.json
- Shops_*.json
- Ports_*.json
- Nations_*.json
where '*' replaced by internal shard name (ex. ItemTemplates_cleanopenworldprodeu1.json) and stored at google storage (ex. https://storage.googleapis.com/nacleanopenworldprodshards/ItemTemplates_cleanopenworldprodeu1.json)

From this data you can access description about all item templates in game (not items), shop content, port statuses and national information, but there is no player specific data

Also, in here (http://pastebin.com/Q68M53ev) you can find simple tool based on top of this data - TradersTool, which allows to find specific items/resources/materials/... within specified range from port and filtered by nation

Share this post


Link to post
Share on other sites
Martin    7

And to think I was trying to reverse engineer those http requests and rabbit mq protocol calls.

 

THANKS ALOT!!!!!

 

Also your link is broken the bracket at the end needs to be removed from the url.

Edited by Martin

Share this post


Link to post
Share on other sites
qw569    1,170

Супер теперь не надо тратить время на изучение того, что производится и потребляется в городах.

Share this post


Link to post
Share on other sites

And to think I was trying to reverse engineer those http requests and rabbit mq protocol calls.

 

THANKS ALOT!!!!!

 

Also your link is broken the bracket at the end needs to be removed from the url.

Thanks Martin, I fixed the errant parenthesis.

Share this post


Link to post
Share on other sites
raskolnikoff    124

raskolnikoff there is another api mentioned in the pastebin post, are we meant to be able to access that :)?

this is api made by Slik, he is reading this topic, so you can ask directly :)

Share this post


Link to post
Share on other sites
slik    702

raskolnikoff there is another api mentioned in the pastebin post, are we meant to be able to access that :)?

If you mean shipsofwar.net - yes, you can use it. I will update it using the new data.

Share this post


Link to post
Share on other sites
Martin    7

If you mean shipsofwar.net - yes, you can use it. I will update it using the new data.

Maybe enable queries to use the parameters id, name etc in the lookups. Would be nice :).

 

e.g http://api.shipsofwar.net/ports?apikey=secret&id=133

 

 

 

instead we're making dump of all data each time when we do maintenance and export it to google storage

Could we be so bold as to ask for a nightly backup =D

 

I've attached this picture as a bribe 

369550_f288_625x1000.jpg

Edited by Martin

Share this post


Link to post
Share on other sites
Prater    5,325

Some people are going to get very rich.

 

Ya, not sure that shop info should be given out, but ports is nice.

Share this post


Link to post
Share on other sites
Grim DeGrim    668

Ya, not sure that shop info should be given out, but ports is nice.

If it is made available to those with the skills / know how to get it outside of game, they should just build an auction house into the game and make it EASILY available to all players ingame.

Easy of access and use does not favor the general masses of the gaming population. A select few will get rich with this data.

Overall, I love the API. But there is some concern as noted :)

Share this post


Link to post
Share on other sites
Mored    83

i now tested the link in

http://jsonlint.com/

and it also displayed an error, so can you confirm this please?

 

Error: Parse error on line 1:
var ItemTemplates =
^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '[', got 'undefined'

Edited by Mored

Share this post


Link to post
Share on other sites
Prater    5,325

If it is made available to those with the skills / know how to get it outside of game, they should just build an auction house into the game and make it EASILY available to all players ingame.

Easy of access and use does not favor the general masses of the gaming population. A select few will get rich with this data.

Overall, I love the API. But there is some concern as noted :)

That is exactly what is going to happen.  It will be a requirement on every map to have the data.  But those who can play right after server maintenance will get a very clear picture of the economy and can go grab everything up.

 

The port data is nice, it allows us to update port nationality changes easily.  That doesn't really affect anything because it is what we have on the map in game.  But what the shop data will make it so the current shop data on the map is irrelevant.  Right now you only get consumption and production based on the ports you travel to.  Now you can look at an external map and get everything.

For example.

Under the shops api.  First entry is ID 3.  If you look at the ports api, ID 3 is Walker's Cay.  It produces item template 40 (Pine), 41 (Redwood), 42 (Silver), 43 (stone).  Comparing the data between the game and the files will give the formula to put the produced amount into to get the actual produced amount.

 

It has silver currently in stock as of the last maintenance. 

{"TemplateId":42,"Quantity":23,"SellPrice":70,"BuyPrice":90,"BuyContractQuantity":-1,"SellContractQuantity":300},

Share this post


Link to post
Share on other sites
Prater    5,325

P.s.  As of server maintenance

 

Nassau has 4 gold in stock

Harbour Island has 175 gold in stock priced at 159

George's Town has 9

Ragged Cay has 5

Atwood has 9

Nuevitas has 265 priced at 152

Puerto Del Padre has 140 priced at 159

Baracoa 125 at 159

Port Antonio 251 at 152

 

etc

 

I did this all quickly by hand.  A computer can do it in seconds shortly after server maintenance is done and without error (I could have made errors because I was quickly skimming)

Share this post


Link to post
Share on other sites
admin    28,100

Some people are asking why it was done and will it break game balance.

 

1) requests that some services were trying to get from the servers loaded them with queries creating all sorts of problems

2) based on the types of requests we were getting some players have already done similar tools - creating advantage without sailing anyway

 

API is open now. But we can all decide eventually what we need in it and what should remain hidden.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×