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
- Issue where disabled in-scene placed NetworkObjects could not be spawned after starting a session.
- Issue where users are allowed to spawn a NetworkObject with a GlobalObjectIdHash value of 0 (zero).
// Trap for users just creating things during runtime where this will be zero.
28
+
if(networkObject.GlobalObjectIdHash==0)
29
+
{
30
+
log.Warning(newContext(LogLevel.Developer,$"{nameof(NetworkObject)}'s GlobalObjectIdHash value is zero! Runtime creating of {nameof(NetworkObject)}s is not supported. Skipping processing.").AddNetworkObject(networkObject));
log.Warning(newContext(LogLevel.Developer,$"{nameof(NetworkObject)}'s SceneOrigin doesn't match current scene being processed! Skipping processing.").AddInfo("SceneOrigin",networkObject.SceneOriginHandle).AddNetworkObject(networkObject));
@@ -36,7 +42,15 @@ public void OnProcessScene(Scene scene, BuildReport report)
36
42
continue;
37
43
}
38
44
45
+
// If already marked, the do nothing.
46
+
if(networkObject.InScenePlaced)
47
+
{
48
+
continue;
49
+
}
50
+
39
51
networkObject.InScenePlaced=true;
52
+
// Will not be true when making a build and the values are serialized.
// This should never happen, but in the case it somehow does log an error and remove the duplicate entry
304
-
Debug.LogError($"{nameof(NetworkPrefab)} ({networkObject.name}) has a duplicate {nameof(NetworkObject.GlobalObjectIdHash)} source entry value of: {source}!");
351
+
Debug.LogError($"{nameof(NetworkPrefab)} ({nameOrHashOverride}) has a duplicate {nameof(NetworkObject.GlobalObjectIdHash)} source entry value of: {source}!");
NetworkLog.LogError(newContext(LogLevel.Developer,"Player prefab is marked as belonging to a scene. This may cause issues.").AddNetworkObject(networkObject).AddInfo("SceneName",networkObject.SceneOrigin.name));
1122
1122
networkObject.InScenePlaced=false;
1123
1123
}
1124
-
NetworkLog.InternalAssert(sceneObject==networkObject.InScenePlaced,"Legacy sceneObject value should match calculated InScenePlaced value.");
1124
+
// This logic is no longer true with the adjustments to spawn pre-disabled in-scene placed NetworkObjects.
1125
+
// Leaving this for reference purposes.
1126
+
//NetworkLog.InternalAssert(sceneObject == networkObject.InScenePlaced, "Legacy sceneObject value should match calculated InScenePlaced value.");
0 commit comments