2023-03-03 18:52:31 +00:00
|
|
|
using System.Reflection;
|
|
|
|
using UnityEngine.Networking;
|
2024-05-21 19:10:17 +01:00
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
using SPT.Core.Models;
|
2023-03-03 18:52:31 +00:00
|
|
|
|
2024-05-21 19:10:17 +01:00
|
|
|
namespace SPT.Core.Patches
|
2023-03-03 18:52:31 +00:00
|
|
|
{
|
|
|
|
public class UnityWebRequestPatch : ModulePatch
|
|
|
|
{
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
{
|
|
|
|
return typeof(UnityWebRequestTexture).GetMethod(nameof(UnityWebRequestTexture.GetTexture), new[] { typeof(string) });
|
|
|
|
}
|
|
|
|
|
|
|
|
[PatchPostfix]
|
|
|
|
private static void PatchPostfix(UnityWebRequest __result)
|
|
|
|
{
|
|
|
|
__result.certificateHandler = new FakeCertificateHandler();
|
|
|
|
__result.disposeCertificateHandlerOnDispose = true;
|
|
|
|
__result.timeout = 15000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|