Repository navigation
Relay: one console holds world-object authority; Scene > Network panel - #231
Merged
Merged
Conversation
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.
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.
Behind the relay all consoles got
hostSlot0, so no console was host and objects registered withNet.RegisterActordid not move on the other consoles. The relay now names a room authority in eachHelloAck: 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:onHelloAckalready setsisHost = 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.relayplaycheckwith 3 real pcsx-redux consoles checks that a crate moved on console 1 shows up on console 2.