Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Rubberduckycooly
GitHub Repository: Rubberduckycooly/RSDKv5-Decompilation
Path: blob/master/RSDKv5/RSDK/User/Dummy/DummyStorage.hpp
1182 views
1
2
#if RETRO_REV02
3
4
struct DummyFileInfo {
5
void (*callback)(int32 status);
6
int32 type;
7
char path[64];
8
void *fileBuffer;
9
int32 fileSize;
10
int32 storageTime;
11
bool32 compressed;
12
};
13
14
// This is the "dummy" struct, it serves as the base in the event a suitable API isn't loaded (such as in this decomp)
15
// This struct should never be removed, other structs such as "SteamUserStorage" would be added and "userStorage" would be set to that instead
16
struct DummyUserStorage : UserStorage {
17
void FrameInit()
18
{
19
ProcessFileLoadTime();
20
21
if (authStatus == STATUS_CONTINUE) {
22
if (authTime <= 0) {
23
authStatus = GetAPIValue(GetAPIValueID("SYSTEM_USERSTORAGE_AUTH_STATUS", 0));
24
}
25
else {
26
authTime--;
27
}
28
}
29
30
if (storageStatus == STATUS_CONTINUE) {
31
if (storageInitTime <= 0) {
32
storageStatus = GetAPIValue(GetAPIValueID("SYSTEM_USERSTORAGE_STORAGE_STATUS", 0));
33
}
34
else {
35
storageInitTime--;
36
}
37
}
38
39
if (!saveStatus) {
40
if (authStatus == STATUS_ERROR || storageStatus == STATUS_ERROR)
41
saveStatus = STATUS_ERROR;
42
else if (storageStatus == STATUS_OK)
43
saveStatus = STATUS_OK;
44
}
45
}
46
void StageLoad() { UserStorage::StageLoad(); }
47
int32 TryAuth();
48
int32 TryInitStorage();
49
bool32 GetUsername(String *name);
50
bool32 TryLoadUserFile(const char *filename, void *buffer, uint32 size, void (*callback)(int32 status));
51
bool32 TrySaveUserFile(const char *filename, void *buffer, uint32 size, void (*callback)(int32 status), bool32 compressed);
52
bool32 TryDeleteUserFile(const char *filename, void (*callback)(int32 status));
53
void ClearPrerollErrors();
54
55
void ProcessFileLoadTime();
56
57
int32 authTime = 0;
58
int32 storageInitTime = 0;
59
List<DummyFileInfo> fileList;
60
};
61
62
#endif
63