mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 00:39:53 +00:00
remove variable from QSBCore, only allow setting as host (or when not in multiplayer), fix the message
This commit is contained in:
parent
9c4c80eb36
commit
108561adb7
@ -58,7 +58,6 @@ public class QSBCore : ModBehaviour
|
||||
Application.version.Split('.').Take(3).Join(delimiter: ".");
|
||||
public static bool DLCInstalled => EntitlementsManager.IsDlcOwned() == EntitlementsManager.AsyncOwnershipStatus.Owned;
|
||||
public static bool IncompatibleModsAllowed { get; private set; }
|
||||
public static bool ShowPlayerNames { get; private set; }
|
||||
public static GameVendor GameVendor { get; private set; } = GameVendor.None;
|
||||
public static bool IsStandalone => GameVendor is GameVendor.Epic or GameVendor.Steam;
|
||||
public static IProfileManager ProfileManager => IsStandalone
|
||||
@ -245,14 +244,21 @@ public class QSBCore : ModBehaviour
|
||||
{
|
||||
DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
|
||||
IncompatibleModsAllowed = config.GetSettingsValue<bool>("incompatibleModsAllowed");
|
||||
var _showPlayerNames = config.GetSettingsValue<bool>("showPlayerNames");
|
||||
|
||||
if (_showPlayerNames != ShowPlayerNames)
|
||||
if (!IsInMultiplayer || IsHost)
|
||||
{
|
||||
new ServerSettingsMessage().Send();
|
||||
}
|
||||
var _showPlayerNames = config.GetSettingsValue<bool>("showPlayerNames");
|
||||
|
||||
ShowPlayerNames = _showPlayerNames;
|
||||
if (_showPlayerNames != ServerSettingsManager.ShowPlayerNames)
|
||||
{
|
||||
new ServerSettingsMessage().Send();
|
||||
}
|
||||
|
||||
ServerSettingsManager.ShowPlayerNames = _showPlayerNames;
|
||||
}
|
||||
else
|
||||
{
|
||||
config.SetSettingsValue("showPlayerNames", ServerSettingsManager.ShowPlayerNames);
|
||||
}
|
||||
}
|
||||
|
||||
private void Update()
|
||||
|
@ -7,10 +7,15 @@ internal class ServerSettingsMessage : QSBMessage
|
||||
{
|
||||
private bool _showPlayerNames;
|
||||
|
||||
public ServerSettingsMessage()
|
||||
{
|
||||
_showPlayerNames = ServerSettingsManager.ShowPlayerNames;
|
||||
}
|
||||
|
||||
public override void Serialize(NetworkWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write(QSBCore.ShowPlayerNames);
|
||||
writer.Write(_showPlayerNames);
|
||||
}
|
||||
|
||||
public override void Deserialize(NetworkReader reader)
|
||||
|
Loading…
x
Reference in New Issue
Block a user