0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/Aki.Core/Patches/ConsistencyMultiPatch.cs
2023-03-03 18:52:31 +00:00

27 lines
784 B
C#

using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Aki.Reflection.Patching;
using Aki.Reflection.Utils;
using Aki.Core.Models;
using FilesChecker;
namespace Aki.Core.Patches
{
public class ConsistencyMultiPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return PatchConstants.FilesCheckerTypes.Single(x => x.Name == "ConsistencyController")
.GetMethods().Single(x => x.Name == "EnsureConsistency" && x.ReturnType == typeof(Task<ICheckResult>));
}
[PatchPrefix]
private static bool PatchPrefix(ref object __result)
{
__result = Task.FromResult<ICheckResult>(new FakeFileCheckerResult());
return false;
}
}
}