HTTP Shopping API Documentation

Until they are released they are saying just start the creative mode servers locally and test against that.

I completely read past that! Thanks for pointing that out!

Not sure if that is what you are looking for

1 Like

I’m going to guess with the API key will come the URLto GET from

My guess is there is no validation on the creative server right now. As soon as I get the thing to start locally I can verify that

did anyone write a response parser yet? I have no experience with binaries :frowning:

I have some oort for sale on one of my local servers.

But when querying for it, I get a zero length response.

image

Is the response cached for a time and I should wait for it to appear, or am I doing something wrong?

Content type is text/plain here, if you check the http resonse code it will not be a 200 i’m hoping! (200 responses on this endpoint will be application/binary contenttypes). The endpoint is rate-limited to once per second to ensure cant stall responses for ‘real players’ in-game. Querying faster will just reject until a second passes.

I see, it’s a 404. I was expecting the node http library to throw an error automatically for that :smiley:

But I don’t see what’s wrong. The testing client can’t connect to creative servers atm, there’s a version mismatch, related? Or a problem with my request :thinking:

Can you share the list-gameservers response? I notice you have 2 different ports in the second screenshot.

{
  _lastUpdate: 1581859517.458244,
  addr: '192.168.43.54',
  apiURL: 'http://192.168.43.54:8859/api',
  atmosphereColor: [ 0.08850499987602234, 0.9416580200195312, 2.8768720626831055 ],
  chunksURL: 'http://192.168.43.54:8859/api/chunk',
  displayName: 'Creative',
  id: 1,
  info: {
    afkIdleInterval: 450,
    afkIdleThreshold: 900,
    maxPlayers: 0,
    players: 0,
    spawnWeight: 0.2619839906692505
  },
  ipAddr: '192.168.43.54',
  name: '1',
  numRegions: 1,
  planetsURL: 'http://192.168.43.54:8859/api/planet',
  region: 'creative',
  tier: 0,
  timeOffset: 1581846668.420033,
  waterColor: [ 0.07777100056409836, 0.31118398904800415, 0.5838239789009094 ],
  websocketURL: 'ws://192.168.43.54:8858/websocket/game',
  worldDescription: 'WORLD_TYPE_LUSH',
  worldSize: 192,
  worldType: 'LUSH'
},
{
  _lastUpdate: 1581859521.178272,
  addr: '192.168.43.54',
  apiURL: 'http://192.168.43.54:8959/api',
  atmosphereColor: [ 0.08850499987602234, 0.9416580200195312, 2.8768720626831055 ],
  chunksURL: 'http://192.168.43.54:8959/api/chunk',
  displayName: 'T3',
  id: 2,
  info: {
    afkIdleInterval: 450,
    afkIdleThreshold: 900,
    maxPlayers: 0,
    players: 0,
    spawnWeight: 0.26197099685668945
  },
  ipAddr: '192.168.43.54',
  name: '2',
  numRegions: 1,
  planetsURL: 'http://192.168.43.54:8959/api/planet',
  region: 'creative',
  tier: 2,
  timeOffset: 1581847835.290713,
  waterColor: [ 0.07777100056409836, 0.31118398904800415, 0.5838239789009094 ],
  websocketURL: 'ws://192.168.43.54:8958/websocket/game',
  worldDescription: 'WORLD_TYPE_LUSH',
  worldSize: 192,
  worldType: 'LUSH'
}

I had to skip the debug menu and run them directly from the command line, so the other server ports were copied from the first one with a small change.

“boundlessserver.exe” “–no-daemon” “–no-admin” “–config” “config/creative.json” “–port” “8858” “–apiPort” “8859” “–adminPort” “8860” “–udpPort” “8861” “–worldName” “1” “–worldId” “1” “–worldPath” “creativeworlds/1”

“boundlessserver.exe” “–no-daemon” “–no-admin” “–config” “config/creative.json” “–port” “8958” “–apiPort” “8959” “–adminPort” “8960” “–udpPort” “8961” “–worldName” “2” “–worldId” “2” “–worldPath” “creativeworlds/2”

Let me check why the Testing client is reporting a version issue.

1 Like

Latest release on Testing should work now.

3 Likes

I can confirm that it works now.

Alright, I have spent some more time trying to flush things out and I have found the following:

  • Beacon Size & Name decoded perfectly fine
  • Guild Tag Size & name decoded perfectly fine
  • The Buy From and Sell To appears to be swapped. That is Buy From lists Request Baskets and Sell To lists Shop Stands
  • When I extract the price that doesn’t seem to math out. For request basket buying at 250/275 the price comes back as 25,000. The quantity is accurate for the amount I have in there though. For the shop stand selling at 500/475 the price is 50,000 even though the quantity is 16
  • Location X appears to be the E/W value and is spot on
  • Location Z appears to be N/S but is inverted. It shows me 1075 when the game client shows me -1075
  • Location Y appears to be spot on.

I have now attempted to separate approaching to decode this. One uses a manual navigation of byte array and the second loading the byte array into a memory stream and reading through it progressively. They both net the exact same values.

if you compared against the player dui window, you’d see the z in there is opposite the N/S as well (for whatever ancient reason, the normal user-facing gui inverts the z, who knows why…), its accurate.

the price returned by the api is the raw price pre-tax, and integer units of cents (1 coin = 100 cents), its not multiplied by the item count or anything.

as James specified in the OP, B is for request Baskets (internally, buying_plinths), S is for Shop Stands (internally, selling_plinths)

2 Likes

Thanks for the clarification! I formed a mental block of B for Buy and S for sell lol. I can confirm it works as intended across the board. Thanks.

Does this mean that the response is fresh every time, no server side caching? I notice there’s an ETag, I assume this means I should provide the If-None-Match header in the requests.

There’s also some items which aren’t visible in the knowledge but still have a response, is there a way to know which items are queryable? The compileditems.msgpack doesn’t seem to help here, and an invalid item id gives an empty response, just like a valid item with no active orders.

I have some trouble getting the item list length to match that :smiley:

i based that 1114 on everything that “can be in the knowledge screen” which isnt really known server side per-say… so server just responds with an empty valid response as it doesnt care if its “allowed in a plinth or not”.

based on the compiledmsgpack… itll roughly (except for tokens) be anything that is “canDevGive”… excluding anything that “cant be got in game” (a bit complex…) but largely means “has no recipe” as there are some items that exist in the game/are valid/usable etc… but not possible to get in game as does not occur naturally and has no recipes etc (items designers added but at the last minute decided not to use, some brews fall into this category)

I could give you a dump of the itemids tomorrow if you remind me in a PM.

1 Like

This doesn’t seem to be the case, at least the server responds with the data when querying faster. Is the creative server different with the rate limiting than it’ll be on live? Trying to find out if I can schedule the next request 1 second after the previous one was initiated, or 1 second after I received the response.

At 1 second intervals and 1200 items it’d take 20 minutes to go through the list, should I not live on the edge and increase the delay a bit or is it safe to hammer it every second?