Jump to content
Game-Labs Forum

Public "API" for Naval Action


Recommended Posts

  • 1 month later...

 

 

Does the API address this suggestion I posted about the economy? 

And is there a currently functioning website somewhere that reads the economic data?

Or can a non-coder (me) read the data directly and manipulate it in a spreadsheet?

This is a big issue on the PvE server.  The population is low enough in my time zone that clans aren't going to provide a workaround.

Link to comment
Share on other sites

  • 2 weeks later...
On 15.02.2018 at 2:57 PM, Marcus Valerius Corvus said:

Does the API address this suggestion I posted about the economy? 

And is there a currently functioning website somewhere that reads the economic data?

Or can a non-coder (me) read the data directly and manipulate it in a spreadsheet?

This is a big issue on the PvE server.  The population is low enough in my time zone that clans aren't going to provide a workaround.

1. API provides:
- Item in each shop
- sale price / sale quantity - so if someone is selling through contract it will show that price and the contracts quantity, the same for the NPC sale
- buy price / buy quantity - so if the NPC store would buy any ammount of the item the price would be set, if that's a contact it would show how many items would that be
- biggest issue on this is the fact the data is provided at maintenance time, and it is not updated during day time

2. From what i know there is no "working" website.

3. Yes, it is possible to parse the API data to identify items sold/bought. I'm doing that myself. ;) (greedy bastard mode) 

  • Like 1
Link to comment
Share on other sites

8 hours ago, Darayavahus said:

1. API provides:
- Item in each shop
- sale price / sale quantity - so if someone is selling through contract it will show that price and the contracts quantity, the same for the NPC sale
- buy price / buy quantity - so if the NPC store would buy any ammount of the item the price would be set, if that's a contact it would show how many items would that be
- biggest issue on this is the fact the data is provided at maintenance time, and it is not updated during day time

2. From what i know there is no "working" website.

3. Yes, it is possible to parse the API data to identify items sold/bought. I'm doing that myself. ;) (greedy bastard mode) 

That contract data is precisely what I am after.  The shop screen at Navalactioncraft looks like it was supposed to do this (at least in part) but appears to have had no updates since last summer.  Seems a bit erratic in how accurate and what exactly gets posted.

What are you loading the API data into to parse it?

I tried a couple things that were supposed to read the json file and output a table but couldn't get them to work.  But I really have NO idea what I am doing.

 

Link to comment
Share on other sites

On 3/2/2018 at 7:45 AM, Darayavahus said:

Txt file :D then i use Authotkey macro that looks for certain items i described in excel sheet which is my final output aswell.

Will try that.  I originally was trying to use the pastebin file in the original post and I couldn't get it to load.  I am guessing it is stale javascript that my browser doesn't like.

Link to comment
Share on other sites

  • 1 month later...
On 3/3/2018 at 11:12 AM, Marcus Corvus said:

Will try that.  I originally was trying to use the pastebin file in the original post and I couldn't get it to load.  I am guessing it is stale javascript that my browser doesn't like.

And I find that I don't have time to fiddle with this as a casual player.  Sailing, crafting, combat and trading all take time.  I have to focus on something.  In my case that is trading IN-GAME.  This needs to be either a packaged tool I can download and run without modification, an easily manipulated delimited file, or packaged inside the trader tool where the player contract data belongs.

Link to comment
Share on other sites

7 hours ago, Wraith said:

It is a delimited text file, as XML is highly structured in fact, but just more flexible in the type of data structures it can contain than more common, "flat" structures. 

The links of the OP are accurate as of server reset. We'll likely never see a true API to the live data because of the server overhead and the fact that providing this data is probably low priority. 

I get that it is not going to be live data.  My issue is that I can't figure out how to get it into a form I can work with without creating a huge daily chore.

Since I am settling down to something to something in the neighborhood of six hours a week for the game it's time to cut the lines and move on.

Link to comment
Share on other sites

On 4/13/2018 at 3:57 PM, Marcus Corvus said:

I get that it is not going to be live data.  My issue is that I can't figure out how to get it into a form I can work with without creating a huge daily chore.

Since I am settling down to something to something in the neighborhood of six hours a week for the game it's time to cut the lines and move on.

https://nicktestxyz.com/na_cache/

I'll be working on eco data next.

BTW this is a temporary solution/test version.  

  • Like 1
Link to comment
Share on other sites

30 minutes ago, Jean Ribault said:

Pretty cool stuff.  However, your column sorting does not seem to be working correctly.  Was I doing something wrong?

filter just removes the unmatched entries from the main dump, columns should sort if you click on them. There's some weirdness with that grid I'm using though so I wouldn't be shocked if something was bugged. I had to remove currency symbols before for it to sort the gold correctly. Just a test for now I may not even use that grid in the final version because of its odd ins and outs.

Edited by koiz
Link to comment
Share on other sites

  • 3 months later...

Is there an error in Nation.json? Because I am trying to parse it in C++ with the Qt json classes and all but nation work... in nation I get this error: "garbage at the end of the document".

Also your api is not really json... it is json wrapped in java script so in c++ you need to filter the lead and the end out. Would somewhat be nice if you would provide pure json data without the java script heading...

 

Link to comment
Share on other sites

20 minutes ago, John Hood said:

Is there an error in Nation.json? Because I am trying to parse it in C++ with the Qt json classes and all but nation work... in nation I get this error: "garbage at the end of the document".

Also your api is not really json... it is json wrapped in java script so in c++ you need to filter the lead and the end out. Would somewhat be nice if you would provide pure json data without the java script heading...

 

Delete in beginning var Nations = and in the end ;

Your proposal the author of topic will not see. Look at his last visited time and last message.

 
Edited by qw569
Link to comment
Share on other sites

28 minutes ago, qw569 said:

Delete in beginning var Nations = and in the end ;

Your proposal the author of topic will not see. Look at his last visited time and last message.



 

I do that for all the others... for Nations it somehow does not work...

Link to comment
Share on other sites

