Revert "revert to old value if fail to set the transport"

This reverts commit 84ee48ecb2841e3e4a1d9434ff9ca569873c1ad0.
This commit is contained in:
JohnCorby 2023-05-06 20:05:55 -07:00
parent b9899fa0f6
commit 1366e2cbd3
2 changed files with 3 additions and 10 deletions

View File

@ -255,14 +255,8 @@ public class QSBCore : ModBehaviour
public override void Configure(IModConfig config)
{
var useKcpTransport = UseKcpTransport;
UseKcpTransport = config.GetSettingsValue<bool>("useKcpTransport") || DebugSettings.AutoStart;
if (!QSBNetworkManager.UpdateTransport())
{
UseKcpTransport = useKcpTransport;
config.SetSettingsValue("useKcpTransport", useKcpTransport);
Helper.Storage.Save(config, Constants.ModConfigFileName);
}
QSBNetworkManager.UpdateTransport();
DefaultServerIP = config.GetSettingsValue<string>("defaultServerIP");
IncompatibleModsAllowed = config.GetSettingsValue<bool>("incompatibleModsAllowed");

View File

@ -164,11 +164,11 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
ConfigureNetworkManager();
}
public static bool UpdateTransport()
public static void UpdateTransport()
{
if (QSBCore.IsInMultiplayer)
{
return false;
return;
}
if (singleton != null)
{
@ -178,7 +178,6 @@ public class QSBNetworkManager : NetworkManager, IAddComponentOnStart
{
MenuManager.Instance.OnLanguageChanged(); // hack to update text
}
return true;
}
private void InitPlayerName() =>