mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-20 15:41:01 +00:00
further migrate to AuthorityManager
This commit is contained in:
parent
da1cf59ecb
commit
629deaa927
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user