Expand description
Optional banishedinfo.com support for Un-Banished:
list and search the site’s Banished mods, read a mod’s versions, and install the .pkm
packages of a version. It is not part of the original game.
The site has no public API. Its mod list loads from a JSON address the browse page itself
uses (/mods/ajax?action=mods&…), its search page carries its results as JSON in the page
(var mods = […]), and a mod’s page links each version (/mods/download/<mod>/<n>), whose
file (/mods/file/<mod>/<n>) redirects to the package or archive. No account is needed.
Requests are made only when the player lists, searches or installs, one at a time, with a
user agent that names Un-Banished (user_agent). The site sends no CORS headers, so a
browser page cannot read it: the support is for native builds (native).
This crate builds the addresses and reads the answers; native sends the requests.
Modules§
- native
- Sending the requests on native builds (blocking; run them off the main thread in a window), and installing a version.
Structs§
- Mod
- A mod as the site lists it.
- Version
- One version of a mod, newest first in
parse_versions.
Enums§
Constants§
Functions§
- file_
name - The file name at the end of a download’s address (
/mods/file-download/264/XP-Schools.pkm). - list_
url - The address of
countmods fromstartof a section (""for all), in an order. - parse_
list - Read the answer of
list_url: a JSON list of mods (empty past the end). - parse_
search - Read the search page of
search_url: the results it carries asvar mods = […];. - parse_
versions - Read a mod’s page (
Mod::page): its versions, newest first, from the links/mods/download/<id>-<name>/<n>">Download version <label>(the page of modid). - search_
url - The address of the site’s search for
text. - user_
agent - The user agent sent with every request: the application, its version and where it lives.