Expand description
Sending requests and downloading files on native builds (blocking; run it off the main thread in the game), and writing installed packages to the pack folder.
Enums§
- Source
- What to install: a file of a mod (Premium), or the file an
nxm://link names. - Step
- How far an installation has got, for a progress display.
Constants§
- KEY_
SETTING - The settings file’s key for the API key (the file is
key=valuelines). - KEY_
VARIABLE - The environment variable that holds an API key; it wins over the settings file.
Functions§
- download
- Download a file, calling
progress(done, total)as it arrives (totalwhen the server says it). Download links need no headers. - install
- Write packages into the pack folder (
WinData), replacing packages of the same name. Each is written to a temporary file first and then renamed, so a failed write leaves no half-written package. - install_
from - Get the download link for
source, download it, take out its.pkmpackages and write them todir. Returns the paths written. - key_
in_ settings - The
KEY_SETTINGvalue in a settings file’s text. - send
- Send a request and return the body of a 2xx answer.
downloadmarks a download-link request, whose 403 means the account needs Premium. - settings_
path - The game’s settings file:
BANISHED_SETTINGSif set, elsesettings.txtin thebanished-wasmfolder of the platform’s configuration folder (as the game reads it). - stored_
key - The API key:
KEY_VARIABLE, else theKEY_SETTINGline of the settings file. An empty value counts as none.