Initial commit
This commit is contained in:
@@ -31,10 +31,7 @@ namespace undead_universal_patch_il2cpp.Patches
|
||||
return true;
|
||||
}
|
||||
|
||||
static MethodBase TargetMethod()
|
||||
{
|
||||
return targetMethod;
|
||||
}
|
||||
static MethodBase TargetMethod() => targetMethod;
|
||||
|
||||
[HarmonyPrefix]
|
||||
static bool Prefix(ref object request)
|
||||
@@ -46,7 +43,7 @@ namespace undead_universal_patch_il2cpp.Patches
|
||||
return false;
|
||||
}
|
||||
|
||||
var uriInstance = (Uri)uriProperty.GetValue(request, null);
|
||||
var uriInstance = (Il2CppSystem.Uri)uriProperty.GetValue(request, null);
|
||||
if (uriInstance == null)
|
||||
{
|
||||
Plugin.Log.LogFatal("BestHTTP_Unob failed: uriInstance was null.");
|
||||
@@ -55,11 +52,11 @@ namespace undead_universal_patch_il2cpp.Patches
|
||||
|
||||
if (GenericConfig.LogAllRequests.Value) Plugin.Log.LogInfo($"BestHTTP_Unob request (Before) URL: {uriInstance.ToString()}");
|
||||
|
||||
Uri newUri = new(NameserverConfig.NewUrl.Value);
|
||||
Il2CppSystem.Uri newUri = new(uriInstance.ToString().Contains("ns.rec.net") ? NameserverConfig.NewUrl.Value : uriInstance.ToString());
|
||||
|
||||
if (GenericConfig.LogAllRequests.Value) Plugin.Log.LogInfo($"BestHTTP_Unob request (After) URL: {newUri.ToString()}");
|
||||
|
||||
uriProperty.SetValue(request, NameserverConfig., null);
|
||||
uriProperty.SetValue(request, NameserverConfig.Rewrite.Value ? newUri : uriInstance, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user