I found the bug... a stupid mistake with stripping out the java script that I guess they need for jsonp... instead of looking for the equal I started to strip at the { and well Nations as only one uses a [... kinda easy to overlook but clearly my mistake :)

 

https://jsonformatter.curiousconcept.com/ this link helped me to find it because well it looks much better then looking at it in chrome...

Edited by John Hood
Link to comment
Share on other sites

  • 1 month later...

@DaRho

I check sha256 of both files and don't see difference.

curl 'http://storage.googleapis.com/nacleanopenworldprodshards/Ports_cleanopenworldprodeu1.json' | sha256sum
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  830k  100  830k    0     0   9.9M      0 --:--:-- --:--:-- --:--:-- 10.0M
42b325be07bda30b6ae60fd0ed97033cab40da7d4c5a85e2eea641c7dc174749  -
curl 'https://storage.googleapis.com/nacleanopenworldprodshards/Ports_cleanopenworldprodeu1.json' | sha256sum
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  830k  100  830k    0     0  18.4M      0 --:--:-- --:--:-- --:--:-- 18.8M
42b325be07bda30b6ae60fd0ed97033cab40da7d4c5a85e2eea641c7dc174749  -

btw You always can check if file updated or not by HTTP headers like  Last-Modified, x-goog-hash and Etag.

 

curl -I 'https://storage.googleapis.com/nacleanopenworldprodshards/Ports_cleanopenworldprodeu1.json'
HTTP/1.1 200 OK
X-GUploader-UploadID: AEnB2UoMcLeJGTB44mPSO2incD2rjDLycNX1Pze_n3R0pkpyyEgzzbxbdESLJQNFrKlijbwH9Y3_PCHmGVvVvWFgvYS9Z50aCA
Date: Fri, 31 Aug 2018 11:50:50 GMT
Expires: Fri, 31 Aug 2018 15:50:50 GMT
Last-Modified: Fri, 31 Aug 2018 10:20:26 GMT
ETag: "64d192ae2adf25362cbe19b0281e5724"
x-goog-generation: 1535710826390446
x-goog-metageneration: 1
x-goog-stored-content-encoding: identity
x-goog-stored-content-length: 850198
Content-Type: text/plain
x-goog-hash: crc32c=OEkE/g==
x-goog-hash: md5=ZNGSrirfJTYsvhmwKB5XJA==

x-goog-storage-class: STANDARD
Accept-Ranges: bytes
Content-Length: 850198
Server: UploadServer
Cache-Control: max-age=14400
Age: 1208
Alt-Svc: quic=":443"; ma=2592000; v="44,43,39,35"

Edited by qw569
  • Like 1
Link to comment
Share on other sites

Quite strange... I checked again a moment ago, and could see differences with my bare eyes. Then used some online comparison tool for URLs (https://www.diffnow.com/) and it has shown no differences... refreshed the pages in browser again, and now they're the same... very odd. Perhaps some cache issue or something. However I checked that on few PCs at my home at the issue was on all of them, now it's gone... Anyway - thanks for the reply. BTW. Did never consider to check the headers to see if the data was updated already. Good idea. Thanks.

Link to comment
Share on other sites

14 minutes ago, DaRho said:

Quite strange... I checked again a moment ago, and could see differences with my bare eyes. Then used some online comparison tool for URLs (https://www.diffnow.com/) and it has shown no differences... refreshed the pages in browser again, and now they're the same... very odd. Perhaps some cache issue or something. However I checked that on few PCs at my home at the issue was on all of them, now it's gone... Anyway - thanks for the reply. BTW. Did never consider to check the headers to see if the data was updated already. Good idea. Thanks.

There is a special type of HTTP request HEAD which return only HTTP headers. In my example i use curl with parameter -I

Edited by qw569
Link to comment
Share on other sites

  • 5 weeks later...
  • 3 weeks later...

O7.

Where do I find Ship planking (trim) recipe data? I could find all recipe data except for that one.

For eg. L'Ocean Blueprint (Item ID 747), provides all crafting ingredients information in "FullRequirements" node, and Frame Ingredients in "WoodTypeDescs" node, but I fail to find information on Planking ingredient amounts. What am I missing?

 

image.thumb.png.a30bf825338949325e1de31372f1830e.png

Link to comment
Share on other sites

13 hours ago, DaRho said:

O7.

Where do I find Ship planking (trim) recipe data? I could find all recipe data except for that one.

For eg. L'Ocean Blueprint (Item ID 747), provides all crafting ingredients information in "FullRequirements" node, and Frame Ingredients in "WoodTypeDescs" node, but I fail to find information on Planking ingredient amounts. What am I missing?

 

As I remember, and if I understand the question correctly, then you need to look for TemplateId = 14 (Oak Planks)

 

Link to comment
Share on other sites

Thank You @qw569 but I guess I was not precise enough in my question.

What I meant is that I would like to check, how many, and which resources do I need to obtain to craft a ship of a certain type (to calculate, for eg. the real production cost). So I look at, let's say, item template 747, which is the L'Ocean Blueprint, and I can see all "ingredients" in "FullRequirements" node. Of course, those ingredients, have their own ingredients and then I need to find those as well, etc, until I reach "raw materials". The problem is, that ships, as opposed to other craftable items, have different "versions" (different frame and planking woods). Depending on choice here, different woods wood framing parts and planking are required, and also - a different amount of those materials, depending on the choice. I was able to find how many framing parts of a certain wood is required depending on wood framing choice ("WoodTypeDescs" node), but I can't find information on the "planking" part. For eg. if I choose L'Ocean Teak / Fir, I can find, how many Teak Framing Parts I need, but not how many Fir Planks I need to craft it. I thought for a moment, that it would be a fixed amount, just a different wood type, but it's not like that and the number of planks needed changes depending on the wood choice, so I'm missing this information in the recipe.

Or am I missing something?

Link to comment
Share on other sites

×
×
  • Create New...