diff --git a/QSB/QSBCore.cs b/QSB/QSBCore.cs index 995e1ec8..81c853a5 100644 --- a/QSB/QSBCore.cs +++ b/QSB/QSBCore.cs @@ -255,8 +255,14 @@ public class QSBCore : ModBehaviour public override void Configure(IModConfig config) { + var useKcpTransport = UseKcpTransport; UseKcpTransport = config.GetSettingsValue("useKcpTransport") || DebugSettings.AutoStart; - QSBNetworkManager.UpdateTransport(); + if (!QSBNetworkManager.UpdateTransport()) + { + UseKcpTransport = useKcpTransport; + config.SetSettingsValue("useKcpTransport", useKcpTransport); + Helper.Storage.Save(config, Constants.ModConfigFileName); + } DefaultServerIP = config.GetSettingsValue("defaultServerIP"); IncompatibleModsAllowed = config.GetSettingsValue("incompatibleModsAllowed"); diff --git a/QSB/QSBNetworkManager.cs b/QSB/QSBNetworkManager.cs index 04b4e12d..becb4348 100644 --- a/QSB/QSBNetworkManager.cs +++ b/QSB/QSBNetworkManager.cs @@ -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() =>