Skip to content

Commit

Permalink
Merge pull request #242 from SubnauticaModding/Dev
Browse files Browse the repository at this point in the history
QModManager 4.2
  • Loading branch information
toebeann authored Jun 18, 2021
2 parents c976a95 + e00aed2 commit 372d7e8
Show file tree
Hide file tree
Showing 29 changed files with 342 additions and 242 deletions.
2 changes: 1 addition & 1 deletion Data/latest-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.4.0
4.2.0.0
16 changes: 16 additions & 0 deletions Dependencies/BZ.EXP/BepInEx.cfg
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
16 changes: 16 additions & 0 deletions Dependencies/BZ.STABLE/BepInEx.cfg
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.
5 changes: 4 additions & 1 deletion Dependencies/BepInEx/doorstop_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,7 @@ ignoreDisableSwitch=false
# (e.g. mscorlib is stripped in original game)
# This option causes Mono to seek mscorlib and core libraries from a different folder before Managed
# Original Managed folder is added as a secondary folder in the search path
dllSearchPathOverride=
dllSearchPathOverride=

[MultiFolderLoader]
baseDir=.\QMods
16 changes: 16 additions & 0 deletions Dependencies/SN.EXP/BepInEx.cfg
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
16 changes: 16 additions & 0 deletions Dependencies/SN.STABLE/BepInEx.cfg
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
4 changes: 2 additions & 2 deletions Executable/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@

[assembly: ComVisible(false)]

[assembly: AssemblyVersion("4.1.4")]
[assembly: AssemblyFileVersion("4.1.4")]
[assembly: AssemblyVersion("4.2")]
[assembly: AssemblyFileVersion("4.2")]
5 changes: 3 additions & 2 deletions Installer/BZ.EXP.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#endif

#define Name "QModManager" ; The name of the game will be added after it
#define Version "4.1.4"
#define Version "4.2"
#define Author "QModManager"
#define URL "https://github.com/QModManager/QModManager"
#define SupportURL "https://discord.gg/UpWuWwq"
Expand Down Expand Up @@ -59,7 +59,7 @@ Source: "InstallerExtensions.dll"; Flags: DontCopy

; Files required by QModManager itself
; Dependencies
Source: "..\..\packages\AssetsTools.NET.2.0.3\lib\net35\AssetsTools.NET.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\packages\AssetsTools.NET.2.0.9\lib\net40\AssetsTools.NET.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\Dependencies\cldb.dat"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\Dependencies\Oculus.Newtonsoft.Json.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;

Expand All @@ -76,6 +76,7 @@ Source: "QModManager.UnityAudioFixer.xml"; DestDir: "{app}\BepInEx\patchers\QMod

; BepInEx
Source: "..\..\Dependencies\BepInEx\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs replacesameversion sharedfile uninsnosharedfileprompt;
Source: "..\..\Dependencies\BZ.EXP\BepInEx.cfg"; DestDir: "{app}\BepInEx\config"; Flags: ignoreversion sharedfile uninsnosharedfileprompt;

[Dirs]
Name: "{app}\QMods"
Expand Down
5 changes: 3 additions & 2 deletions Installer/BZ.STABLE.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#endif

#define Name "QModManager" ; The name of the game will be added after it
#define Version "4.1.4"
#define Version "4.2"
#define Author "QModManager"
#define URL "https://github.com/QModManager/QModManager"
#define SupportURL "https://discord.gg/UpWuWwq"
Expand Down Expand Up @@ -59,7 +59,7 @@ Source: "InstallerExtensions.dll"; Flags: DontCopy

; Files required by QModManager itself
; Dependencies
Source: "..\..\packages\AssetsTools.NET.2.0.3\lib\net35\AssetsTools.NET.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\packages\AssetsTools.NET.2.0.9\lib\net40\AssetsTools.NET.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\Dependencies\cldb.dat"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\Dependencies\Oculus.Newtonsoft.Json.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;

Expand All @@ -76,6 +76,7 @@ Source: "QModManager.UnityAudioFixer.xml"; DestDir: "{app}\BepInEx\patchers\QMod

; BepInEx
Source: "..\..\Dependencies\BepInEx\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs replacesameversion sharedfile uninsnosharedfileprompt;
Source: "..\..\Dependencies\BZ.STABLE\BepInEx.cfg"; DestDir: "{app}\BepInEx\config"; Flags: ignoreversion sharedfile uninsnosharedfileprompt;

[Dirs]
Name: "{app}\QMods"
Expand Down
4 changes: 2 additions & 2 deletions Installer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@

[assembly: Guid("8c6c9a0b-80c4-43d2-89f2-749e6f09fdda")]

