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
Copy file name to clipboardexpand all lines: Assets/Mirror/Runtime/NetworkIdentity.cs
+37-68
Original file line number
Diff line number
Diff line change
@@ -82,7 +82,31 @@ public bool isServer
82
82
/// <para>This value is determined at runtime. For most objects, authority is held by the server.</para>
83
83
/// <para>For objects that had their authority set by AssignClientAuthority on the server, this will be true on the client that owns the object. NOT on other clients.</para>
84
84
/// </summary>
85
-
publicboolhasAuthority{get;privateset;}
85
+
boolisOwner;
86
+
87
+
publicboolhasAuthority
88
+
{
89
+
get=>isOwner;
90
+
set
91
+
{
92
+
boolprevious=isOwner;
93
+
isOwner=value;
94
+
95
+
if(previous&&!isOwner)
96
+
{
97
+
OnStopAuthority();
98
+
}
99
+
if(!previous&&isOwner)
100
+
{
101
+
OnStartAuthority();
102
+
}
103
+
}
104
+
}
105
+
106
+
// whether this object has been spawned with authority
107
+
// we need hasAuthority and pendingOwner because
108
+
// we need to wait until all of them spawn before updating hasAuthority
109
+
internalboolpendingAuthority{get;set;}
86
110
87
111
/// <summary>
88
112
/// The set of network connections (players) that can see this object.
/// <para>Whenever an object is spawned using SpawnWithClientAuthority, or the client authority status of an object is changed with AssignClientAuthority or RemoveClientAuthority, then this callback will be invoked.</para>
235
-
/// <para>This callback is used by the NetworkMigrationManager to distribute client authority state to peers for host migration. If the NetworkMigrationManager is not being used, this callback does not need to be populated.</para>
236
-
/// </summary>
237
-
[EditorBrowsable(EditorBrowsableState.Never),Obsolete("Host Migration was removed")]
0 commit comments