code wiki / _hdl_build / nx_room_relay.nx

nx_room_relay.nx

buildroot/runtime/_hdl_build/nx_room_relay.nx

3370 B78 linesdepth 0pulls 0 transitivereach 15 importersview sourcekind librarytopic room
docsdependenciesstructsconstsfunctions

about

nx_room_relay.nx -- the SOVEREIGN server-side relay core for Nishi video. Per-room, per-peer latest-frame store + live roster. The no-WS down-channel (nx_room_stream) pushes each peer the OTHER live peers' newest frames; peers upload via POST. Server-relay model = works through any NAT with ZERO WebRTC/STUN/TURN (the flaky third-party ICE the cardboard depended on). Pure buffer ops: imports nothing, no syscalls -- caller supplies the state arena (like nx_video_client_wasm / nx_room_stream). Proven by nx_room_relay_gate. State layout (st: *i64): st[0]=nslots, st[1]=slot_bytes, then 5 parallel arrays of nslots each -> room_hash, peer_id, last_seq, last_seen_ms, frame_len. A slot is FREE when room_hash==0 (room hashes are nonzero by construction). Frame bytes for slot i live at arena[i*slot_bytes ..] (arena: nslots*slot_bytes). license_tier: ORIGINAL

dependencies 0 imports · 10 importers

nx_room_relay.nx nx_connect_lds_room.nx nx_game_room_gate.nx nx_mp_relay.nx nx_pets_mp_relay_gate.nx nx_room_fec_relay.nx nx_room_privacy_gate.nx nx_room_relay_gate.nx nx_vroom.nx nx_vroom_daemon.nx nx_vroom_gate.nx

imports: none

imported by: nx_connect_lds_room.nxnx_game_room_gate.nxnx_mp_relay.nxnx_pets_mp_relay_gate.nxnx_room_fec_relay.nxnx_room_privacy_gate.nxnx_room_relay_gate.nxnx_vroom.nxnx_vroom_daemon.nxnx_vroom_gate.nx

structs

none

consts

none

functions

15func rr_init(st: *i64, nslots: i64, slotb: i64) -> i64
called by 12: mainmainmainmainmainmain+6
23func rr_find(st: *i64, rm: i64, pr: i64) -> i64
30func rr_alloc(st: *i64) -> i64
called by 1: rr_post
37func rr_post(st: *i64, arena: *u8, rm: i64, pr: i64, now: i64, sq: i64, frame: *u8, fl: i64) -> i64
50func rr_roster(st: *i64, rm: i64, self_pr: i64, now: i64, ttl: i64, out: *i64) -> i64
64func rr_live(st: *i64, rm: i64, pr: i64, now: i64, ttl: i64) -> i64
72func rr_seq(st: *i64, s: i64) -> i64 { let n: i64 = st[0]; return st[2 + 2 * n + s] }
called by 2: mainvd_stream
73func rr_flen(st: *i64, s: i64) -> i64 { let n: i64 = st[0]; return st[2 + 4 * n + s] }
75func rr_nslots(st: *i64) -> i64 { return st[0] }
76func rr_room(st: *i64, s: i64) -> i64 { return st[2 + s] }
77func rr_peer(st: *i64, s: i64) -> i64 { let n: i64 = st[0]; return st[2 + n + s] }
78func rr_seen(st: *i64, s: i64) -> i64 { let n: i64 = st[0]; return st[2 + 3 * n + s] }