Client identity, turn rotation and docs - #24
Merged
Merged
Conversation
HeatXD
force-pushed
the
client-identity
branch
2 times, most recently
from
August 18, 2026 14:30
601dc82 to
fd3c9ba
Compare
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
force-pushed
the
client-identity
branch
3 times, most recently
from
August 18, 2026 14:41
0b4eb9c to
61e9714
Compare
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
force-pushed
the
client-identity
branch
from
August 18, 2026 15:05
61e9714 to
78c9ffb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.