From 89ea604e4ba9c533d71d44b713cca63746685294 Mon Sep 17 00:00:00 2001 From: nt153133 <52430037+nt153133@users.noreply.github.com> Date: Tue, 3 Sep 2024 23:24:14 -0400 Subject: [PATCH] feat: Prep for CN Dawntrail --- Extensions/LocalPlayerExtensions.cs | 7 +++++-- Memory/Attributes/OffsetAttribute.cs | 2 +- Memory/OffsetManager.cs | 6 ++++++ 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Extensions/LocalPlayerExtensions.cs b/Extensions/LocalPlayerExtensions.cs index 3a23896..4c5ac7c 100644 --- a/Extensions/LocalPlayerExtensions.cs +++ b/Extensions/LocalPlayerExtensions.cs @@ -31,9 +31,12 @@ internal static class Offsets [Offset("Search 48 8B 05 ? ? ? ? 48 8D 0D ? ? ? ? 41 8B DC Add 3 TraceRelative")] internal static IntPtr PlayerId; -#if !RB_CN +#if RB_DT [Offset("Search 48 89 BB ? ? ? ? 80 A3 ? ? ? ? ? 88 83 ? ? ? ? Add 3 Read32")] internal static int AccountId; +#else + [Offset("Search 48 8B 05 ? ? ? ? 48 8D 0D ? ? ? ? 41 8B DC Add 3 TraceRelative")] + internal static int AccountId; #endif [Offset("Search 0F B6 05 ? ? ? ? 88 83 ? ? ? ? Add 3 TraceRelative")] @@ -141,7 +144,7 @@ public static ulong PlayerId(this LocalPlayer player) public static ulong AccountId(this LocalPlayer player) { -#if !RB_CN +#if RB_DT return Core.Memory.Read(player.Pointer + Offsets.AccountId); #endif return 0; diff --git a/Memory/Attributes/OffsetAttribute.cs b/Memory/Attributes/OffsetAttribute.cs index 1e65f83..80cc65f 100644 --- a/Memory/Attributes/OffsetAttribute.cs +++ b/Memory/Attributes/OffsetAttribute.cs @@ -349,7 +349,7 @@ public OffsetCNAttribute(string pattern, bool ignoreCache = false, int expectedV public class OffsetDawntrailAttribute : OffsetAttribute { -#if RB_CN +#if !RB_DT private static bool _isValid { get; } = false; #else private static bool _isValid { get; } = true; diff --git a/Memory/OffsetManager.cs b/Memory/OffsetManager.cs index 9c38f69..b40c02e 100644 --- a/Memory/OffsetManager.cs +++ b/Memory/OffsetManager.cs @@ -95,6 +95,12 @@ private static int GameVersion public const bool IsChinese = false; #endif +#if RB_DT + public const bool IsDawntrail = true; +#else + public const bool IsDawntrail = false; +#endif + private static bool _isNewGameBuild; private static int GameVersion1 = 0;