Skip to content

Online Play

RenanQueiroz edited this page Nov 26, 2026 · 8 revisions

Online Play

How the game's System Link and Xbox LIVE menus work online in LARecomp: the relay, the server browser, the command-line tool that reads the same servers, the nick check, Rate My Ride, leaderboards and the Online Tournament. Operators should read Relay Server, Master Server and Rate My Ride Server. Source: src/mc_engine/online/.

How it works

The game's own System Link session layer is used. LAN broadcast cannot cross processes or the internet, so the online client sends game packets to a relay over UDP. The relay forwards them between players and gives each player a virtual IP (vip) as identity. A master server lists relays for the in-game server browser and, optionally, keeps a registry of gamertags (nicks). Rate My Ride and leaderboards use a separate TCP server (see Rate My Ride Server).

Piece Default port Role
Relay UDP 31000 Matchmaker and packet relay.
Relay HTTP service TCP relay port + 1 (31001) Mod downloads and the operator dashboard.
Rate My Ride and leaderboards server TCP 31002 Shared storage for rides and boards.
Master server UDP and TCP 31003 Server list, nick registry.

Going online

  • The ONLINE checkbox in the SYSTEM LINK menu switches online on and off in a running game. The SDK gives up if the server does not answer within mcla_online_connect_timeout_ms, and online then stays off.
  • The SDK settings mcla_online.enable, mcla_online.server (host or host:port), mcla_online.port and mcla_online.connect_timeout_ms are read by the online client (the flat names mcla_online_enable, mcla_online_server, mcla_online_port and mcla_online_connect_timeout_ms still work). They are registered by the SDK, so type and default are not documented in this repository.
  • Rate My Ride and leaderboards reach the same host as the relay on TCP 31002, unless rmr_server names another one.
  • --join_server (a launch argument, see Joining a server from the command line) switches online on for one run, on the server it names.

Session size

The host menu can offer up to 31 players. A race still takes up to 16 racers. To change the host menu's upper limit, set net_max_players in larecomp.toml and restart. Use 16 for the game's original session limit.

Server browser (F6)

Opens with F6 (bind_server_browser) or the SERVER BROWSER row in the SYSTEM LINK and XBOX LIVE menus. It lists every relay the master lists plus your own, with icon, name, description, players and ping, and each relay's rooms with what they are playing. You can join one. While it is open the game gets no input; keyboard, mouse and a pad drive the window.

Joining uses the game's Quick Match: the browser names the host by its vip, the game's search keeps only that host, and the join script does the rest. "Play on this server" joins any session of that mode on the relay or hosts one for the next player. If the host is gone, the join is turned into the game's own "networking problem" error instead of making you host.

Joining from the pause menu: with the pause menu open on the SYSTEM LINK or XBOX LIVE page, the browser starts the search from that page and closes nothing, as the game's own QUICK CRUISE does. From any other state the join closes the pause menu first (only when one is open), waits until the game runs again, goes to the page and waits for it to finish loading, then checks that the search started (it asks again, twice, when it did not). A join is not started from a race, from the garage or while you are already in an online session: the browser says why (see the reasons below, and the table of Joining a server from the command line). "Done" in logs/join_server.txt means the game is in a session. A join you click while the city is still loading also waits for the game's start-up message box to close, if one is on screen; one that stays open for 2 minutes cancels the join (message_box).

If a room belongs to a relay other than the one you are on, the browser stores the room in server_browser_pending and restarts to switch servers.

Cvar Default Effect
online_master_server see Settings Reference Server list: host or host:port of a master (port 31003 if omitted). An empty or whitespace-only value uses your own servers and the current one. Delete the setting to restore the default list.
server_browser_servers "" Your own relays, comma-separated host:port.
server_browser_show_icons true Show each server's icon.

The browser asks the list and each relay through the same code as the command-line tool (src/mc_engine/online/server_browser/browser_query.cpp). The list is cut at 128 servers, 8 are asked at a time, and a relay that does not answer its details within 800 ms is shown as not answering. The list itself gets 1.5 s to connect and 3 s for its answer. Every text a relay sends (its name, its rooms) is cleaned of control characters, and an icon is used only when it is a PNG of at most 64 KB whose header claims at most 512 pixels on a side.

Joining a server from the command line

