Repository navigation
Mod Browser
An in-game window (F5, bind_mod_browser) for the mods installed in the mod folder and for mods the known servers offer. Source: src/mc_engine/modloader/modsbrowser/. Rows open and close with the key; while the window is open the game receives no input, and it can be driven with a controller read through XInput.
| Action | How it works |
|---|---|
| List installed mods | Every folder in the mod folder that the mod loader would treat as a mod, plus disabled and backup copies. Shows each mod's size, file count and its mod.toml information. |
| Switch a mod off or on | Renames its folder. Off adds the prefix .disabled_; on removes it. A folder starting with . is skipped by the mod loader, so the mod stops loading. |
| Clear old copies | Removes .old_<mod>_<time> backup folders that the browsers keep. |
| Update a mod | Installs a newer version a server offers. |
| Install a mod | Downloads a mod a server offers into the mod folder. |
| Restart | Changes take a restart; the window restarts the game with the same command line. |
Downloads go to .download_<mod>/ first. Only when every file has arrived and matched its hash does the old folder move aside as .old_<mod>_<time> and the new one take the mod's name. File hashes use FNV-1a 64-bit. What the client takes from a server is in What the client accepts.
A server's mod list is fetched over the relay's HTTP service. A mod is installed, missing or outdated; versions are compared as dotted numbers piece by piece (1.10 is newer than 1.9), and non-numeric parts compare as text.
Mod names: 1 to 64 characters, only the letters A to Z and a to z, digits, _, - and ., not starting or ending with ., and not a Windows device name (CON, PRN, AUX, NUL, COM0 to COM9, LPT0 to LPT9, with or without an extension). Two names that differ only in letter case count as the same name. A mod with another name is left out of the list without a log line of its own, and so is a name listed a second time. At most 64 mods are taken.
File paths. A file is refused, with server mod file rejected: <mod>/<path> in the log, when its mod was not taken or when its path:
- is empty, longer than 400 characters, or starts with
/; - contains
\or:; - has an empty part, a part starting with
.(which includes..), or a part ending in.or a space; - has a part that is a Windows device name (as for mod names) or contains
<,>,",|,?or*; - is the same as another file's path of that mod except for letter case;
- contains a control character;
- ends, in any letter case, in an extension Windows runs:
.exe,.dll,.bat,.cmd,.com,.ps1,.psm1,.psd1,.vbs,.vbe,.js,.jse,.wsf,.wsh,.hta,.msi,.msp,.mst,.scr,.pif,.cpl,.msc,.jar,.reg,.lnk,.url,.scf,.inf,.sys,.appref-ms,.application,.gadget, or.sh.
The other files go on being read.
Sizes. These fail the whole check, not one file: a file over 2 GiB, or more than 4 GiB over all the mods together (the server's mods are larger than this game accepts), and a mod list over 8 MiB.
For the information shown in the window, mod.toml is fetched only up to 16 KiB and the image up to 1 MiB.
Download. The server has to answer HTTP 200 with a Content-Length. The connection is IPv4; each read and each write on it gives up after 15 seconds (connecting is left to the system's own limit). A file whose size or hash differs from the list stops the download with arrived damaged (size or hash differ). A server that sends more bytes than the list says stops it with cancelled.
Source: src/mc_engine/modloader/modsbrowser/mod_download.cpp (ValidModName, ValidModPath, CheckServerMods, DownloadMod).
Optional file at the root of a mod folder. The mod loader reads meshes only, so it never sees this file. Fields:
title = "My Car Mod"
description = "..."
author = "..."
version = "1.2.0"
image = "preview.png"image is a PNG or JPG in the same folder, 1 MB at most.
| Message | Meaning |
|---|---|
[browser] server mod file rejected: <mod>/<path> |
A server listed a file path the client will not accept. |
[browser] mod download failed: <error> |
The download failed; the old copy stays. |
[restart] could not start the game again (error <code>) |
The game could not start itself again. It stays open and says so; close it and open it yourself. |
window message Cannot rename <folder> (<reason>)
|
The folder could not be renamed (for example because a file is in use). |
-
Mod Loader for what
.-prefixed folders mean. - Online Play for the server browser, and Relay Server for how a server offers mods.
LARecomp
Settings
Game Features
Mods
Content Modding
Development
Online
Server Hosting