FAF sim mods API

0

I'm trying to find an HTTP requests to sim mods vault, but couldn't find anything at api.faforever.com. I also tried to find related code in the downlords-faf-client sources, but I'm already exhausted serfing through these interfaces and functions without any particular values being set.
Please help me where can I find files to install or update sim mods or where in the downlords-faf-client sources should I search.
(The only link I have seen is that one in the (downlord's) client itself when it was running, it was something like content.faforever.com/.../...)

0

Go to the vault and click mods

1

API docs for the mod
API docs for the mod version
The result is valid JSON-API format as described on jsonapi.org

The query you are asking for: https://api.faforever.com/data/mod?include=latestVersion&filter=latestVersion.type==SIM
The easiest way is to get the query string from the client (tick the checkbox)

0

Oh, completely missed that "select a definition" bar. Thank you very much!

0

I don't want to spam another topic, but could someone explain how does featured_mod_versions work?
For example, I get the following info from the replay:
{..., 'featured_mod' : 'nomads', ... , 'featured_mod_versions': {'6': 81, '9': 72, '10': 95, '11': 95, '12': 95, '13': 95, '14': 95, '15': 72, '16': 95, '17': 95, '18': 95, '19': 95, '20': 95}}
What do these '6', '9', ... , '20' numbers mean? As I go to api.faforever.com none of these versions (95, 81, 72) have files with corresponding ids. Should I take maximum (95) as version?
Thank you.

0

Ahhh.. featured mods in replays is just retarded legacy crap.
The API has a dedicated endpoint for featured mods: Swagger doc
As you can see you need a featured mod id. You can look it up here

So how does this (not) work:
They key id refers to a particular file. The value refers to this files value.
Some values being lower than others means that this file has not been changed since then.
But you are right the maximum number gives you the actual patch version you can lookup in the api.

Since nomads is id=4 and version=95, basically this endpoint would give you the files you need: https://api.faforever.com/featuredMods/4/files/95

But: All featured mods are built on top of FAF base mod. The replay format json doesn't tell you which base mod version was played. There might be a chance that this info is in the binary replay stream though. (The client does not support this and the replay is broken if there is a base patch)

0

@Brutus5000 Thanks, I will take the maximum then.

P.S. Actually it (the info about FAF base mod) is in the binary replay stream and, fortunately, Python client can deal with it. So, if you want to fix this in your client, to get such info you should (according to the Python code):

  1. Open the replay file
  2. Read the data starting from line 2 (the first line is the JSON info)
  3. Decode the data from base64
  4. Decompress the data with zlib (you might want to remove the header (the first 4 bytes) to do this)

Now the decompressed data should begin like this: 'Supreme Commander v1.50.3717\x00\ ...', so you can decode it and extract the version (3717).

0

Nice I was wondering how the python client did it. Thanks for the info I will probably add this to the java client as well.

0
This post is deleted!
Log in to reply