mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: #2595 InterestManagement AddAllAuthenticatedConnectionsToObservers fat fingered from x branch which didn't have 'ready' anymore. it should be AddAllReadyServerConnectionsToObservers like before, no change in the logic.
This commit is contained in:
parent
f3813c41cc
commit
2ef51d03f7
@ -1358,13 +1358,13 @@ public static bool SpawnObjects()
|
||||
// Helper function to add all server connections as observers.
|
||||
// This is used if none of the components provides their own
|
||||
// OnRebuildObservers function.
|
||||
internal static void AddAllAuthenticatedConnectionsToObservers(NetworkIdentity identity)
|
||||
internal static void AddAllReadyServerConnectionsToObservers(NetworkIdentity identity)
|
||||
{
|
||||
// add all server connections
|
||||
foreach (NetworkConnectionToClient conn in connections.Values)
|
||||
{
|
||||
// only if authenticated (don't send to people during logins)
|
||||
if (conn.isAuthenticated)
|
||||
if (conn.isReady)
|
||||
identity.AddObserver(conn);
|
||||
}
|
||||
|
||||
@ -1388,7 +1388,7 @@ static void RebuildObserversDefault(NetworkIdentity identity, bool initialize)
|
||||
// not force hidden?
|
||||
if (identity.visible != Visibility.ForceHidden)
|
||||
{
|
||||
AddAllAuthenticatedConnectionsToObservers(identity);
|
||||
AddAllReadyServerConnectionsToObservers(identity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,7 @@ public virtual void SetUp()
|
||||
identityA = gameObjectA.AddComponent<NetworkIdentity>();
|
||||
connectionA = new NetworkConnectionToClient(0x0A, false, 0);
|
||||
connectionA.isAuthenticated = true;
|
||||
connectionA.isReady = true;
|
||||
connectionA.identity = identityA;
|
||||
NetworkIdentity.spawned[0xAA] = identityA;
|
||||
|
||||
@ -30,6 +31,7 @@ public virtual void SetUp()
|
||||
identityB = gameObjectB.AddComponent<NetworkIdentity>();
|
||||
connectionB = new NetworkConnectionToClient(0x0B, false, 0);
|
||||
connectionB.isAuthenticated = true;
|
||||
connectionB.isReady = true;
|
||||
connectionB.identity = identityB;
|
||||
NetworkIdentity.spawned[0xBB] = identityB;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user