The debugger reports synchronizers with empty state to the editor
even if no data is being sent to other peers.
The editor conditional to avoid division by zero was checking the wrong
variable.
Godot supports sending messages to "all but one peer" by sending a
packet with a negative target (the negated ID of the excluded peer).
The relay protocol was incorrectly interpreting the values and relaying
the message to the wrong peers.
This issue only affected "send_bytes" since the other subsystem (RPC
and replication) "resolves" the correct IDs client-side (to match
visibility information).
When multiple clients are connected, and the server is using the relay
sub-protocol, it might happen that a client disconnects while a packet
sent to it from another peer is still in transit.
In that case, when the packet reaches the server for relaying, it used
to generate an error (as the destination client did no longer exists).
This commit changes check to suppress the error message while still
skipping the packet.
Cleaning up remote NodePath cache is not trivial since the visibility
API allows for certain nodes to be despawned (and re-spawned) on some
peers while being retained in the authority.
This means that from the server point of view, the node has not changed,
and the path simplification protocol won't be run again after
respawning.
While we can track this information for synchronizers via the
replication API, we can't easily track this information for potential
child nodes that use RPCs (I'm convinced it is doable, but we need to
track the whole dependency tree which would require some more complex
refactoring).
This commit partially reverts some of the cache cleanup logic to always
retain remote IDs, and adds a NodePath lookup fallback when the ObjectID
is invalid.
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)
* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
It's possible that after sending a cached node reference (e.g. RPC or
static MultiplayerSynchronizer) the reference node is removed from tree
before the remote peer(s) can confirm the referenced path.
To better detect that case, and avoid spamming errors when it happens,
this commit modifies the multiplayer API caching protocol, to send the
received ID instead of the Node path when sending the confirmation
packet.
**This is a breaking change** because it makes the runtime multiplayer
protocol incompatible with previous versions of Godot.
Default shortcuts use the first or second letter of each word.
This also adds a new shortcut to toggle the last opened bottom panel.
On editor startup, this defaults to the first panel in the list
(which is the Output panel).