Browse Source

Update packages and bump version

pull/104/head 4.3.1
Anairkoen Schno 2 years ago
committed by Meivyn
parent
commit
f6ebc69a59
No known key found for this signature in database GPG Key ID: 8BDD3E48158B2F71
5 changed files with 250 additions and 251 deletions
  1. +1
    -1
      IPA.Injector/IPA.Injector.csproj
  2. +237
    -237
      IPA.Loader/Config/SelfConfig.cs
  3. +10
    -11
      IPA.Loader/IPA.Loader.csproj
  4. +1
    -1
      IPA.Loader/Loader/manifest.json
  5. +1
    -1
      IPA/Program.cs

+ 1
- 1
IPA.Injector/IPA.Injector.csproj View File

@ -84,7 +84,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="Mono.Cecil" Version="0.11.5" />
<PackageReference Include="AsyncBridge" Version="0.3.1" />
<ProjectReference Include="..\SemVer\SemVer.csproj" />


+ 237
- 237
IPA.Loader/Config/SelfConfig.cs View File

@ -1,238 +1,238 @@
// BEGIN: section ignore
#nullable enable
using IPA.Logging;
using IPA.Config.Stores;
using IPA.Config.Stores.Attributes;
using IPA.Config.Stores.Converters;
// END: section ignore
using Newtonsoft.Json;
using System.Collections.Generic;
namespace IPA.Config
{
internal class SelfConfig
{
// This is to allow the doc generation to parse this file and use Newtonsoft to generate a JSON schema
// BEGIN: section ignore
public static Config LoaderConfig { get; set; } = null!; // this is set before used
public static SelfConfig Instance = new();
public static void Load()
{
LoaderConfig = Config.GetConfigFor(IPAName, "json");
Instance = LoaderConfig.Generated<SelfConfig>();
Instance.OnReload();
}
protected virtual void CopyFrom(SelfConfig cfg) { }
protected internal virtual void OnReload()
{
if (Regenerate)
CopyFrom(new SelfConfig { Regenerate = false });
StandardLogger.Configure();
}
protected internal virtual void Changed()
{
Logger.Default.Debug("SelfConfig Changed called");
}
public static void ReadCommandLine(string[] args)
{
foreach (var arg in args)
{
switch (arg)
{
case "--debug":
case "--mono-debug":
CommandLineValues.Debug.ShowDebug = true;
CommandLineValues.Debug.ShowCallSource = true;
break;
case "--no-yeet":
CommandLineValues.YeetMods = false;
break;
case "--no-logs":
CommandLineValues.WriteLogs = false;
break;
case "--darken-message":
CommandLineValues.Debug.DarkenMessages = true;
break;
case "--condense-logs":
CommandLineValues.Debug.CondenseModLogs = true;
break;
case "--plugin-logs":
CommandLineValues.Debug.CreateModLogs = true;
break;
#if false
case "--no-updates":
CommandLineValues.Updates.AutoCheckUpdates = false;
CommandLineValues.Updates.AutoUpdate = false;
break;
#endif
case "--trace":
CommandLineValues.Debug.ShowTrace = true;
break;
}
}
}
public void CheckVersionBoundary()
{
if (ResetGameAssebliesOnVersionChange && Utilities.UnityGame.IsGameVersionBoundary)
{
GameAssemblies = GetDefaultGameAssemblies();
}
}
internal const string IPAName = "Beat Saber IPA";
internal const string IPAVersion = "4.3.0.0";
// uses Updates.AutoUpdate, Updates.AutoCheckUpdates, YeetMods, Debug.ShowCallSource, Debug.ShowDebug,
// Debug.CondenseModLogs
internal static SelfConfig CommandLineValues = new();
// For readability's sake, I want the default values to be visible in source.
#pragma warning disable CA1805 // Do not initialize unnecessarily
// END: section ignore
public virtual bool Regenerate { get; set; } = true;
#if false
public class Updates_
{
public virtual bool AutoUpdate { get; set; } = true;
// LINE: ignore 2
public static bool AutoUpdate_ => (Instance?.Updates?.AutoUpdate ?? true)
&& CommandLineValues.Updates.AutoUpdate;
public virtual bool AutoCheckUpdates { get; set; } = true;
// LINE: ignore 2
public static bool AutoCheckUpdates_ => (Instance?.Updates?.AutoCheckUpdates ?? true)
&& CommandLineValues.Updates.AutoCheckUpdates;
}
// LINE: ignore
[NonNullable]
public virtual Updates_ Updates { get; set; } = new Updates_();
#endif
public class Debug_
{
public virtual bool ShowCallSource { get; set; } = false;
// LINE: ignore 2
public static bool ShowCallSource_ => (Instance?.Debug?.ShowCallSource ?? false)
|| CommandLineValues.Debug.ShowCallSource;
public virtual bool ShowDebug { get; set; } = false;
// LINE: ignore 2
public static bool ShowDebug_ => (Instance?.Debug?.ShowDebug ?? false)
|| CommandLineValues.Debug.ShowDebug;
// This option only takes effect after a full game restart, unless new logs are created again
public virtual bool CondenseModLogs { get; set; } = false;
// LINE: ignore 2
public static bool CondenseModLogs_ => (Instance?.Debug?.CondenseModLogs ?? false)
|| CommandLineValues.Debug.CondenseModLogs;
// This option only takes effect after a full game restart, unless new logs are created again
public virtual bool CreateModLogs { get; set; } = false;
// LINE: ignore 2
public static bool CreateModLogs_ => (Instance?.Debug?.CreateModLogs ?? false)
|| CommandLineValues.Debug.CreateModLogs;
public virtual bool ShowHandledErrorStackTraces { get; set; } = false;
// LINE: ignore
public static bool ShowHandledErrorStackTraces_ => Instance?.Debug?.ShowHandledErrorStackTraces ?? false;
public virtual bool HideMessagesForPerformance { get; set; } = true;
// LINE: ignore
public static bool HideMessagesForPerformance_ => Instance?.Debug?.HideMessagesForPerformance ?? true;
public virtual int HideLogThreshold { get; set; } = 512;
// LINE: ignore
public static int HideLogThreshold_ => Instance?.Debug?.HideLogThreshold ?? 512;
public virtual bool ShowTrace { get; set; } = false;
// LINE: ignore 2
public static bool ShowTrace_ => (Instance?.Debug?.ShowTrace ?? false)
|| CommandLineValues.Debug.ShowTrace;
public virtual bool SyncLogging { get; set; } = false;
// LINE: ignore
public static bool SyncLogging_ => Instance?.Debug?.SyncLogging ?? false;
public virtual bool DarkenMessages { get; set; } = false;
// LINE: ignore 2
public static bool DarkenMessages_ => (Instance?.Debug?.DarkenMessages ?? false)
|| CommandLineValues.Debug.DarkenMessages;
}
// LINE: ignore
[NonNullable]
public virtual Debug_ Debug { get; set; } = new();
public class AntiMalware_
{
public virtual bool UseIfAvailable { get; set; } = true;
// LINE: ignore
public static bool UseIfAvailable_ => Instance?.AntiMalware?.UseIfAvailable ?? true;
public virtual bool RunPartialThreatCode { get; set; } = false;
// LINE: ignore
public static bool RunPartialThreatCode_ => Instance?.AntiMalware?.RunPartialThreatCode ?? true;
}
// LINE: ignore
[NonNullable]
public virtual AntiMalware_ AntiMalware { get; set; } = new();
public virtual bool YeetMods { get; set; } = true;
// LINE: ignore 2
public static bool YeetMods_ => (Instance?.YeetMods ?? true)
&& CommandLineValues.YeetMods;
[JsonIgnore]
public bool WriteLogs { get; set; } = true;
public virtual bool ResetGameAssebliesOnVersionChange { get; set; } = true;
// LINE: ignore
[NonNullable, UseConverter(typeof(CollectionConverter<string, HashSet<string?>>))]
public virtual HashSet<string> GameAssemblies { get; set; } = GetDefaultGameAssemblies();
// BEGIN: section ignore
public static HashSet<string> GetDefaultGameAssemblies()
=> new()
{
#if BeatSaber // provide these defaults only for Beat Saber builds
"Main.dll", "Core.dll", "HMLib.dll", "HMUI.dll", "HMRendering.dll", "VRUI.dll",
"BeatmapCore.dll", "GameplayCore.dll", "HMLibAttributes.dll", "BeatmapEditor3D.dll"
#else // otherwise specify Assembly-CSharp.dll
"Assembly-CSharp.dll"
#endif
};
// END: section ignore
// LINE: ignore
#if false // used to make schema gen happy
private static HashSet<string> GetDefaultGameAssemblies() => null;
// LINE: ignore
#endif
// LINE: ignore
public static HashSet<string> GameAssemblies_ => Instance?.GameAssemblies ?? new HashSet<string> { "Assembly-CSharp.dll" };
// LINE: ignore
#if false // Used for documentation schema generation
[JsonProperty(Required = Required.DisallowNull)]
public virtual string LastGameVersion { get; set; } = null;
// LINE: ignore 2
#endif
public virtual string? LastGameVersion { get; set; } = null;
// LINE: ignore
public static string? LastGameVersion_ => Instance?.LastGameVersion;
}
// BEGIN: section ignore
#nullable enable
using IPA.Logging;
using IPA.Config.Stores;
using IPA.Config.Stores.Attributes;
using IPA.Config.Stores.Converters;
// END: section ignore
using Newtonsoft.Json;
using System.Collections.Generic;
namespace IPA.Config
{
internal class SelfConfig
{
// This is to allow the doc generation to parse this file and use Newtonsoft to generate a JSON schema
// BEGIN: section ignore
public static Config LoaderConfig { get; set; } = null!; // this is set before used
public static SelfConfig Instance = new();
public static void Load()
{
LoaderConfig = Config.GetConfigFor(IPAName, "json");
Instance = LoaderConfig.Generated<SelfConfig>();
Instance.OnReload();
}
protected virtual void CopyFrom(SelfConfig cfg) { }
protected internal virtual void OnReload()
{
if (Regenerate)
CopyFrom(new SelfConfig { Regenerate = false });
StandardLogger.Configure();
}
protected internal virtual void Changed()
{
Logger.Default.Debug("SelfConfig Changed called");
}
public static void ReadCommandLine(string[] args)
{
foreach (var arg in args)
{
switch (arg)
{
case "--debug":
case "--mono-debug":
CommandLineValues.Debug.ShowDebug = true;
CommandLineValues.Debug.ShowCallSource = true;
break;
case "--no-yeet":
CommandLineValues.YeetMods = false;
break;
case "--no-logs":
CommandLineValues.WriteLogs = false;
break;
case "--darken-message":
CommandLineValues.Debug.DarkenMessages = true;
break;
case "--condense-logs":
CommandLineValues.Debug.CondenseModLogs = true;
break;
case "--plugin-logs":
CommandLineValues.Debug.CreateModLogs = true;
break;
#if false
case "--no-updates":
CommandLineValues.Updates.AutoCheckUpdates = false;
CommandLineValues.Updates.AutoUpdate = false;
break;
#endif
case "--trace":
CommandLineValues.Debug.ShowTrace = true;
break;
}
}
}
public void CheckVersionBoundary()
{
if (ResetGameAssebliesOnVersionChange && Utilities.UnityGame.IsGameVersionBoundary)
{
GameAssemblies = GetDefaultGameAssemblies();
}
}
internal const string IPAName = "Beat Saber IPA";
internal const string IPAVersion = "4.3.1.0";
// uses Updates.AutoUpdate, Updates.AutoCheckUpdates, YeetMods, Debug.ShowCallSource, Debug.ShowDebug,
// Debug.CondenseModLogs
internal static SelfConfig CommandLineValues = new();
// For readability's sake, I want the default values to be visible in source.
#pragma warning disable CA1805 // Do not initialize unnecessarily
// END: section ignore
public virtual bool Regenerate { get; set; } = true;
#if false
public class Updates_
{
public virtual bool AutoUpdate { get; set; } = true;
// LINE: ignore 2
public static bool AutoUpdate_ => (Instance?.Updates?.AutoUpdate ?? true)
&& CommandLineValues.Updates.AutoUpdate;
public virtual bool AutoCheckUpdates { get; set; } = true;
// LINE: ignore 2
public static bool AutoCheckUpdates_ => (Instance?.Updates?.AutoCheckUpdates ?? true)
&& CommandLineValues.Updates.AutoCheckUpdates;
}
// LINE: ignore
[NonNullable]
public virtual Updates_ Updates { get; set; } = new Updates_();
#endif
public class Debug_
{
public virtual bool ShowCallSource { get; set; } = false;
// LINE: ignore 2
public static bool ShowCallSource_ => (Instance?.Debug?.ShowCallSource ?? false)
|| CommandLineValues.Debug.ShowCallSource;
public virtual bool ShowDebug { get; set; } = false;
// LINE: ignore 2
public static bool ShowDebug_ => (Instance?.Debug?.ShowDebug ?? false)
|| CommandLineValues.Debug.ShowDebug;
// This option only takes effect after a full game restart, unless new logs are created again
public virtual bool CondenseModLogs { get; set; } = false;
// LINE: ignore 2
public static bool CondenseModLogs_ => (Instance?.Debug?.CondenseModLogs ?? false)
|| CommandLineValues.Debug.CondenseModLogs;
// This option only takes effect after a full game restart, unless new logs are created again
public virtual bool CreateModLogs { get; set; } = false;
// LINE: ignore 2
public static bool CreateModLogs_ => (Instance?.Debug?.CreateModLogs ?? false)
|| CommandLineValues.Debug.CreateModLogs;
public virtual bool ShowHandledErrorStackTraces { get; set; } = false;
// LINE: ignore
public static bool ShowHandledErrorStackTraces_ => Instance?.Debug?.ShowHandledErrorStackTraces ?? false;
public virtual bool HideMessagesForPerformance { get; set; } = true;
// LINE: ignore
public static bool HideMessagesForPerformance_ => Instance?.Debug?.HideMessagesForPerformance ?? true;
public virtual int HideLogThreshold { get; set; } = 512;
// LINE: ignore
public static int HideLogThreshold_ => Instance?.Debug?.HideLogThreshold ?? 512;
public virtual bool ShowTrace { get; set; } = false;
// LINE: ignore 2
public static bool ShowTrace_ => (Instance?.Debug?.ShowTrace ?? false)
|| CommandLineValues.Debug.ShowTrace;
public virtual bool SyncLogging { get; set; } = false;
// LINE: ignore
public static bool SyncLogging_ => Instance?.Debug?.SyncLogging ?? false;
public virtual bool DarkenMessages { get; set; } = false;
// LINE: ignore 2
public static bool DarkenMessages_ => (Instance?.Debug?.DarkenMessages ?? false)
|| CommandLineValues.Debug.DarkenMessages;
}
// LINE: ignore
[NonNullable]
public virtual Debug_ Debug { get; set; } = new();
public class AntiMalware_
{
public virtual bool UseIfAvailable { get; set; } = true;
// LINE: ignore
public static bool UseIfAvailable_ => Instance?.AntiMalware?.UseIfAvailable ?? true;
public virtual bool RunPartialThreatCode { get; set; } = false;
// LINE: ignore
public static bool RunPartialThreatCode_ => Instance?.AntiMalware?.RunPartialThreatCode ?? true;
}
// LINE: ignore
[NonNullable]
public virtual AntiMalware_ AntiMalware { get; set; } = new();
public virtual bool YeetMods { get; set; } = true;
// LINE: ignore 2
public static bool YeetMods_ => (Instance?.YeetMods ?? true)
&& CommandLineValues.YeetMods;
[JsonIgnore]
public bool WriteLogs { get; set; } = true;
public virtual bool ResetGameAssebliesOnVersionChange { get; set; } = true;
// LINE: ignore
[NonNullable, UseConverter(typeof(CollectionConverter<string, HashSet<string?>>))]
public virtual HashSet<string> GameAssemblies { get; set; } = GetDefaultGameAssemblies();
// BEGIN: section ignore
public static HashSet<string> GetDefaultGameAssemblies()
=> new()
{
#if BeatSaber // provide these defaults only for Beat Saber builds
"Main.dll", "Core.dll", "HMLib.dll", "HMUI.dll", "HMRendering.dll", "VRUI.dll",
"BeatmapCore.dll", "GameplayCore.dll", "HMLibAttributes.dll", "BeatmapEditor3D.dll"
#else // otherwise specify Assembly-CSharp.dll
"Assembly-CSharp.dll"
#endif
};
// END: section ignore
// LINE: ignore
#if false // used to make schema gen happy
private static HashSet<string> GetDefaultGameAssemblies() => null;
// LINE: ignore
#endif
// LINE: ignore
public static HashSet<string> GameAssemblies_ => Instance?.GameAssemblies ?? new HashSet<string> { "Assembly-CSharp.dll" };
// LINE: ignore
#if false // Used for documentation schema generation
[JsonProperty(Required = Required.DisallowNull)]
public virtual string LastGameVersion { get; set; } = null;
// LINE: ignore 2
#endif
public virtual string? LastGameVersion { get; set; } = null;
// LINE: ignore
public static string? LastGameVersion_ => Instance?.LastGameVersion;
}
}

+ 10
- 11
IPA.Loader/IPA.Loader.csproj View File

@ -5,7 +5,7 @@
<PropertyGroup>
<TargetFrameworks>net472</TargetFrameworks>
<RootNamespace>IPA</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
@ -21,7 +21,7 @@
<PropertyGroup Condition="'$(BuildForBeatSaber)' == 'true'">
<DefineConstants>$(DefineConstants);BeatSaber</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' ">
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\Refs\UnityEngine.CoreModule.Net4.dll</HintPath>
@ -42,34 +42,33 @@
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<ProjectReference Include="..\Net3-Proxy\Net3-Proxy.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Ionic.Zip" Version="1.9.1.8" />
<!--<PackageReference Include="Lib.Harmony" Version="2.0.2" />-->
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<!--<PackageReference Include="AsyncBridge" Version="0.3.1" />
<PackageReference Include="System.ValueTuple" Version="4.5.0">
<ExcludeAssets>buildtransitive</ExcludeAssets>
</PackageReference>-->
<PackageReference Include="Mono.Cecil" Version="0.11.4" />
<PackageReference Include="HarmonyX" Version="2.7.0" />
<PackageReference Include="MonoMod.RuntimeDetour" Version="21.12.13.1" />
<PackageReference Include="Mono.Cecil" Version="0.11.5" />
<PackageReference Include="HarmonyX" Version="2.10.2" />
<PackageReference Include="Hive.Versioning.Standalone" Version="0.1.0-gh846.1" />
<ProjectReference Include="..\SemVer\SemVer.csproj" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Loader\manifest.json" />
<EmbeddedResource Include="icon_white.png" />
<EmbeddedResource Include="Loader\description.md" />
</ItemGroup>
<!-- disable the updater -->
<ItemGroup>
<Compile Remove="Updating\BeatMods\*.cs" />


+ 1
- 1
IPA.Loader/Loader/manifest.json View File

@ -7,7 +7,7 @@
],
"id": "BSIPA",
"name": "Beat Saber IPA",
"version": "4.3.0",
"version": "4.3.1",
"icon": "IPA.icon_white.png",
"features": {
"IPA.DefineFeature": [


+ 1
- 1
IPA/Program.cs View File

@ -21,7 +21,7 @@ namespace IPA
Unknown
}
public const string FileVersion = "4.3.0.0";
public const string FileVersion = "4.3.1.0";
public static Version Version => Assembly.GetEntryAssembly()!.GetName().Version!;


Loading…
Cancel
Save