Commit Graph

4 Commits

Author SHA1 Message Date
Fabio Alessandrelli 1e0d563467 [Net] Fix multi-peer path-only replication.
It used to check if a net_id was ever assigned to that node to detect
when to send the path confirm to the remote peer.
This is wrong, because the same net_id is shared for all the remote
peers, but sent one by one.
Instead we now check if it's either not assigned or if the assigned
net_id is a cache ID, and in that case ensure that the remote peer has
been notified.

This can be further improved by unifying the cache interface, but for
now it's a fast fix to get path-only sync to work.
2022-02-21 19:05:04 +01:00
Fabio Alessandrelli 87f4bbd668 [Debugger] Move most profilers to ServersDebugger.
Also splits bandwidth/rpc profiler (RPCProfiler is now in
SceneDebugger).
2022-02-06 17:36:48 +01:00
Fabio Alessandrelli 347d2dfc42 [Net] Move RPC, Node cache out of MultiplayerAPI.
Now uses two interfaces so it can be overridden in the future, and
core no longer depends on Node.

The interfaces are implements in scene/multiplayer.
Replaces root_node with root_path.
Remove all Node references from MultiplayerAPI.
2022-02-05 02:00:23 +01:00
Fabio Alessandrelli d219547c96 [Net] New replication interface, spawner and synchronizer nodes.
Initial implementation of the MultiplayerReplicationInterface and its
default implementation (SceneReplicationInterface).

New MultiplayerSpawner node helps dealing with instantiation of scenes
on remote peers (e.g. clients).
It supports both custom spawns via a `_spawn_custom` virtual function,
and optional auto-spawn of known scenes via a TypedArray<PackedScenes>
property.

New MultiplayerSynchornizer helps synchronizing states between the local
and remote peers, supports both sync and spawn properties and is
configured via a `SceneReplicationConfig` resource.
It can also sync via path (i.e. without being spawned by a
MultiplayerSpawner if both peers has it in tree, but will not send the
spawn state in that case, only the sync one.
2022-02-04 14:56:30 +01:00