feat(ctrl): report connection mode in welcome

PLAN.md calls out room modes such as relay, direct-p2p, and relay fallback so
future transport choices can fit the protocol. Add an explicit ConnectionMode
field to ServerWelcome and default it to relay for existing decoded welcomes.

The relay still operates only in relay mode today. Client and gateway startup
logs now print the selected mode, which makes the current relay path visible
without changing routing or forwarding behavior.

Test Plan:
- cargo fmt --check
- cargo test -p lanparty-ctrl server_welcome -- --nocapture
- cargo test -p lanparty-client-win -p lanparty-gateway
- cargo test --workspace
- cargo clippy --workspace --all-targets -- -D warnings
- git diff --check

Refs: PLAN.md
This commit is contained in:
2026-05-21 21:43:44 +02:00
parent bdb571799a
commit 6a18daac3a
4 changed files with 78 additions and 4 deletions
+3 -2
View File
@@ -15,10 +15,11 @@ async fn main() -> anyhow::Result<()> {
let gateway = connect_gateway(config).await?;
println!(
"lanparty-gateway connected as peer {} in room id {} with TAP MTU {}",
"lanparty-gateway connected as peer {} in room id {} with TAP MTU {} over {}",
gateway.welcome().peer_id(),
gateway.welcome().room_id(),
gateway.welcome().effective_tap_mtu()
gateway.welcome().effective_tap_mtu(),
gateway.welcome().mode()
);
#[cfg(target_os = "linux")]
{