0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 01:50:45 -05:00
modules/project/SPT.Core/Patches/WebSocketPatch.cs
chomp ffde317c59 Feature: new-remapper (!143)
Co-authored-by: Dev <dev@dev.sp-tarkov.com>
Reviewed-on: SPT/Modules#143
2024-07-04 14:11:11 +00:00

24 lines
700 B
C#

using HarmonyLib;
using SPT.Reflection.Patching;
using System;
using System.Reflection;
namespace SPT.Core.Patches
{
public class WebSocketPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(UriParamsClass), nameof(UriParamsClass.method_0));
}
// This is a pass through postfix and behaves a little differently than usual
// https://harmony.pardeike.net/articles/patching-postfix.html#pass-through-postfixes
[PatchPostfix]
private static Uri PatchPostfix(Uri __result)
{
return new Uri(__result.ToString().Replace("wss:", "ws:"));
}
}
}