From c371698285df0bf256bac6816fab9d00c125ec65 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Fri, 18 Nov 2022 22:24:44 +0000 Subject: [PATCH 1/3] update game versions --- src/OWML.Launcher/OWML.Manifest.json | 2 +- src/OWML.Launcher/game-versions.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OWML.Launcher/OWML.Manifest.json b/src/OWML.Launcher/OWML.Manifest.json index 268c6508c..205e7c73c 100644 --- a/src/OWML.Launcher/OWML.Manifest.json +++ b/src/OWML.Launcher/OWML.Manifest.json @@ -5,5 +5,5 @@ "uniqueName": "Alek.OWML", "version": "2.7.4", "minGameVersion": "1.1.13.393", - "maxGameVersion": "1.1.13.450" + "maxGameVersion": "1.1.13.456" } diff --git a/src/OWML.Launcher/game-versions.json b/src/OWML.Launcher/game-versions.json index d2bc21266..55619cfa4 100644 --- a/src/OWML.Launcher/game-versions.json +++ b/src/OWML.Launcher/game-versions.json @@ -1,5 +1,5 @@ { - "steam": "1.1.13.450", - "epic": "1.1.13.450", - "gamepass": "1.1.13.450" + "steam": "1.1.13.456", + "epic": "1.1.13.456", + "gamepass": "1.1.13.456" } From 1f613fc07cef144906171566478d6486c886989a Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Fri, 18 Nov 2022 22:30:46 +0000 Subject: [PATCH 2/3] Incremental GC --- src/OWML.Common/Interfaces/IOwmlConfig.cs | 2 ++ src/OWML.Common/OwmlConfig.cs | 3 +++ src/OWML.Launcher/OWML.DefaultConfig.json | 1 + src/OWML.Patcher/OWPatcher.cs | 25 +++++++++++++++++++++++ 4 files changed, 31 insertions(+) diff --git a/src/OWML.Common/Interfaces/IOwmlConfig.cs b/src/OWML.Common/Interfaces/IOwmlConfig.cs index b8cda4032..a1d996ba6 100644 --- a/src/OWML.Common/Interfaces/IOwmlConfig.cs +++ b/src/OWML.Common/Interfaces/IOwmlConfig.cs @@ -22,6 +22,8 @@ public interface IOwmlConfig bool ForceExe { get; set; } + bool IncrementalGC { get; set; } + int SocketPort { get; set; } } } diff --git a/src/OWML.Common/OwmlConfig.cs b/src/OWML.Common/OwmlConfig.cs index 09e1ff39f..2b79d4516 100644 --- a/src/OWML.Common/OwmlConfig.cs +++ b/src/OWML.Common/OwmlConfig.cs @@ -14,6 +14,9 @@ public class OwmlConfig : IOwmlConfig [JsonProperty("forceExe")] public bool ForceExe { get; set; } + [JsonProperty("incrementalGC")] + public bool IncrementalGC { get; set; } + [JsonIgnore] public bool IsSpaced => Directory.Exists(Path.Combine(GamePath, "Outer Wilds_Data")); diff --git a/src/OWML.Launcher/OWML.DefaultConfig.json b/src/OWML.Launcher/OWML.DefaultConfig.json index a10adb2cf..33b298714 100644 --- a/src/OWML.Launcher/OWML.DefaultConfig.json +++ b/src/OWML.Launcher/OWML.DefaultConfig.json @@ -2,5 +2,6 @@ "gamePath": "C:/Program Files (x86)/Steam/steamapps/common/Outer Wilds", "debugMode": false, "forceExe": false, + "incrementalGC": false, "socketPort": 0 } diff --git a/src/OWML.Patcher/OWPatcher.cs b/src/OWML.Patcher/OWPatcher.cs index a7e2adb2f..af63274e5 100644 --- a/src/OWML.Patcher/OWPatcher.cs +++ b/src/OWML.Patcher/OWPatcher.cs @@ -15,6 +15,7 @@ public class OWPatcher : IOWPatcher private const string PatchClass = "PermanentManager"; private const string PatchMethod = "Awake"; + private const string IncGCProperty = "gc-max-time-slice=3"; public OWPatcher(IOwmlConfig owmlConfig, IModConsole writer) { @@ -27,6 +28,7 @@ public void PatchGame() CopyOWMLFiles(); CopyLibFiles(); PatchAssembly(); + UpdateIncrementalGC(); } private void CopyOWMLFiles() @@ -136,6 +138,29 @@ private void PatchAssembly() Save(patcher); } + private void UpdateIncrementalGC() + { + _writer.WriteLine("Updating incremental GC..."); + + var incGCEnabled = _owmlConfig.IncrementalGC; + + var bootConfigPath = Path.Combine(_owmlConfig.DataPath, "boot.config"); + var bootConfigText = File.ReadAllText(bootConfigPath); + + var alreadyEnabled = bootConfigText.Contains(IncGCProperty + Environment.NewLine); + + if (alreadyEnabled && !incGCEnabled) + { + _writer.WriteLine("- Disabling incremental GC"); + File.WriteAllText(bootConfigPath, bootConfigText.Replace(IncGCProperty + Environment.NewLine, "")); + } + else if (!alreadyEnabled && incGCEnabled) + { + _writer.WriteLine("- Enabling incremental GC"); + File.AppendAllText(bootConfigPath, IncGCProperty + Environment.NewLine); + } + } + private List GetPatchedInstructions(List instructions) => instructions.Where(x => x.Operand != null && x.Operand.ToString().Contains(nameof(ModLoader.ModLoader))).ToList(); From abd2ae1ec58fba5f38dbeef27b95eb209813d629 Mon Sep 17 00:00:00 2001 From: Mister_Nebula <41904486+misternebula@users.noreply.github.com> Date: Fri, 18 Nov 2022 22:31:15 +0000 Subject: [PATCH 3/3] Update OWML.Manifest.json --- src/OWML.Launcher/OWML.Manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OWML.Launcher/OWML.Manifest.json b/src/OWML.Launcher/OWML.Manifest.json index 205e7c73c..7c040f168 100644 --- a/src/OWML.Launcher/OWML.Manifest.json +++ b/src/OWML.Launcher/OWML.Manifest.json @@ -3,7 +3,7 @@ "author": "Alek", "name": "OWML", "uniqueName": "Alek.OWML", - "version": "2.7.4", + "version": "2.7.5", "minGameVersion": "1.1.13.393", "maxGameVersion": "1.1.13.456" }