Make startup and world-loading execution roles explicit

Separate client, integrated-server and dedicated-server roles from connection state. Use roles for startup, presentation work and server dimension loading while preserving in-frame client simulation.

Co-Authored-By: OpenAI Codex (GPT-6.1) <noreply@openai.com>
This commit is contained in:
rdbtCVS
2026-10-24 23:53:00 +01:00
parent de840da0e5
commit 0d1736da8f
6 changed files with 76 additions and 27 deletions
+11 -5
View File
@@ -32,11 +32,17 @@ stay in the host's dimension. That mode is the escape hatch, so it gets no multi
## One code path for both
The dedicated server and the server thread are the same code. The server thread runs a `Game` with
`options.dedicated` set and a hub without a host player. The window joins it through memory as one
more player. Everything above serves both, and `server_dimension_players` (vanilla clients on Horizon's
dedicated server) and `lan_e2e --server-thread` (Horizon clients on the server thread) check it from
the two sides.
The dedicated server and the server thread are the same code. Each `Game` has an explicit
`ExecutionRole`: `Client`, `IntegratedServer` or `DedicatedServer`, selected before construction in
`Options.execution_role`. Startup, world loading and opening other dimensions use that role. Only
clients mesh chunks and show loading progress; a client can still run its simulation in-frame.
Connecting or disconnecting changes `remote`, independently of the execution role.
The server thread has a hub without a host player. The window joins it through memory as one
more player. It still sets `options.dedicated` for gameplay checks outside the role migration's
startup/world-loading scope. Everything above serves both servers, and `server_dimension_players`
(vanilla clients on Horizon's dedicated server) and `lan_e2e --server-thread` (Horizon clients on the
server thread) check it from the two sides.
## Cost of an extra level