Skip to content

Client identity, turn rotation and docs - #24

Merged
HeatXD merged 7 commits into
mainfrom
client-identity
Aug 18, 2026
Merged

HeatXD merged 7 commits into
mainfrom
client-identity

Conversation

@HeatXD

@HeatXD HeatXD commented Aug 18, 2026

Copy link
Copy Markdown
Owner

No description provided.

@HeatXD
HeatXD force-pushed the client-identity branch 2 times, most recently from 601dc82 to fd3c9ba Compare August 18, 2026 14:30
HeatXD added 6 commits August 18, 2026 16:34
Ids split into a 20 bit slot and a 12 bit generation. A released slot goes
back on a FIFO free list with its generation already bumped, so reuse always
yields a different id and stale references to a departed client miss in
_connections instead of landing on the slot's new owner.
SetName carries a display name, appended to the variant. AssignClientId and
PeerJoined carry the name alongside the id, so the pairing travels with every
message that announces one. Names are cosmetic and never unique: the id stays
the identity.
Connection::name defaults to WEYVE_PLAYER and is refused while in a room, so
a name peers learned from PeerJoined holds still for as long as they can see
it and no rename event is needed. Empty resets to the default, over-long names
are clamped, and control characters are stripped so a newline cannot forge
lines in the log.
_names follows membership exactly, inserted on PeerJoined and erased on
PeerLeft, so a name never outlives the id it belongs to. Surfaced through
weyve_set_name, weyve_name and weyve_peer_name, with the C header's copies of
the name constants pinned against protocol.h.
A name on the command line before joining, names alongside ids in /who and on
peer joins.
SetIceServers replaces the stun/turn set and pushes it to everyone already
connected, so credentials rotate without dropping anyone. An unchanged set
sends nothing, and links already built keep the config they were built with,
since expiry only gates new allocations.

--ice-file reads the set from a file and rereads it as it expires. Fields are
space separated rather than colon separated like --turn, because a coturn REST
username is <expiry>:<name> and a colon split would tear it in half. A read
that yields no stun and no turn is treated as failed, so a file caught half
written never blanks working credentials.
@HeatXD
HeatXD force-pushed the client-identity branch 3 times, most recently from 0b4eb9c to 61e9714 Compare August 18, 2026 14:41
Covers running the server, the wire protocol's append-only rule, and STUN/TURN
with coturn, Violet or Cloudflare, with a credential minter for the two that
rotate.
@HeatXD
HeatXD merged commit c2f6ac8 into main Aug 18, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant