Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dusklight Multiplayer

Set mod config values:

  • mode: host or client
  • host: 127.0.0.1 for a client-side cloudflared access tcp endpoint
  • port: 30120 on host, forwarded local port on client

Host runs the tunnel with cloudflared.example.yml. Each remote player runs:

cloudflared access tcp --hostname play.example.com --url 127.0.0.1:30121

Set that player's mod host to 127.0.0.1 and port to 30121.

The host performs the HELLO/WELCOME handshake and assigns each client a stable session slot. Player state is relayed every three game updates. The host sends a world snapshot every six updates containing active NPC, enemy, object, and script/save markers (stage, room, event, and zone switches). Clients create or update matching native actors from that snapshot.

Remote players are registered as native correction cylinders. The game’s existing collision system therefore resolves Link-vs-remote-player contacts locally and feeds the correction back into the replicated remote state.

The transport is loopback TCP with up to eight clients. Cloudflare Tunnel is only the external TCP route; it does not provide game synchronization. Build and run the focused tests with:

cmake --build --preset linux-default-relwithdebinfo --target \
  dusklight_multiplayer dusklight_multiplayer_protocol_test \
  dusklight_multiplayer_tcp_test dusklight_multiplayer_two_client_test
ctest --test-dir build/linux-default-relwithdebinfo -R dusklight_multiplayer --output-on-failure

The repository currently has no installed cloudflared binary or tunnel credentials, so the external tunnel path still needs a live deployment test.

Contributors

Languages