Skip to content

A client is not started before the map it downloads is there - #339

Merged
cybersecurity merged 1 commit into
OpenCommunityEdition:mainfrom
FractumSeraph:map-share-game-start
Oct 19, 2026
Merged

cybersecurity merged 1 commit into
OpenCommunityEdition:mainfrom
FractumSeraph:map-share-game-start

Conversation

@FractumSeraph

Copy link
Copy Markdown

A client that is still downloading the game's Custom Edition map (map sharing) no longer freezes when the host starts the game.

The bug

  1. A client joins a lobby on a map it doesn't have and starts downloading it by map sharing.
  2. The host starts the game. It correctly holds the client's players out ("machine Port: keep blended colours within [0, 1] #1 is still downloading the map; the others will not wait").
  3. The client's download began in the lobby, so it doesn't know the game has started and asks for its player again. The host takes that as a late joiner's request and starts the machine at once ("machine Port: keep blended colours within [0, 1] #1 joins the game in progress at game tick Port: keep blended colours within [0, 1] #1").
  4. The client loads a map it doesn't have yet. cache_files_precache_map_begin shows the damaged disc error (display_error_damaged_media), which stops the game for good.

Stock build-201 does the same with a build-201 host, every time the host starts during a download.

The fix

  • Host (network_server_manager.c): a player asked for by a machine still downloading the map waits with the players held at the start (network_game_server_hold_requested_player). It joins with them, the machine started as a late joiner, once the download is done (network_game_server_release_map_fetchers).
  • Client (network_client_manager.c): a start that arrives while the map is still downloading is put off until the map is there (network_game_client_begin_game, network_game_client_idle_pregame). This covers a host of an earlier build. A put-off start is dropped if its game is over by then (another map, or another game).
  • NETCODE.md, "Map sharing": it said the host's start waits for a downloading machine, which it hasn't since version 28. It now says what happens.

Nothing sent changes, so the network version stays 28.

Checked

  • Linux CI steps in Docker (tools/ci_build.py linux release, the test step's pytest list: 325 passed; test_light_storage.py).
  • Web build and tools/test_web_build.py.
  • Windows release build (clang-cl, MSVC 2019's libraries).
  • End to end on Linux in Docker, on the loopback, the host starting the lobby game as soon as the client joined (the case that froze):
Host Client Before After
This build This build Damaged disc error, game stopped The host held the player ("holding a player on machine #1 until the map is downloaded"), then started it at game tick 296 once the download was done; the client played
Build-201 This build Damaged disc error, game stopped "the host started the game while its map is being downloaded: joining it once the map is there"; the client played once the map was there
This build Build-201 Damaged disc error, game stopped The host held the player; stock build-201 downloaded the map and played

🤖 Generated with Claude Code

A client that joins a lobby on a Custom Edition map it does not have
downloads it by map sharing. When the host started the game meanwhile, the
host held the client's players out, as it should, but the client, whose
download began in the lobby, did not know the game had started and asked
for its player again; the host took the request as a late joiner's and
started it at once. The client then loaded a map it did not have yet:
cache_files_precache_map_begin's damaged disc error, which stops the game
for good. Stock build-201 does the same with its own host.

- The host (network_server_manager.c): a player asked for by a machine
  still downloading the map waits with those held at the start
  (network_game_server_hold_requested_player), and joins with them, the
  machine started as a late joiner, once its download is done
  (network_game_server_release_map_fetchers).
- The client (network_client_manager.c): a start that comes while the
  map is still being downloaded, from a host of an earlier build, is put
  off until the map is there (network_game_client_begin_game,
  network_game_client_idle_pregame), and dropped if the game it was for is
  over by then (another map, or another game).
- NETCODE.md's "Map sharing" says what happens when a host starts during a
  download (it said the host waited, which it has not since version 28).

Nothing sent changes: no network version.

Checked: the Linux CI steps, the web build and its tests, and the Windows
release build. End to end on Linux in Docker, the host starting the lobby
game at once while the client downloads (the case that stopped the game):
this build both ends (the host held the player and started it at game tick
296 once the map was there); build-201 hosting this build's client (the
start put off until the map was there); this build hosting build-201's
client (held, then played). Each client played the game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FractumSeraph pushed a commit to FractumSeraph/OpenCE that referenced this pull request Oct 16, 2026
…-hud-loading

Powerup timers and the classic loading screen (opt-in)
@VerySmuggy VerySmuggy added bug Something isn't working priority: high Should be handled soon labels Oct 19, 2026
@cybersecurity
cybersecurity merged commit 951ec3b into OpenCommunityEdition:main Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority: high Should be handled soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants