style(loader): file-scoped namespace + silence Harmony003 false positive

This commit is contained in:
gamer147
2026-06-03 09:17:37 -04:00
parent 800e40344b
commit 620ae31582

View File

@@ -1,11 +1,11 @@
using Cute; using Cute;
using HarmonyLib; using HarmonyLib;
namespace SVSimLoader.Patches namespace SVSimLoader.Patches;
[HarmonyPatch]
public static class MultiInstancePatches
{ {
[HarmonyPatch]
public static class MultiInstancePatches
{
// (1) Defeat the machine-wide single-instance guard. createMutex is private, so target it // (1) Defeat the machine-wide single-instance guard. createMutex is private, so target it
// by string name. Prefix returning false skips the original (Application.Quit never runs). // by string name. Prefix returning false skips the original (Application.Quit never runs).
[HarmonyPatch(typeof(BootApp), "createMutex")] [HarmonyPatch(typeof(BootApp), "createMutex")]
@@ -54,7 +54,8 @@ namespace SVSimLoader.Patches
public static bool SetInt(string key, int value) public static bool SetInt(string key, int value)
{ {
if (!SvSimConfig.SecondaryInstance || !IsIdentityKey(key)) return true; if (!SvSimConfig.SecondaryInstance || !IsIdentityKey(key)) return true;
InstanceIdentityStore.Set(key, value.ToString()); int v = value;
InstanceIdentityStore.Set(key, v.ToString());
return false; return false;
} }
@@ -70,5 +71,4 @@ namespace SVSimLoader.Patches
Plugin.Log.LogWarning( Plugin.Log.LogWarning(
$"Multi-instance: forced SteamID={SvSimConfig.FakeSteamId}, ticket={SvSimConfig.FakeTicket}."); $"Multi-instance: forced SteamID={SvSimConfig.FakeSteamId}, ticket={SvSimConfig.FakeTicket}.");
} }
}
} }