SDKBOX 2.3.14 Release - All your saves, on the cloud

SDKBOX 2.3.14 Release - All your saves, on the cloud
0.0 0

#21

As of right now, The save function seems to only support strings. Is there going to be an update to support arbitrary files?

In my case, I want to save a database for use between devices so the user wont lose there scores and be ables to continue from any device

Maybe something like a byte array?


#22

That’s a good feature request we’ll discuss it and let you know.


#24
#ifdef ENABLE_CLOUD_SAVE
         // sdkbox::PluginSdkboxPlay::loadAllData(); //DEPRECATED
        sdkbox::PluginSdkboxPlay::loadAllGameData();
#else
        INFO("cloud save is not enable");
#endif
    }),
    MenuItemFont::create("Save game data", [](cocos2d::Ref* sender) {
        // comment this to compile with old version sdkboxplay
#ifdef ENABLE_CLOUD_SAVE
         //sdkbox::PluginSdkboxPlay::saveGameData("key1", "{\"game_name\": \"sdkbox go\", \"stage\": 3}"); // 
DEPRECATED
    std::string sData("1bC\0u\4;Y\5L", 10);
    const void* data = (const void*)sData.c_str();
    int len = (int)sData.length();
    sdkbox::PluginSdkboxPlay::saveGameDataBinary("key3", data, len);
#else
    INFO("cloud save is not enable");

#endif

Hi all, quick question about the new methods (given that the ones explained in the official docs seems to be deprecated…), what sData here exactly? could it be anything? what if you want to save a json string? should we encode it (base64) or whatever, or could it be saved as the old method used to do?

Thanks in advance, I would appreciate a better example of cloud save/load as well as the docs being updated.


#25

OK, I have this working now, using rapidjson handle the json string that goes into the saved data. The problem now is that when I launch the game, and I call loadAllGameData() or loadOneGameData() the onLoadGameData callback gets triggered twice: the first time with the actula saved games, and the second one with savedData = NULL and error = “”.

Is this the correct behaviour? should it be happening at all?

Also, I would like to know how could I know in a reliable way that there is no saved games? when it is returning null when there are actually data there?

Thanks again.


#26

this is a end flag for loadAllGameData.


#27

OK, thanks htlxyz, so it is safe to assume in that when the data is null and error is empty is done loading data right? and that this will be always the last time the callback is triggered right? Thanks again.


#28

Hi, anyone using flatbuffers for cloud saved data? is it a good idea and why? any examples? Thanks!!! @yinjimmy any advice on this matter? thanks