Exemple #1
0
 private void InternalManualOpen(string filename, GooglePlayGames.BasicApi.DataSource source, bool prefetchDataOnConflict, ConflictCallback conflictCallback, Action <SavedGameRequestStatus, ISavedGameMetadata> completedCallback)
 {
     this.mSnapshotManager.Open(filename, NativeSavedGameClient.AsDataSource(source), Types.SnapshotConflictPolicy.MANUAL, (Action <GooglePlayGames.Native.PInvoke.SnapshotManager.OpenResponse>)(response =>
     {
         if (!response.RequestSucceeded())
         {
             completedCallback(NativeSavedGameClient.AsRequestStatus(response.ResponseStatus()), (ISavedGameMetadata)null);
         }
         else if (response.ResponseStatus() == CommonErrorStatus.SnapshotOpenStatus.VALID)
         {
             completedCallback(SavedGameRequestStatus.Success, (ISavedGameMetadata)response.Data());
         }
         else if (response.ResponseStatus() == CommonErrorStatus.SnapshotOpenStatus.VALID_WITH_CONFLICT)
         {
             // ISSUE: object of a compiler-generated type is created
             // ISSUE: variable of a compiler-generated type
             NativeSavedGameClient.\u003CInternalManualOpen\u003Ec__AnonStorey142.\u003CInternalManualOpen\u003Ec__AnonStorey143 openCAnonStorey143 = new NativeSavedGameClient.\u003CInternalManualOpen\u003Ec__AnonStorey142.\u003CInternalManualOpen\u003Ec__AnonStorey143();
             // ISSUE: reference to a compiler-generated field
             openCAnonStorey143.\u003C\u003Ef__ref\u0024322 = this;
             // ISSUE: reference to a compiler-generated field
             openCAnonStorey143.original = response.ConflictOriginal();
             // ISSUE: reference to a compiler-generated field
             openCAnonStorey143.unmerged = response.ConflictUnmerged();
             // ISSUE: reference to a compiler-generated field
             // ISSUE: reference to a compiler-generated field
             // ISSUE: reference to a compiler-generated field
             // ISSUE: reference to a compiler-generated method
             openCAnonStorey143.resolver = new NativeSavedGameClient.NativeConflictResolver(this.mSnapshotManager, response.ConflictId(), openCAnonStorey143.original, openCAnonStorey143.unmerged, completedCallback, new Action(openCAnonStorey143.\u003C\u003Em__6E));
             if (!prefetchDataOnConflict)
             {
                 // ISSUE: reference to a compiler-generated field
                 // ISSUE: reference to a compiler-generated field
                 // ISSUE: reference to a compiler-generated field
                 conflictCallback((IConflictResolver)openCAnonStorey143.resolver, (ISavedGameMetadata)openCAnonStorey143.original, (byte[])null, (ISavedGameMetadata)openCAnonStorey143.unmerged, (byte[])null);
             }
             else
             {
                 // ISSUE: reference to a compiler-generated method
                 NativeSavedGameClient.Prefetcher prefetcher = new NativeSavedGameClient.Prefetcher(new Action <byte[], byte[]>(openCAnonStorey143.\u003C\u003Em__6F), completedCallback);
                 // ISSUE: reference to a compiler-generated field
                 this.mSnapshotManager.Read(openCAnonStorey143.original, new Action <GooglePlayGames.Native.PInvoke.SnapshotManager.ReadResponse>(prefetcher.OnOriginalDataRead));
                 // ISSUE: reference to a compiler-generated field
                 this.mSnapshotManager.Read(openCAnonStorey143.unmerged, new Action <GooglePlayGames.Native.PInvoke.SnapshotManager.ReadResponse>(prefetcher.OnUnmergedDataRead));
             }
         }
         else
         {
             Logger.e("Unhandled response status");
             completedCallback(SavedGameRequestStatus.InternalError, (ISavedGameMetadata)null);
         }
     }));
 }
Exemple #2
0
 public void FetchAllSavedGames(GooglePlayGames.BasicApi.DataSource source, Action <SavedGameRequestStatus, List <ISavedGameMetadata> > callback)
 {
     Misc.CheckNotNull <Action <SavedGameRequestStatus, List <ISavedGameMetadata> > >(callback);
     callback = NativeSavedGameClient.ToOnGameThread <SavedGameRequestStatus, List <ISavedGameMetadata> >(callback);
     this.mSnapshotManager.FetchAll(NativeSavedGameClient.AsDataSource(source), (Action <GooglePlayGames.Native.PInvoke.SnapshotManager.FetchAllResponse>)(response =>
     {
         if (!response.RequestSucceeded())
         {
             callback(NativeSavedGameClient.AsRequestStatus(response.ResponseStatus()), new List <ISavedGameMetadata>());
         }
         else
         {
             callback(SavedGameRequestStatus.Success, response.Data().Cast <ISavedGameMetadata>().ToList <ISavedGameMetadata>());
         }
     }));
 }