[assembly: AssemblyVersion("4.1.4")]
[assembly: AssemblyFileVersion("4.1.4")]
[assembly: AssemblyVersion("4.2")]
[assembly: AssemblyFileVersion("4.2")]
5 changes: 3 additions & 2 deletions Installer/SN.EXP.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#endif

#define Name "QModManager" ; The name of the game will be added after it
#define Version "4.1.4"
#define Version "4.2"
#define Author "QModManager"
#define URL "https://github.com/QModManager/QModManager"
#define SupportURL "https://discord.gg/UpWuWwq"
Expand Down Expand Up @@ -59,7 +59,7 @@ Source: "InstallerExtensions.dll"; Flags: DontCopy

; Files required by QModManager itself
; Dependencies
Source: "..\..\packages\AssetsTools.NET.2.0.3\lib\net35\AssetsTools.NET.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\packages\AssetsTools.NET.2.0.9\lib\net40\AssetsTools.NET.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\Dependencies\cldb.dat"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\Dependencies\Oculus.Newtonsoft.Json.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;

Expand All @@ -76,6 +76,7 @@ Source: "QModManager.UnityAudioFixer.xml"; DestDir: "{app}\BepInEx\patchers\QMod

; BepInEx
Source: "..\..\Dependencies\BepInEx\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs replacesameversion sharedfile uninsnosharedfileprompt;
Source: "..\..\Dependencies\SN.EXP\BepInEx.cfg"; DestDir: "{app}\BepInEx\config"; Flags: ignoreversion sharedfile uninsnosharedfileprompt;

[Dirs]
Name: "{app}\QMods"
Expand Down
5 changes: 3 additions & 2 deletions Installer/SN.STABLE.iss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#endif

#define Name "QModManager" ; The name of the game will be added after it
#define Version "4.1.4"
#define Version "4.2"
#define Author "QModManager"
#define URL "https://github.com/QModManager/QModManager"
#define SupportURL "https://discord.gg/UpWuWwq"
Expand Down Expand Up @@ -59,7 +59,7 @@ Source: "InstallerExtensions.dll"; Flags: DontCopy

; Files required by QModManager itself
; Dependencies
Source: "..\..\packages\AssetsTools.NET.2.0.3\lib\net35\AssetsTools.NET.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\packages\AssetsTools.NET.2.0.9\lib\net40\AssetsTools.NET.dll"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;
Source: "..\..\Dependencies\cldb.dat"; DestDir: "{app}\BepInEx\patchers\QModManager"; Flags: ignoreversion;

; QMM
Expand All @@ -74,6 +74,7 @@ Source: "QModManager.UnityAudioFixer.xml"; DestDir: "{app}\BepInEx\patchers\QMod

; BepInEx
Source: "..\..\Dependencies\BepInEx\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs replacesameversion sharedfile uninsnosharedfileprompt;
Source: "..\..\Dependencies\SN.STABLE\BepInEx.cfg"; DestDir: "{app}\BepInEx\config"; Flags: ignoreversion sharedfile uninsnosharedfileprompt;

[Dirs]
Name: "{app}\QMods"
Expand Down
4 changes: 2 additions & 2 deletions OculusNewtonsoftRedirect/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.1.4")]
[assembly: AssemblyFileVersion("4.1.4")]
[assembly: AssemblyVersion("4.2")]
[assembly: AssemblyFileVersion("4.2")]
8 changes: 8 additions & 0 deletions QModManager.sln
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QModManager.QModPluginGener
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QModManager.OculusNewtonsoftRedirect", "OculusNewtonsoftRedirect\QModManager.OculusNewtonsoftRedirect.csproj", "{25558450-FF33-4FDF-91C7-0C5C00A94A57}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Scripts", "Build Scripts", "{075884D3-CC6F-4B56-B050-C31A8E11FA52}"
ProjectSection(SolutionItems) = preProject
Scripts\QModPluginGenerator-post-build.cmd = Scripts\QModPluginGenerator-post-build.cmd
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
BZ.EXP|Any CPU = BZ.EXP|Any CPU
Expand Down Expand Up @@ -224,6 +229,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{075884D3-CC6F-4B56-B050-C31A8E11FA52} = {5A8D179E-C749-4346-AD81-05F11C082A1C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {54A73C4F-4981-48CC-AD91-27D3D090D5D4}
EndGlobalSection
Expand Down
54 changes: 54 additions & 0 deletions QModManager/BepInex/Plugins/LogFilter.cs
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;
}
}
}
}
Loading

0 comments on commit 372d7e8

Please sign in to comment.