#Migrating from Social.Active to CloudServices for loading files

1 messages · Page 1 of 1 (latest)

mighty spruce
#

I initially call:
((PlayGamesPlatform)Social.Active).SavedGame.OpenWithAutomaticConflictResolution(
m_saveName, //name of file.
DataSource.ReadCacheOrNetwork,
ConflictResolutionStrategy.UseLongestPlaytime,
(status, game) => SavedGameOpened(status, game, null));

I have players data loaded like so:
((PlayGamesPlatform)Social.Active).SavedGame.ReadBinaryData(game, SavedGameLoaded);

However, due to needing to upgrade to SDK34 and Google's own Unity Plugin having bugs in the latest version that break key features I need to use, I'm trying to migrate to use Essentials Kit for cloud save.

However, I've been storing player data using:
((PlayGamesPlatform)Social.Active).SavedGame.CommitUpdate(game, updatedMetadata, data, SavedGameWritten);

Where data is a string converted using:
Encoding.UTF8.GetBytes(encryptedSaveBinary);


Any guidance/tips on how I will migrate this and let my players restore their old saves??

Unsure if I can just pull out the byte[] as a string using:
CloudServices.GetString(m_saveName);

Initial tests this has not worked, but unsure if that's another issue or if I have thinking all wrong on how this works.

Thanks ^_^ hope you have some guidance please

#

Oh I just found I can do byte[] cloudData = CloudServices.GetByteArray(m_saveName);

I will try this now 🙂

mighty spruce
#

So, I see:

Creating from android native object : 26702

But then it returns null.

Is it possible Google Play Plugin was saving things under my m_saveName to something incompattible to be read by CloudServices?

Any tips on migrating this please? 🙂

mighty spruce
#

@vivid bloom , any thoughts on this?? cat_sip

vivid bloom
#

GPGS follows a different save format compared to ours.

For this we added a special key to get the complete data and from this data use our setters to set the data(basically migrate).

string saveFileBackupString;
        saveFileBackupString = CloudServices.GetString("ESSENTIAL_KIT_CLOUD_SERVICES_OTHER_SNAPSHOTS_BACKUP");

mighty spruce
mighty spruce
#

Testing how things work (UPDATE)

mighty spruce
#

Findings 🧪 the string is JSON