Skip to content

Relay: one console holds world-object authority; Scene > Network panel - #231

Merged
rixnobis merged 6 commits into
mainfrom
net-authority
Oct 21, 2026
Merged

rixnobis merged 6 commits into
mainfrom
net-authority

Conversation

@rixnobis

Copy link
Copy Markdown
Contributor

Behind the relay all consoles got hostSlot 0, so no console was host and objects registered with Net.RegisterActor did not move on the other consoles. The relay now names a room authority in each HelloAck: the first console to join, then the lowest remaining slot when that console quits. The relay snapshots carry the authority's world objects. The engine is unchanged: onHelloAck already sets isHost = yourSlot == hostSlot.

The Network view and the console status lines name the authority, with a row for each change of authority. Scene > Network gets a one-click id from the scene name, the Play console count and the relay rule (2 consoles link directly, 3 or more use the relay). Its help text now names Net.Connect.

Tests: testRelayRooms, testRelayWorldObjects, relayviewcheck (console 1 quits, slot 2 takes over), netidcheck. relayplaycheck with 3 real pcsx-redux consoles checks that a crate moved on console 1 shows up on console 2.

The relay's HelloAck left hostSlot at 0, the relay itself, so no console
was ever psxsplash's host and nothing registered with Net.RegisterActor
replicated. A room's first member is now its authority; when it leaves,
the lowest slot still in takes over and the announce acks say so. A
newcomer in a freed lower slot does not take it. Slot 0 is kRelaySlot
now, and the Network view's log gets a row per authority change.
The relay kept only the sender's own avatar record of a snapshot, so the
host's Net.RegisterActor objects never reached the other consoles. It now
keeps the world objects the room's authority sends (and only its), and
adds them to the snapshot it builds for the rest of that scene group, in
the records psxsplash reads: compact (11 bytes, in the origin and spread)
or legacy (20 bytes), cut to one frame. The authority's own copy has
none. With no objects the bytes are psnl's, as before.
The Network view's head line and the authority's console chip say which
slot is the room's authority, and each authority change is a row in its
log ("Authority slot 2 (was 1)"). Under each console, the relayed status
line says "authority" or which slot is. Scripted runs print
net: authority and net: hand-off. relayviewcheck now makes console 1
leave after Pause and checks the hand-off to slot 2 end to end.
The Network id's help named Net.Begin; the engine's call is Net.Connect.
While the id is empty, a button sets it to the scene's name in one undoable
edit. Below it, how many consoles Play boots and the relay switch for 2,
the same saved settings as the Players list, with one line on direct link
against relay. netidcheck covers the button, its undo, both controls, the
saved settings and the toolbar's list moving the section.
The relay now names console 1 the authority, so the check expects it host
and the others not, and the status lines to say so. The scene registers
Crate (3) with Net.RegisterActor; the host moves it each second and a
console that is not host logs once it sees it move, which only the
relay's forwarded world objects can do. Console 2's output, filtered to
that line, must show it. Passes on a real pcsx-redux with 3 consoles.
Both wheeled the scene inspector a fixed amount to its bottom, taking
Memory card for the last section. With Scene > Network grown below it,
the bottom left the Enable saves switch above the panel. They now use
--scroll-to on the controls they click, which wheels either way until
the control is inside the panel. Both pass on main and on this branch.
@rixnobis
rixnobis merged commit aff653b into main Oct 21, 2026
5 checks passed
@rixnobis
rixnobis deleted the net-authority branch October 21, 2026 06:43
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