Fission FSN
Loading...
Searching...
No Matches
fsCCloudSave.h
Go to the documentation of this file.
1/********************************************************************
2*
3* File: fsCCloudSave.h
4*
5* Purpose: Connects fsCProfileManager to the optional cloud save
6* sync (fsPlatform/cloudsave). Only built with fsCloudSave.
7*
8*********************************************************************/
9
10#ifndef fsCCloudSavehdr
11#define fsCCloudSavehdr
12
13#if defined fsCloudSave
14
15#include <memory>
16#include <vector>
17
18#include <fsCore/fsBaseTypes.h>
20
22
23class fsCCloudSave : public fsIProfileSaveListener
24{
25public:
26
27 fsCCloudSave();
28 ~fsCCloudSave() override;
29
30 // Around fsCProfileManager::initialise(): cloud data must reach disk before the profile is loaded,
31 // and a restored profile can only be created once the profile manager is up.
32 void bootBeforeProfilesLoad();
33 void bootAfterProfilesLoad();
34
35 void update();
36 void flush();
37 void shutdown();
38
39 void userDataSaved(const fsCResourceName& pFileName, const fsStr& pPlayerName) override;
40 void profileDeleted(const fsCResourceName& pFileName) override;
41
42private:
43
44 static fsBool syncEligibleGet(const fsStr& pPlayerName);
45 static fsCloudSaveProfile profileMake(const fsCResourceName& pFileName, const fsStr& pPlayerName);
46 std::vector<fsCloudSaveProfile> profilesGet() const;
47
48 std::unique_ptr<fsCCloudSaveSync> mSync;
49 fsCCloudSaveSync::BootResult mBoot;
50};
51
52#endif
53
54#endif
Definition fsIProfileSaveListener.h:17
virtual void userDataSaved(const fsCResourceName &pFileName, const fsStr &pPlayerName)=0
virtual void profileDeleted(const fsCResourceName &pFileName)=0
bool fsBool
Definition fsBaseTypes.h:26
void shutdown()
Definition fsCODR.mm:134