playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.43k stars 953 forks source link

Opened save has wrong metadata #3229

Closed ClemCa closed 1 year ago

ClemCa commented 1 year ago

This form is for reporting Unity Plugin issues only. To report an issue with the Play Games Service (non-SDK related), check Google Play Games Services Support. Once you've read this section and determined that your issue is appropriate for this repository, please delete this section.

Describe the bug After using ISavedGameClient.ShowSelectSavedGameUI(), the returned metadata is incomplete. Specifically, ISavedGameMetadata.TotalTimePlayed is set to -00:00:00.0010000, and ISavedGameMetadata.LastModifiedTimestamp is 1 millisecond before midnight 1970 too. After checking, this seems to be on the android side, as the value in milliseconds is -1.

To Reproduce Steps to reproduce the behavior:

  1. ShowSelectSavedGameUI()
  2. On the device, select an existing save or create a new save. The total time played & last modified dates are displayed correctly on all saves in the selection menu.
  3. Observe the callback value, the metadata is wrong.

Expected behavior TotalTimePlayed contains the value saved by the game, and LastModifiedTimestamp the DateTime of the last change.

Observed behavior Both are set to -1 ms.

Screenshots image

Versions

Additional context To note, I only observed this when opening from that menu, but it is consistent later on, so it might be a wider issue. Using OpenWithAutomaticConflictResolution on the filename also leads to the same result.

ClemCa commented 1 year ago

After a good hour of tinkering some more, I found that the described behavior only resulted from accidental saving happening coincidentally at the exact same time. Having that game-side bug mixed with the loading made it seem like a bug with the plugin. Sorry about that, I'm closing the issue.