mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 09:39:56 +00:00
fix some stuff with HasWokenUp
This commit is contained in:
parent
1c4f17550a
commit
c18cf0b43f
@ -12,7 +12,25 @@ namespace QSB.Player
|
||||
{
|
||||
public static class QSBPlayerManager
|
||||
{
|
||||
public static uint LocalPlayerId => PlayerTransformSync.LocalInstance?.NetIdentity?.NetId.Value ?? uint.MaxValue;
|
||||
public static uint LocalPlayerId
|
||||
{
|
||||
get
|
||||
{
|
||||
var localInstance = PlayerTransformSync.LocalInstance;
|
||||
if (localInstance == null)
|
||||
{
|
||||
DebugLog.DebugWrite($"Error - Trying to get LocalPlayerId when the local PlayerTransformSync instance is null.", MessageType.Error);
|
||||
return uint.MaxValue;
|
||||
}
|
||||
if (localInstance.NetIdentity == null)
|
||||
{
|
||||
DebugLog.DebugWrite($"Error - Trying to get LocalPlayerId when the local PlayerTransformSync instance's QNetworkIdentity is null.", MessageType.Error);
|
||||
return uint.MaxValue;
|
||||
}
|
||||
return localInstance.NetIdentity.NetId.Value;
|
||||
}
|
||||
}
|
||||
|
||||
public static PlayerInfo LocalPlayer => GetPlayer(LocalPlayerId);
|
||||
public static List<PlayerInfo> PlayerList { get; } = new List<PlayerInfo>();
|
||||
|
||||
|
@ -220,6 +220,7 @@ namespace QSB
|
||||
QSBPatchManager.DoUnpatchType(QSBPatchTypes.OnClientConnect);
|
||||
|
||||
_lobby.CanEditName = true;
|
||||
QSBCore.HasWokenUp = false;
|
||||
|
||||
IsReady = false;
|
||||
}
|
||||
@ -255,6 +256,7 @@ namespace QSB
|
||||
QSBPlayerManager.PlayerList.ForEach(player => player.HudMarker?.Remove());
|
||||
|
||||
RemoveWorldObjects();
|
||||
QSBCore.HasWokenUp = false;
|
||||
|
||||
base.OnStopServer();
|
||||
}
|
||||
|
@ -75,6 +75,8 @@ namespace QSB.QuantumSync
|
||||
|
||||
public void OnGUI()
|
||||
{
|
||||
GUI.Label(new Rect(220, 10, 200f, 20f), $"HasWokenUp : {QSBCore.HasWokenUp}");
|
||||
|
||||
if (!QSBCore.HasWokenUp || !QSBCore.DebugMode)
|
||||
{
|
||||
return;
|
||||
@ -85,8 +87,8 @@ namespace QSB.QuantumSync
|
||||
return;
|
||||
}
|
||||
|
||||
GUI.Label(new Rect(220, 10, 200f, 20f), $"QM Visible : {Locator.GetQuantumMoon().IsVisible()}");
|
||||
var offset = 40f;
|
||||
GUI.Label(new Rect(220, 40, 200f, 20f), $"QM Visible : {Locator.GetQuantumMoon().IsVisible()}");
|
||||
var offset = 70f;
|
||||
var tracker = Locator.GetQuantumMoon().GetValue<ShapeVisibilityTracker>("_visibilityTracker");
|
||||
foreach (var camera in QSBPlayerManager.GetPlayerCameras())
|
||||
{
|
||||
|
@ -11,7 +11,8 @@ namespace QSB.TransformSync
|
||||
|
||||
static PlayerTransformSync() => AnimControllerPatch.Init();
|
||||
|
||||
public override void OnStartLocalPlayer() => LocalInstance = this;
|
||||
public override void OnStartLocalPlayer()
|
||||
=> LocalInstance = this;
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
|
@ -8,7 +8,7 @@
|
||||
public const int ErrorType = 3;
|
||||
public const int FatalErrorType = 4;
|
||||
|
||||
private static int _currentLog;
|
||||
private static int _currentLog = 2;
|
||||
private static bool _logDebug => _currentLog <= 0;
|
||||
private static bool _logLog => _currentLog <= 1;
|
||||
private static bool _logWarning => _currentLog <= 2;
|
||||
|
@ -31,6 +31,11 @@ namespace QuantumUNET
|
||||
get
|
||||
{
|
||||
QNetworkIdentity myView;
|
||||
if (gameObject == null)
|
||||
{
|
||||
QLog.FatalError($"Trying to get QNetworkIdentity of a null gameobject?");
|
||||
return null;
|
||||
}
|
||||
if (m_MyView == null)
|
||||
{
|
||||
m_MyView = GetComponent<QNetworkIdentity>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user