class

FAchievements

Achievements and stats for game code, whatever platform is (or is not) up. Every write lands in a local store first — the game reads its own values back with no Steam client, and the editor can test unlock logic in PIE — and is queued for the primary online service. The queue drains once that service has the player's current values, and a debounced StoreStats uploads it; the shutdown flush stores whatever is left. When the platform's values arrive, unlocks and stats the player earned offline are pushed up and ones earned elsewhere are pulled down (stats keep the larger value).

Module
Networking
Header
#include "Networking/Achievements.h"
Namespace
Mowo

Constructors

SignatureNameDescription
FAchievements(const FAchievements&) = deleteFAchievements

Public functions

ReturnsNameDescription
FAchievements&Get
FAchievements&operator=
boolLoadDefinitionsDefinitions from an Achievements.ini; false (and nothing defined) when the file is missing or malformed.
boolLoadDefinitionsFromText
boolLoadProjectDefinitionsConfig/Achievements.ini under configDir, or under the packaged game's Config/ when empty.
const std::vector<FAchievementDefinition>&GetAchievements
const std::vector<FStatDefinition>&GetStats
const FAchievementDefinition*FindAchievement
const FStatDefinition*FindStat
voidSetLocalStorePathThe local store's file.
const std::string&GetLocalStorePath
boolSetAchievement
boolClearAchievement
boolIsAchievementUnlocked
boolSetStatInt
boolSetStatFloat
boolAddStatInt
int32_tGetStatInt
floatGetStatFloat
boolIndicateProgressShows the platform's progress popup; unlocking stays with SetAchievement or the achievement's ProgressStat.
voidUpdateThe per-frame pump (FOnlineServices::UpdateAll): binds the primary service's callbacks, drains the queue into it once its stats are ready, and stores after StoreDelaySeconds without a new write (at most 4 x StoreDelaySeconds after the first one).
voidUpdate
voidFlushDrains, stores and saves now.
voidUnbindServiceThe service FAchievements registered its callbacks on is going away.
size_tGetPendingCount
uint32_tGetStoreCount
voidSetStoreDelaySeconds
floatGetStoreDelaySeconds
voidSetUnlockHandlerRuns once per achievement the player newly unlocks, platform or not — the game's own toast.
std::stringPopUnlocked
voidResetForgets definitions, values, the queue and the store path.

Function details

FAchievements

C++
FAchievements(const FAchievements&) = delete

Get

C++
static FAchievements& Get()

operator=

C++
FAchievements& operator=(const FAchievements&) = delete

LoadDefinitions

C++
bool LoadDefinitions(const std::string& path)

Definitions from an Achievements.ini; false (and nothing defined) when the file is missing or malformed. The text form is what the tests drive.

LoadDefinitionsFromText

C++
bool LoadDefinitionsFromText(const std::string& text)

LoadProjectDefinitions

C++
bool LoadProjectDefinitions(const std::string& configDir)

Config/Achievements.ini under configDir, or under the packaged game's Config/ when empty.

GetAchievements

C++
const std::vector<FAchievementDefinition>& GetAchievements() const

GetStats

C++
const std::vector<FStatDefinition>& GetStats() const

FindAchievement

C++
const FAchievementDefinition* FindAchievement(const std::string& id) const

FindStat

C++
const FStatDefinition* FindStat(const std::string& id) const

SetLocalStorePath

C++
void SetLocalStorePath(const std::string& path)

The local store's file. Unset, it is AchievementProgress.ini beside the player's save games (the project's Saved/SaveGames in the editor). Setting it loads that file.

GetLocalStorePath

C++
const std::string& GetLocalStorePath()

SetAchievement

C++
bool SetAchievement(const std::string& id)

ClearAchievement

C++
bool ClearAchievement(const std::string& id)

IsAchievementUnlocked

C++
bool IsAchievementUnlocked(const std::string& id)

SetStatInt

C++
bool SetStatInt(const std::string& id, int32_t value)

SetStatFloat

C++
bool SetStatFloat(const std::string& id, float value)

AddStatInt

C++
bool AddStatInt(const std::string& id, int32_t delta)

GetStatInt

C++
int32_t GetStatInt(const std::string& id)

GetStatFloat

C++
float GetStatFloat(const std::string& id)

IndicateProgress

C++
bool IndicateProgress(const std::string& id, uint32_t current, uint32_t max)

Shows the platform's progress popup; unlocking stays with SetAchievement or the achievement's ProgressStat.

Update

C++
void Update()

The per-frame pump (FOnlineServices::UpdateAll): binds the primary service's callbacks, drains the queue into it once its stats are ready, and stores after StoreDelaySeconds without a new write (at most 4 x StoreDelaySeconds after the first one).

Update

C++
void Update(double nowSeconds)

Flush

C++
void Flush()

Drains, stores and saves now. Runs before the services shut down.

UnbindService

C++
void UnbindService()

The service FAchievements registered its callbacks on is going away.

GetPendingCount

C++
size_t GetPendingCount() const

GetStoreCount

C++
uint32_t GetStoreCount() const

SetStoreDelaySeconds

C++
void SetStoreDelaySeconds(float seconds)

GetStoreDelaySeconds

C++
float GetStoreDelaySeconds() const

SetUnlockHandler

C++
void SetUnlockHandler(std::function<void(const std::string&)> handler)

Runs once per achievement the player newly unlocks, platform or not — the game's own toast. Unlocks also wait in a queue a Visual Script graph polls with PopUnlocked (empty when none).

PopUnlocked

C++
std::string PopUnlocked()

Reset

C++
void Reset()

Forgets definitions, values, the queue and the store path. Tests only.

Generated from Networking/Achievements.h via networking.json · Nov 4, 2026Version 1.0.0