You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
[MP] Gracefully handle cache confirmation of deleted nodes
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 commit is contained in:
@@ -44,7 +44,7 @@ private:
|
||||
|
||||
//path sent caches
|
||||
struct NodeCache {
|
||||
int cache_id;
|
||||
int cache_id = 0;
|
||||
HashMap<int, int> recv_ids; // peer id, remote cache id
|
||||
HashMap<int, bool> confirmed_peers; // peer id, confirmed
|
||||
};
|
||||
@@ -55,6 +55,7 @@ private:
|
||||
};
|
||||
|
||||
HashMap<ObjectID, NodeCache> nodes_cache;
|
||||
HashMap<int, ObjectID> assigned_ids;
|
||||
HashMap<int, PeerInfo> peers_info;
|
||||
int last_send_cache_id = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user