From 8f04ae0b5a4bea93563691316773adab5c9bcb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mehmet=20=C3=96zdemir?= Date: Fri, 14 Feb 2020 07:26:40 -0800 Subject: [PATCH] Update TimeSpan conversions while committing an update, to fix #2836. PiperOrigin-RevId: 295141879 Change-Id: If6b91c5f3568a9baea49fb178d83cb68613e853f --- .../Platforms/Android/AndroidSavedGameClient.cs | 2 +- .../Platforms/Android/AndroidSnapshotMetadata.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSavedGameClient.cs b/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSavedGameClient.cs index 1833d8f0a..ad4acb138 100644 --- a/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSavedGameClient.cs +++ b/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSavedGameClient.cs @@ -474,7 +474,7 @@ private static AndroidJavaObject AsMetadataChange(SavedGameMetadataUpdate update if (update.IsPlayedTimeUpdated) { using (builder.Call("setPlayedTimeMillis", - (long) update.UpdatedPlayedTime.Value.TotalMilliseconds)) ; + Convert.ToInt64(update.UpdatedPlayedTime.Value.TotalMilliseconds))) ; } return builder.Call("build"); diff --git a/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSnapshotMetadata.cs b/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSnapshotMetadata.cs index 4716cdce5..23623fbe6 100644 --- a/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSnapshotMetadata.cs +++ b/source/PluginDev/Assets/GooglePlayGames/Platforms/Android/AndroidSnapshotMetadata.cs @@ -73,7 +73,7 @@ public string CoverImageURL public TimeSpan TotalTimePlayed { - get { return TimeSpan.FromTicks(mJavaMetadata.Call("getPlayedTime")); } + get { return TimeSpan.FromMilliseconds(mJavaMetadata.Call("getPlayedTime")); } } public DateTime LastModifiedTimestamp @@ -87,4 +87,4 @@ public DateTime LastModifiedTimestamp } } } -#endif \ No newline at end of file +#endif