mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-16 07:10:35 +00:00
revert to old value if fail to set the transport
This commit is contained in:
parent
55e2898c97
commit
84ee48ecb2
@ -255,8 +255,14 @@ public class QSBCore : ModBehaviour
|
||||
|
||||
public override void Configure(IModConfig config)
|
||||
{
|
||||
var useKcpTransport = UseKcpTransport;
|
||||
UseKcpTransport = config.GetSettingsValue<bool>("useKcpTransport") || DebugSettings.AutoStart;
|
||||
QSBNetworkManager.UpdateTransport();
|
||||
if (!QSBNetworkManager.UpdateTransport())
|
||||
{
|
||||
UseKcpTransport = useKcpTransport;
|
||||
config.SetSettingsValue("useKcpTransport", useKcpTransport);
|
||||
Helper.Storage.Save(config, Constants.ModConfigFileName);
|
||||
}
|
||||
|
||||
DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
|
||||
IncompatibleModsAllowed = config.GetSettingsValue<bool>("incompatibleModsAllowed");
|
||||
|
@ -164,11 +164,11 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
|
||||
ConfigureNetworkManager();
|
||||
}
|
||||
|
||||
public static void UpdateTransport()
|
||||
public static bool UpdateTransport()
|
||||
{
|
||||
if (QSBCore.IsInMultiplayer)
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
if (singleton != null)
|
||||
{
|
||||
@ -178,6 +178,7 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
|
||||
{
|
||||
MenuManager.Instance.OnLanguageChanged(); // hack to update text
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private void InitPlayerName() =>
|
||||
|
Loading…
Reference in New Issue
Block a user