public void FetchPPIDataFromCloudAsyncOpFinished(CloudServices.AsyncOpResult res) { if (res.m_Res) { PlayerPersistantInfo PPIFromCloud = new PlayerPersistantInfo(); if (PPIFromCloud.InitPlayerDataFromStr(res.m_ResultDesc)) { // Debug.Log("Server: got user data from cloud for : " + UserName); CopyPlayerData(PPIFromCloud); IsValid = true; EnforceDataValidity(); //Debug.Log("Updated Score: " + Name + " exp" + Score.Experience + " money " + Score.Money + " experience old " + Experience); return; } } PlayerData.Params.Experience = 0; PlayerData.Params.Money = 0; PlayerData.Params.Gold = 0; Debug.LogWarning("FetchPPIDataFromCloudAsyncOpFinished(): error getting PPI from cloud for user : "******"(" + Name + ")"); }
void PPISyncToCloudFinished(CloudServices.AsyncOpResult res) { if (res.m_Res && res.m_ResultDesc == CloudServices.RESP_OK) { // Debug.Log("Synced PPI to cloud for user " + UserName); // we don't want to fetch local ppi here // it will be done later after round results display //PPIManager.Instance.ClientNotifyPPIChange(Player); } else { Debug.LogError("Error synchronizing PPI to cloud : " + Name + "(" + res.m_ResultDesc + ")"); } }
void Update() { switch (m_State) { case E_State.E_STATE_INIT: { m_LoadShopItemsAsyncOp = CloudServices.GetInstance().ProductGetParam(PPIManager.ProductID, CloudServices.PROP_ID_SHOP_ITEMS, ""); m_State = E_State.E_STATE_LOADING_SHOP_ITEMS; } break; case E_State.E_STATE_LOADING_SHOP_ITEMS: { if (m_LoadShopItemsAsyncOp != null) { if (m_LoadShopItemsAsyncOp.m_Finished) { if (m_LoadShopItemsAsyncOp.m_Res) { m_ShopItemsJSON = m_LoadShopItemsAsyncOp.m_ResultDesc; UpdateSettingsManagers(); //Debug.Log("Loaded shop settings from cloud"); m_State = E_State.E_STATE_OK; } else { Debug.LogError("Unable to load shop settings from cloud"); m_State = E_State.E_STATE_FAILED; } } } else { Debug.LogError("Unable to load shop settings from cloud"); m_State = E_State.E_STATE_FAILED; } } break; } }