You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: client owned NetworkObject with prefabhandler destroy order incorrect on host-server side (#3200)
* fix
Pass in false for the destroy object parameter when cleaning up objects owned by a client upon the client disconnecting and the spawned objects have a prefab handler registered for their associated network prefab.
* update
adding change log entry.
* update
Cleaning up the connection manager.
Removing the warning about a client having nothing that it owns spawned (could be a valid design pattern and no reason to spam the message upon a client disconnecting if it is intentional).
* test
Updated NetworkPrefabOverrideTests to add a validation check for this PR
* update
Adding PR number to changelog entry.
* style
remove whitespaces
* style
remove unused namespace
Copy file name to clipboardExpand all lines: com.unity.netcode.gameobjects/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,8 @@ Additional documentation and release notes are available at [Multiplayer Documen
12
12
13
13
### Fixed
14
14
15
+
- Fixed issue where a spawned `NetworkObject` that was registered with a prefab handler and owned by a client would invoke destroy more than once on the host-server side if the client disconnected while the `NetworkObject` was still spawned. (#3200)
Debug.Log($"[Disconnected][Client-{clientId}][Child of {ownedObject.NetworkObjectId}][NetworkObjectId-{ownedObject.NetworkObjectId} Distributed to Client-{targetOwner}");
1261
-
}
1251
+
Debug.Log($"[Disconnected][Client-{clientId}][Child of {ownedObject.NetworkObjectId}][NetworkObjectId-{ownedObject.NetworkObjectId} Distributed to Client-{targetOwner}");
1262
1252
}
1263
1253
}
1264
1254
}
1265
-
else
1266
-
{
1267
-
ownedObject.RemoveOwnership();
1268
-
}
1255
+
}
1256
+
else
1257
+
{
1258
+
ownedObject.RemoveOwnership();
1269
1259
}
1270
1260
}
1271
1261
}
1272
1262
}
1273
1263
1264
+
1274
1265
// TODO: Could(should?) be replaced with more memory per client, by storing the visibility
// Verify that the despawn and destroy order of operations is correct for client owned NetworkObjects and the nunmber of times each is invoked is correct
0 commit comments