public void SetLastUserCollectionUpdateToJson(long uctCreatedUnix) { //if (debugOn) Debug.Log("LAST USER UPDATE TO JSON " + uctCreatedUnix); LastUpdateAuxiliar dateAux = new LastUpdateAuxiliar(uctCreatedUnix); CheckAndSave(CreateJsonStringFromObject(dateAux), lastCollectionUpdateFile); }
public long GetLastUserCollectionUpdateFromJsonLong() { long lastUpd = 0; if (SaveLoadDirectoryExist() && FileExist(lastCollectionUpdateFile)) { string json = ReadStringFromJson(lastCollectionUpdateFile); LastUpdateAuxiliar dateAux2 = new LastUpdateAuxiliar(); JsonUtility.FromJsonOverwrite(json, dateAux2); lastUpd = dateAux2.uctCreatedUnix; if (debugOn) { Debug.Log("LAST COLLECTION UPDATE LOADED FROM JSON"); } } return(lastUpd); }
public async Task <long> GetLastGameCardCollectionUpdateTimestamp() { if (DatosFirebaseRTHelper.Instance.isInit == false) { return(0); } DataSnapshot dtSnapshot = null; DatosFirebaseRTHelper.Instance.reference.Child(DatosFirebaseRTHelper.Instance.GameCardCollectionLastUpdateTable) .Child("uctCreatedUnix").KeepSynced(true); await DatosFirebaseRTHelper.Instance.reference.Child(DatosFirebaseRTHelper.Instance.GameCardCollectionLastUpdateTable).GetValueAsync().ContinueWith(task => { if (task.IsFaulted) { //Debug.Log("NoChild"); // Handle the error... } else if (task.IsCompleted) { dtSnapshot = task.Result; } }); LastUpdateAuxiliar utcLastGCCDownload = new LastUpdateAuxiliar(); if (dtSnapshot != null) { if (dtSnapshot.Exists) { utcLastGCCDownload = JsonUtility.FromJson <LastUpdateAuxiliar>(dtSnapshot.GetRawJsonValue()); if (debugOn) { Debug.Log("LAST GAME UPDATE " + utcLastGCCDownload.uctCreatedUnix); } } } return(utcLastGCCDownload.uctCreatedUnix); }