Repository navigation
Conversation
…word A listen server's join code (--join-code, now 8 symbols XXXX-XXXX) opens the match's room on public Nostr relays through Atyha (common/atyha, MIT, github.com/ngspades/atyha), Net/Room.c. A friend's offer comes from the room, Net/WebRtc.c answers it as it answers the master's, and the answer goes back through the relays. SP_JOIN_PASSWORD gives the room a password (CPace: the relays cannot test guesses, a host answers 20 hellos a minute). The log says "Room <code> open" once a relay confirmed it. The master is no longer told the code: a private listen server is not announced at all, a public one is listed as before. A room's friend has no address until ICE finds it: a key of its own until then (the per-address limit no longer lumps every friend under 0), the real address from the selected candidate at "connect", where bans and the limit read it. netlib's p2p.c follows Atyha's code rule (8 symbols, the 25-symbol alphabet, white space trimmed); transport.h carries the room's password and the wrong-password flag for the client. The WebSocket to the relays is libdatachannel's own (NO_WEBSOCKET off). libsodium is a new dependency: CI (Ubuntu, macOS), the Alpine and MSYS2 release builds and server_deps_macos.sh (1.0.20, static, SHA-256 checked) install it.
…r is a list A browser builds this server's answer itself from the master's row (address, webrtc_port, dtls_fingerprint), the way libp2p's webrtc-direct does: its offer's ICE username and password are one random string R, and its first STUN request (USERNAME "R:R") reaches libdatachannel's IceUdpMuxListener on the WebRTC port (rtcw_direct_listen). Net/WebRtc.c reads bans, "server full" and the per-address limit (4 joining) on that request, before anything is made; rtcw_peer_create_direct then answers a synthetic offer (R as ufrag and password, the browser's address as its candidate, DTLS client) with R, not checking the browser's certificate (anyone may join a public server); the browser checks ours against the listed fingerprint. From there it is the same peer as before. The master's signalling is gone: no long poll, no /v1/answer, no master_answer/master_reject, the two lanes they used. Offers now come only from a match's room (Net/Room.c). The log shows the certificate's fingerprint. Checked with Chrome, Safari 27.3 and Firefox 153 (connection open in 56 to 194 ms, the 1.0 Greeting received) and with the game's own browser build; a wrong fingerprint fails, as it must.
p2p_code_norm takes a room link, ngspades://HK4M-7TRW in any case and with the trailing slash a browser may add: the game's desktop builds register the scheme. sadcode:// (Shoot and Destroy's) is gone.
WebRTC direct: browsers join listed servers with no offer; the master is a list
Join codes: ngspades:// links in place of sadcode://
common/atyha is the Atyha repository at c96b71d (its main), the C library in its c/; the copy it replaces was the same files. CI and the releases already check submodules out recursively.
Contributor
Author
|
Superseded by the PR that ports these features onto ngnet (the server moved to ngnet in #38). |
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.
A listen server's join code no longer goes through the master: it opens the match's room on public Nostr relays with Atyha (MIT, vendored in
common/atyhauntil it becomes a submodule), and friends join over WebRTC as browsers already did.What changes
--join-codeis 8 symbols,XXXX-XXXX(25-symbol alphabet, no look-alikes; netlib's p2p.c follows Atyha's rule).Net/Room.c: the room (Atyha host), polled on the tick. Offers go toNet/WebRtc.cas the master's do; answers and refusals go back through the room. The log saysRoom <code> open(the client reads it).SP_JOIN_PASSWORD: an optional room password (CPace: relays cannot test guesses; a host answers 20 hellos a minute).--publiclists it as before.connect, where bans and the limit read it.NO_WEBSOCKET OFF).tools/server_deps_macos.sh(1.0.20 static, SHA-256 checked) install it.Checked locally (macOS)
make server(Release, -Werror), and the client against it (paired client PR).This PR runs CI (
ci.ymlruns on pull_request).