mirror of
https://github.com/djdevin/recnet-plugin.git
synced 2026-09-08 14:41:30 -07:00
19 lines
525 B
C#
19 lines
525 B
C#
using BestHTTP;
|
|
using HarmonyLib;
|
|
|
|
namespace CannedNet.Client.Patches;
|
|
|
|
public class SendRequestPatch
|
|
{
|
|
[HarmonyPatch(typeof(HTTPManager), "SendRequest", [typeof(HTTPRequest)])]
|
|
public class ConnectToRecNetPatch
|
|
{
|
|
private static void Prefix(ref HTTPRequest request)
|
|
{
|
|
Plugin.Log.LogInfo($"hi {request.Uri.Host}");
|
|
|
|
if (request.Uri.Host.Contains("ns.rec.net"))
|
|
request.Uri = new Il2CppSystem.Uri(Plugin.ServerHostname.Value);
|
|
}
|
|
}
|
|
} |