further migrate to AuthorityManager

This commit is contained in:
JohnCorby 2021-12-01 22:09:12 -08:00
parent da1cf59ecb
commit 629deaa927
2 changed files with 5 additions and 8 deletions

View File

@ -25,8 +25,6 @@ namespace QSB.AuthoritySync
var oldAuthority = authQueue.Contains(id);
if (queue == oldAuthority)
{
DebugLog.ToConsole($"{identity.NetId}:{identity.gameObject.name} - "
+ $"{id} already {(queue ? "" : "not ")} queued", MessageType.Warning);
return;
}
@ -61,8 +59,6 @@ namespace QSB.AuthoritySync
if (oldConn == newConn)
{
DebugLog.ToConsole($"{identity.NetId}:{identity.gameObject.name} - "
+ $"{id} already has authority", MessageType.Warning);
return;
}

View File

@ -209,28 +209,29 @@ namespace QSB
{
DebugLog.DebugWrite("OnServerDisconnect", MessageType.Info);
// remove authority for orbs
// revert authority for orbs
foreach (var item in NomaiOrbTransformSync.OrbTransformSyncs)
{
if (!item)
{
DebugLog.ToConsole($"Warning - null transform sync in NomaiOrbTransformSync.OrbTransformSyncs!", MessageType.Warning);
continue;
}
var identity = item.NetIdentity;
if (identity.ClientAuthorityOwner == conn)
{
identity.RemoveClientAuthority(conn);
identity.SetAuthority(QSBPlayerManager.LocalPlayerId);
}
}
// remove authority from ship
// revert authority from ship
if (ShipTransformSync.LocalInstance)
{
var identity = ShipTransformSync.LocalInstance.NetIdentity;
if (identity.ClientAuthorityOwner == conn)
{
identity.RemoveClientAuthority(conn);
identity.SetAuthority(QSBPlayerManager.LocalPlayerId);
}
}