mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-01-02 01:30:25 -06:00
* Fix DLC info message always being displayed * Use uint32_t for version numbers * Make AchievementManager follow the same naming convention as PersistentStorageManager * persistent_data: remove header size field * Make status success by default or on file not existing
33 lines
644 B
C++
33 lines
644 B
C++
#pragma once
|
|
|
|
#include <user/paths.h>
|
|
|
|
#define ACH_FILENAME "ACH-DATA"
|
|
#define ACH_SIGNATURE { 'A', 'C', 'H', ' ' }
|
|
#define ACH_VERSION 1
|
|
#define ACH_RECORDS 50
|
|
|
|
class AchievementData
|
|
{
|
|
public:
|
|
#pragma pack(push, 1)
|
|
struct AchRecord
|
|
{
|
|
uint16_t ID;
|
|
time_t Timestamp;
|
|
uint16_t Reserved[3];
|
|
};
|
|
#pragma pack(pop)
|
|
|
|
char Signature[4] ACH_SIGNATURE;
|
|
uint32_t Version{ ACH_VERSION };
|
|
uint32_t Checksum{};
|
|
uint32_t Reserved{};
|
|
AchRecord Records[ACH_RECORDS]{};
|
|
|
|
bool VerifySignature() const;
|
|
bool VerifyVersion() const;
|
|
bool VerifyChecksum();
|
|
uint32_t CalculateChecksum();
|
|
};
|