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.
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.
This allows to include script_instance.h directly in the
generated gdvirtual.gen.inc, and remove excessive includes
from the codebase.
This should also allow Resource to use GDVIRTUAL macros,
which wasn't possible previously due to a circular dependency.
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.
It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).
We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).
Also fixed "cf." Frenchism - it's meant as "refer to / see".
- RPC configurations are now dictionaries.
- Script.get_rpc_methods renamed to Script.get_rpc_config.
- Node.rpc[_id] and Callable.rpc now return an Error.
- Refactor MultiplayerAPI to allow extension.
- New MultiplayerAPI.rpc method with Array argument (for scripts).
- Move the default MultiplayerAPI implementation to a module.
2022-07-26 09:31:12 +02:00
Renamed from scene/multiplayer/scene_cache_interface.h (Browse further)