openOMSI GitHub Discord
Dedicated server

Docs / Multiplayer / Dedicated server

Uploads

2 min readEdit this pagedocs/SERVER.md

With accept_uploads = 1 a player may drive a bus the server does not have. Their game sends the files to the server, which keeps them and passes them on, so nobody sees a stand-in.

What is sent. Only what the player's game actually loaded for that bus: the variant and paint driven, the shared folders its files point into (..\..\Anzeigen, shared sounds) and the fonts of its displays. Stock OMSI 2 content and files that came from the server are never sent. Programs, libraries and plugins are refused by name and by content.

When. A joining player sends it under the loading screen (Getting your bus to the server), so the others see the real bus from the start. After three minutes the loading screen lets go and the rest continues in the background. A bus or paint changed in the game is sent the same way.

How others get it. Each game names the bus by its fingerprint, a hash over its list of files. A game that already has the same bus file for file uses its own copy. Otherwise it downloads that exact version from the server, never another version at the same path. At most three buses download at once.

Transfer. Files go in pieces of 1 MiB, compressed when that helps, over four connections at once. An interrupted transfer resumes where it stopped. A file counts only when its SHA-256 matches its list and it passes the content checks. A bus is drawn only when all its files are there.

Storage on the server. Every file is kept sealed once in ~/.openomsi/lan-store, by its SHA-256. A file several buses share is kept once. Every bus is a list of files in lan-store/vehicles/<fingerprint>.json. Two versions of the same mod are two buses, both kept.

  • Uploads are taken without asking and have no size limit.
  • A bus nobody drives is kept uploads_keep_days after its last use.
  • When the disk runs short, the buses nobody drives now go first, least recently used first. No bus is refused for its size.
  • To forget a bus by hand, stop the server and delete its .json.

accept_uploads = 0 turns uploads off. A game hosting a session (not a dedicated server) takes its players' buses the same way.

Something wrong or missing? Fix it on GitHub or open an issue.

↑↓ to move↵ to open