-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from SubnauticaModding/Dev
QModManager 4.2
- Loading branch information
Showing
29 changed files
with
342 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.1.4.0 | ||
4.2.0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Preloader.Entrypoint] | ||
|
||
## The local filename of the assembly to target. | ||
# Setting type: String | ||
# Default value: UnityEngine.CoreModule.dll | ||
Assembly = Assembly-CSharp.dll | ||
|
||
## The name of the type in the entrypoint assembly to search for the entrypoint method. | ||
# Setting type: String | ||
# Default value: Application | ||
Type = PreStartScreen | ||
|
||
## The name of the method in the specified entrypoint assembly and type to hook and load Chainloader from. | ||
# Setting type: String | ||
# Default value: .cctor | ||
Method = Start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Preloader.Entrypoint] | ||
|
||
## The local filename of the assembly to target. | ||
# Setting type: String | ||
# Default value: UnityEngine.CoreModule.dll | ||
Assembly = Assembly-CSharp.dll | ||
|
||
## The name of the type in the entrypoint assembly to search for the entrypoint method. | ||
# Setting type: String | ||
# Default value: Application | ||
Type = PreStartScreen | ||
|
||
## The name of the method in the specified entrypoint assembly and type to hook and load Chainloader from. | ||
# Setting type: String | ||
# Default value: .cctor | ||
Method = Start |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Preloader.Entrypoint] | ||
|
||
## The local filename of the assembly to target. | ||
# Setting type: String | ||
# Default value: UnityEngine.CoreModule.dll | ||
Assembly = Assembly-CSharp.dll | ||
|
||
## The name of the type in the entrypoint assembly to search for the entrypoint method. | ||
# Setting type: String | ||
# Default value: Application | ||
Type = PreStartScreen | ||
|
||
## The name of the method in the specified entrypoint assembly and type to hook and load Chainloader from. | ||
# Setting type: String | ||
# Default value: .cctor | ||
Method = Start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Preloader.Entrypoint] | ||
|
||
## The local filename of the assembly to target. | ||
# Setting type: String | ||
# Default value: UnityEngine.CoreModule.dll | ||
Assembly = Assembly-CSharp.dll | ||
|
||
## The name of the type in the entrypoint assembly to search for the entrypoint method. | ||
# Setting type: String | ||
# Default value: Application | ||
Type = SystemsSpawner | ||
|
||
## The name of the method in the specified entrypoint assembly and type to hook and load Chainloader from. | ||
# Setting type: String | ||
# Default value: .cctor | ||
Method = Awake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using BepInEx; | ||
using HarmonyLib; | ||
using System.Text.RegularExpressions; | ||
|
||
namespace QModInstaller.BepInEx.Plugins | ||
{ | ||
/// <summary> | ||
/// Handles filtering noisy logs from the QModManager logs. | ||
/// </summary> | ||
[BepInPlugin(PluginGuid, PluginName, PluginVersion)] | ||
[BepInProcess("Subnautica"), BepInProcess("SubnauticaZero")] | ||
internal class LogFilter : BaseUnityPlugin | ||
{ | ||
internal const string PluginGuid = "QModManager.LogFilter"; | ||
internal const string PluginName = PluginGuid; | ||
internal const string PluginVersion = "4.2"; | ||
|
||
private void Awake() | ||
{ | ||
var harmony = new Harmony(PluginGuid); | ||
harmony.Patch(AccessTools.Method("MirrorInternalLogs.Util.LibcHelper:Format"), | ||
postfix: new HarmonyMethod(AccessTools.Method(typeof(LogFilter), nameof(LogFilter.LibcHelper_Format_Postfix)))); | ||
} | ||
|
||
private readonly static Regex[] DirtyRegexPatterns = new Regex[] { | ||
new Regex(@"([\r\n]+)?(\(Filename: .*\))", RegexOptions.Compiled), | ||
new Regex(@"([\r\n]+)?(Replacing cell.*)", RegexOptions.Compiled), | ||
new Regex(@"([\r\n]+)?(Resetting cell with.*)", RegexOptions.Compiled), | ||
new Regex(@"([\r\n]+)?(Fallback handler could not load.*)", RegexOptions.Compiled), | ||
new Regex(@"([\r\n]+)?(Heartbeat CSV.*,[0-9])", RegexOptions.Compiled), | ||
new Regex(@"([\r\n]+)?(L[0-9]: .*)", RegexOptions.Compiled), | ||
new Regex(@"([\r\n]+)?(Kinematic body only supports Speculative Continuous collision detection)", RegexOptions.Compiled) | ||
}; | ||
|
||
private static void LibcHelper_Format_Postfix(ref string __result) | ||
{ | ||
bool match = false; | ||
foreach (Regex pattern in DirtyRegexPatterns) | ||
{ | ||
if (pattern.IsMatch(__result)) | ||
{ | ||
__result = pattern.Replace(__result, string.Empty).Trim(); | ||
match = true; | ||
} | ||
} | ||
|
||
// if our filtering resulted in an empty string, return null so that MirrorInternalLogs will skip the line | ||
if (match && string.IsNullOrWhiteSpace(__result)) | ||
{ | ||
__result = null; | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.