feat(network): add selectable privacy-preserving discovery

This commit is contained in:
Alexander Sellite 2026-09-01 10:21:26 -04:00
parent 9cf0c8fc9c
commit 4d31fd1517
26 changed files with 959 additions and 153 deletions

View file

@ -38,11 +38,15 @@ node names, connect persistent and networked state to that data.
network services validate and replicate bounded domains such as fishing,
sales, shops, item use, profiles, jobs, mail, chat, drawings, time, and weather.
`DiscoveryClient` is an optional directory layer beside `NetworkSession`. An
open host may publish a short-lived room lease, and the shared Join Game page
may browse compatible leases before handing the selected address back to the
existing direct ENet connection flow. The directory does not carry gameplay
traffic or become a gameplay authority. Its base URL comes from
`DiscoveryClient` is an optional directory layer beside `NetworkSession`. A
player host cycles its discovery control through `private`, `direct`, and
`relay`. Private leaves the room unlisted, direct discovery discloses the host
route only after an explicit Join, and relay discovery allocates a UDP privacy
route without making discovery a gameplay authority. Relay joins fail closed
and never silently downgrade to direct. Dedicated servers are always direct:
the game forces direct advertisements and discovery independently rejects a
dedicated relay request. Public room browsing never receives a host address.
The base URL comes from
`network/discovery/base_url`, with `straywild_DISCOVERY_URL` available as a
development/deployment override.
@ -53,8 +57,9 @@ friendship; unblocking does not recreate it. Discovery may publish opt-in,
short-lived friend presence and deliver invitations only while both games are
online. It stores hashed capability identifiers rather than identity
fingerprints or a complete friend graph, keeps no durable social records, and
provides no offline delivery. Direct joins still use the existing verified
public-room and ENet connection path.
provides no offline delivery. Public joins still use the existing verified
server-identity and ENet connection path. Discovery endpoints remain transient:
they are not shown, added to recent servers, or persisted in the trust store.
The host is authoritative. Clients submit requests or evidence; the host
derives trusted context from registered peers, authoritative regions, and