diff --git a/Meds.Watchdog/Entrypoint.cs b/Meds.Watchdog/Entrypoint.cs index 7a4ff01..71bbefc 100644 --- a/Meds.Watchdog/Entrypoint.cs +++ b/Meds.Watchdog/Entrypoint.cs @@ -1,4 +1,6 @@ using System; +using System.Globalization; +using System.Threading; using System.Threading.Tasks; using Meds.Dist; using Meds.Shared; @@ -8,7 +10,6 @@ using Meds.Watchdog.Utils; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; using SteamKit2; namespace Meds.Watchdog @@ -17,6 +18,12 @@ public sealed class Entrypoint { public static async Task Main(string[] args) { + var culture = CultureInfo.GetCultureInfo("en-US"); + CultureInfo.CurrentUICulture = culture; + CultureInfo.CurrentCulture = culture; + CultureInfo.DefaultThreadCurrentUICulture = culture; + CultureInfo.DefaultThreadCurrentCulture = culture; + if (args.Length == 3 && args[0] == "restore-game-binaries") { await CiUtils.RestoreGameBinaries(args[1], args[2]); diff --git a/Meds.Wrapper/Entrypoint.cs b/Meds.Wrapper/Entrypoint.cs index cc02767..c086479 100644 --- a/Meds.Wrapper/Entrypoint.cs +++ b/Meds.Wrapper/Entrypoint.cs @@ -1,4 +1,5 @@ using System; +using System.Globalization; using Meds.Shared; using Meds.Wrapper.Shim; using Microsoft.Extensions.DependencyInjection; @@ -18,6 +19,12 @@ public static class Entrypoint public static void Main(string[] args) { + var culture = CultureInfo.GetCultureInfo("en-US"); + CultureInfo.CurrentUICulture = culture; + CultureInfo.CurrentCulture = culture; + CultureInfo.DefaultThreadCurrentUICulture = culture; + CultureInfo.DefaultThreadCurrentCulture = culture; + if (args.Length != 2) throw new Exception("Wrapper should not be invoked manually. [installConfig] [runtimeConfig]"); var cfg = new Configuration(args[0], args[1]); diff --git a/Meds.Wrapper/Shim/PatchHelper.cs b/Meds.Wrapper/Shim/PatchHelper.cs index cb357a3..481c10a 100644 --- a/Meds.Wrapper/Shim/PatchHelper.cs +++ b/Meds.Wrapper/Shim/PatchHelper.cs @@ -105,7 +105,14 @@ public static void Patch(Type type) public static IEnumerable<(MyModContext mod, Type type)> ModTypes(string typeName) { - foreach (var kv in MySession.Static.ModManager.Assemblies) + var mods = MySession.Static?.ModManager; + if (mods == null) + { + Entrypoint.LoggerFor(typeof(PatchHelper))? + .ZLogWarning("Tried to fetch mod types {0} but mod manager isn't initialized", typeName); + yield break; + } + foreach (var kv in mods.Assemblies) { var type = kv.Value.GetType(typeName); if (type == null) continue;