Skip to content

Commit 91cf538

Browse files
update
Removing a hack work around that is no longer needed due to recent fixes merged in the dots repo side.
1 parent adf29e1 commit 91cf538

File tree

3 files changed

+1
-51
lines changed

3 files changed

+1
-51
lines changed

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,11 +348,6 @@ public void NetworkUpdate(NetworkUpdateStage updateStage)
348348
{
349349
NetworkConfig.Prefabs.RegisterGhostPrefabs(this);
350350
}
351-
352-
if (!IsServer)
353-
{
354-
SpawnManager?.CheckGhostsPendingNetworkObjectId();
355-
}
356351
#endif
357352

358353
UpdateTopology();

com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3854,16 +3854,6 @@ private void InitGhost()
38543854
}
38553855
}
38563856

3857-
internal bool IsGhostNetworkObjectIdValid()
3858-
{
3859-
if (NetworkObjectBridge == null)
3860-
{
3861-
return false;
3862-
}
3863-
// TODO-UNIFIED: Sometimes the GhostField can be latent. Need a way to know the GhostField has been set.
3864-
return NetworkObjectBridge.NetworkObjectId.Value < 1000000;
3865-
}
3866-
38673857
internal void RegisterGhostBridge()
38683858
{
38693859
if (NetworkManager.LogLevel == LogLevel.Developer)

com.unity.netcode.gameobjects/Runtime/Spawning/NetworkSpawnManager.cs

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -34,46 +34,13 @@ public class NetworkSpawnManager
3434

3535
internal readonly Dictionary<ulong, NetworkObject> GhostsPendingSpawn = new Dictionary<ulong, NetworkObject>();
3636

37-
internal readonly List<NetworkObject> GhostsPendingNetworkObjectId = new List<NetworkObject>();
38-
39-
internal void CheckGhostsPendingNetworkObjectId()
40-
{
41-
if (GhostsPendingNetworkObjectId.Count == 0)
42-
{
43-
return;
44-
}
45-
46-
for(int i = GhostsPendingNetworkObjectId.Count - 1; i >= 0; i--)
47-
{
48-
var networkObject = GhostsPendingNetworkObjectId[i];
49-
if (networkObject.IsGhostNetworkObjectIdValid())
50-
{
51-
GhostsPendingNetworkObjectId.Remove(networkObject);
52-
if (NetworkManager.LogLevel == LogLevel.Developer)
53-
{
54-
Debug.Log($"[{nameof(RegisterGhostPendingSpawn)}] {networkObject.name}'s Ghost {nameof(NetworkObject.NetworkObjectId)} is valid. Re-registering.");
55-
}
56-
networkObject.RegisterGhostBridge();
57-
}
58-
}
59-
}
60-
6137
internal void RegisterGhostPendingSpawn(NetworkObject networkObject, ulong networkObjectId)
6238
{
63-
if (!networkObject.IsGhostNetworkObjectIdValid())
64-
{
65-
GhostsPendingNetworkObjectId.Add(networkObject);
66-
if (NetworkManager.LogLevel == LogLevel.Developer)
67-
{
68-
Debug.Log($"[{nameof(RegisterGhostPendingSpawn)}] {networkObject.name}'s Ghost {nameof(NetworkObject.NetworkObjectId)} ({networkObjectId}) seems invalid. Adding to the pending NetworkObjectId list.");
69-
}
70-
return;
71-
}
7239
if (NetworkManager.LogLevel == LogLevel.Developer)
7340
{
7441
Debug.Log($"[{nameof(RegisterGhostPendingSpawn)}] Registering {networkObject.name} with a {nameof(NetworkObject.NetworkObjectId)} of {networkObjectId}.");
7542
}
76-
if(GhostsPendingSpawn.TryAdd(networkObjectId, networkObject))
43+
if (GhostsPendingSpawn.TryAdd(networkObjectId, networkObject))
7744
{
7845
// TODO-UNIFIED: We need a better way to preserve any hybrid instances pending NGO spawn.
7946
// For now, move any pending object into the DDOL.
@@ -2041,8 +2008,6 @@ internal NetworkSpawnManager(NetworkManager networkManager)
20412008
internal void Shutdown()
20422009
{
20432010
#if UNIFIED_NETCODE
2044-
GhostsPendingNetworkObjectId.Clear();
2045-
GhostsPendingNetworkObjectId.Clear();
20462011
GhostsPendingSpawn.Clear();
20472012
GhostsPendingSynchronization.Clear();
20482013
#endif

0 commit comments

Comments
 (0)