mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-11 01:13:47 +00:00
change isServer to isHost
This commit is contained in:
parent
aba169319b
commit
967718d234
@ -30,8 +30,8 @@ namespace QSB.Events
|
||||
public abstract void SetupListener();
|
||||
public abstract void CloseListener();
|
||||
|
||||
public virtual void OnReceiveRemote(bool server, T message) { }
|
||||
public virtual void OnReceiveLocal(bool server, T message) { }
|
||||
public virtual void OnReceiveRemote(bool isHost, T message) { }
|
||||
public virtual void OnReceiveLocal(bool isHost, T message) { }
|
||||
|
||||
public void SendEvent(T message)
|
||||
{
|
||||
@ -68,7 +68,7 @@ namespace QSB.Events
|
||||
return;
|
||||
}
|
||||
|
||||
if (message.OnlySendToServer && !QNetworkServer.active)
|
||||
if (message.OnlySendToHost && !QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -82,11 +82,11 @@ namespace QSB.Events
|
||||
if (message.FromId == QSBPlayerManager.LocalPlayerId ||
|
||||
QSBPlayerManager.IsBelongingToLocalPlayer(message.FromId))
|
||||
{
|
||||
OnReceiveLocal(QNetworkServer.active, message);
|
||||
OnReceiveLocal(QSBCore.IsHost, message);
|
||||
return;
|
||||
}
|
||||
|
||||
OnReceiveRemote(QNetworkServer.active, message);
|
||||
OnReceiveRemote(QSBCore.IsHost, message);
|
||||
}
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ namespace QSB.GeyserSync.Events
|
||||
State = state
|
||||
};
|
||||
|
||||
public override void OnReceiveRemote(bool server, BoolWorldObjectMessage message)
|
||||
public override void OnReceiveRemote(bool isHost, BoolWorldObjectMessage message)
|
||||
{
|
||||
if (!QSBCore.WorldObjectsReady)
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ namespace QSB.OrbSync
|
||||
{
|
||||
QSBWorldSync.OldOrbList.Clear();
|
||||
QSBWorldSync.OldOrbList = Resources.FindObjectsOfTypeAll<NomaiInterfaceOrb>().ToList();
|
||||
if (QSBCore.IsServer)
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
NomaiOrbTransformSync.OrbTransformSyncs.ForEach(x => QNetworkServer.Destroy(x.gameObject));
|
||||
NomaiOrbTransformSync.OrbTransformSyncs.Clear();
|
||||
|
@ -60,7 +60,7 @@ namespace QSB
|
||||
public static AssetBundle InstrumentAssetBundle { get; private set; }
|
||||
public static AssetBundle ConversationAssetBundle { get; private set; }
|
||||
public static bool WorldObjectsReady => WorldObjectManager.AllReady && IsInMultiplayer && PlayerTransformSync.LocalInstance != null;
|
||||
public static bool IsServer => QNetworkServer.active;
|
||||
public static bool IsHost => QNetworkServer.active;
|
||||
public static bool IsInMultiplayer => QNetworkManager.singleton.isNetworkActive;
|
||||
public static string QSBVersion => Helper.Manifest.Version;
|
||||
|
||||
|
@ -169,7 +169,7 @@ namespace QSB
|
||||
QSBCore.UnityEvents.RunWhen(() => QSBEventManager.Ready && PlayerTransformSync.LocalInstance != null,
|
||||
() => QSBEventManager.FireEvent(EventNames.QSBPlayerJoin, _lobby.PlayerName));
|
||||
|
||||
if (!QSBCore.IsServer)
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
QSBCore.UnityEvents.RunWhen(() => QSBEventManager.Ready && PlayerTransformSync.LocalInstance != null,
|
||||
() => QSBEventManager.FireEvent(EventNames.QSBPlayerStatesRequest));
|
||||
@ -183,6 +183,8 @@ namespace QSB
|
||||
DebugLog.DebugWrite("OnStopClient", MessageType.Info);
|
||||
DebugLog.ToConsole("Disconnecting from server...", MessageType.Info);
|
||||
Destroy(GetComponent<RespawnOnDeath>());
|
||||
Destroy(GetComponent<ServerStateManager>());
|
||||
Destroy(GetComponent<ClientStateManager>());
|
||||
QSBEventManager.Reset();
|
||||
QSBPlayerManager.PlayerList.ForEach(player => player.HudMarker?.Remove());
|
||||
|
||||
|
@ -47,7 +47,7 @@ namespace QSB.QuantumSync
|
||||
|
||||
public void PlayerLeave(uint playerId)
|
||||
{
|
||||
if (!QSBCore.IsServer)
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
private void OnEnable(Shape s)
|
||||
{
|
||||
IsEnabled = true;
|
||||
if (!QSBCore.WorldObjectsReady && !QSBCore.IsServer)
|
||||
if (!QSBCore.WorldObjectsReady && !QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -116,7 +116,7 @@ namespace QSB.QuantumSync.WorldObjects
|
||||
}
|
||||
|
||||
IsEnabled = false;
|
||||
if (!QSBCore.WorldObjectsReady && !QSBCore.IsServer)
|
||||
if (!QSBCore.WorldObjectsReady && !QSBCore.IsHost)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ namespace QSB.ShipSync.Events
|
||||
? id
|
||||
: uint.MaxValue;
|
||||
|
||||
if (QSBCore.IsServer)
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
var newAuthority = ShipManager.Instance.CurrentFlyer == uint.MaxValue
|
||||
? QNetworkServer.connections.First(x => x.GetPlayerId() == QSBPlayerManager.LocalPlayerId)
|
||||
|
@ -69,7 +69,7 @@ namespace QSB.ShipSync
|
||||
sphereShape.radius = 2.5f;
|
||||
sphereShape.center = new Vector3(0, 0, 1);
|
||||
|
||||
if (QSBCore.IsServer)
|
||||
if (QSBCore.IsHost)
|
||||
{
|
||||
if (ShipTransformSync.LocalInstance != null)
|
||||
{
|
||||
|
@ -154,7 +154,7 @@ namespace QSB.WorldSync
|
||||
|
||||
public static void SetDialogueCondition(string name, bool state)
|
||||
{
|
||||
if (!QSBCore.IsServer)
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
DebugLog.ToConsole("Warning - Cannot write to condition dict when not server!", MessageType.Warning);
|
||||
return;
|
||||
@ -165,7 +165,7 @@ namespace QSB.WorldSync
|
||||
|
||||
public static void AddFactReveal(string id, bool saveGame, bool showNotification)
|
||||
{
|
||||
if (!QSBCore.IsServer)
|
||||
if (!QSBCore.IsHost)
|
||||
{
|
||||
DebugLog.ToConsole("Warning - Cannot write to fact list when not server!", MessageType.Warning);
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user