--join_server joins a server by itself, without the server browser. The game goes online on that server for this run only (the same as --mcla_online_enable=true --mcla_online_server=host:port; nothing is written to larecomp.toml, and a larecomp.toml line for join_server is ignored with a log line) and joins as the browser's Join button would, with no offer to accept and no 3 minute expiry. It overrides --mcla_online_server and --mcla_online_enable for the run (the log says so when they were given too). The argument is the setting join_server (debug only, never saved).

Argument Joins
--join_server=host[:port] or --join_server=host[:port],cruise Cruise: any Cruise session on that server, or hosts one for whoever comes next
--join_server=host[:port],race Race: any Race session on it, or hosts one
--join_server=host[:port],room:<gamertag> the room that player hosts (if nobody of that name hosts, the room of that name); host[:port],<gamertag> is the same for a text that is not cruise or race

The port is the relay's (31000 if left out). The host is a name or an address made of letters, digits, dots and hyphens; IPv6 addresses are not accepted. A room is found by the relay's room list, which relays of 16 October 2026 and newer answer (an older one cannot be asked for its rooms).

What the game does, in order:

  1. It waits for you to press Start and for the game to reach free roam with your car on the road (up to 20 minutes: a first start that builds shaders takes a while). The join never starts from the title screen, the loading screen or a menu. It also waits until the message box the game shows after Start has closed (and a moment after it); a message box that stays open for the whole 20 minutes cancels the join with the reason message_box.
  2. It asks the relay: does it answer (3 tries, 2 seconds apart), which mods does it need and does the game have them, and for a room, is it listed and not full (a room that is not listed yet is waited for 45 seconds). The whole check is given up after 3 minutes.
  3. It starts the same join as the server browser. If the pause menu is open it closes it first and waits until the game runs again.

What happens is written in the log ([join_server] lines) and in logs/join_server.txt, which the launcher reads. A failure also opens the server browser with the sentence in red. The file is rewritten whole on every change:

join_server_status=1
state=waiting|connecting|searching|joining|done|failed
server=host:port
target=cruise|race|room:<name>
reason=<word>        (only when failed)
message=<a sentence>
updated=<unix seconds>

done and failed are final. The reasons, with the sentence the game shows and logs:

reason Meaning
bad_argument The argument is not valid (the message says what is wrong with it).
online_unavailable Online play is not available on Linux yet.
online_failed Online play could not be switched on: the server did not answer.
server_unreachable The server did not answer (also when the relay check took more than 3 minutes).
server_too_old The server is too old to list its rooms, so the room cannot be found.
mods_missing The server needs mods this game does not have (the message lists them).
room_not_found No room hosted by that gamertag was found on the server.
room_ambiguous More than one room has that name: join it by its host's gamertag.
room_full The room is full.
room_gone The room is gone: it closed, is full, or is in another mode.
host_no_answer The room did not answer the search.
world_timeout The game did not reach the city in the time allowed, so the join was cancelled.
pause_open The pause menu stayed open, so the join was cancelled.
message_box A message box in the game stayed open, so the join was cancelled.
menu_unavailable The game's online menu could not be opened.
race_on A race is on: finish or quit it, then join.
garage_open The garage is open: leave it, then join.
in_session You are already in an online session: leave it from the pause menu first, then join.
no_session The game's search did not start or join a session.

Nick check and identity (F8)

A relay may check gamertags. When it does, a nick only plays from a PC that proves it owns the nick on the master the relay names. Until the proof lands the relay does not answer the register, so the game finds no server and keeps retrying. A new game session gets a grace period (default 20 seconds, set by the relay) before its nick must be proved.

F8 (bind_identity) opens the identity window. It opens by itself when something needs you. It shows who you are online, whether the server admits the nick, the recovery code to write down, a transfer to cancel, a nick to recover, and a password-protected backup.

Status texts of the window and what they mean:

Status Meaning
Online is off. Online is not enabled.
Checking... Asking the relay and master right now.
No nick check from the server The relay does not answer (an old relay, or it is down).
Server does not check nicks The relay has no identity_master_key; anyone plays under any nick.
Nick verified The relay admits this nick from here.
Nick taken Someone else owns the nick on the relay's master.
Nick coming to you Your recovery code moves the nick to you at a stated time.
Nick server unreachable The master the relay names does not answer.
Nick check failed Anything else; the window shows the detail.

