-
Notifications
You must be signed in to change notification settings - Fork 1
/
FortGameStateAthena.cpp
99 lines (76 loc) · 2.69 KB
/
FortGameStateAthena.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#include "pch.h"
#include "FortGameStateAthena.h"
int32_t AFortGameStateAthena::Offset_CurrentPlaylistInfo = 0;
int32_t AFortGameStateAthena::Offset_GamePhase = 0;
AFortGameStateAthena::AFortGameStateAthena()
{
}
// Only used for manual casting
AFortGameStateAthena::AFortGameStateAthena(AGameStateBase* GameStateBase)
{
InternalObject = GameStateBase->GetInternalObjectRef();
Setup();
}
void AFortGameStateAthena::Setup()
{
__super::Setup();
if (Offset_CurrentPlaylistInfo == 0)
{
Offset_CurrentPlaylistInfo = ObjectFinder::FindOffset(XOR(L"Class /Script/FortniteGame.FortGameStateAthena"), XOR(L"CurrentPlaylistInfo"));
if (Offset_CurrentPlaylistInfo == 0)
{
PLOGE << "Couldn't find Offset_CurrentPlaylistInfo";
}
}
if (Offset_GamePhase == 0)
{
Offset_GamePhase = ObjectFinder::FindOffset(XOR(L"Class /Script/FortniteGame.FortGameStateAthena"), XOR(L"GamePhase"));
if (Offset_GamePhase == 0)
{
PLOGE << "Couldn't find Offset_GamePhase";
}
}
auto InternalCurrentPlaylistInfo = reinterpret_cast<INTERNALFPlaylistPropertyArray*>(reinterpret_cast<uintptr_t>(GetInternalObject()) + Offset_CurrentPlaylistInfo);
if (Util::IsBadReadPtr(InternalCurrentPlaylistInfo)) {
PLOGE << "InternalCurrentPlaylistInfo is nullptr";
}
CurrentPlaylistInfo = new FPlaylistPropertyArray(InternalCurrentPlaylistInfo);
CurrentPlaylistInfo->Setup();
GamePhase = reinterpret_cast<EAthenaGamePhase*>(reinterpret_cast<uintptr_t>(GetInternalObject()) + Offset_GamePhase);
if (Util::IsBadReadPtr(GamePhase)) {
PLOGE << "InternalCurrentPlaylistInfo is nullptr";
}
SetPointer(XOR(L"Function /Script/FortniteGame.FortGameStateAthena:OnRep_CurrentPlaylistInfo"), &Fn_OnRep_CurrentPlaylistInfo, &CanExec_OnRep_CurrentPlaylistInfo);
SetPointer(XOR(L"Function /Script/FortniteGame.FortGameStateAthena:OnRep_GamePhase"), &Fn_OnRep_GamePhase, &CanExec_OnRep_GamePhase);
}
void AFortGameStateAthena::OnRep_CurrentPlaylistInfo()
{
if (!CanExec_OnRep_CurrentPlaylistInfo) return;
if (Util::IsBadReadPtr(InternalObject))
{
PLOGE << "InternalUObject is nullptr";
}
if (Util::IsBadReadPtr(Fn_OnRep_CurrentPlaylistInfo))
{
PLOGE << "Fn_OnRep_CurrentPlaylistInfo is nullptr";
}
ProcessNoParamsEvent(InternalObject, Fn_OnRep_CurrentPlaylistInfo);
}
void AFortGameStateAthena::OnRep_GamePhase(EAthenaGamePhase OldGamePhase)
{
if (!CanExec_OnRep_GamePhase) return;
struct Params {
EAthenaGamePhase OldGamePhase;
};
auto params = Params();
params.OldGamePhase = OldGamePhase;
if (Util::IsBadReadPtr(InternalObject))
{
PLOGE << "InternalObject is nullptr";
}
if (Util::IsBadReadPtr(Fn_OnRep_GamePhase))
{
PLOGE << "Fn_OnRep_GamePhase is nullptr";
}
ProcessEvent(InternalObject, Fn_OnRep_GamePhase, ¶ms);
}