Code: Select all
FormatException: Expected '{' or "null", found '1'.
ES3Internal.ES3JSONReader.ReadNullOrCharIgnoreWhitespace (System.Char expectedChar) (at <e070eb114eab438993237e81806ca4dd>:0)
ES3Internal.ES3JSONReader.StartReadObject () (at <e070eb114eab438993237e81806ca4dd>:0)
ES3Reader.ReadObject[T] (System.Object obj, ES3Types.ES3Type type) (at <e070eb114eab438993237e81806ca4dd>:0)
ES3Reader.ReadInto[T] (System.Object obj, ES3Types.ES3Type type) (at <e070eb114eab438993237e81806ca4dd>:0)
ES3.DeserializeInto[T] (ES3Types.ES3Type type, System.Byte[] bytes, T obj, ES3Settings settings) (at <e070eb114eab438993237e81806ca4dd>:0)
ES3File.LoadInto[T] (System.String key, T obj) (at <e070eb114eab438993237e81806ca4dd>:0)
ES3.LoadInto[T] (System.String key, T obj, ES3Settings settings) (at <e070eb114eab438993237e81806ca4dd>:0)
ES3.LoadInto (System.String key, System.Object obj, ES3Settings settings) (at <e070eb114eab438993237e81806ca4dd>:0)
Wallet.ReplaceWithCloudSavedData (System.Byte[] data) (at <e070eb114eab438993237e81806ca4dd>:0)
CloudGameSave+<>c.<ReadSavedGame>b__8_0 (EasyMobile.SavedGame game, System.Byte[] data, System.String error) (at <e070eb114eab438993237e81806ca4dd>:0)
EasyMobile.Internal.GameServices.AndroidSavedGameClient+<>c_DisplayClass3_0.<ReadSavedGameData>b_0 (GooglePlayGames.BasicApi.SavedGame.SavedGameRequestStatus status, System.Byte[] data) (at <e070eb114eab438993237e81806ca4dd>:0)
GooglePlayGames.Android.AndroidSavedGameClient+<>c_DisplayClass15_1`2[T1,T2].<ToOnGameThread>b_1 () (at <e070eb114eab438993237e81806ca4dd>:0)
GooglePlayGames.OurUtils.PlayGamesHelperObject.Update () (at <e070eb114eab438993237e81806ca4dd>:0)
This is my saving code:
Code: Select all
private void SaveWalletCloud()
{
if (EasyMobile.RuntimeManager.IsInitialized() == false || EasyMobile.GameServices.IsInitialized() == false || EasyMobile.EM_Settings.GameServices.IsSavedGamesEnabled == false)
{
HelperMethods.LogErr($"<b>Wallet ►</b> Requested cloud saving but conditions not met.");
return;
}
var cacheSettings = new ES3Settings(ES3.Location.Cache);
ES3.Save<int>("collectableGoldCoin", collectableGoldCoin, cacheSettings);
ES3.Save<int>("collectableDiamond", collectableDiamond, cacheSettings);
byte[] bytes = ES3.LoadRawBytes(cacheSettings);
HelperMethods.Log(HelperMethods.LogHandle().Wallet, $"<b>Wallet ►</b> Attempting to save to cloud. Bytes to save: {Convert.ToBase64String(bytes)}");
GameData.GetInstance().StartCoroutine(GameData.GetInstance().CloudGameSave.PushDataToCloud(bytes));
}
Code: Select all
<b>Wallet ►</b> Attempting to save to cloud. Bytes to save: ewoJImNvbGxlY3RhYmxlR29sZENvaW4iIDogewoJCSJfX3R5cGUiIDogIlN5c3RlbS5JbnQzMiIsCgkJInZhbHVlIiA6IDEwNTgKCX0sCgkiY29sbGVjdGFibGVEaWFtb25kIiA6IHsKCQkiX190eXBlIiA6ICJTeXN0ZW0uSW50MzIiLAoJCSJ2YWx1ZSIgOiAxMDAKCX0KfQ==
Code: Select all
public void ReplaceWithCloudSavedData(byte[] data)
{
HelperMethods.Log(HelperMethods.LogHandle().Wallet, $"<b>Wallet ►</b> Overwriting local data with the data retrieved from cloud. Bytes retrieved: {Convert.ToBase64String(data)}");
var cacheSettings = new ES3Settings(ES3.Location.Cache);
ES3.SaveRaw(data, cacheSettings);
ES3.LoadInto("collectableGoldCoin", collectableGoldCoin, cacheSettings);
ES3.LoadInto("collectableDiamond", collectableDiamond, cacheSettings);
}
Code: Select all
<b>Wallet ►</b> Overwriting local data with the data retrieved from cloud. Bytes retrieved: ewoJImNvbGxlY3RhYmxlR29sZENvaW4iIDogewoJCSJfX3R5cGUiIDogIlN5c3RlbS5JbnQzMiIsCgkJInZhbHVlIiA6IDEwNTgKCX0sCgkiY29sbGVjdGFibGVEaWFtb25kIiA6IHsKCQkiX190eXBlIiA6ICJTeXN0ZW0uSW50MzIiLAoJCSJ2YWx1ZSIgOiAxMDAKCX0KfQ==