play-games-plugin-for-unity icon indicating copy to clipboard operation
play-games-plugin-for-unity copied to clipboard

Open save game callback not called

Open kkondarev opened this issue 8 years ago • 9 comments

Hi, I figured out, that if actual conflict resolving is involved, the callback for game being opened is not called at all. Scenario: Turn device online -> start the game -> authentication successful -> save game is created -> some gameplay -> game is saved successfully -> exit game -> Turn device offline -> start the game -> save game loaded successfully -> some gameplay -> game is saved successfully -> exit game -> Turn device online -> start game -> save game attempts to load -> callback is not called at all, so game hangs

Narrowed it down to following:

  1. The game always starts successfully when the device is offline, the save game is also opened, all good
  2. When the device is online, game loading is stuck on: ISavedGameClient savedGameClient = PlayGamesPlatform.Instance.SavedGame; savedGameClient.OpenWithAutomaticConflictResolution(saveName, DataSource.ReadCacheOrNetwork, ConflictResolutionStrategy.UseLongestPlaytime, onSavedGameOpened); -> No exceptions, no nothing -> onSavedGameOpened callback is not called at all -> If another app receives focus for a sec and then I switch back to the game - the callback is called and the save game is opened -> if the game is restarted with device offline, the callback is called and the save is opened every time

Any comments or suggestions what to do/check/try?

kkondarev avatar Oct 20 '16 05:10 kkondarev

More info: looking at the logs, I found the following error message. Some help to decipher what it means, please? Seems to be related...

10-26 22:38:48.854: W/GamesServiceBroker(6870): Client connected with SDK 8487000, Services 9877036, and Games 37240036 10-26 22:38:48.914: E/SnapshotEventService(6870): Error handling event: CompletionEvent [id=DriveId:CAESSDFfdWxkT2hXZ2o4bjFMQmpEeWwtMWlzWnlSNk9zQnY4OGRZWHRVNGtpMFVOb3dsaUlFR2VaSWJtb0xBbzBVOUwtMzVxeDJmaxjEBSCKyuvRxVEoAA==, status=2, trackingTag='info.dragonslabs.submarine<:>drive://g15862525828023294684/104358369895/DefaultGame<:>104358369895<:>6<:>https://www.googleapis.com/auth/games_lite<:>com.google'] 10-26 22:38:48.914: E/SnapshotEventService(6870): java.lang.IllegalStateException: Attempting to underflow ref count for drive://g15862525828023294684/104358369895/DefaultGame 10-26 22:38:48.914: E/SnapshotEventService(6870): at com.google.android.gms.common.internal.Asserts.fail(Asserts.java:135) 10-26 22:38:48.914: E/SnapshotEventService(6870): at com.google.android.gms.games.broker.SnapshotAgent.decrementPendingChangeCount(SnapshotAgent.java:874) 10-26 22:38:48.914: E/SnapshotEventService(6870): at com.google.android.gms.games.service.PlaySnapshotEventService.onCompletionInner(PlaySnapshotEventService.java:107) 10-26 22:38:48.914: E/SnapshotEventService(6870): at com.google.android.gms.games.service.PlaySnapshotEventService.onCompletion(PlaySnapshotEventService.java:58) 10-26 22:38:48.914: E/SnapshotEventService(6870): at com.google.android.gms.chimera.DriveEventService.access$000(DriveEventService.java:70) 10-26 22:38:48.914: E/SnapshotEventService(6870): at com.google.android.gms.chimera.DriveEventService$EventHandler.handleMessage(DriveEventService.java:132) 10-26 22:38:48.914: E/SnapshotEventService(6870): at android.os.Handler.dispatchMessage(Handler.java:99) 10-26 22:38:48.914: E/SnapshotEventService(6870): at android.os.Looper.loop(Looper.java:176) 10-26 22:38:48.914: E/SnapshotEventService(6870): at com.google.android.gms.chimera.DriveEventService$1.run(DriveEventService.java:223)

kkondarev avatar Oct 26 '16 20:10 kkondarev

Hey guys, any update on this one?

kkondarev avatar Oct 31 '16 13:10 kkondarev

I've passed it along to the SDK team. Can you share the versions of the play-services libraries used and the complete log of authenticating and this error?

claywilkinson avatar Dec 22 '16 20:12 claywilkinson

I have the same issue any suggestions?

gladieweb avatar Nov 30 '21 22:11 gladieweb

@gladieweb, do you see java.lang.IllegalStateException: Attempting to underflow ref count in the logcat?

smile616 avatar Dec 01 '21 11:12 smile616

no I dont see that

gladieweb avatar Dec 02 '21 06:12 gladieweb

@gladieweb, please open a new ticket with details about your case and include:

  • version of the plugin
  • step to reproduce the issue
  • logcat logs around time of the issue Anything else you think is important.

Thanks!

smile616 avatar Dec 02 '21 13:12 smile616

@smile616 hey, it's 2022 and this issue still happens. The steps to reproduce are quite straigthforward - call a few times one after another (in my case I have some delay between calls) the OpenWithAutomaticConflictResolution. The callback will be called after the first one or two times and then will not be called anymore. After some time it will be called again. That doesn't seem to be working well.

Version of the plugin 10.14 (yes I know I can switch to the new version, BUT for now I don't want to because of this https://github.com/playgameservices/play-games-plugin-for-unity/issues/3162).

The logs don't show anything useful as I can see. So nothing to post about that.

Any ideas?

userqt avatar Jun 07 '22 16:06 userqt

Same. It makes my game to stuck in infinite load and lots of users left with rating a of 1 star.

rico345100 avatar Jun 27 '22 13:06 rico345100