mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-15 22:50:56 +00:00
better QSBPatch.Remote
This commit is contained in:
parent
934e761386
commit
25900cbc2f
@ -11,7 +11,7 @@ public abstract class QSBPatch
|
|||||||
public void DoPatches(Harmony instance) => instance.PatchAll(GetType());
|
public void DoPatches(Harmony instance) => instance.PatchAll(GetType());
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// this is true when a message is received remotely (OnReceiveRemote) or a player leaves (OnRemovePlayer)
|
/// this is true when a message is received remotely (OnReceiveRemote) or a remote player joins/leaves (OnAddPlayer/OnRemovePlayer)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool Remote;
|
public static bool Remote;
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,9 @@ public class PlayerTransformSync : SectoredTransformSync
|
|||||||
var player = new PlayerInfo(this);
|
var player = new PlayerInfo(this);
|
||||||
QSBPlayerManager.PlayerList.SafeAdd(player);
|
QSBPlayerManager.PlayerList.SafeAdd(player);
|
||||||
base.OnStartClient();
|
base.OnStartClient();
|
||||||
|
QSBPatch.Remote = !isLocalPlayer;
|
||||||
QSBPlayerManager.OnAddPlayer?.SafeInvoke(Player);
|
QSBPlayerManager.OnAddPlayer?.SafeInvoke(Player);
|
||||||
|
QSBPatch.Remote = false;
|
||||||
DebugLog.DebugWrite($"Create Player : {Player}", MessageType.Info);
|
DebugLog.DebugWrite($"Create Player : {Player}", MessageType.Info);
|
||||||
|
|
||||||
JoinLeaveSingularity.Create(Player, true);
|
JoinLeaveSingularity.Create(Player, true);
|
||||||
@ -49,7 +51,7 @@ public class PlayerTransformSync : SectoredTransformSync
|
|||||||
JoinLeaveSingularity.Create(Player, false);
|
JoinLeaveSingularity.Create(Player, false);
|
||||||
|
|
||||||
// TODO : Maybe move this to a leave event...? Would ensure everything could finish up before removing the player
|
// TODO : Maybe move this to a leave event...? Would ensure everything could finish up before removing the player
|
||||||
QSBPatch.Remote = true;
|
QSBPatch.Remote = !isLocalPlayer;
|
||||||
QSBPlayerManager.OnRemovePlayer?.SafeInvoke(Player);
|
QSBPlayerManager.OnRemovePlayer?.SafeInvoke(Player);
|
||||||
QSBPatch.Remote = false;
|
QSBPatch.Remote = false;
|
||||||
base.OnStopClient();
|
base.OnStopClient();
|
||||||
|
Loading…
Reference in New Issue
Block a user