Path: blob/master/RSDKv5/RSDK/User/Dummy/DummyStorage.hpp
1182 views
1#if RETRO_REV0223struct DummyFileInfo {4void (*callback)(int32 status);5int32 type;6char path[64];7void *fileBuffer;8int32 fileSize;9int32 storageTime;10bool32 compressed;11};1213// This is the "dummy" struct, it serves as the base in the event a suitable API isn't loaded (such as in this decomp)14// This struct should never be removed, other structs such as "SteamUserStorage" would be added and "userStorage" would be set to that instead15struct DummyUserStorage : UserStorage {16void FrameInit()17{18ProcessFileLoadTime();1920if (authStatus == STATUS_CONTINUE) {21if (authTime <= 0) {22authStatus = GetAPIValue(GetAPIValueID("SYSTEM_USERSTORAGE_AUTH_STATUS", 0));23}24else {25authTime--;26}27}2829if (storageStatus == STATUS_CONTINUE) {30if (storageInitTime <= 0) {31storageStatus = GetAPIValue(GetAPIValueID("SYSTEM_USERSTORAGE_STORAGE_STATUS", 0));32}33else {34storageInitTime--;35}36}3738if (!saveStatus) {39if (authStatus == STATUS_ERROR || storageStatus == STATUS_ERROR)40saveStatus = STATUS_ERROR;41else if (storageStatus == STATUS_OK)42saveStatus = STATUS_OK;43}44}45void StageLoad() { UserStorage::StageLoad(); }46int32 TryAuth();47int32 TryInitStorage();48bool32 GetUsername(String *name);49bool32 TryLoadUserFile(const char *filename, void *buffer, uint32 size, void (*callback)(int32 status));50bool32 TrySaveUserFile(const char *filename, void *buffer, uint32 size, void (*callback)(int32 status), bool32 compressed);51bool32 TryDeleteUserFile(const char *filename, void (*callback)(int32 status));52void ClearPrerollErrors();5354void ProcessFileLoadTime();5556int32 authTime = 0;57int32 storageInitTime = 0;58List<DummyFileInfo> fileList;59};6061#endif6263