diff --git a/Patches/BestHTTP.cs b/Patches/BestHTTP.cs index 231af25..fd91db6 100644 --- a/Patches/BestHTTP.cs +++ b/Patches/BestHTTP.cs @@ -56,13 +56,13 @@ if (uriInstance.Host.Contains("api.amplitude.com") && GenericConfig.DisableAmplitude.Value) return false; - Plugin.Log.LogInfo($"BestHTTP_MonoOne request (Before) URL: {uriInstance.ToString()}"); + if (GenericConfig.LogAllRequests.Value) Plugin.Log.LogInfo($"BestHTTP_MonoOne request (Before) URL: {uriInstance.ToString()}"); Uri newUri; if (GenericConfig.IsNameserver.Value) newUri = PatchUtils.RewriteUrlForNameserver(uriInstance); else newUri = PatchUtils.RewriteUrlForGameserver(uriInstance); - Plugin.Log.LogInfo($"BestHTTP_MonoOne request (After) URL: {newUri.ToString()}"); + if (GenericConfig.LogAllRequests.Value) Plugin.Log.LogInfo($"BestHTTP_MonoOne request (After) URL: {newUri.ToString()}"); uriProperty.SetValue(OCJJLJHMMGH, newUri, null); return true; @@ -120,13 +120,13 @@ // TODO: Not the most elegant way to patch out amplitude - find a better way if (uriInstance.Host.Contains("api.amplitude.com") && GenericConfig.DisableAmplitude.Value) return false; - Plugin.Log.LogInfo($"BestHTTP_MonoTwo request (Before) URL: {uriInstance.ToString()}"); + if (GenericConfig.LogAllRequests.Value) Plugin.Log.LogInfo($"BestHTTP_MonoTwo request (Before) URL: {uriInstance.ToString()}"); Uri newUri; if (GenericConfig.IsNameserver.Value) newUri = PatchUtils.RewriteUrlForNameserver(uriInstance); else newUri = PatchUtils.RewriteUrlForGameserver(uriInstance); - Plugin.Log.LogInfo($"BestHTTP_MonoTwo request (After) URL: {newUri.ToString()}"); + if (GenericConfig.LogAllRequests.Value) Plugin.Log.LogInfo($"BestHTTP_MonoTwo request (After) URL: {newUri.ToString()}"); uriProperty.SetValue(GFKPFLABKMA, newUri, null); return true; diff --git a/Patches/UWRPatchNoArg.cs b/Patches/UWRPatchNoArg.cs index 847acc1..e032da9 100644 --- a/Patches/UWRPatchNoArg.cs +++ b/Patches/UWRPatchNoArg.cs @@ -35,15 +35,6 @@ return AccessTools.Constructor(targetType, []); } - [HarmonyPrefix] - public static bool Prefix(ref string url) - { - // TODO: This is duplicated across all UWR patch files, reduce boilerplate - // TODO: This is not the most elegant way to patch out amplitude - find a better fix - if (url.Contains("api.amplitude.com") && GenericConfig.DisableAmplitude.Value) return false; - else return true; - } - [HarmonyPostfix] static void Postfix(object __instance) => InPostfix(__instance, UWRParams); diff --git a/Plugin.cs b/Plugin.cs index df359aa..878716c 100644 --- a/Plugin.cs +++ b/Plugin.cs @@ -5,7 +5,7 @@ namespace undead_universal_patch; -[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.mono", "Undead Universal Patch", "1.0.1")] +[BepInPlugin("dev.proxnet.recroom.universalpatch.noneac.mono", "Undead Universal Patch", "1.0.2")] public class Plugin : BaseUnityPlugin { public static readonly ManualLogSource Log = BepInEx.Logging.Logger.CreateLogSource("UUPatch");