Facts from the code:

  • The first player to claim a nick on a master owns it. A recovery code or a backup moves it to another PC.
  • The identity is kept outside the save folder, so sharing a save shares no identity. The same save on another PC starts a new identity (new XUID); the nick needs a backup or its recovery code to follow.
  • A recovery code is shown once. The window keeps it until you confirm you wrote it down.
  • If someone uses your recovery code, the nick moves to them after a hold unless you cancel from the window. The hold is set by the master (default 168 hours).
  • A nick unused for the master's expiry (default 90 days) is free again.
  • The key is a file in the identity folder (<id>.key, sealed for your Windows user). It is never overwritten without a copy: importing a backup of another key keeps the key it replaces as <id>.key.replaced-<time> beside it, and a key file the game cannot read is moved aside as <id>.key.unreadable (a second one as .unreadable-2, and so on). If a file cannot be moved aside the game leaves it alone, runs on a new identity that is not saved, and says so in the log.
  • A key file is written to a temporary file, flushed, and then moved into place, so a crash or a power cut leaves the old key.

The identity commands of the tool

larecomp_online_tool identity ... does from the command line what the F8 window does: it shows who a profile is, asks a relay what it says about the nick, backs the key up, restores it, handles the recovery code, moves a nick with its code, stops someone else moving it, and renames the gamertag. It uses the game's own identity code, so a key written by one is read by the other, byte for byte. A launcher runs it; the commands and their JSON are in src/mc_engine/online/online_tool/README-identity.md.

Command Does
identity show The gamertag and the key's fingerprint. Local, instant, safe while the game runs.
identity check --server host[:port] What F8 shows: does the relay check nicks, and is this nick verified, taken or coming to you. It asks the nick server only with --claim (registers the nick if it is free) or --refresh.
identity backup, identity restore The password-protected backup file, as F8's Export and Import.
identity recovery show, check, confirm, remind The recovery code: show it, check a typed one, confirm that you wrote it down, set the reminder.
identity recover, identity cancel Move a nick to this PC with its recovery code; stop someone else moving it.
identity rename A new gamertag (optionally claimed on a server).

The rules the tool keeps: passwords and recovery codes come in on standard input and never on a command line, in a log or in its output; every command that changes a file refuses while the game is running (the game rewrites the whole key file on its own changes); the nick server is asked only for what the command was told to ask, one request and no retry, so its limits (30 requests a minute, 3 new nicks a day per IP) are not touched; a key is never deleted, and a restore over another key keeps the old one beside it.

Rate My Ride and leaderboards

The mode runs in the game; the storage that died with the original servers is replaced.

Cvar Default Effect
rmr_enabled true Serve Rate My Ride from our backend. Off gives the stock "server not available".
rmr_server "" host[:port]. Empty uses the relay host when online is on, otherwise a local store shared by the profiles on this PC. local forces the local store.
rmr_server_port 31002 TCP port when the server runs on the relay host. A port typed into rmr_server overrides it.
rmr_diag false Log every request and record.
leaderboards_enabled true Serve the Xbox LIVE stats boards (race wins, battle modes, race times) from the same server. Off gives empty boards.
leaderboards_diag false Log every leaderboard read and write.

Without a server, Rate My Ride falls back to a local store on your PC.

The ONLINE TOURNAMENT mode uses the same settings and server; see Online Tournament.

Car config repairs

LARecomp repairs broken vinyl layers and impossible tuning values on received cars and Rate My Ride imports. It also checks your garage cars when loading a save. Turn online_car_guard_notice off to hide repair messages. Repairs still run.

Other online cvars

Cvar Default Effect
online_ignore_content_check true Ignore the session DLC compatibility check when joining or hosting. The stock check wrongly demands South Central DLC even when nobody owns any.
net_lift_big_session_limits false Sessions of more than 8 players keep damage, debris, world props and default session settings. Applies to the next session you host. Menu: EXTRAS > NO 8 PLAYER LIMITS.
online_race_prop_guard true Skip the physics update of a prop whose owner is broken instead of crashing.
online_diag false Log session content masks at the join check. Verbose.
online_race_prop_watch "" Diagnostic: guest address of a prop to watch.

Discord Rich Presence has its own cvars (larecomp_discord_rpc and related; the switch applies at once, no restart); see Settings Reference.

Full rows with sources: Settings Reference.

The command-line tool

