mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 08:50:43 -05:00
28 lines
741 B
C#
28 lines
741 B
C#
using Aki.Reflection.Patching;
|
|
using Aki.Reflection.Utils;
|
|
using Aki.Common.Http;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
|
|
namespace Aki.Custom.Patches
|
|
{
|
|
public class CoreDifficultyPatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod()
|
|
{
|
|
var methodName = "LoadCoreByString";
|
|
var flags = BindingFlags.Public | BindingFlags.Static;
|
|
|
|
return PatchConstants.EftTypes.Single(x => x.GetMethod(methodName, flags) != null)
|
|
.GetMethod(methodName, flags);
|
|
}
|
|
|
|
[PatchPrefix]
|
|
private static bool PatchPrefix(ref string __result)
|
|
{
|
|
__result = RequestHandler.GetJson("/singleplayer/settings/bot/difficulty/core/core");
|
|
return string.IsNullOrWhiteSpace(__result);
|
|
}
|
|
}
|
|
}
|