mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 07:50:46 -05:00
24 lines
700 B
C#
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:"));
|
|
}
|
|
}
|
|
}
|