0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:30:46 -05:00
modules/project/SPT.Core/Patches/WebSocketPatch.cs

24 lines
700 B
C#
Raw Normal View History

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