diff --git a/AndroidStudioExample/app/packageMe.ps1 b/AndroidStudioExample/app/packageMe.ps1 index a6555b7b..8ae9e039 100644 --- a/AndroidStudioExample/app/packageMe.ps1 +++ b/AndroidStudioExample/app/packageMe.ps1 @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds popd cd target -Copy-Item client-sdk-0.167.220804.jar -Destination ../../builds/client-sdk-0.167.220804.jar \ No newline at end of file +Copy-Item client-sdk-0.168.220815.jar -Destination ../../builds/client-sdk-0.168.220815.jar \ No newline at end of file diff --git a/AndroidStudioExample/app/packageMe.sh b/AndroidStudioExample/app/packageMe.sh index 78e0af0e..975b99ed 100644 --- a/AndroidStudioExample/app/packageMe.sh +++ b/AndroidStudioExample/app/packageMe.sh @@ -7,4 +7,4 @@ mkdir -p ./builds popd cd target -cp client-sdk-0.167.220804.jar ../../builds/client-sdk-0.167.220804.jar +cp client-sdk-0.168.220815.jar ../../builds/client-sdk-0.168.220815.jar diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java index 20df84c4..56c537da 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java @@ -3329,6 +3329,76 @@ private static PlayFabResult privateGetPlayFab return pfResult; } + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + * @param request GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest + * @return Async Task will return GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + * @param request GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest + * @return GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromGooglePlayGamesPlayerIDs(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/GetPlayFabIDsFromGooglePlayGamesPlayerIDs"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the * IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: @@ -5179,6 +5249,73 @@ private static PlayFabResult privateLinkGoogleAccountAs return pfResult; } + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + * @param request LinkGooglePlayGamesServicesAccountRequest + * @return Async Task will return LinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkGooglePlayGamesServicesAccountAsync(final LinkGooglePlayGamesServicesAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkGooglePlayGamesServicesAccountAsync(request); + } + }); + } + + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + * @param request LinkGooglePlayGamesServicesAccountRequest + * @return LinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkGooglePlayGamesServicesAccount(final LinkGooglePlayGamesServicesAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkGooglePlayGamesServicesAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkGooglePlayGamesServicesAccountAsync(final LinkGooglePlayGamesServicesAccountRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/LinkGooglePlayGamesServicesAccount"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkGooglePlayGamesServicesAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Links the vendor-specific iOS device identifier to the user's PlayFab account * @param request LinkIOSDeviceIDRequest @@ -8938,6 +9075,68 @@ private static PlayFabResult privateUnlinkGoogleAccou return pfResult; } + /** + * Unlinks the related Google Play Games account from the user's PlayFab account. + * @param request UnlinkGooglePlayGamesServicesAccountRequest + * @return Async Task will return UnlinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkGooglePlayGamesServicesAccountAsync(final UnlinkGooglePlayGamesServicesAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkGooglePlayGamesServicesAccountAsync(request); + } + }); + } + + /** + * Unlinks the related Google Play Games account from the user's PlayFab account. + * @param request UnlinkGooglePlayGamesServicesAccountRequest + * @return UnlinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkGooglePlayGamesServicesAccount(final UnlinkGooglePlayGamesServicesAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkGooglePlayGamesServicesAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Unlinks the related Google Play Games account from the user's PlayFab account. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkGooglePlayGamesServicesAccountAsync(final UnlinkGooglePlayGamesServicesAccountRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/UnlinkGooglePlayGamesServicesAccount"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkGooglePlayGamesServicesAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Unlinks the related iOS device identifier from the user's PlayFab account * @param request UnlinkIOSDeviceIDRequest diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java index ce5ca3cf..0d340339 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java @@ -1619,11 +1619,7 @@ public static class GetLeaderboardRequest { } - /** - * Note that the Position of the user in the results is for the overall leaderboard. If Facebook friends are included, make - * sure the access token from previous LoginWithFacebook call is still valid and not expired. If Xbox Live friends are - * included, make sure the access token from the previous LoginWithXbox call is still valid and not expired. - */ + /** Note: the user's Position is relative to the overall leaderboard. */ public static class GetLeaderboardResult { /** Ordered listing of users and their positions in the requested leaderboard. */ public ArrayList Leaderboard; @@ -1932,6 +1928,19 @@ public static class GetPlayFabIDsFromGoogleIDsResult { } + public static class GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest { + /** Array of unique Google Play Games identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. */ + public ArrayList GooglePlayGamesPlayerIDs; + + } + + /** For Google Play Games identifiers which have not been linked to PlayFab accounts, null will be returned. */ + public static class GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult { + /** Mapping of Google Play Games identifiers to PlayFab identifiers. */ + public ArrayList Data; + + } + public static class GetPlayFabIDsFromKongregateIDsRequest { /** Array of unique Kongregate identifiers (Kongregate's user_id) for which the title needs to get PlayFab identifiers. */ public ArrayList KongregateIDs; @@ -2285,6 +2294,14 @@ public static class GooglePlayFabIdPair { } + public static class GooglePlayGamesPlayFabIdPair { + /** Unique Google Play Games identifier for a user. */ + public String GooglePlayGamesPlayerId; + /** Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Google Play Games identifier. */ + public String PlayFabId; + + } + /** * Grants a character to the user of the type specified by the item ID. The user must already have an instance of this item * in their inventory in order to allow character creation. This item can come from a purchase or grant, which must be done @@ -2533,6 +2550,30 @@ public static class LinkGoogleAccountResult { } + /** + * Google Play Games sign-in is accomplished by obtaining a Google OAuth 2.0 credential using the Google Play Games sign-in + * for Android APIs on the device and passing it to this API. + */ + public static class LinkGooglePlayGamesServicesAccountRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** + * If another user is already linked to the account, unlink the other user and re-link. If the current user is already + * linked, link both accounts + */ + public Boolean ForceLink; + /** + * OAuth 2.0 server authentication code obtained on the client by calling the requestServerSideAccess() + * (https://developers.google.com/games/services/android/signin) Google Play Games client API. + */ + public String ServerAuthCode; + + } + + public static class LinkGooglePlayGamesServicesAccountResult { + + } + public static class LinkIOSDeviceIDRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; @@ -4424,6 +4465,16 @@ public static class UnlinkGoogleAccountResult { } + public static class UnlinkGooglePlayGamesServicesAccountRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + + } + + public static class UnlinkGooglePlayGamesServicesAccountResult { + + } + public static class UnlinkIOSDeviceIDRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java index ac24be58..6c2a147d 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java @@ -545,6 +545,7 @@ public static enum PlayFabErrorCode { AutomationRuleAlreadyExists(1543), AutomationRuleLimitExceeded(1544), InvalidGooglePlayGamesServerAuthCode(1545), + StorageAccountNotFound(1546), MatchmakingEntityInvalid(2001), MatchmakingPlayerAttributesInvalid(2002), MatchmakingQueueNotFound(2016), diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerModels.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerModels.java index e4a82b90..0684a86b 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabMultiplayerModels.java @@ -434,6 +434,8 @@ public static class CreateBuildWithCustomContainerRequest { public ArrayList Ports; /** The region configurations for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** * When true, assets will be downloaded and uncompressed in memory, without the compressedversion being written first to * disc. @@ -480,6 +482,8 @@ public static class CreateBuildWithCustomContainerResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** @@ -529,6 +533,8 @@ public static class CreateBuildWithManagedContainerRequest { public ArrayList Ports; /** The region configurations for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The command to run when the multiplayer server is started, including any arguments. */ public String StartMultiplayerServerCommand; /** @@ -580,6 +586,8 @@ public static class CreateBuildWithManagedContainerResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** The command to run when the multiplayer server has been allocated, including any arguments. */ @@ -1256,6 +1264,8 @@ public static class GetBuildResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM. */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** @@ -2344,6 +2354,17 @@ public static class ServerDetails { } + public static class ServerResourceConstraintParams { + /** The maximum number of cores that each server is allowed to use. */ + public Double CpuLimit; + /** + * The maximum number of GiB of memory that each server is allowed to use. WARNING: After exceeding this limit, the server + * will be killed + */ + public Double MemoryLimitGB; + + } + public static enum ServerType { Container, Process @@ -2414,7 +2435,7 @@ public static class TitleMultiplayerServersQuotas { } - /** Request to unsubscribe from lobby notifications. Only a client can unsubscribe from notifications. */ + /** Request to unsubscribe from lobby notifications. */ public static class UnsubscribeFromLobbyResourceRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java index d61aab5d..53b772f2 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java @@ -9,9 +9,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.167.220804"; - public static String BuildIdentifier = "adobuild_javasdk_8"; - public static String SdkVersionString = "JavaSDK-0.167.220804"; + public static String SdkVersion = "0.168.220815"; + public static String BuildIdentifier = "adobuild_javasdk_118"; + public static String SdkVersionString = "JavaSDK-0.168.220815"; public static Map RequestGetParams; static { diff --git a/PlayFabClientSDK/packageMe.ps1 b/PlayFabClientSDK/packageMe.ps1 index a6555b7b..8ae9e039 100644 --- a/PlayFabClientSDK/packageMe.ps1 +++ b/PlayFabClientSDK/packageMe.ps1 @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds popd cd target -Copy-Item client-sdk-0.167.220804.jar -Destination ../../builds/client-sdk-0.167.220804.jar \ No newline at end of file +Copy-Item client-sdk-0.168.220815.jar -Destination ../../builds/client-sdk-0.168.220815.jar \ No newline at end of file diff --git a/PlayFabClientSDK/packageMe.sh b/PlayFabClientSDK/packageMe.sh index 78e0af0e..975b99ed 100644 --- a/PlayFabClientSDK/packageMe.sh +++ b/PlayFabClientSDK/packageMe.sh @@ -7,4 +7,4 @@ mkdir -p ./builds popd cd target -cp client-sdk-0.167.220804.jar ../../builds/client-sdk-0.167.220804.jar +cp client-sdk-0.168.220815.jar ../../builds/client-sdk-0.168.220815.jar diff --git a/PlayFabClientSDK/pom.xml b/PlayFabClientSDK/pom.xml index ac9d7992..91fb6c37 100644 --- a/PlayFabClientSDK/pom.xml +++ b/PlayFabClientSDK/pom.xml @@ -14,7 +14,7 @@ com.playfab client-sdk - 0.167.220804 + 0.168.220815 PlayFab Client API PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. https://docs.microsoft.com/gaming/playfab/ diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientAPI.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientAPI.java index 20df84c4..56c537da 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientAPI.java @@ -3329,6 +3329,76 @@ private static PlayFabResult privateGetPlayFab return pfResult; } + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + * @param request GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest + * @return Async Task will return GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + * @param request GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest + * @return GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromGooglePlayGamesPlayerIDs(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/GetPlayFabIDsFromGooglePlayGamesPlayerIDs"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the * IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: @@ -5179,6 +5249,73 @@ private static PlayFabResult privateLinkGoogleAccountAs return pfResult; } + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + * @param request LinkGooglePlayGamesServicesAccountRequest + * @return Async Task will return LinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkGooglePlayGamesServicesAccountAsync(final LinkGooglePlayGamesServicesAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkGooglePlayGamesServicesAccountAsync(request); + } + }); + } + + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + * @param request LinkGooglePlayGamesServicesAccountRequest + * @return LinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkGooglePlayGamesServicesAccount(final LinkGooglePlayGamesServicesAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkGooglePlayGamesServicesAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkGooglePlayGamesServicesAccountAsync(final LinkGooglePlayGamesServicesAccountRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/LinkGooglePlayGamesServicesAccount"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkGooglePlayGamesServicesAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Links the vendor-specific iOS device identifier to the user's PlayFab account * @param request LinkIOSDeviceIDRequest @@ -8938,6 +9075,68 @@ private static PlayFabResult privateUnlinkGoogleAccou return pfResult; } + /** + * Unlinks the related Google Play Games account from the user's PlayFab account. + * @param request UnlinkGooglePlayGamesServicesAccountRequest + * @return Async Task will return UnlinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkGooglePlayGamesServicesAccountAsync(final UnlinkGooglePlayGamesServicesAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkGooglePlayGamesServicesAccountAsync(request); + } + }); + } + + /** + * Unlinks the related Google Play Games account from the user's PlayFab account. + * @param request UnlinkGooglePlayGamesServicesAccountRequest + * @return UnlinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkGooglePlayGamesServicesAccount(final UnlinkGooglePlayGamesServicesAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkGooglePlayGamesServicesAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Unlinks the related Google Play Games account from the user's PlayFab account. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkGooglePlayGamesServicesAccountAsync(final UnlinkGooglePlayGamesServicesAccountRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/UnlinkGooglePlayGamesServicesAccount"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkGooglePlayGamesServicesAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Unlinks the related iOS device identifier from the user's PlayFab account * @param request UnlinkIOSDeviceIDRequest diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientModels.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientModels.java index ce5ca3cf..0d340339 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientModels.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabClientModels.java @@ -1619,11 +1619,7 @@ public static class GetLeaderboardRequest { } - /** - * Note that the Position of the user in the results is for the overall leaderboard. If Facebook friends are included, make - * sure the access token from previous LoginWithFacebook call is still valid and not expired. If Xbox Live friends are - * included, make sure the access token from the previous LoginWithXbox call is still valid and not expired. - */ + /** Note: the user's Position is relative to the overall leaderboard. */ public static class GetLeaderboardResult { /** Ordered listing of users and their positions in the requested leaderboard. */ public ArrayList Leaderboard; @@ -1932,6 +1928,19 @@ public static class GetPlayFabIDsFromGoogleIDsResult { } + public static class GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest { + /** Array of unique Google Play Games identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. */ + public ArrayList GooglePlayGamesPlayerIDs; + + } + + /** For Google Play Games identifiers which have not been linked to PlayFab accounts, null will be returned. */ + public static class GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult { + /** Mapping of Google Play Games identifiers to PlayFab identifiers. */ + public ArrayList Data; + + } + public static class GetPlayFabIDsFromKongregateIDsRequest { /** Array of unique Kongregate identifiers (Kongregate's user_id) for which the title needs to get PlayFab identifiers. */ public ArrayList KongregateIDs; @@ -2285,6 +2294,14 @@ public static class GooglePlayFabIdPair { } + public static class GooglePlayGamesPlayFabIdPair { + /** Unique Google Play Games identifier for a user. */ + public String GooglePlayGamesPlayerId; + /** Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Google Play Games identifier. */ + public String PlayFabId; + + } + /** * Grants a character to the user of the type specified by the item ID. The user must already have an instance of this item * in their inventory in order to allow character creation. This item can come from a purchase or grant, which must be done @@ -2533,6 +2550,30 @@ public static class LinkGoogleAccountResult { } + /** + * Google Play Games sign-in is accomplished by obtaining a Google OAuth 2.0 credential using the Google Play Games sign-in + * for Android APIs on the device and passing it to this API. + */ + public static class LinkGooglePlayGamesServicesAccountRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** + * If another user is already linked to the account, unlink the other user and re-link. If the current user is already + * linked, link both accounts + */ + public Boolean ForceLink; + /** + * OAuth 2.0 server authentication code obtained on the client by calling the requestServerSideAccess() + * (https://developers.google.com/games/services/android/signin) Google Play Games client API. + */ + public String ServerAuthCode; + + } + + public static class LinkGooglePlayGamesServicesAccountResult { + + } + public static class LinkIOSDeviceIDRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; @@ -4424,6 +4465,16 @@ public static class UnlinkGoogleAccountResult { } + public static class UnlinkGooglePlayGamesServicesAccountRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + + } + + public static class UnlinkGooglePlayGamesServicesAccountResult { + + } + public static class UnlinkIOSDeviceIDRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabErrors.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabErrors.java index ac24be58..6c2a147d 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabErrors.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabErrors.java @@ -545,6 +545,7 @@ public static enum PlayFabErrorCode { AutomationRuleAlreadyExists(1543), AutomationRuleLimitExceeded(1544), InvalidGooglePlayGamesServerAuthCode(1545), + StorageAccountNotFound(1546), MatchmakingEntityInvalid(2001), MatchmakingPlayerAttributesInvalid(2002), MatchmakingQueueNotFound(2016), diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java index e4a82b90..0684a86b 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java @@ -434,6 +434,8 @@ public static class CreateBuildWithCustomContainerRequest { public ArrayList Ports; /** The region configurations for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** * When true, assets will be downloaded and uncompressed in memory, without the compressedversion being written first to * disc. @@ -480,6 +482,8 @@ public static class CreateBuildWithCustomContainerResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** @@ -529,6 +533,8 @@ public static class CreateBuildWithManagedContainerRequest { public ArrayList Ports; /** The region configurations for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The command to run when the multiplayer server is started, including any arguments. */ public String StartMultiplayerServerCommand; /** @@ -580,6 +586,8 @@ public static class CreateBuildWithManagedContainerResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** The command to run when the multiplayer server has been allocated, including any arguments. */ @@ -1256,6 +1264,8 @@ public static class GetBuildResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM. */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** @@ -2344,6 +2354,17 @@ public static class ServerDetails { } + public static class ServerResourceConstraintParams { + /** The maximum number of cores that each server is allowed to use. */ + public Double CpuLimit; + /** + * The maximum number of GiB of memory that each server is allowed to use. WARNING: After exceeding this limit, the server + * will be killed + */ + public Double MemoryLimitGB; + + } + public static enum ServerType { Container, Process @@ -2414,7 +2435,7 @@ public static class TitleMultiplayerServersQuotas { } - /** Request to unsubscribe from lobby notifications. Only a client can unsubscribe from notifications. */ + /** Request to unsubscribe from lobby notifications. */ public static class UnsubscribeFromLobbyResourceRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; diff --git a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java index eca75954..f3548d07 100644 --- a/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabClientSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -8,9 +8,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.167.220804"; - public static String BuildIdentifier = "adobuild_javasdk_8"; - public static String SdkVersionString = "JavaSDK-0.167.220804"; + public static String SdkVersion = "0.168.220815"; + public static String BuildIdentifier = "adobuild_javasdk_118"; + public static String SdkVersionString = "JavaSDK-0.168.220815"; public static Map RequestGetParams; static { diff --git a/PlayFabSDK/packageMe.ps1 b/PlayFabSDK/packageMe.ps1 index c0ab8a33..64a28fca 100644 --- a/PlayFabSDK/packageMe.ps1 +++ b/PlayFabSDK/packageMe.ps1 @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds popd cd target -Copy-Item combo-sdk-0.167.220804.jar -Destination ../../builds/combo-sdk-0.167.220804.jar \ No newline at end of file +Copy-Item combo-sdk-0.168.220815.jar -Destination ../../builds/combo-sdk-0.168.220815.jar \ No newline at end of file diff --git a/PlayFabSDK/packageMe.sh b/PlayFabSDK/packageMe.sh index d7efab18..e3e8d064 100644 --- a/PlayFabSDK/packageMe.sh +++ b/PlayFabSDK/packageMe.sh @@ -7,4 +7,4 @@ mkdir -p ./builds popd cd target -cp combo-sdk-0.167.220804.jar ../../builds/combo-sdk-0.167.220804.jar +cp combo-sdk-0.168.220815.jar ../../builds/combo-sdk-0.168.220815.jar diff --git a/PlayFabSDK/pom.xml b/PlayFabSDK/pom.xml index 9208a71d..91870044 100644 --- a/PlayFabSDK/pom.xml +++ b/PlayFabSDK/pom.xml @@ -14,7 +14,7 @@ com.playfab combo-sdk - 0.167.220804 + 0.168.220815 PlayFab Combo API PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. https://docs.microsoft.com/gaming/playfab/ diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabAdminModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabAdminModels.java index cef741ba..fafc7653 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabAdminModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabAdminModels.java @@ -1921,6 +1921,7 @@ public static enum GenericErrorCodes { AutomationRuleAlreadyExists, AutomationRuleLimitExceeded, InvalidGooglePlayGamesServerAuthCode, + StorageAccountNotFound, MatchmakingEntityInvalid, MatchmakingPlayerAttributesInvalid, MatchmakingQueueNotFound, diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabClientAPI.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabClientAPI.java index 20df84c4..56c537da 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabClientAPI.java @@ -3329,6 +3329,76 @@ private static PlayFabResult privateGetPlayFab return pfResult; } + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + * @param request GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest + * @return Async Task will return GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + * @param request GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest + * @return GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromGooglePlayGamesPlayerIDs(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Google Play Games identifiers. The Google Play Games + * identifiers are the IDs for the user accounts, available as "playerId" in the Google Play Games Services - Players API + * calls. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromGooglePlayGamesPlayerIDsAsync(final GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/GetPlayFabIDsFromGooglePlayGamesPlayerIDs"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Kongregate identifiers. The Kongregate identifiers are the * IDs for the user accounts, available as "user_id" from the Kongregate API methods(ex: @@ -5179,6 +5249,73 @@ private static PlayFabResult privateLinkGoogleAccountAs return pfResult; } + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + * @param request LinkGooglePlayGamesServicesAccountRequest + * @return Async Task will return LinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkGooglePlayGamesServicesAccountAsync(final LinkGooglePlayGamesServicesAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkGooglePlayGamesServicesAccountAsync(request); + } + }); + } + + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + * @param request LinkGooglePlayGamesServicesAccountRequest + * @return LinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkGooglePlayGamesServicesAccount(final LinkGooglePlayGamesServicesAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkGooglePlayGamesServicesAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** + * Links the currently signed-in user account to their Google Play Games account, using their Google Play Games account + * credentials + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkGooglePlayGamesServicesAccountAsync(final LinkGooglePlayGamesServicesAccountRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/LinkGooglePlayGamesServicesAccount"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkGooglePlayGamesServicesAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Links the vendor-specific iOS device identifier to the user's PlayFab account * @param request LinkIOSDeviceIDRequest @@ -8938,6 +9075,68 @@ private static PlayFabResult privateUnlinkGoogleAccou return pfResult; } + /** + * Unlinks the related Google Play Games account from the user's PlayFab account. + * @param request UnlinkGooglePlayGamesServicesAccountRequest + * @return Async Task will return UnlinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkGooglePlayGamesServicesAccountAsync(final UnlinkGooglePlayGamesServicesAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkGooglePlayGamesServicesAccountAsync(request); + } + }); + } + + /** + * Unlinks the related Google Play Games account from the user's PlayFab account. + * @param request UnlinkGooglePlayGamesServicesAccountRequest + * @return UnlinkGooglePlayGamesServicesAccountResult + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkGooglePlayGamesServicesAccount(final UnlinkGooglePlayGamesServicesAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkGooglePlayGamesServicesAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + PlayFabResult exceptionResult = new PlayFabResult(); + exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null); + return exceptionResult; + } + } + + /** Unlinks the related Google Play Games account from the user's PlayFab account. */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkGooglePlayGamesServicesAccountAsync(final UnlinkGooglePlayGamesServicesAccountRequest request) throws Exception { + if (PlayFabSettings.ClientSessionTicket == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Client/UnlinkGooglePlayGamesServicesAccount"), request, "X-Authorization", PlayFabSettings.ClientSessionTicket); + task.run(); + Object httpResult = task.get(); + if (httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkGooglePlayGamesServicesAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Unlinks the related iOS device identifier from the user's PlayFab account * @param request UnlinkIOSDeviceIDRequest diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabClientModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabClientModels.java index ce5ca3cf..0d340339 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabClientModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabClientModels.java @@ -1619,11 +1619,7 @@ public static class GetLeaderboardRequest { } - /** - * Note that the Position of the user in the results is for the overall leaderboard. If Facebook friends are included, make - * sure the access token from previous LoginWithFacebook call is still valid and not expired. If Xbox Live friends are - * included, make sure the access token from the previous LoginWithXbox call is still valid and not expired. - */ + /** Note: the user's Position is relative to the overall leaderboard. */ public static class GetLeaderboardResult { /** Ordered listing of users and their positions in the requested leaderboard. */ public ArrayList Leaderboard; @@ -1932,6 +1928,19 @@ public static class GetPlayFabIDsFromGoogleIDsResult { } + public static class GetPlayFabIDsFromGooglePlayGamesPlayerIDsRequest { + /** Array of unique Google Play Games identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. */ + public ArrayList GooglePlayGamesPlayerIDs; + + } + + /** For Google Play Games identifiers which have not been linked to PlayFab accounts, null will be returned. */ + public static class GetPlayFabIDsFromGooglePlayGamesPlayerIDsResult { + /** Mapping of Google Play Games identifiers to PlayFab identifiers. */ + public ArrayList Data; + + } + public static class GetPlayFabIDsFromKongregateIDsRequest { /** Array of unique Kongregate identifiers (Kongregate's user_id) for which the title needs to get PlayFab identifiers. */ public ArrayList KongregateIDs; @@ -2285,6 +2294,14 @@ public static class GooglePlayFabIdPair { } + public static class GooglePlayGamesPlayFabIdPair { + /** Unique Google Play Games identifier for a user. */ + public String GooglePlayGamesPlayerId; + /** Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Google Play Games identifier. */ + public String PlayFabId; + + } + /** * Grants a character to the user of the type specified by the item ID. The user must already have an instance of this item * in their inventory in order to allow character creation. This item can come from a purchase or grant, which must be done @@ -2533,6 +2550,30 @@ public static class LinkGoogleAccountResult { } + /** + * Google Play Games sign-in is accomplished by obtaining a Google OAuth 2.0 credential using the Google Play Games sign-in + * for Android APIs on the device and passing it to this API. + */ + public static class LinkGooglePlayGamesServicesAccountRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + /** + * If another user is already linked to the account, unlink the other user and re-link. If the current user is already + * linked, link both accounts + */ + public Boolean ForceLink; + /** + * OAuth 2.0 server authentication code obtained on the client by calling the requestServerSideAccess() + * (https://developers.google.com/games/services/android/signin) Google Play Games client API. + */ + public String ServerAuthCode; + + } + + public static class LinkGooglePlayGamesServicesAccountResult { + + } + public static class LinkIOSDeviceIDRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; @@ -4424,6 +4465,16 @@ public static class UnlinkGoogleAccountResult { } + public static class UnlinkGooglePlayGamesServicesAccountRequest { + /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ + public Map CustomTags; + + } + + public static class UnlinkGooglePlayGamesServicesAccountResult { + + } + public static class UnlinkIOSDeviceIDRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabErrors.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabErrors.java index ac24be58..6c2a147d 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabErrors.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabErrors.java @@ -545,6 +545,7 @@ public static enum PlayFabErrorCode { AutomationRuleAlreadyExists(1543), AutomationRuleLimitExceeded(1544), InvalidGooglePlayGamesServerAuthCode(1545), + StorageAccountNotFound(1546), MatchmakingEntityInvalid(2001), MatchmakingPlayerAttributesInvalid(2002), MatchmakingQueueNotFound(2016), diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java index e4a82b90..0684a86b 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java @@ -434,6 +434,8 @@ public static class CreateBuildWithCustomContainerRequest { public ArrayList Ports; /** The region configurations for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** * When true, assets will be downloaded and uncompressed in memory, without the compressedversion being written first to * disc. @@ -480,6 +482,8 @@ public static class CreateBuildWithCustomContainerResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** @@ -529,6 +533,8 @@ public static class CreateBuildWithManagedContainerRequest { public ArrayList Ports; /** The region configurations for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The command to run when the multiplayer server is started, including any arguments. */ public String StartMultiplayerServerCommand; /** @@ -580,6 +586,8 @@ public static class CreateBuildWithManagedContainerResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** The command to run when the multiplayer server has been allocated, including any arguments. */ @@ -1256,6 +1264,8 @@ public static class GetBuildResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM. */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** @@ -2344,6 +2354,17 @@ public static class ServerDetails { } + public static class ServerResourceConstraintParams { + /** The maximum number of cores that each server is allowed to use. */ + public Double CpuLimit; + /** + * The maximum number of GiB of memory that each server is allowed to use. WARNING: After exceeding this limit, the server + * will be killed + */ + public Double MemoryLimitGB; + + } + public static enum ServerType { Container, Process @@ -2414,7 +2435,7 @@ public static class TitleMultiplayerServersQuotas { } - /** Request to unsubscribe from lobby notifications. Only a client can unsubscribe from notifications. */ + /** Request to unsubscribe from lobby notifications. */ public static class UnsubscribeFromLobbyResourceRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java index 87ac8a68..8bf9d250 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabServerModels.java @@ -1637,6 +1637,7 @@ public static enum GenericErrorCodes { AutomationRuleAlreadyExists, AutomationRuleLimitExceeded, InvalidGooglePlayGamesServerAuthCode, + StorageAccountNotFound, MatchmakingEntityInvalid, MatchmakingPlayerAttributesInvalid, MatchmakingQueueNotFound, diff --git a/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java index eca75954..f3548d07 100644 --- a/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -8,9 +8,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.167.220804"; - public static String BuildIdentifier = "adobuild_javasdk_8"; - public static String SdkVersionString = "JavaSDK-0.167.220804"; + public static String SdkVersion = "0.168.220815"; + public static String BuildIdentifier = "adobuild_javasdk_118"; + public static String SdkVersionString = "JavaSDK-0.168.220815"; public static Map RequestGetParams; static { diff --git a/PlayFabServerSDK/packageMe.ps1 b/PlayFabServerSDK/packageMe.ps1 index a7b23b4e..1352c6d9 100644 --- a/PlayFabServerSDK/packageMe.ps1 +++ b/PlayFabServerSDK/packageMe.ps1 @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds popd cd target -Copy-Item server-sdk-0.167.220804.jar -Destination ../../builds/server-sdk-0.167.220804.jar \ No newline at end of file +Copy-Item server-sdk-0.168.220815.jar -Destination ../../builds/server-sdk-0.168.220815.jar \ No newline at end of file diff --git a/PlayFabServerSDK/packageMe.sh b/PlayFabServerSDK/packageMe.sh index bcfbc57f..4a1e12c2 100644 --- a/PlayFabServerSDK/packageMe.sh +++ b/PlayFabServerSDK/packageMe.sh @@ -7,4 +7,4 @@ mkdir -p ./builds popd cd target -cp server-sdk-0.167.220804.jar ../../builds/server-sdk-0.167.220804.jar +cp server-sdk-0.168.220815.jar ../../builds/server-sdk-0.168.220815.jar diff --git a/PlayFabServerSDK/pom.xml b/PlayFabServerSDK/pom.xml index a93a445b..6dcd79f8 100644 --- a/PlayFabServerSDK/pom.xml +++ b/PlayFabServerSDK/pom.xml @@ -14,7 +14,7 @@ com.playfab server-sdk - 0.167.220804 + 0.168.220815 PlayFab Server API PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. https://docs.microsoft.com/gaming/playfab/ diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabAdminModels.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabAdminModels.java index cef741ba..fafc7653 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabAdminModels.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabAdminModels.java @@ -1921,6 +1921,7 @@ public static enum GenericErrorCodes { AutomationRuleAlreadyExists, AutomationRuleLimitExceeded, InvalidGooglePlayGamesServerAuthCode, + StorageAccountNotFound, MatchmakingEntityInvalid, MatchmakingPlayerAttributesInvalid, MatchmakingQueueNotFound, diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabErrors.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabErrors.java index ac24be58..6c2a147d 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabErrors.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabErrors.java @@ -545,6 +545,7 @@ public static enum PlayFabErrorCode { AutomationRuleAlreadyExists(1543), AutomationRuleLimitExceeded(1544), InvalidGooglePlayGamesServerAuthCode(1545), + StorageAccountNotFound(1546), MatchmakingEntityInvalid(2001), MatchmakingPlayerAttributesInvalid(2002), MatchmakingQueueNotFound(2016), diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java index e4a82b90..0684a86b 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabMultiplayerModels.java @@ -434,6 +434,8 @@ public static class CreateBuildWithCustomContainerRequest { public ArrayList Ports; /** The region configurations for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** * When true, assets will be downloaded and uncompressed in memory, without the compressedversion being written first to * disc. @@ -480,6 +482,8 @@ public static class CreateBuildWithCustomContainerResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** @@ -529,6 +533,8 @@ public static class CreateBuildWithManagedContainerRequest { public ArrayList Ports; /** The region configurations for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The command to run when the multiplayer server is started, including any arguments. */ public String StartMultiplayerServerCommand; /** @@ -580,6 +586,8 @@ public static class CreateBuildWithManagedContainerResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM (EXPERIMENTAL API) */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** The command to run when the multiplayer server has been allocated, including any arguments. */ @@ -1256,6 +1264,8 @@ public static class GetBuildResponse { public ArrayList Ports; /** The region configuration for the build. */ public ArrayList RegionConfigurations; + /** The resource constraints to apply to each server on the VM. */ + public ServerResourceConstraintParams ServerResourceConstraints; /** The type of game server being hosted. */ public String ServerType; /** @@ -2344,6 +2354,17 @@ public static class ServerDetails { } + public static class ServerResourceConstraintParams { + /** The maximum number of cores that each server is allowed to use. */ + public Double CpuLimit; + /** + * The maximum number of GiB of memory that each server is allowed to use. WARNING: After exceeding this limit, the server + * will be killed + */ + public Double MemoryLimitGB; + + } + public static enum ServerType { Container, Process @@ -2414,7 +2435,7 @@ public static class TitleMultiplayerServersQuotas { } - /** Request to unsubscribe from lobby notifications. Only a client can unsubscribe from notifications. */ + /** Request to unsubscribe from lobby notifications. */ public static class UnsubscribeFromLobbyResourceRequest { /** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */ public Map CustomTags; diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java index 87ac8a68..8bf9d250 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabServerModels.java @@ -1637,6 +1637,7 @@ public static enum GenericErrorCodes { AutomationRuleAlreadyExists, AutomationRuleLimitExceeded, InvalidGooglePlayGamesServerAuthCode, + StorageAccountNotFound, MatchmakingEntityInvalid, MatchmakingPlayerAttributesInvalid, MatchmakingQueueNotFound, diff --git a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java index a15ed6ca..f10b7642 100644 --- a/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java +++ b/PlayFabServerSDK/src/main/java/com/playfab/PlayFabSettings.java @@ -8,9 +8,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.167.220804"; - public static String BuildIdentifier = "adobuild_javasdk_8"; - public static String SdkVersionString = "JavaSDK-0.167.220804"; + public static String SdkVersion = "0.168.220815"; + public static String BuildIdentifier = "adobuild_javasdk_118"; + public static String SdkVersionString = "JavaSDK-0.168.220815"; public static Map RequestGetParams; static { diff --git a/builds/client-sdk-0.168.220815.jar b/builds/client-sdk-0.168.220815.jar new file mode 100644 index 00000000..2ce49a99 Binary files /dev/null and b/builds/client-sdk-0.168.220815.jar differ diff --git a/builds/combo-sdk-0.168.220815.jar b/builds/combo-sdk-0.168.220815.jar new file mode 100644 index 00000000..8e82ec91 Binary files /dev/null and b/builds/combo-sdk-0.168.220815.jar differ diff --git a/builds/server-sdk-0.168.220815.jar b/builds/server-sdk-0.168.220815.jar new file mode 100644 index 00000000..3cffc69e Binary files /dev/null and b/builds/server-sdk-0.168.220815.jar differ