CommonLibVR
BGSSaveLoadManager.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RE/B/BSAtomic.h"
4 #include "RE/B/BSFixedString.h"
5 #include "RE/B/BSTArray.h"
6 #include "RE/B/BSTEvent.h"
7 #include "RE/B/BSTHashMap.h"
8 #include "RE/B/BSTMessageQueue.h"
9 #include "RE/B/BSTSmartPointer.h"
10 #include "RE/B/BSThread.h"
11 #include "RE/R/RaceSexMenuEvent.h"
12 #include "RE/R/Request.h"
13 
14 namespace RE
15 {
16  class BSSaveDataEvent;
17  class BSSystemEvent;
18  struct BGSSaveLoadManagerEvent;
19 
21  {
22  public:
23  enum class SaveType
24  {
25  kAutosave = 0x0,
26  kSave = 0x1,
27  kQuicksave = 0x2
28  };
29 
30  // members
37  std::int32_t saveVersion; // 30
38  std::uint32_t saveNumber; // 34
39  std::uint32_t characterLevel; // 38
40  float currentExperience; // 3C
41  float requiredExperience; // 40
42  std::uint32_t screenshotWidth; // 44
43  std::uint32_t screenshotHeight; // 48
44  std::uint32_t unk4C; // 4C
47  std::int32_t unk60; // 60
48  bool loaded; // 64
49  bool unk65; // 65
50  bool unk66; // 66
51  std::uint8_t unk67; // 67
52  std::uint8_t unk68; // 68
53  bool unk69; // 69
54  std::uint16_t pad6A; // 6A
55  std::uint32_t characterID; // 6C
57  std::uint32_t pad74; // 74
58  private:
59  KEEP_FOR_RE()
60  };
61  static_assert(sizeof(BGSSaveLoadFileEntry) == 0x78);
62 
64  public BSTEventSink<BSSaveDataEvent>, // 000
65  public BSTEventSink<RaceSexMenuEvent::NameChangedEvent>, // 008
66  public BSTEventSource<BGSSaveLoadManagerEvent>, // 018
67  public BSTEventSink<BSSystemEvent> // 010
68  {
69  public:
70  inline static constexpr auto RTTI = RTTI_BGSSaveLoadManager;
71  inline static constexpr auto VTABLE = VTABLE_BGSSaveLoadManager;
72 
73  class Thread : public BSThread
74  {
75  public:
76  inline static constexpr auto RTTI = RTTI_BGSSaveLoadManager__Thread;
77  inline static constexpr auto VTABLE = VTABLE_BGSSaveLoadManager__Thread;
78 
79  ~Thread() override; // 00
80 
81  void Unk_01(void) override; // 01
82  void Unk_02(void) override; // 02
83 
84  // members
85  bool isRunnning; // 50
86  bool isBusy; // 51
87  std::uint16_t pad52; // 52
88  std::uint32_t pad54; // 54
91  };
92  static_assert(sizeof(Thread) == 0xC0);
93 
94  ~BGSSaveLoadManager() override; // 00
95 
96  // override (BSTEventSink<BSSaveDataEvent>)
97  BSEventNotifyControl ProcessEvent(const BSSaveDataEvent* a_event, BSTEventSource<BSSaveDataEvent>* a_eventSource) override; // 01
98 
99  // override (BSTEventSink<RaceSexMenuEvent::NameChangedEvent>)
101 
102  // override (BSTEventSink<BSSystemEvent>)
103  BSEventNotifyControl ProcessEvent(const BSSystemEvent* a_event, BSTEventSource<BSSystemEvent>* a_eventSource) override; // 01
104 
106 
107  void Save(const char* a_fileName);
108  void Load(const char* a_fileName);
109  void Load(const char* a_fileName, bool a_checkForMods);
111 
113 
114  // members
116  std::uint64_t unk0A0; // 0A0
117  std::uint32_t unk0A8; // 0A8
118  std::uint32_t unk0AC; // 0AC
119  std::uint32_t unk0B0; // 0B0
120  std::uint32_t unk0B4; // 0B4
121  std::uint64_t unk0B8; // 0B8
122  std::uint64_t unk0C0; // 0C0
123  std::uint64_t unk0C8; // 0C8
124  std::uint64_t currentPlayerID; // 0D0
125  std::uint64_t displayPlayerID; // 0D8
126  std::uint32_t unk0E0; // 0E0
127  std::uint32_t unk0E4; // 0E4
129 
131  std::uint8_t unk118; // 118
132  std::uint8_t unk119; // 119
133  std::uint16_t unk11A; // 11A
134  std::uint32_t unk11C; // 11C
135  std::uint16_t unk120; // 120
136  std::uint16_t unk122; // 122
137  std::uint32_t unk124; // 124
138  std::uint32_t tickCount; // 128
139  std::uint32_t unk12C; // 12C
140  std::uint8_t unk130; // 130
141  std::uint8_t unk131; // 131
142  std::uint16_t unk132; // 132
143  std::uint32_t unk134; // 134
144  std::uint64_t unk138; // 138
145  std::uint64_t unk140; // 140
146  std::uint64_t unk148; // 148
147  std::uint64_t unk150; // 150
148  std::uint64_t unk158; // 158
149  std::uint64_t unk160; // 160
150  std::uint64_t unk168; // 168
151  std::uint64_t unk170; // 170
152  std::uint64_t unk178; // 178
153  std::uint64_t unk180; // 180
154  std::uint64_t unk188; // 188
155  std::uint64_t unk190; // 190
156  std::uint64_t unk198; // 198
157  std::uint64_t unk1A0; // 1A0
158  std::uint64_t unk1A8; // 1A8
159  std::uint64_t unk1B0; // 1B0
160  std::uint64_t unk1B8; // 1B8
161  std::uint64_t unk1C0; // 1C0
162  std::uint64_t unk1C8; // 1C8
163  std::uint64_t unk1D0; // 1D0
164  std::uint64_t unk1D8; // 1D8
165  std::uint64_t unk1E0; // 1E0
166  std::uint64_t unk1E8; // 1E8
167  std::uint64_t unk1F0; // 1F0
168  std::uint64_t unk1F8; // 1F8
169 
170  std::uint64_t unk200; // 200
171  std::uint64_t unk208; // 208
172  std::uint64_t unk210; // 210
173  std::uint64_t unk218; // 218
174  std::uint64_t unk220; // 220
175  std::uint64_t unk228; // 228
176  std::uint64_t unk230; // 230
177  std::uint64_t unk238; // 238
178  std::uint64_t unk240; // 240
179  std::uint64_t unk248; // 248
180  std::uint32_t unk250; // 250
181  std::uint32_t unk254; // 254
182  std::uint64_t unk258; // 258
183  std::uint16_t unk260; // 260
184  std::uint16_t unk262; // 262
185  std::uint32_t unk264; // 264
186  std::uint64_t unk268; // 268
187  std::uint32_t unk270; // 270
188  std::uint32_t unk274; // 274
189  std::uint64_t unk278; // 278
190  std::uint64_t unk280; // 280
191  std::uint32_t unk288; // 288
192  std::uint32_t unk28C; // 28C
193  std::uint64_t unk290; // 290
194  std::uint64_t unk298; // 298
195  std::uint32_t unk2A0; // 2A0
196  std::uint32_t unk2A4; // 2A4
197  std::uint64_t unk2A8; // 2A8
198 #ifdef SKYRIM_SUPPORT_AE
199  std::uint16_t unk2B0; // 2B0
200  std::uint16_t unk2B2; // 2B2
201  std::uint64_t unk2B8; // 2B8
202  BSTArray<void*> unk2C0; // 2C0
203  BSTArray<void*> unk2D8; // 2D8
204  std::uint8_t unk2F0; // 2F0
205 #endif
206  Thread thread; // 2B0
207 
209 
210  uint64_t unk3D0; // 3D0;
211 
212  protected:
213  bool Save_Impl(std::int32_t a_deviceID, std::uint32_t a_outputStats, const char* a_fileName);
214  bool Load_Impl(const char* a_fileName, std::int32_t a_deviceID, std::uint32_t a_outputStats, bool a_checkForMods);
215 
216  private:
217  KEEP_FOR_RE()
218  };
219 #ifndef SKYRIMVR
220 # ifdef SKYRIM_SUPPORT_AE
221  static_assert(sizeof(BGSSaveLoadManager) == 0x418);
222 # else
223  static_assert(sizeof(BGSSaveLoadManager) == 0x3D8);
224 # endif
225 #else
226  static_assert(sizeof(BGSSaveLoadManager) == 0x3D8);
227 #endif
228 }
#define KEEP_FOR_RE()
Definition: PCH.h:713
Definition: BGSSaveLoadManager.h:21
std::uint32_t pad74
Definition: BGSSaveLoadManager.h:57
BSFixedString playTime
Definition: BGSSaveLoadManager.h:35
stl::enumeration< SaveType, std::uint32_t > saveType
Definition: BGSSaveLoadManager.h:56
std::uint32_t characterID
Definition: BGSSaveLoadManager.h:55
bool unk65
Definition: BGSSaveLoadManager.h:49
bool unk66
Definition: BGSSaveLoadManager.h:50
bool unk69
Definition: BGSSaveLoadManager.h:53
BSFixedString fileName
Definition: BGSSaveLoadManager.h:31
std::int32_t saveVersion
Definition: BGSSaveLoadManager.h:37
bool loaded
Definition: BGSSaveLoadManager.h:48
std::uint32_t characterLevel
Definition: BGSSaveLoadManager.h:39
std::uint32_t screenshotHeight
Definition: BGSSaveLoadManager.h:43
std::uint16_t pad6A
Definition: BGSSaveLoadManager.h:54
std::int32_t unk60
Definition: BGSSaveLoadManager.h:47
BSFixedString characterName
Definition: BGSSaveLoadManager.h:32
std::uint32_t saveNumber
Definition: BGSSaveLoadManager.h:38
std::uint32_t screenshotWidth
Definition: BGSSaveLoadManager.h:42
float currentExperience
Definition: BGSSaveLoadManager.h:40
BSFixedString currentLocation
Definition: BGSSaveLoadManager.h:34
std::uint8_t unk68
Definition: BGSSaveLoadManager.h:52
SaveType
Definition: BGSSaveLoadManager.h:24
BSFixedString characterRace
Definition: BGSSaveLoadManager.h:36
REX::W32::FILETIME fileTime
Definition: BGSSaveLoadManager.h:45
std::uint32_t unk4C
Definition: BGSSaveLoadManager.h:44
REX::W32::FILETIME saveTime
Definition: BGSSaveLoadManager.h:46
BSFixedString characterTitle
Definition: BGSSaveLoadManager.h:33
std::uint8_t unk67
Definition: BGSSaveLoadManager.h:51
float requiredExperience
Definition: BGSSaveLoadManager.h:41
Definition: BGSSaveLoadManager.h:74
void Unk_02(void) override
bool isBusy
Definition: BGSSaveLoadManager.h:86
static constexpr auto VTABLE
Definition: BGSSaveLoadManager.h:77
std::uint32_t pad54
Definition: BGSSaveLoadManager.h:88
void Unk_01(void) override
static constexpr auto RTTI
Definition: BGSSaveLoadManager.h:76
BSTCommonStaticMessageQueue< BSTSmartPointer< bgs::saveload::Request >, 8 > asyncSaveLoadOperationQueue
Definition: BGSSaveLoadManager.h:90
std::uint16_t pad52
Definition: BGSSaveLoadManager.h:87
BSEventFlag haveTask
Definition: BGSSaveLoadManager.h:89
bool isRunnning
Definition: BGSSaveLoadManager.h:85
Definition: BGSSaveLoadManager.h:68
std::uint64_t unk220
Definition: BGSSaveLoadManager.h:174
BSTCommonStaticMessageQueue< BSTSmartPointer< bgs::saveload::Request >, 8 > unk370
Definition: BGSSaveLoadManager.h:208
static BGSSaveLoadManager * GetSingleton()
std::uint64_t unk140
Definition: BGSSaveLoadManager.h:145
std::uint32_t unk2A4
Definition: BGSSaveLoadManager.h:196
std::uint64_t unk1F0
Definition: BGSSaveLoadManager.h:167
static constexpr auto RTTI
Definition: BGSSaveLoadManager.h:70
std::uint64_t unk148
Definition: BGSSaveLoadManager.h:146
std::uint64_t unk278
Definition: BGSSaveLoadManager.h:189
std::uint64_t unk170
Definition: BGSSaveLoadManager.h:151
std::uint64_t unk248
Definition: BGSSaveLoadManager.h:179
std::uint64_t unk1A8
Definition: BGSSaveLoadManager.h:158
std::uint8_t unk118
Definition: BGSSaveLoadManager.h:131
std::uint32_t unk2A0
Definition: BGSSaveLoadManager.h:195
std::uint64_t unk190
Definition: BGSSaveLoadManager.h:155
std::uint32_t unk0B0
Definition: BGSSaveLoadManager.h:119
std::uint32_t unk0E4
Definition: BGSSaveLoadManager.h:127
std::uint64_t unk230
Definition: BGSSaveLoadManager.h:176
BSEventNotifyControl ProcessEvent(const BSSaveDataEvent *a_event, BSTEventSource< BSSaveDataEvent > *a_eventSource) override
std::uint64_t unk1B0
Definition: BGSSaveLoadManager.h:159
std::uint32_t unk250
Definition: BGSSaveLoadManager.h:180
std::uint64_t unk240
Definition: BGSSaveLoadManager.h:178
std::uint64_t unk1C8
Definition: BGSSaveLoadManager.h:162
void Save(const char *a_fileName)
std::uint64_t unk1C0
Definition: BGSSaveLoadManager.h:161
Thread thread
Definition: BGSSaveLoadManager.h:206
BSEventNotifyControl ProcessEvent(const RaceSexMenuEvent::NameChangedEvent *a_event, BSTEventSource< RaceSexMenuEvent::NameChangedEvent > *a_eventSource) override
std::uint16_t unk11A
Definition: BGSSaveLoadManager.h:133
std::uint8_t unk131
Definition: BGSSaveLoadManager.h:141
static constexpr auto VTABLE
Definition: BGSSaveLoadManager.h:71
std::uint64_t unk228
Definition: BGSSaveLoadManager.h:175
std::uint32_t unk270
Definition: BGSSaveLoadManager.h:187
std::uint64_t unk258
Definition: BGSSaveLoadManager.h:182
std::uint64_t unk198
Definition: BGSSaveLoadManager.h:156
uint64_t unk3D0
Definition: BGSSaveLoadManager.h:210
std::uint64_t unk1E0
Definition: BGSSaveLoadManager.h:165
std::uint32_t unk12C
Definition: BGSSaveLoadManager.h:139
std::uint16_t unk262
Definition: BGSSaveLoadManager.h:184
std::uint32_t unk0B4
Definition: BGSSaveLoadManager.h:120
std::uint32_t unk254
Definition: BGSSaveLoadManager.h:181
BSEventNotifyControl ProcessEvent(const BSSystemEvent *a_event, BSTEventSource< BSSystemEvent > *a_eventSource) override
bool Load_Impl(const char *a_fileName, std::int32_t a_deviceID, std::uint32_t a_outputStats, bool a_checkForMods)
std::uint32_t unk134
Definition: BGSSaveLoadManager.h:143
std::uint64_t unk0A0
Definition: BGSSaveLoadManager.h:116
std::uint64_t unk2A8
Definition: BGSSaveLoadManager.h:197
std::uint64_t unk280
Definition: BGSSaveLoadManager.h:190
std::uint64_t unk188
Definition: BGSSaveLoadManager.h:154
std::uint16_t unk122
Definition: BGSSaveLoadManager.h:136
std::uint64_t unk290
Definition: BGSSaveLoadManager.h:193
std::uint32_t unk274
Definition: BGSSaveLoadManager.h:188
std::uint64_t unk200
Definition: BGSSaveLoadManager.h:170
void Load(const char *a_fileName, bool a_checkForMods)
BSTArray< void * > unk0E8
Definition: BGSSaveLoadManager.h:128
BSTHashMap< std::uint64_t, BSFixedString > playerIDNameMap
Definition: BGSSaveLoadManager.h:115
std::uint16_t unk132
Definition: BGSSaveLoadManager.h:142
std::uint32_t unk288
Definition: BGSSaveLoadManager.h:191
std::uint32_t unk11C
Definition: BGSSaveLoadManager.h:134
std::uint64_t unk168
Definition: BGSSaveLoadManager.h:150
std::uint8_t unk130
Definition: BGSSaveLoadManager.h:140
std::uint64_t unk0C8
Definition: BGSSaveLoadManager.h:123
std::uint32_t unk0AC
Definition: BGSSaveLoadManager.h:118
std::uint16_t unk260
Definition: BGSSaveLoadManager.h:183
std::uint64_t unk238
Definition: BGSSaveLoadManager.h:177
std::uint32_t unk0E0
Definition: BGSSaveLoadManager.h:126
std::uint64_t unk1E8
Definition: BGSSaveLoadManager.h:166
std::uint64_t unk0B8
Definition: BGSSaveLoadManager.h:121
std::uint64_t unk1D8
Definition: BGSSaveLoadManager.h:164
std::uint64_t unk1A0
Definition: BGSSaveLoadManager.h:157
std::uint64_t displayPlayerID
Definition: BGSSaveLoadManager.h:125
std::uint64_t unk1F8
Definition: BGSSaveLoadManager.h:168
std::uint64_t unk180
Definition: BGSSaveLoadManager.h:153
std::uint64_t unk1D0
Definition: BGSSaveLoadManager.h:163
std::uint64_t unk138
Definition: BGSSaveLoadManager.h:144
std::uint64_t currentPlayerID
Definition: BGSSaveLoadManager.h:124
void Load(const char *a_fileName)
std::uint64_t unk150
Definition: BGSSaveLoadManager.h:147
std::uint8_t unk119
Definition: BGSSaveLoadManager.h:132
std::uint64_t unk178
Definition: BGSSaveLoadManager.h:152
std::uint64_t unk268
Definition: BGSSaveLoadManager.h:186
~BGSSaveLoadManager() override
std::uint64_t unk160
Definition: BGSSaveLoadManager.h:149
std::uint32_t tickCount
Definition: BGSSaveLoadManager.h:138
std::uint32_t unk124
Definition: BGSSaveLoadManager.h:137
std::uint64_t unk298
Definition: BGSSaveLoadManager.h:194
std::uint32_t unk0A8
Definition: BGSSaveLoadManager.h:117
std::uint32_t unk28C
Definition: BGSSaveLoadManager.h:192
std::uint16_t unk120
Definition: BGSSaveLoadManager.h:135
std::uint64_t unk1B8
Definition: BGSSaveLoadManager.h:160
std::uint64_t unk208
Definition: BGSSaveLoadManager.h:171
BSTArray< BGSSaveLoadFileEntry * > saveGameList
Definition: BGSSaveLoadManager.h:130
std::uint64_t unk218
Definition: BGSSaveLoadManager.h:173
std::uint32_t unk264
Definition: BGSSaveLoadManager.h:185
std::uint64_t unk210
Definition: BGSSaveLoadManager.h:172
std::uint64_t unk158
Definition: BGSSaveLoadManager.h:148
std::uint64_t unk0C0
Definition: BGSSaveLoadManager.h:122
bool Save_Impl(std::int32_t a_deviceID, std::uint32_t a_outputStats, const char *a_fileName)
Definition: BSAtomic.h:57
Definition: BSTMessageQueue.h:81
Definition: BSTEvent.h:143
Definition: BSTEvent.h:19
Definition: BSTHashMap.h:21
Definition: BSThread.h:8
Definition: AbsorbEffect.h:6
constexpr std::array< REL::ID, 3 > VTABLE_BGSSaveLoadManager
Definition: Offsets_VTABLE.h:8849
constexpr REL::ID RTTI_BGSSaveLoadManager(static_cast< std::uint64_t >(686602))
constexpr REL::ID RTTI_BGSSaveLoadManager__Thread(static_cast< std::uint64_t >(686610))
BSEventNotifyControl
Definition: BSTEvent.h:12
constexpr std::array< REL::ID, 1 > VTABLE_BGSSaveLoadManager__Thread
Definition: Offsets_VTABLE.h:8850
Definition: BASE.h:40
Definition: RaceSexMenuEvent.h:9