Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/engine/front-end.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ Not ported: 3D RENDER MODE, which OpenReliant has no Direct3D devices for.
**Improvement:** the original can't load mods. GAME OPTIONS' MODS button opens OpenReliant's mods screen ([`mod_manager.zig`](../../src/engine/game/interface/mod_manager.zig), [#497](https://github.com/OpenReliant/openreliant/issues/497)) after `interface\optfade.bik`, on the settings screen's shapes and background (`interface\frntend5.spr`, `interface\optfade.tga`), laid out as its controls tab is:

- MODS, in white, centred on (320, 95), where the settings screen has its tabs.
- A framed list of the mods in the `mods` folder, from (45, 136), 324 by 250, with nine rows 26 pixels apart. Each row is a check box, ticked while the mod is on, and the mod's name and version from its manifest, or its folder name if it has none. The chosen row's name is white, a mod that is on but doesn't load is red, and a mod that is off is dim. The lists' arrows right of the frame scroll it, as the mouse wheel and the Up and Down keys do.
- A framed panel from (401, 136), 195 by 250, with the chosen mod's thumbnail where it has one, fitted to a box 175 by 70 at its top; its name, version, author, description and page; the mods whose files it replaces (REPLACES FILES OF) and the mods below it that replace its own (FILES REPLACED BY), each up to two lines; and in red why it doesn't load: an archive that doesn't match its checksum file, or a mod it needs that is missing, off, or below it. The description takes the lines the rest leaves.
- A framed list of the mods in the `mods` folder, from (45, 136), 324 by 250, with nine rows 26 pixels apart. Each row is a check box, ticked while the mod is on, and the mod's name and version from its manifest, or its folder name if it has none. The chosen row's name is white, a mod that is on but doesn't load is red, a mod the catalogue offers in a newer version is gold, and a mod that is off is dim. The lists' arrows right of the frame scroll it, as the mouse wheel and the Up and Down keys do.
- A framed panel from (401, 136), 195 by 250, with the chosen mod's thumbnail where it has one, fitted to a box 175 by 70 at its top; its name, version and author; in gold, UPDATE AVAILABLE IN GET MODS with the version where the catalogue offers a newer one that this OpenReliant can run, for an archive and not for a folder copied in by hand ([Getting mods from the catalogue](../guide/modding.md#getting-mods-from-the-catalogue)); its description and page; the mods whose files it replaces (REPLACES FILES OF) and the mods below it that replace its own (FILES REPLACED BY), each up to two lines; and in red why it doesn't load: an archive that doesn't match its checksum file, or a mod it needs that is missing, off, or below it. The description takes the lines the rest leaves.
- A gold box of up and down arrows (shape `0x2A`, lit with `0x2B` and `0x27`) at the foot of the gap between the frames, which moves the chosen mod up or down the order.
- The settings screen's buttons: OK and MAIN MENU in the left column, and in the right column REFRESH, where RESET DEFAULTS stands on the settings screen, and CANCEL CHANGES. REFRESH reads the `mods` folder again, to find mods added or removed since OpenReliant started, and keeps the chosen mod chosen. CANCEL CHANGES puts the mods back as they were when the screen opened, or at the last REFRESH. OK and Escape end the screen, back to GAME OPTIONS.
- OPTIONS, in the foot of the panel, where the chosen mod's scripts offer a page of options ([The mod's options](#the-mods-options)). It is a button of the settings screen's shapes (`0x28`, lit `0x29`) with its label right of it.
Expand All @@ -341,7 +341,7 @@ Each change is written to `starlancer.ini` at once, in the section `[OpenReliant
- The framed panel from (401, 136), which says CHOOSE A MOD while nothing is selected, and otherwise shows the selected mod's thumbnail, downloaded when the mod is selected and fitted into the same box as on the mods screen; its name; right under it, its status line, in gold: INSTALLED with the installed version, BY HAND where the settings file doesn't record the install, and UPDATE TO with the catalogue's version where it is newer, INSTALLED BY HAND AS A FOLDER: INSTALL WON'T REPLACE IT where a folder mod of the name is in the `mods` folder, DOWNLOADING with the percentage, CANCELING once CANCEL was pressed, or INSTALLED: RESTART TO APPLY; in red: NEEDS OPENRELIANT with the version, or why the install failed. Then its version and author; its full category, as IN SHIPS / FIGHTERS / ALLIANCE; the repository that lists it, as FROM openreliant-mods; the OpenReliant it needs, in red when it is newer than this one; its size and its description, which takes the lines left. During a download, a progress bar at the bottom of the panel, measured against the size the catalogue gives.
- The settings screen's buttons: OK and MAIN MENU in the left column. In the right column, INSTALL (or UPDATE when an older version is installed) where RESET DEFAULTS is, dimmed when there is nothing to do, and RELOAD where CANCEL CHANGES is, which reads the repositories again and tries again the thumbnails that failed. While a mod downloads, one download runs at a time and the catalogue can't change under it, so RELOAD is dimmed, and INSTALL reads CANCEL while the downloading mod is chosen and is dimmed while another is. CANCEL stops the download, which deletes its part file; the panel says CANCELING until the download's thread has stopped, then shows the mod as it was before. OK and Escape go back to the mods screen, which rereads the `mods` folder if a mod was installed.

The repositories `starlancer.ini` names ([Repositories](../guide/modding.md#repositories)) are read one after another into one catalogue, where the first repository to list an id wins, and the catalogue is kept until RELOAD or until the front end closes. A mod without the keys it needs (`id`, `archive`, `sha256`, `size`), whose id can't name a mod, or whose size is over 4294967295 bytes, the most a HOG archive's 32-bit offsets reach, is skipped with a line in the log, which escapes the id; an index in a newer format fails with THE CATALOG NEEDS A NEWER OPENRELIANT. Every download goes through [`web.zig`](../../src/engine/web.zig), on a thread of its own with its own HTTP client, and over HTTPS: `http` is changed to `https` before each request and each redirect, which the download follows itself, five at most; any other scheme is refused. Each request sends `OpenReliant` as its user agent. The player's own machine (`localhost` and the names under it, `127.0.0.0/8` and `0.0.0.0` in every form the system's resolver reads, such as `127.1`, and `::1`, `::` and the IPv4 addresses mapped into IPv6) is read only for a repository whose URL names it, and for the thumbnails and archives its index links, over plain HTTP. Anywhere else, a link to the player's machine, or a redirect to it from another host, fails with THE CATALOG POINTS AT THIS COMPUTER, so that a repository on the web can't make OpenReliant send requests to the services on the player's machine. A host name that the system's resolver turns into the player's own address isn't caught, since only the link itself is checked, but such a link is read over HTTPS, so a service there gets the start of a secure connection that it can't complete, never a request. A failure says what happened: the server's name can't be found, a secure connection can't be made, the system's certificates can't be loaded, too many redirects, a bad redirect, and so on. An index or a thumbnail gives up after 60 seconds, or after 15 seconds without anything arriving, and an archive after 30 seconds without anything arriving, with THE SERVER DOESN'T ANSWER. An index is read up to 4 MiB and a thumbnail up to 2 MiB; an archive is read up to the size the catalogue gives, and a download that goes past it, or that the server announces at another size, stops at once. INSTALL downloads the archive into `<id>.hog.part` in the `mods` folder, hashing the bytes on their way to the file. Once the archive is complete and matches the catalogue's digest, the digest is written as `<id>.hog.sha256.part`, the archive's part is renamed to `<id>.hog`, replacing an older copy, and the checksum file's part is renamed to `<id>.hog.sha256`; then the install is recorded in `[OpenReliantInstalledMods]` with the repository's name, so that the loader refuses the archive without its checksum file from then on. A download that fails or doesn't match leaves nothing behind; if the checksum file can't be put in place, the archive is removed again, with the checksum file of the copy it replaced. Leaving the screen lets a download continue. CANCEL stops it: its thread cancels the request, deletes the archive's part file and ends, and only then does the screen let the install go, so that an install of the same mod started right after can't run into the part file being deleted. Closing the front end lets go of a download without waiting, so that quitting is never held up, not even by a lookup of a host's address, which nothing can interrupt: the download's thread cancels it and ends on its own, deleting an archive's part file, unless OpenReliant has ended first, in which case the next install of the mod replaces the part file. Not yet: updates shown on the mods screen ([#1041](https://github.com/OpenReliant/openreliant/issues/1041)). The GET MODS button on the mods screen uses the settings screen's shapes, at (45, 116) with its label to its right, and is shown only when the settings file names a repository.
The repositories `starlancer.ini` names ([Repositories](../guide/modding.md#repositories)) are read one after another into one catalogue, where the first repository to list an id wins, and the catalogue is kept until RELOAD or until the front end closes. A mod without the keys it needs (`id`, `archive`, `sha256`, `size`), whose id can't name a mod, or whose size is over 4294967295 bytes, the most a HOG archive's 32-bit offsets reach, is skipped with a line in the log, which escapes the id; an index in a newer format fails with THE CATALOG NEEDS A NEWER OPENRELIANT. Every download goes through [`web.zig`](../../src/engine/web.zig), on a thread of its own with its own HTTP client, and over HTTPS: `http` is changed to `https` before each request and each redirect, which the download follows itself, five at most; any other scheme is refused. Each request sends `OpenReliant` as its user agent. The player's own machine (`localhost` and the names under it, `127.0.0.0/8` and `0.0.0.0` in every form the system's resolver reads, such as `127.1`, and `::1`, `::` and the IPv4 addresses mapped into IPv6) is read only for a repository whose URL names it, and for the thumbnails and archives its index links, over plain HTTP. Anywhere else, a link to the player's machine, or a redirect to it from another host, fails with THE CATALOG POINTS AT THIS COMPUTER, so that a repository on the web can't make OpenReliant send requests to the services on the player's machine. A host name that the system's resolver turns into the player's own address isn't caught, since only the link itself is checked, but such a link is read over HTTPS, so a service there gets the start of a secure connection that it can't complete, never a request. A failure says what happened: the server's name can't be found, a secure connection can't be made, the system's certificates can't be loaded, too many redirects, a bad redirect, and so on. An index or a thumbnail gives up after 60 seconds, or after 15 seconds without anything arriving, and an archive after 30 seconds without anything arriving, with THE SERVER DOESN'T ANSWER. An index is read up to 4 MiB and a thumbnail up to 2 MiB; an archive is read up to the size the catalogue gives, and a download that goes past it, or that the server announces at another size, stops at once. INSTALL downloads the archive into `<id>.hog.part` in the `mods` folder, hashing the bytes on their way to the file. Once the archive is complete and matches the catalogue's digest, the digest is written as `<id>.hog.sha256.part`, the archive's part is renamed to `<id>.hog`, replacing an older copy, and the checksum file's part is renamed to `<id>.hog.sha256`; then the install is recorded in `[OpenReliantInstalledMods]` with the repository's name, so that the loader refuses the archive without its checksum file from then on. A download that fails or doesn't match leaves nothing behind; if the checksum file can't be put in place, the archive is removed again, with the checksum file of the copy it replaced. Leaving the screen lets a download continue. CANCEL stops it: its thread cancels the request, deletes the archive's part file and ends, and only then does the screen let the install go, so that an install of the same mod started right after can't run into the part file being deleted. Closing the front end lets go of a download without waiting, so that quitting is never held up, not even by a lookup of a host's address, which nothing can interrupt: the download's thread cancels it and ends on its own, deleting an archive's part file, unless OpenReliant has ended first, in which case the next install of the mod replaces the part file. The mods screen uses the catalogue too, to say which of its mods have an update: with CHECK FOR UPDATES on ([Newer releases](../guide/configuration.md#newer-releases)), entering it starts this reading in the background, once per run, and each of its passes takes in what has arrived, as this screen's passes do; with it off, nothing is read, but a catalogue this screen has read serves all the same. Opened from the mods screen, GET MODS chooses the mod the mods screen had chosen, unfolding its group, where the catalogue lists it. The GET MODS button on the mods screen uses the settings screen's shapes, at (45, 116) with its label to its right, and is shown only when the settings file names a repository.

## The mod's options

Expand Down
8 changes: 5 additions & 3 deletions docs/guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ player doesn't launch, the launch counts as over 600 ticks, six seconds, into th
| `--developer-mode` | The tools for writing mods' scripts: the scripting console, which F11 brings up where a mod has scripts, and folder mods' scripts reloading when they or their shaders are saved ([Scripting](scripting.md#the-console)) |
| `--editor-link` | Listen for a mission editor or a script debugger, such as `openreliant debug`, on this computer's own address, 127.0.0.1, which can then pause the mission and stop and step its script, as the original's editor link does ([Debugging mission scripts](debugging.md)) |
| `--editor-link-port <port>` | With `--editor-link`, the port to listen at; 22539 by default |
| `--no-update-check` | Don't check for a newer release of OpenReliant. By default it checks as it starts, logs a newer release and shows it once in the main menu ([Newer releases](#newer-releases)) |
| `--no-update-check` | Don't check for a newer release of OpenReliant, and don't read the catalogue of mods on the mods screen. By default it checks as it starts, logs a newer release and shows it once in the main menu, and the mods screen says which mods have an update ([Newer releases](#newer-releases)) |
| `--screenshot <file.png>` | Draw one frame, with the camera settled, to a PNG, and quit; the controls, the `[OpenReliant]` settings and the details in `[Device]` are not read, so that it comes out the same each time |
| `--screenshot-ticks <ticks>` | With `--screenshot`, how many game ticks to run first, one a frame, so that the scene plays out; 2 by default |
| `--seed <number>` | Start each mission's random numbers from this seed, so that a run comes out the same each time, for testing; by default, as in the game, from the clock as the mission starts, and from a fixed seed with `--screenshot` |
Expand Down Expand Up @@ -197,7 +197,7 @@ Samples=8
| `Compressor` | 1 or 0, which AUDIO's COMPRESSOR sets | `--no-compressor` |
| `DeveloperMode` | 1 or 0; 0 by default | `--developer-mode` |
| `TextureCompression` | 1 or 0; 1 by default: the mods' pictures compressed for the GPU ([Modding](modding.md#compression)) | `--uncompressed-textures` |
| `UpdateCheck` | 1 or 0, which VIDEO's CHECK FOR UPDATES sets: whether OpenReliant checks for a newer release as it starts ([Newer releases](#newer-releases)) | `--no-update-check` |
| `UpdateCheck` | 1 or 0, which VIDEO's CHECK FOR UPDATES sets: whether OpenReliant checks for a newer release as it starts, and whether the mods screen reads the catalogue of mods for updates to the installed mods ([Newer releases](#newer-releases)) | `--no-update-check` |
| `UpdateSeen` | The newest release the main menu has shown you, such as `0.10.0`, which the main menu writes | |

The mods screen keeps which mods are on, and the order they load in, in a section of its own, `[OpenReliantMods]` ([The mods screen](modding.md#the-mods-screen)). The GET MODS screen reads the repositories of mods on the web from `[OpenReliantModRepositories]`, one line for each: a name of your choosing, and the URL of its `mods.json` ([Repositories](modding.md#repositories)). Without the section, it reads OpenReliant's own repository; an empty section hides GET MODS. It records the mods it installs in `[OpenReliantInstalledMods]`, one line for each: the archive's name, and the repository it came from. OpenReliant refuses a recorded archive whose checksum file is missing or doesn't match ([Getting mods from the catalogue](modding.md#getting-mods-from-the-catalogue)).
Expand All @@ -220,4 +220,6 @@ As it starts, OpenReliant asks GitHub's API for its latest release, in the backg

When a release newer than yours is out, the log says so, with the address of the release's page, and the main menu shows it once, in a dialog like QUIT's: YES opens the page in your default web browser, and NO closes the dialog. `UpdateSeen` keeps the release it showed you, so the dialog comes back only for a newer one. A build from source counts as the release it was built from, and pre-releases are never shown.

To turn the check off, untick CHECK FOR UPDATES on the settings screen's VIDEO tab, which takes effect at the next start, set `UpdateCheck=0`, or start with `--no-update-check`. A run with `--screenshot` never checks.
The same setting lets the mods screen read the catalogue of mods on the web as it opens, once per run, to say which of your mods have an update ([The mods screen](modding.md#the-mods-screen)). The repository's server sees your address then, as GitHub does for the release check. Nothing is read while GET MODS is hidden, that is, while the settings file names no repository ([Repositories](modding.md#repositories)).

To turn both off, untick CHECK FOR UPDATES on the settings screen's VIDEO tab, set `UpdateCheck=0`, or start with `--no-update-check`. The release check takes the change at the next start, the mods screen at once. A run with `--screenshot` never checks.
Loading
Loading