larecomp_online_tool is a small program built with the game (the CMake target larecomp_online_tool, next to larecomp_relay_server and larecomp_master_server; no SDK, no game running, no settings file). It asks the servers what the game's own screens ask: the server list and each relay's name, players, rooms, mods and icon (what F6 shows), and the Rate My Ride, leaderboards and tournament screens' data. It prints one JSON document on stdout per call and nothing else there. A launcher runs it; an operator can too. It is read-only except where said below, and it is built from the game's own code (the same messages, the same text cleaning, the same Rate My Ride and leaderboard codecs), so the game and the tool read an answer the same way.

Command Asks
--version, --protocol The tool's version, and the commands, limits and message sizes it knows.
servers The server list (--master host[:port]) and your own relays (--servers a,b): each relay's name, players, rooms with their modes, mods and icon.
rmr table, top, mine, photo Rate My Ride: how many rides are ranked, a page of the top, a player's ride, ride photos.
rmr rate Rates a ride. The one command that changes data on a server: it needs --confirm.
lb views, size, top, around, owners The leaderboards: which boards exist, their size, the top rows, the rows around a player. With --tables (the game's online_tables.json, or the folder it is in) a board says whether it is a race-time board and each row of one has its time.
tournament current, standings, next, rewards The week's race, car rule and prizes, the standings, the next weeks, and a player's prizes.
  • The tool has no server list address of its own: it asks the list it is given with --master (a launcher passes the player's online_master_server); without it no list is asked.
  • It asks no more often than the game does (a launcher keeps to one call every 8 seconds at most), writes only the icon and photo files it is told to keep, and never reads the game's identity key or larecomp.toml.
  • The player's Rate My Ride token never goes on a command line: --token-stdin reads it from standard input, and only rmr rate and tournament rewards send it. The other commands use it only to know the player's public owner key (or take --owner). It is never printed.
  • Exit code 0 means the document is the answer (a server that does not answer is still an answer); 2 means the command line was wrong.
  • servers --pretty, and the other options, are in src/mc_engine/online/online_tool/README.md.
  • The identity commands, and --profile for the rmr, lb and tournament commands, read and write the player's identity files: see The identity commands of the tool.

Files the game writes for other programs

File Contents
logs/join_server.txt The progress and result of --join_server, as described under Joining a server from the command line. It is removed at the start of a run that has no --join_server, so it is never an earlier run's answer.
logs/online_tables.json The game's own online tables, read from its memory a few seconds after start and written once a run (and again after 90 s only if more of the table filled in; a file with the same text is left alone): the stats views with their columns (from the game's XDBF resource) and the session property names with the words of their values (what a room's GameMode and the like mean). The tool reads it to tell a race-time board from a score board, and a launcher or a bug report can read it to name them without the game running. It holds no player data, and nothing of it is shipped with LARecomp: the game writes it from its own files.

Known limits

  • A relay older than 16 October 2026 does not answer the info queries the browser uses (src/mc_engine/online/relay_info.h).
  • --join_server needs the game's online client, which is not available on Linux yet (the reason is online_unavailable). A room cannot be joined on a relay older than 16 October 2026, which does not list its rooms.

Troubleshooting

Symptom Check
Game finds no server The relay may be refusing your nick (log: REFUSED gt=... nick not verified on this relay). Open F8 and read the status.
Browser shows no relays online_master_server empty or unreachable; add your relay to server_browser_servers.
Join fails with "networking problem" The host left before the join finished.
Rate My Ride says "server not available" rmr_enabled is off, or rmr_server points at a server that is down.
Boards empty leaderboards_enabled off, or the server on TCP 31002 is not reachable.
ONLINE TOURNAMENT says "server is not available" Same as Rate My Ride, or the server predates tournaments (13 November 2026).
The log says [identity] ... is unreadable here; moved aside, starting a new identity The key file could not be read (another Windows user wrote it, or it is damaged), so it was kept as <id>.key.unreadable in the identity folder and the game made a new identity. A backup or the recovery code brings the old nick back. If it says could not be moved aside, the file was left alone and this session runs on an identity that is not saved.
--join_server ends with state=failed Read reason= and message= in logs/join_server.txt; the table under Joining a server from the command line says what each reason means.
Join says a race is on, the garage is open or you are in a session A join starts from free roam, or from the pause menu's SYSTEM LINK or XBOX LIVE page. Finish or quit the race, leave the garage, or leave the online session from the pause menu, then join again.

Clone this wiki locally