public void _RestoreOfflineSessions() { string[] _paths = Directory.GetFiles(RaqnStorage.DataPath() + "cache"); for (int i = 0; i < _paths.Length; ++i) { string _dir = Path.GetDirectoryName(_paths[i]); string _name = _paths[i].Substring(_dir.Length + 1); if (_name.StartsWith(Raqn.Dix.Id + "_L$") && _name.EndsWith(".json")) { RaqnPlaySession _pl = RaqnPlaySession.Load <RaqnPlaySession>(_name); if (_pl == null) { File.Delete(_paths[i]); } else { _pl.Sync(() => { Debug.Log("Playsession synced OK!"); File.Delete(_paths[i]); }, (_err) => { Debug.Log("Error syncing playsession, until next time!"); }); } } } }
static public void SyncNow() { if (PlaySession == null) { return; } PlaySession.Sync(OnSync, OnSyncError); }