Skip to content

Commit

Permalink
feat: Prep for CN Dawntrail
Browse files Browse the repository at this point in the history
  • Loading branch information
nt153133 committed Sep 4, 2024
1 parent 1438765 commit 89ea604
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions Extensions/LocalPlayerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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<ulong>(player.Pointer + Offsets.AccountId);
#endif
return 0;
Expand Down
2 changes: 1 addition & 1 deletion Memory/Attributes/OffsetAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions Memory/OffsetManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 89ea604

Please sign in to comment.