public bool RemoveClientAuthority(NetworkConnection conn)
{
if (!this.isServer)
{
if (LogFilter.logError)
{
Debug.LogError("RemoveClientAuthority can only be call on the server for spawned objects.");
}
return false;
}
if (this.connectionToClient != null)
{
if (LogFilter.logError)
{
Debug.LogError("RemoveClientAuthority cannot remove authority for a player object");
}
return false;
}
if (this.m_ClientAuthorityOwner == null)
{
if (LogFilter.logError)
{
Debug.LogError("RemoveClientAuthority for " + base.gameObject + " has no clientAuthority owner.");
}
return false;
}
if (this.m_ClientAuthorityOwner != conn)
{
if (LogFilter.logError)
{
Debug.LogError("RemoveClientAuthority for " + base.gameObject + " has different owner.");
}
return false;
}
this.m_ClientAuthorityOwner.RemoveOwnedObject(this);
this.m_ClientAuthorityOwner = null;
this.ForceAuthority(true);
ClientAuthorityMessage msg = new ClientAuthorityMessage {
netId = this.netId,
authority = false
};
conn.Send(15, msg);
if (clientAuthorityCallback != null)
{
clientAuthorityCallback(conn, this, false);
}
return true;
}