2024-08-28 12:52:54 +01:00
|
|
|
|
using System.Reflection;
|
2023-03-03 18:52:31 +00:00
|
|
|
|
using System.Threading.Tasks;
|
2024-05-21 19:10:17 +01:00
|
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
|
using SPT.Reflection.Utils;
|
|
|
|
|
using SPT.Core.Models;
|
2023-03-03 18:52:31 +00:00
|
|
|
|
using FilesChecker;
|
|
|
|
|
|
2024-05-21 19:10:17 +01:00
|
|
|
|
namespace SPT.Core.Patches
|
2023-03-03 18:52:31 +00:00
|
|
|
|
{
|
|
|
|
|
public class ConsistencySinglePatch : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
2024-01-13 22:08:29 +00:00
|
|
|
|
return PatchConstants.FilesCheckerTypes.SingleCustom(x => x.Name == "ConsistencyController")
|
|
|
|
|
.GetMethods().SingleCustom(x => x.Name == "EnsureConsistencySingle" && x.ReturnType == typeof(Task<ICheckResult>));
|
2023-03-03 18:52:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPrefix]
|
|
|
|
|
private static bool PatchPrefix(ref object __result)
|
|
|
|
|
{
|
|
|
|
|
__result = Task.FromResult<ICheckResult>(new FakeFileCheckerResult());
|
2024-09-16 15:02:51 +01:00
|
|
|
|
|
2024-10-03 10:28:48 +01:00
|
|
|
|
return false; // Skip original
|
2023-03-03 18:52:31 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|