allow autostart override

This commit is contained in:
JohnCorby 2023-05-06 20:04:07 -07:00
parent 84ee48ecb2
commit 7e0312f026

View File

@ -157,6 +157,9 @@ public class QSBCore : ModBehaviour
if (DebugSettings.AutoStart) if (DebugSettings.AutoStart)
{ {
UseKcpTransport = true; UseKcpTransport = true;
var config = Helper.Config;
config.SetSettingsValue("useKcpTransport", UseKcpTransport);
Helper.Storage.Save(config, Constants.ModConfigFileName);
DebugSettings.DebugMode = true; DebugSettings.DebugMode = true;
} }
@ -256,11 +259,11 @@ public class QSBCore : ModBehaviour
public override void Configure(IModConfig config) public override void Configure(IModConfig config)
{ {
var useKcpTransport = UseKcpTransport; var useKcpTransport = UseKcpTransport;
UseKcpTransport = config.GetSettingsValue<bool>("useKcpTransport") || DebugSettings.AutoStart; UseKcpTransport = config.GetSettingsValue<bool>("useKcpTransport");
if (!QSBNetworkManager.UpdateTransport()) if (!QSBNetworkManager.UpdateTransport())
{ {
UseKcpTransport = useKcpTransport; UseKcpTransport = useKcpTransport;
config.SetSettingsValue("useKcpTransport", useKcpTransport); config.SetSettingsValue("useKcpTransport", UseKcpTransport);
Helper.Storage.Save(config, Constants.ModConfigFileName); Helper.Storage.Save(config, Constants.ModConfigFileName);
} }