From 544ed466d386f3dc5bd334076b4edd9fc49e014b Mon Sep 17 00:00:00 2001 From: Paul Gilmore Date: Mon, 29 Aug 2016 18:18:30 -0700 Subject: [PATCH] https://api.playfab.com/releaseNotes/#160829 (#83) (#84) * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins * https://github.com/PlayFab/SDKGenerator/commit/b216b6eb481e21fda1c1dd77144bcdaec2c9216d * https://github.com/PlayFab/SDKGenerator/commit/9603865b90241eda4188c2b3648e66961a140f08 * Automated pf-main build from Jenkins * https://github.com/PlayFab/SDKGenerator/commit/88cfcc25e19d6f62015611f63041454be318692e * https://github.com/PlayFab/SDKGenerator/commit/15e56d3d20c083fa2aa03a784296e76ce7547972 * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins * https://github.com/PlayFab/SDKGenerator/commit/6f6b966c8c8a7ee8377dc1fba48c8437eaec824b * Automated build from Jenkins * Automated build from Jenkins * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins * Automated pf-main build from Jenkins --- .../java/com/playfab/PlayFabClientAPI.java | 130 ++++++++--- .../java/com/playfab/PlayFabClientModels.java | 192 +++++++++++++++-- .../main/java/com/playfab/PlayFabErrors.java | 4 +- .../java/com/playfab/PlayFabSettings.java | 6 +- .../src/com/playfab/PlayFabClientAPI.java | 130 ++++++++--- .../src/com/playfab/PlayFabClientModels.java | 192 +++++++++++++++-- .../src/com/playfab/PlayFabErrors.java | 4 +- .../src/com/playfab/PlayFabSettings.java | 6 +- .../src/com/playfab/PlayFabAdminAPI.java | 174 +++++++++++++++ .../src/com/playfab/PlayFabAdminModels.java | 166 +++++++++++++-- .../src/com/playfab/PlayFabClientAPI.java | 130 ++++++++--- .../src/com/playfab/PlayFabClientModels.java | 192 +++++++++++++++-- PlayFabSDK/src/com/playfab/PlayFabErrors.java | 4 +- .../com/playfab/PlayFabMatchmakerModels.java | 4 +- .../src/com/playfab/PlayFabServerAPI.java | 201 +++++++++++++++++- .../src/com/playfab/PlayFabServerModels.java | 119 +++++++++-- .../src/com/playfab/PlayFabSettings.java | 6 +- .../src/com/playfab/PlayFabAdminAPI.java | 174 +++++++++++++++ .../src/com/playfab/PlayFabAdminModels.java | 166 +++++++++++++-- .../src/com/playfab/PlayFabErrors.java | 4 +- .../com/playfab/PlayFabMatchmakerModels.java | 4 +- .../src/com/playfab/PlayFabServerAPI.java | 201 +++++++++++++++++- .../src/com/playfab/PlayFabServerModels.java | 119 +++++++++-- .../src/com/playfab/PlayFabSettings.java | 6 +- 24 files changed, 2095 insertions(+), 239 deletions(-) diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java index ca860193e..f3e013296 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java @@ -1446,8 +1446,9 @@ private static PlayFabResult privateGetPlayFab } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) { return new FutureTask(new Callable>() { @@ -1458,8 +1459,9 @@ public PlayFabResult call() throws Exception { } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetUserCombinedInfo(final GetUserCombinedInfoRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -1476,8 +1478,9 @@ public PlayFabResult call() throws Exception { } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -2837,8 +2840,9 @@ private static PlayFabResult privateGetFriendLeaderboardAs } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) { return new FutureTask(new Callable>() { @@ -2849,8 +2853,9 @@ public PlayFabResult call() throws } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetFriendLeaderboardAroundCurrentUser(final GetFriendLeaderboardAroundCurrentUserRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -2867,8 +2872,9 @@ public PlayFabResult call() throws } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3011,8 +3017,9 @@ private static PlayFabResult privateGetLeaderboardAsync(fi } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) { return new FutureTask(new Callable>() { @@ -3023,8 +3030,9 @@ public PlayFabResult call() throws Except } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetLeaderboardAroundCurrentUser(final GetLeaderboardAroundCurrentUserRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3041,8 +3049,9 @@ public PlayFabResult call() throws Except } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3475,8 +3484,9 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetUserStatisticsAsync(final GetUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -3487,8 +3497,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetUserStatistics(final GetUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3505,8 +3516,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserStatisticsAsync(final GetUserStatisticsRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3707,8 +3719,9 @@ private static PlayFabResult privateUpdateUserPublisherDat } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> UpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -3719,8 +3732,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult UpdateUserStatistics(final UpdateUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3737,8 +3751,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -5563,8 +5578,9 @@ private static PlayFabResult privateValidateGo } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> LogEventAsync(final LogEventRequest request) { return new FutureTask(new Callable>() { @@ -5575,8 +5591,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult LogEvent(final LogEventRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -5593,8 +5610,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateLogEventAsync(final LogEventRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -6143,8 +6161,9 @@ private static PlayFabResult privateExecuteCloudScript } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) { return new FutureTask(new Callable>() { @@ -6155,8 +6174,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetCloudScriptUrl(final GetCloudScriptUrlRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -6173,8 +6193,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -6202,8 +6223,9 @@ private static PlayFabResult privateGetCloudScriptUrlAs } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> RunCloudScriptAsync(final RunCloudScriptRequest request) { return new FutureTask(new Callable>() { @@ -6214,8 +6236,9 @@ public PlayFabResult call() throws Exception { } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult RunCloudScript(final RunCloudScriptRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -6232,8 +6255,9 @@ public PlayFabResult call() throws Exception { } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateRunCloudScriptAsync(final RunCloudScriptRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -7363,6 +7387,64 @@ private static PlayFabResult privateGetPlayerSegmentsAs return pfResult; } + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerTagsAsync(final GetPlayerTagsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerTags(final GetPlayerTagsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerTagsAsync(final GetPlayerTagsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTags", request, "X-Authorization", _authKey); + 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()); + GetPlayerTagsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + public static void MultiStepClientLogin(Boolean needsAttribution) { if (needsAttribution && !PlayFabSettings.DisableAdvertising && (PlayFabSettings.AdvertisingIdType == null || PlayFabSettings.AdvertisingIdType == "") diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java index d2db8f907..f59dd22d7 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java @@ -208,8 +208,9 @@ public static class CartItem { public Map VCAmount; } + /** - * A purchasable item from the item catalog + * A purchasable item from the item catalog */ public static class CatalogItem implements Comparable { /** @@ -277,13 +278,16 @@ public static class CatalogItem implements Comparable { * URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. */ public String ItemImageUrl; + /** + * if true, then only a fixed number can ever be granted. + */ + public Boolean IsLimitedEdition; public int compareTo(CatalogItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } - } public static class CatalogItemBundleInfo { @@ -319,8 +323,9 @@ public static class CatalogItemConsumableInfo { public String UsagePeriodGroup; } + /** - * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. + * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. */ public static class CatalogItemContainerInfo { /** @@ -409,8 +414,9 @@ public static enum CloudScriptRevisionOption { Latest, Specific } + /** - * Collection filter to include and/or exclude collections with certain key-value pairs. The filter generates a collection set defined by Includes rules and then remove collections that matches the Excludes rules. A collection is considered matching a rule if the rule describes a subset of the collection. + * Collection filter to include and/or exclude collections with certain key-value pairs. The filter generates a collection set defined by Includes rules and then remove collections that matches the Excludes rules. A collection is considered matching a rule if the rule describes a subset of the collection. */ public static class CollectionFilter { /** @@ -475,8 +481,9 @@ public static class ConsumeItemResult { public Integer RemainingUses; } + /** - * A data container + * A data container */ public static class Container_Dictionary_String_String { /** @@ -1088,6 +1095,10 @@ public static class GetCharacterStatisticsResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetCloudScriptUrlRequest { /** * Cloud Script Version to use. Defaults to 1. @@ -1100,6 +1111,10 @@ public static class GetCloudScriptUrlRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetCloudScriptUrlResult { /** * URL of the Cloud Script logic server. @@ -1132,6 +1147,10 @@ public static class GetContentDownloadUrlResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetFriendLeaderboardAroundCurrentUserRequest { /** * Statistic used to rank players for this leaderboard. @@ -1152,6 +1171,10 @@ public static class GetFriendLeaderboardAroundCurrentUserRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetFriendLeaderboardAroundCurrentUserResult { /** * Ordered listing of users and their positions in the requested leaderboard. @@ -1264,6 +1287,10 @@ public static class GetLeaderboardAroundCharacterResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetLeaderboardAroundCurrentUserRequest { /** * Statistic used to rank players for this leaderboard. @@ -1276,6 +1303,10 @@ public static class GetLeaderboardAroundCurrentUserRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetLeaderboardAroundCurrentUserResult { /** * Ordered listing of users and their positions in the requested leaderboard. @@ -1549,6 +1580,30 @@ public static class GetPlayerStatisticVersionsResult { } + public static class GetPlayerTagsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Optional namespace to filter results by + */ + public String Namespace; + + } + + public static class GetPlayerTagsResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Canonical tags (including namespace and tag's name) for the requested user + */ + public ArrayList Tags; + + } + public static class GetPlayerTradesRequest { /** * Returns only trades with the given status. If null, returns all trades. @@ -1651,8 +1706,9 @@ public static class GetPlayFabIDsFromKongregateIDsResult { public static class GetPlayFabIDsFromSteamIDsRequest { /** - * Deprecated: Please use SteamStringIDs + * @deprecated Please use SteamStringIDs instead. */ + @Deprecated public ArrayList SteamIDs; /** * Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. @@ -1799,6 +1855,22 @@ public static class GetStoreItemsResult { */ @Unordered("ItemId") public ArrayList Store; + /** + * How the store was last updated (Admin or a third party). + */ + public SourceType Source; + /** + * The base catalog that this store is a part of. + */ + public String CatalogVersion; + /** + * The ID of this store. + */ + public String StoreId; + /** + * Additional data about the store. + */ + public StoreMarketingModel MarketingData; } @@ -1854,6 +1926,10 @@ public static class GetTradeStatusResponse { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserCombinedInfoRequest { /** * Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no other lookup identifier set. @@ -1902,6 +1978,10 @@ public static class GetUserCombinedInfoRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserCombinedInfoResult { /** * Unique PlayFab identifier of the owner of the combined info. @@ -1992,10 +2072,18 @@ public static class GetUserInventoryResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsResult { /** * User statistics for the active title. @@ -2047,8 +2135,9 @@ public static class GrantCharacterToUserResult { public Boolean Result; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -2117,7 +2206,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class ItemPurchaseRequest { @@ -2296,6 +2384,10 @@ public static class ListUsersCharactersResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventRequest { /** * Optional timestamp for this event. If null, the a timestamp is auto-assigned to the event on the server. @@ -2316,6 +2408,10 @@ public static class LogEventRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventResult { } @@ -2470,8 +2566,9 @@ public static class LoginWithGoogleAccountRequest { */ public Boolean CreateAccount; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public String PublisherId; /** * Flags for which pieces of info to return for the user. @@ -2639,8 +2736,9 @@ public static class MatchmakeRequest { */ public CollectionFilter TagFilter; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public Boolean EnableQueue; } @@ -2989,8 +3087,9 @@ public static class RegisterPlayFabUserRequest { */ public String DisplayName; /** - * The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. + * @deprecated Do not use */ + @Deprecated public String Origination; } @@ -3091,6 +3190,10 @@ public static class RestoreIOSPurchasesResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class RunCloudScriptRequest { /** * server action to trigger @@ -3107,6 +3210,10 @@ public static class RunCloudScriptRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class RunCloudScriptResult { /** * id of Cloud Script run @@ -3165,8 +3272,9 @@ public static class SendAccountRecoveryEmailRequest { */ public String TitleId; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public String PublisherId; } @@ -3211,6 +3319,15 @@ public static class SharedGroupDataRecord { } + public static enum SourceType { + Admin, + BackEnd, + GameClient, + GameServer, + Partner, + Stream + } + public static class StartGameRequest { /** * version information for the build of the game server which is to be started @@ -3349,8 +3466,9 @@ public static class StatisticValue { public static class SteamPlayFabIdPair { /** - * Deprecated: Please use SteamStringId + * @deprecated Please use SteamStringId instead. */ + @Deprecated public Long SteamId; /** * Unique Steam identifier for a user. @@ -3362,28 +3480,55 @@ public static class SteamPlayFabIdPair { public String PlayFabId; } + /** - * A store entry that list a catalog item at a particular price + * A store entry that list a catalog item at a particular price */ public static class StoreItem implements Comparable { /** - * unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog */ public String ItemId; /** - * price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + * Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) */ public Map VirtualCurrencyPrices; /** - * override prices for this item for specific currencies + * Override prices for this item for specific currencies */ public Map RealCurrencyPrices; + /** + * Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + */ + public Object CustomData; + /** + * Intended display position for this item. Note that 0 is the first position + */ + public Long DisplayPosition; public int compareTo(StoreItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } + } + + /** + * Marketing data about a specific store + */ + public static class StoreMarketingModel { + /** + * Display name of a store as it will appear to users. + */ + public String DisplayName; + /** + * Tagline for a store. + */ + public String Description; + /** + * Custom data about a store. + */ + public Object Metadata; } @@ -3772,6 +3917,10 @@ public static class UpdateUserDataResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsRequest { /** * Statistics to be updated with the provided values. UserStatistics object must follow the Key(string), Value(int) pattern. @@ -3780,6 +3929,10 @@ public static class UpdateUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsResult { } @@ -3883,9 +4036,10 @@ public static class UserCustomIdInfo { public String CustomId; } + /** - * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - */ + * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. + */ public static enum UserDataPermission { Private, Public diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java index d6f2ec8ea..045a76723 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java @@ -248,7 +248,9 @@ public static enum PlayFabErrorCode { SessionLogNotFound(1244), InvalidSearchTerm(1245), TwoFactorAuthenticationTokenRequired(1246), - GameServerHostCountLimitExceeded(1247); + GameServerHostCountLimitExceeded(1247), + PlayerTagCountLimitExceeded(1248), + RequestAlreadyRunning(1249); public int id; diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java index 5a14855f5..52245ed94 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java @@ -4,9 +4,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.34.160822"; - public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.34.160822"; + public static String SdkVersion = "0.35.160829"; + public static String BuildIdentifier = "jbuild_javasdk_1"; + public static String SdkVersionString = "JavaSDK-0.35.160829"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java b/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java index 0030d21d3..69fdedd15 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java @@ -1445,8 +1445,9 @@ private static PlayFabResult privateGetPlayFab } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) { return new FutureTask(new Callable>() { @@ -1457,8 +1458,9 @@ public PlayFabResult call() throws Exception { } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetUserCombinedInfo(final GetUserCombinedInfoRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -1475,8 +1477,9 @@ public PlayFabResult call() throws Exception { } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -2836,8 +2839,9 @@ private static PlayFabResult privateGetFriendLeaderboardAs } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) { return new FutureTask(new Callable>() { @@ -2848,8 +2852,9 @@ public PlayFabResult call() throws } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetFriendLeaderboardAroundCurrentUser(final GetFriendLeaderboardAroundCurrentUserRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -2866,8 +2871,9 @@ public PlayFabResult call() throws } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3010,8 +3016,9 @@ private static PlayFabResult privateGetLeaderboardAsync(fi } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) { return new FutureTask(new Callable>() { @@ -3022,8 +3029,9 @@ public PlayFabResult call() throws Except } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetLeaderboardAroundCurrentUser(final GetLeaderboardAroundCurrentUserRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3040,8 +3048,9 @@ public PlayFabResult call() throws Except } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3474,8 +3483,9 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetUserStatisticsAsync(final GetUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -3486,8 +3496,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetUserStatistics(final GetUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3504,8 +3515,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserStatisticsAsync(final GetUserStatisticsRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3706,8 +3718,9 @@ private static PlayFabResult privateUpdateUserPublisherDat } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> UpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -3718,8 +3731,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult UpdateUserStatistics(final UpdateUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3736,8 +3750,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -5562,8 +5577,9 @@ private static PlayFabResult privateValidateGo } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> LogEventAsync(final LogEventRequest request) { return new FutureTask(new Callable>() { @@ -5574,8 +5590,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult LogEvent(final LogEventRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -5592,8 +5609,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateLogEventAsync(final LogEventRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -6142,8 +6160,9 @@ private static PlayFabResult privateExecuteCloudScript } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) { return new FutureTask(new Callable>() { @@ -6154,8 +6173,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetCloudScriptUrl(final GetCloudScriptUrlRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -6172,8 +6192,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -6201,8 +6222,9 @@ private static PlayFabResult privateGetCloudScriptUrlAs } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> RunCloudScriptAsync(final RunCloudScriptRequest request) { return new FutureTask(new Callable>() { @@ -6213,8 +6235,9 @@ public PlayFabResult call() throws Exception { } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult RunCloudScript(final RunCloudScriptRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -6231,8 +6254,9 @@ public PlayFabResult call() throws Exception { } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateRunCloudScriptAsync(final RunCloudScriptRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -7362,6 +7386,64 @@ private static PlayFabResult privateGetPlayerSegmentsAs return pfResult; } + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerTagsAsync(final GetPlayerTagsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerTags(final GetPlayerTagsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerTagsAsync(final GetPlayerTagsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTags", request, "X-Authorization", _authKey); + 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()); + GetPlayerTagsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + public static void MultiStepClientLogin(Boolean needsAttribution) { if (needsAttribution && !PlayFabSettings.DisableAdvertising && PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null) { PlayFabClientModels.AttributeInstallRequest request = new PlayFabClientModels.AttributeInstallRequest(); diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java index d2db8f907..f59dd22d7 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java @@ -208,8 +208,9 @@ public static class CartItem { public Map VCAmount; } + /** - * A purchasable item from the item catalog + * A purchasable item from the item catalog */ public static class CatalogItem implements Comparable { /** @@ -277,13 +278,16 @@ public static class CatalogItem implements Comparable { * URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. */ public String ItemImageUrl; + /** + * if true, then only a fixed number can ever be granted. + */ + public Boolean IsLimitedEdition; public int compareTo(CatalogItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } - } public static class CatalogItemBundleInfo { @@ -319,8 +323,9 @@ public static class CatalogItemConsumableInfo { public String UsagePeriodGroup; } + /** - * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. + * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. */ public static class CatalogItemContainerInfo { /** @@ -409,8 +414,9 @@ public static enum CloudScriptRevisionOption { Latest, Specific } + /** - * Collection filter to include and/or exclude collections with certain key-value pairs. The filter generates a collection set defined by Includes rules and then remove collections that matches the Excludes rules. A collection is considered matching a rule if the rule describes a subset of the collection. + * Collection filter to include and/or exclude collections with certain key-value pairs. The filter generates a collection set defined by Includes rules and then remove collections that matches the Excludes rules. A collection is considered matching a rule if the rule describes a subset of the collection. */ public static class CollectionFilter { /** @@ -475,8 +481,9 @@ public static class ConsumeItemResult { public Integer RemainingUses; } + /** - * A data container + * A data container */ public static class Container_Dictionary_String_String { /** @@ -1088,6 +1095,10 @@ public static class GetCharacterStatisticsResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetCloudScriptUrlRequest { /** * Cloud Script Version to use. Defaults to 1. @@ -1100,6 +1111,10 @@ public static class GetCloudScriptUrlRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetCloudScriptUrlResult { /** * URL of the Cloud Script logic server. @@ -1132,6 +1147,10 @@ public static class GetContentDownloadUrlResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetFriendLeaderboardAroundCurrentUserRequest { /** * Statistic used to rank players for this leaderboard. @@ -1152,6 +1171,10 @@ public static class GetFriendLeaderboardAroundCurrentUserRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetFriendLeaderboardAroundCurrentUserResult { /** * Ordered listing of users and their positions in the requested leaderboard. @@ -1264,6 +1287,10 @@ public static class GetLeaderboardAroundCharacterResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetLeaderboardAroundCurrentUserRequest { /** * Statistic used to rank players for this leaderboard. @@ -1276,6 +1303,10 @@ public static class GetLeaderboardAroundCurrentUserRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetLeaderboardAroundCurrentUserResult { /** * Ordered listing of users and their positions in the requested leaderboard. @@ -1549,6 +1580,30 @@ public static class GetPlayerStatisticVersionsResult { } + public static class GetPlayerTagsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Optional namespace to filter results by + */ + public String Namespace; + + } + + public static class GetPlayerTagsResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Canonical tags (including namespace and tag's name) for the requested user + */ + public ArrayList Tags; + + } + public static class GetPlayerTradesRequest { /** * Returns only trades with the given status. If null, returns all trades. @@ -1651,8 +1706,9 @@ public static class GetPlayFabIDsFromKongregateIDsResult { public static class GetPlayFabIDsFromSteamIDsRequest { /** - * Deprecated: Please use SteamStringIDs + * @deprecated Please use SteamStringIDs instead. */ + @Deprecated public ArrayList SteamIDs; /** * Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. @@ -1799,6 +1855,22 @@ public static class GetStoreItemsResult { */ @Unordered("ItemId") public ArrayList Store; + /** + * How the store was last updated (Admin or a third party). + */ + public SourceType Source; + /** + * The base catalog that this store is a part of. + */ + public String CatalogVersion; + /** + * The ID of this store. + */ + public String StoreId; + /** + * Additional data about the store. + */ + public StoreMarketingModel MarketingData; } @@ -1854,6 +1926,10 @@ public static class GetTradeStatusResponse { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserCombinedInfoRequest { /** * Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no other lookup identifier set. @@ -1902,6 +1978,10 @@ public static class GetUserCombinedInfoRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserCombinedInfoResult { /** * Unique PlayFab identifier of the owner of the combined info. @@ -1992,10 +2072,18 @@ public static class GetUserInventoryResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsResult { /** * User statistics for the active title. @@ -2047,8 +2135,9 @@ public static class GrantCharacterToUserResult { public Boolean Result; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -2117,7 +2206,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class ItemPurchaseRequest { @@ -2296,6 +2384,10 @@ public static class ListUsersCharactersResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventRequest { /** * Optional timestamp for this event. If null, the a timestamp is auto-assigned to the event on the server. @@ -2316,6 +2408,10 @@ public static class LogEventRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventResult { } @@ -2470,8 +2566,9 @@ public static class LoginWithGoogleAccountRequest { */ public Boolean CreateAccount; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public String PublisherId; /** * Flags for which pieces of info to return for the user. @@ -2639,8 +2736,9 @@ public static class MatchmakeRequest { */ public CollectionFilter TagFilter; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public Boolean EnableQueue; } @@ -2989,8 +3087,9 @@ public static class RegisterPlayFabUserRequest { */ public String DisplayName; /** - * The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. + * @deprecated Do not use */ + @Deprecated public String Origination; } @@ -3091,6 +3190,10 @@ public static class RestoreIOSPurchasesResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class RunCloudScriptRequest { /** * server action to trigger @@ -3107,6 +3210,10 @@ public static class RunCloudScriptRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class RunCloudScriptResult { /** * id of Cloud Script run @@ -3165,8 +3272,9 @@ public static class SendAccountRecoveryEmailRequest { */ public String TitleId; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public String PublisherId; } @@ -3211,6 +3319,15 @@ public static class SharedGroupDataRecord { } + public static enum SourceType { + Admin, + BackEnd, + GameClient, + GameServer, + Partner, + Stream + } + public static class StartGameRequest { /** * version information for the build of the game server which is to be started @@ -3349,8 +3466,9 @@ public static class StatisticValue { public static class SteamPlayFabIdPair { /** - * Deprecated: Please use SteamStringId + * @deprecated Please use SteamStringId instead. */ + @Deprecated public Long SteamId; /** * Unique Steam identifier for a user. @@ -3362,28 +3480,55 @@ public static class SteamPlayFabIdPair { public String PlayFabId; } + /** - * A store entry that list a catalog item at a particular price + * A store entry that list a catalog item at a particular price */ public static class StoreItem implements Comparable { /** - * unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog */ public String ItemId; /** - * price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + * Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) */ public Map VirtualCurrencyPrices; /** - * override prices for this item for specific currencies + * Override prices for this item for specific currencies */ public Map RealCurrencyPrices; + /** + * Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + */ + public Object CustomData; + /** + * Intended display position for this item. Note that 0 is the first position + */ + public Long DisplayPosition; public int compareTo(StoreItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } + } + + /** + * Marketing data about a specific store + */ + public static class StoreMarketingModel { + /** + * Display name of a store as it will appear to users. + */ + public String DisplayName; + /** + * Tagline for a store. + */ + public String Description; + /** + * Custom data about a store. + */ + public Object Metadata; } @@ -3772,6 +3917,10 @@ public static class UpdateUserDataResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsRequest { /** * Statistics to be updated with the provided values. UserStatistics object must follow the Key(string), Value(int) pattern. @@ -3780,6 +3929,10 @@ public static class UpdateUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsResult { } @@ -3883,9 +4036,10 @@ public static class UserCustomIdInfo { public String CustomId; } + /** - * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - */ + * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. + */ public static enum UserDataPermission { Private, Public diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java index d6f2ec8ea..045a76723 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java @@ -248,7 +248,9 @@ public static enum PlayFabErrorCode { SessionLogNotFound(1244), InvalidSearchTerm(1245), TwoFactorAuthenticationTokenRequired(1246), - GameServerHostCountLimitExceeded(1247); + GameServerHostCountLimitExceeded(1247), + PlayerTagCountLimitExceeded(1248), + RequestAlreadyRunning(1249); public int id; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java b/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java index 224d4ca68..60fe6138a 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java @@ -3,9 +3,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.34.160822"; - public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.34.160822"; + public static String SdkVersion = "0.35.160829"; + public static String BuildIdentifier = "jbuild_javasdk_1"; + public static String SdkVersionString = "JavaSDK-0.35.160829"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler; diff --git a/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java b/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java index 3a5800738..e0da889d8 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java @@ -4134,6 +4134,64 @@ private static PlayFabResult privateResetCharact return pfResult; } + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AddPlayerTagAsync(final AddPlayerTagRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddPlayerTagAsync(request); + } + }); + } + + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AddPlayerTag(final AddPlayerTagRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddPlayerTagAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAddPlayerTagAsync(final AddPlayerTagRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/AddPlayerTag", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + AddPlayerTagResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. */ @@ -4307,4 +4365,120 @@ private static PlayFabResult privateGetPlayersInSegme pfResult.Result = result; return pfResult; } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerTagsAsync(final GetPlayerTagsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerTags(final GetPlayerTagsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerTagsAsync(final GetPlayerTagsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/GetPlayerTags", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + GetPlayerTagsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemovePlayerTagAsync(final RemovePlayerTagRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemovePlayerTagAsync(request); + } + }); + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemovePlayerTag(final RemovePlayerTagRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemovePlayerTagAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemovePlayerTagAsync(final RemovePlayerTagRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/RemovePlayerTag", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + RemovePlayerTagResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } } diff --git a/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java b/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java index b4eeac559..8a90a3ad7 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java @@ -45,6 +45,22 @@ public static class AddNewsResult { } + public static class AddPlayerTagRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Unique tag for player profile. + */ + public String TagName; + + } + + public static class AddPlayerTagResult { + + } + public static class AddServerBuildRequest { /** * unique identifier for the build executable @@ -144,8 +160,9 @@ public static class AddVirtualCurrencyTypesRequest { public ArrayList VirtualCurrencies; } + /** - * Contains information for a ban. + * Contains information for a ban. */ public static class BanInfo { /** @@ -182,8 +199,9 @@ public static class BanInfo { public Boolean Active; } + /** - * Represents a single ban request. + * Represents a single ban request. */ public static class BanRequest { /** @@ -228,8 +246,9 @@ public static class BanUsersResult { public static class BlankResult { } + /** - * A purchasable item from the item catalog + * A purchasable item from the item catalog */ public static class CatalogItem implements Comparable { /** @@ -297,13 +316,16 @@ public static class CatalogItem implements Comparable { * URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. */ public String ItemImageUrl; + /** + * if true, then only a fixed number can ever be granted. + */ + public Boolean IsLimitedEdition; public int compareTo(CatalogItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } - } public static class CatalogItemBundleInfo { @@ -339,8 +361,9 @@ public static class CatalogItemConsumableInfo { public String UsagePeriodGroup; } + /** - * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. + * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. */ public static class CatalogItemContainerInfo { /** @@ -963,6 +986,30 @@ public static class GetPlayerStatisticVersionsResult { } + public static class GetPlayerTagsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Optional namespace to filter results by + */ + public String Namespace; + + } + + public static class GetPlayerTagsResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Canonical tags (including namespace and tag's name) for the requested user + */ + public ArrayList Tags; + + } + public static class GetPublisherDataRequest { /** * array of keys to get back data from the Publisher data blob, set by the admin tools @@ -1018,8 +1065,9 @@ public static class GetServerBuildInfoRequest { public String BuildId; } + /** - * Information about a particular server build + * Information about a particular server build */ public static class GetServerBuildInfoResult implements Comparable { /** @@ -1065,7 +1113,6 @@ public int compareTo(GetServerBuildInfoResult other) { if (BuildId == null) return -1; return BuildId.compareTo(other.BuildId); } - } public static class GetServerBuildUploadURLRequest { @@ -1102,6 +1149,22 @@ public static class GetStoreItemsResult { */ @Unordered("ItemId") public ArrayList Store; + /** + * How the store was last updated (Admin or a third party). + */ + public SourceType Source; + /** + * The base catalog that this store is a part of. + */ + public String CatalogVersion; + /** + * The ID of this store. + */ + public String StoreId; + /** + * Additional data about the store. + */ + public StoreMarketingModel MarketingData; } @@ -1197,8 +1260,9 @@ public static class GetUserInventoryResult { public Map VirtualCurrencyRechargeTimes; } + /** - * Result of granting an item to a user + * Result of granting an item to a user */ public static class GrantedItemInstance implements Comparable { /** @@ -1279,7 +1343,6 @@ public int compareTo(GrantedItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class GrantItemsToUsersRequest { @@ -1346,8 +1409,9 @@ public static class ItemGrant { public ArrayList KeysToRemove; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -1416,7 +1480,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class ListBuildsRequest { @@ -1824,6 +1887,22 @@ public static enum Region { Australia } + public static class RemovePlayerTagRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Unique tag for player profile. + */ + public String TagName; + + } + + public static class RemovePlayerTagResult { + + } + public static class RemoveServerBuildRequest { /** * unique identifier of the previously uploaded build executable to be removed @@ -2045,6 +2124,15 @@ public static class SetupPushNotificationResult { } + public static enum SourceType { + Admin, + BackEnd, + GameClient, + GameServer, + Partner, + Stream + } + public static enum StatisticAggregationMethod { Last, Min, @@ -2067,28 +2155,55 @@ public static enum StatisticVersionArchivalStatus { InProgress, Complete } + /** - * A store entry that list a catalog item at a particular price + * A store entry that list a catalog item at a particular price */ public static class StoreItem implements Comparable { /** - * unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog */ public String ItemId; /** - * price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + * Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) */ public Map VirtualCurrencyPrices; /** - * override prices for this item for specific currencies + * Override prices for this item for specific currencies */ public Map RealCurrencyPrices; + /** + * Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + */ + public Object CustomData; + /** + * Intended display position for this item. Note that 0 is the first position + */ + public Long DisplayPosition; public int compareTo(StoreItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } + } + + /** + * Marketing data about a specific store + */ + public static class StoreMarketingModel { + /** + * Display name of a store as it will appear to users. + */ + public String DisplayName; + /** + * Tagline for a store. + */ + public String Description; + /** + * Custom data about a store. + */ + public Object Metadata; } @@ -2115,8 +2230,9 @@ public static enum TitleActivationStatus { ActivatedSteam, RevokedSteam } + /** - * Represents a single update ban request. + * Represents a single update ban request. */ public static class UpdateBanRequest { /** @@ -2188,8 +2304,9 @@ public static class UpdateCatalogItemsResult { public static class UpdateCloudScriptRequest { /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public Integer Version; /** * List of Cloud Script files to upload to create the new revision. Must have at least one file. @@ -2260,15 +2377,19 @@ public static class UpdateRandomResultTablesResult { public static class UpdateStoreItemsRequest { /** - * catalog version of the store to update. If null, uses the default catalog. + * Catalog version of the store to update. If null, uses the default catalog. */ public String CatalogVersion; /** - * unqiue identifier for the store which is to be updated + * Unique identifier for the store which is to be updated */ public String StoreId; /** - * array of store items - references to catalog items, with specific pricing - to be added + * Additional data about the store + */ + public StoreMarketingModel MarketingData; + /** + * Array of store items - references to catalog items, with specific pricing - to be added */ public ArrayList Store; @@ -2437,9 +2558,10 @@ public static class UserCustomIdInfo { public String CustomId; } + /** - * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - */ + * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. + */ public static enum UserDataPermission { Private, Public diff --git a/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java b/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java index 0030d21d3..69fdedd15 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java @@ -1445,8 +1445,9 @@ private static PlayFabResult privateGetPlayFab } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) { return new FutureTask(new Callable>() { @@ -1457,8 +1458,9 @@ public PlayFabResult call() throws Exception { } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetUserCombinedInfo(final GetUserCombinedInfoRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -1475,8 +1477,9 @@ public PlayFabResult call() throws Exception { } /** - * NOTE: This call will be deprecated soon. For fetching the data for a given user use GetPlayerCombinedInfo. For looking up users from the client api, we are in the process of adding a new api call. Once that call is ready, this one will be deprecated. Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. + * @deprecated Please use GetPlayerCombinedInfo instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -2836,8 +2839,9 @@ private static PlayFabResult privateGetFriendLeaderboardAs } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) { return new FutureTask(new Callable>() { @@ -2848,8 +2852,9 @@ public PlayFabResult call() throws } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetFriendLeaderboardAroundCurrentUser(final GetFriendLeaderboardAroundCurrentUserRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -2866,8 +2871,9 @@ public PlayFabResult call() throws } /** - * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetFriendLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3010,8 +3016,9 @@ private static PlayFabResult privateGetLeaderboardAsync(fi } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) { return new FutureTask(new Callable>() { @@ -3022,8 +3029,9 @@ public PlayFabResult call() throws Except } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetLeaderboardAroundCurrentUser(final GetLeaderboardAroundCurrentUserRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3040,8 +3048,9 @@ public PlayFabResult call() throws Except } /** - * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user + * @deprecated Please use GetLeaderboardAroundPlayer instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3474,8 +3483,9 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetUserStatisticsAsync(final GetUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -3486,8 +3496,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetUserStatistics(final GetUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3504,8 +3515,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserStatisticsAsync(final GetUserStatisticsRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -3706,8 +3718,9 @@ private static PlayFabResult privateUpdateUserPublisherDat } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> UpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -3718,8 +3731,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult UpdateUserStatistics(final UpdateUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3736,8 +3750,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -5562,8 +5577,9 @@ private static PlayFabResult privateValidateGo } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> LogEventAsync(final LogEventRequest request) { return new FutureTask(new Callable>() { @@ -5574,8 +5590,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult LogEvent(final LogEventRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -5592,8 +5609,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateLogEventAsync(final LogEventRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -6142,8 +6160,9 @@ private static PlayFabResult privateExecuteCloudScript } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) { return new FutureTask(new Callable>() { @@ -6154,8 +6173,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetCloudScriptUrl(final GetCloudScriptUrlRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -6172,8 +6192,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -6201,8 +6222,9 @@ private static PlayFabResult privateGetCloudScriptUrlAs } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> RunCloudScriptAsync(final RunCloudScriptRequest request) { return new FutureTask(new Callable>() { @@ -6213,8 +6235,9 @@ public PlayFabResult call() throws Exception { } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult RunCloudScript(final RunCloudScriptRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -6231,8 +6254,9 @@ public PlayFabResult call() throws Exception { } /** - * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. + * @deprecated Please use ExecuteCloudScript instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateRunCloudScriptAsync(final RunCloudScriptRequest request) throws Exception { if (_authKey == null) throw new Exception ("Must be logged in to call this method"); @@ -7362,6 +7386,64 @@ private static PlayFabResult privateGetPlayerSegmentsAs return pfResult; } + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerTagsAsync(final GetPlayerTagsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerTags(final GetPlayerTagsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerTagsAsync(final GetPlayerTagsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTags", request, "X-Authorization", _authKey); + 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()); + GetPlayerTagsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + public static void MultiStepClientLogin(Boolean needsAttribution) { if (needsAttribution && !PlayFabSettings.DisableAdvertising && PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null) { PlayFabClientModels.AttributeInstallRequest request = new PlayFabClientModels.AttributeInstallRequest(); diff --git a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java index d2db8f907..f59dd22d7 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java @@ -208,8 +208,9 @@ public static class CartItem { public Map VCAmount; } + /** - * A purchasable item from the item catalog + * A purchasable item from the item catalog */ public static class CatalogItem implements Comparable { /** @@ -277,13 +278,16 @@ public static class CatalogItem implements Comparable { * URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. */ public String ItemImageUrl; + /** + * if true, then only a fixed number can ever be granted. + */ + public Boolean IsLimitedEdition; public int compareTo(CatalogItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } - } public static class CatalogItemBundleInfo { @@ -319,8 +323,9 @@ public static class CatalogItemConsumableInfo { public String UsagePeriodGroup; } + /** - * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. + * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. */ public static class CatalogItemContainerInfo { /** @@ -409,8 +414,9 @@ public static enum CloudScriptRevisionOption { Latest, Specific } + /** - * Collection filter to include and/or exclude collections with certain key-value pairs. The filter generates a collection set defined by Includes rules and then remove collections that matches the Excludes rules. A collection is considered matching a rule if the rule describes a subset of the collection. + * Collection filter to include and/or exclude collections with certain key-value pairs. The filter generates a collection set defined by Includes rules and then remove collections that matches the Excludes rules. A collection is considered matching a rule if the rule describes a subset of the collection. */ public static class CollectionFilter { /** @@ -475,8 +481,9 @@ public static class ConsumeItemResult { public Integer RemainingUses; } + /** - * A data container + * A data container */ public static class Container_Dictionary_String_String { /** @@ -1088,6 +1095,10 @@ public static class GetCharacterStatisticsResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetCloudScriptUrlRequest { /** * Cloud Script Version to use. Defaults to 1. @@ -1100,6 +1111,10 @@ public static class GetCloudScriptUrlRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetCloudScriptUrlResult { /** * URL of the Cloud Script logic server. @@ -1132,6 +1147,10 @@ public static class GetContentDownloadUrlResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetFriendLeaderboardAroundCurrentUserRequest { /** * Statistic used to rank players for this leaderboard. @@ -1152,6 +1171,10 @@ public static class GetFriendLeaderboardAroundCurrentUserRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetFriendLeaderboardAroundCurrentUserResult { /** * Ordered listing of users and their positions in the requested leaderboard. @@ -1264,6 +1287,10 @@ public static class GetLeaderboardAroundCharacterResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetLeaderboardAroundCurrentUserRequest { /** * Statistic used to rank players for this leaderboard. @@ -1276,6 +1303,10 @@ public static class GetLeaderboardAroundCurrentUserRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetLeaderboardAroundCurrentUserResult { /** * Ordered listing of users and their positions in the requested leaderboard. @@ -1549,6 +1580,30 @@ public static class GetPlayerStatisticVersionsResult { } + public static class GetPlayerTagsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Optional namespace to filter results by + */ + public String Namespace; + + } + + public static class GetPlayerTagsResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Canonical tags (including namespace and tag's name) for the requested user + */ + public ArrayList Tags; + + } + public static class GetPlayerTradesRequest { /** * Returns only trades with the given status. If null, returns all trades. @@ -1651,8 +1706,9 @@ public static class GetPlayFabIDsFromKongregateIDsResult { public static class GetPlayFabIDsFromSteamIDsRequest { /** - * Deprecated: Please use SteamStringIDs + * @deprecated Please use SteamStringIDs instead. */ + @Deprecated public ArrayList SteamIDs; /** * Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. @@ -1799,6 +1855,22 @@ public static class GetStoreItemsResult { */ @Unordered("ItemId") public ArrayList Store; + /** + * How the store was last updated (Admin or a third party). + */ + public SourceType Source; + /** + * The base catalog that this store is a part of. + */ + public String CatalogVersion; + /** + * The ID of this store. + */ + public String StoreId; + /** + * Additional data about the store. + */ + public StoreMarketingModel MarketingData; } @@ -1854,6 +1926,10 @@ public static class GetTradeStatusResponse { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserCombinedInfoRequest { /** * Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no other lookup identifier set. @@ -1902,6 +1978,10 @@ public static class GetUserCombinedInfoRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserCombinedInfoResult { /** * Unique PlayFab identifier of the owner of the combined info. @@ -1992,10 +2072,18 @@ public static class GetUserInventoryResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsResult { /** * User statistics for the active title. @@ -2047,8 +2135,9 @@ public static class GrantCharacterToUserResult { public Boolean Result; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -2117,7 +2206,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class ItemPurchaseRequest { @@ -2296,6 +2384,10 @@ public static class ListUsersCharactersResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventRequest { /** * Optional timestamp for this event. If null, the a timestamp is auto-assigned to the event on the server. @@ -2316,6 +2408,10 @@ public static class LogEventRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventResult { } @@ -2470,8 +2566,9 @@ public static class LoginWithGoogleAccountRequest { */ public Boolean CreateAccount; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public String PublisherId; /** * Flags for which pieces of info to return for the user. @@ -2639,8 +2736,9 @@ public static class MatchmakeRequest { */ public CollectionFilter TagFilter; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public Boolean EnableQueue; } @@ -2989,8 +3087,9 @@ public static class RegisterPlayFabUserRequest { */ public String DisplayName; /** - * The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. + * @deprecated Do not use */ + @Deprecated public String Origination; } @@ -3091,6 +3190,10 @@ public static class RestoreIOSPurchasesResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class RunCloudScriptRequest { /** * server action to trigger @@ -3107,6 +3210,10 @@ public static class RunCloudScriptRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class RunCloudScriptResult { /** * id of Cloud Script run @@ -3165,8 +3272,9 @@ public static class SendAccountRecoveryEmailRequest { */ public String TitleId; /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public String PublisherId; } @@ -3211,6 +3319,15 @@ public static class SharedGroupDataRecord { } + public static enum SourceType { + Admin, + BackEnd, + GameClient, + GameServer, + Partner, + Stream + } + public static class StartGameRequest { /** * version information for the build of the game server which is to be started @@ -3349,8 +3466,9 @@ public static class StatisticValue { public static class SteamPlayFabIdPair { /** - * Deprecated: Please use SteamStringId + * @deprecated Please use SteamStringId instead. */ + @Deprecated public Long SteamId; /** * Unique Steam identifier for a user. @@ -3362,28 +3480,55 @@ public static class SteamPlayFabIdPair { public String PlayFabId; } + /** - * A store entry that list a catalog item at a particular price + * A store entry that list a catalog item at a particular price */ public static class StoreItem implements Comparable { /** - * unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog */ public String ItemId; /** - * price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + * Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) */ public Map VirtualCurrencyPrices; /** - * override prices for this item for specific currencies + * Override prices for this item for specific currencies */ public Map RealCurrencyPrices; + /** + * Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + */ + public Object CustomData; + /** + * Intended display position for this item. Note that 0 is the first position + */ + public Long DisplayPosition; public int compareTo(StoreItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } + } + + /** + * Marketing data about a specific store + */ + public static class StoreMarketingModel { + /** + * Display name of a store as it will appear to users. + */ + public String DisplayName; + /** + * Tagline for a store. + */ + public String Description; + /** + * Custom data about a store. + */ + public Object Metadata; } @@ -3772,6 +3917,10 @@ public static class UpdateUserDataResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsRequest { /** * Statistics to be updated with the provided values. UserStatistics object must follow the Key(string), Value(int) pattern. @@ -3780,6 +3929,10 @@ public static class UpdateUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsResult { } @@ -3883,9 +4036,10 @@ public static class UserCustomIdInfo { public String CustomId; } + /** - * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - */ + * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. + */ public static enum UserDataPermission { Private, Public diff --git a/PlayFabSDK/src/com/playfab/PlayFabErrors.java b/PlayFabSDK/src/com/playfab/PlayFabErrors.java index d6f2ec8ea..045a76723 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabSDK/src/com/playfab/PlayFabErrors.java @@ -248,7 +248,9 @@ public static enum PlayFabErrorCode { SessionLogNotFound(1244), InvalidSearchTerm(1245), TwoFactorAuthenticationTokenRequired(1246), - GameServerHostCountLimitExceeded(1247); + GameServerHostCountLimitExceeded(1247), + PlayerTagCountLimitExceeded(1248), + RequestAlreadyRunning(1249); public int id; diff --git a/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java b/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java index d43aab61f..28a1814e6 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java @@ -24,8 +24,9 @@ public static class AuthUserResponse { public String PlayFabId; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -94,7 +95,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class PlayerJoinedRequest { diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java index 5f078d35f..18d9483fd 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java @@ -1293,8 +1293,9 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetUserStatisticsAsync(final GetUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -1305,8 +1306,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetUserStatistics(final GetUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -1323,8 +1325,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserStatisticsAsync(final GetUserStatisticsRequest request) throws Exception { if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); @@ -1757,8 +1760,9 @@ private static PlayFabResult privateUpdateUserReadOnlyData } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> UpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -1769,8 +1773,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult UpdateUserStatistics(final UpdateUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -1787,8 +1792,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) throws Exception { if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); @@ -3845,8 +3851,9 @@ private static PlayFabResult privateAwardSteamAchie } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> LogEventAsync(final LogEventRequest request) { return new FutureTask(new Callable>() { @@ -3857,8 +3864,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult LogEvent(final LogEventRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3875,8 +3883,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateLogEventAsync(final LogEventRequest request) throws Exception { if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); @@ -5352,6 +5361,64 @@ private static PlayFabResult privateUpdateCharacterRe return pfResult; } + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AddPlayerTagAsync(final AddPlayerTagRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddPlayerTagAsync(request); + } + }); + } + + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AddPlayerTag(final AddPlayerTagRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddPlayerTagAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAddPlayerTagAsync(final AddPlayerTagRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/AddPlayerTag", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + AddPlayerTagResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. */ @@ -5525,4 +5592,120 @@ private static PlayFabResult privateGetPlayersInSegme pfResult.Result = result; return pfResult; } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerTagsAsync(final GetPlayerTagsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerTags(final GetPlayerTagsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerTagsAsync(final GetPlayerTagsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/GetPlayerTags", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + GetPlayerTagsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemovePlayerTagAsync(final RemovePlayerTagRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemovePlayerTagAsync(request); + } + }); + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemovePlayerTag(final RemovePlayerTagRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemovePlayerTagAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemovePlayerTagAsync(final RemovePlayerTagRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/RemovePlayerTag", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + RemovePlayerTagResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } } diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java index 1651894f9..5630946d8 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java @@ -41,6 +41,22 @@ public static class AddCharacterVirtualCurrencyRequest { } + public static class AddPlayerTagRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Unique tag for player profile. + */ + public String TagName; + + } + + public static class AddPlayerTagResult { + + } + public static class AddSharedGroupMembersRequest { /** * Unique identifier for the shared group. @@ -120,8 +136,9 @@ public static class AwardSteamAchievementResult { public ArrayList AchievementResults; } + /** - * Contains information for a ban. + * Contains information for a ban. */ public static class BanInfo { /** @@ -158,8 +175,9 @@ public static class BanInfo { public Boolean Active; } + /** - * Represents a single ban request. + * Represents a single ban request. */ public static class BanRequest { /** @@ -200,8 +218,9 @@ public static class BanUsersResult { public ArrayList BanData; } + /** - * A purchasable item from the item catalog + * A purchasable item from the item catalog */ public static class CatalogItem implements Comparable { /** @@ -269,13 +288,16 @@ public static class CatalogItem implements Comparable { * URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. */ public String ItemImageUrl; + /** + * if true, then only a fixed number can ever be granted. + */ + public Boolean IsLimitedEdition; public int compareTo(CatalogItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } - } public static class CatalogItemBundleInfo { @@ -311,8 +333,9 @@ public static class CatalogItemConsumableInfo { public String UsagePeriodGroup; } + /** - * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. + * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. */ public static class CatalogItemContainerInfo { /** @@ -1325,6 +1348,30 @@ public static class GetPlayerStatisticVersionsResult { } + public static class GetPlayerTagsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Optional namespace to filter results by + */ + public String Namespace; + + } + + public static class GetPlayerTagsResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Canonical tags (including namespace and tag's name) for the requested user + */ + public ArrayList Tags; + + } + public static class GetPlayFabIDsFromFacebookIDsRequest { /** * Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. @@ -1343,8 +1390,9 @@ public static class GetPlayFabIDsFromFacebookIDsResult { public static class GetPlayFabIDsFromSteamIDsRequest { /** - * Deprecated: Please use SteamStringIDs + * @deprecated Please use SteamStringIDs instead. */ + @Deprecated public ArrayList SteamIDs; /** * Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. @@ -1566,6 +1614,10 @@ public static class GetUserInventoryResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsRequest { /** * User for whom statistics are being requested. @@ -1574,6 +1626,10 @@ public static class GetUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsResult { /** * PlayFab unique identifier of the user whose statistics are being returned. @@ -1609,8 +1665,9 @@ public static class GrantCharacterToUserResult { public String CharacterId; } + /** - * Result of granting an item to a user + * Result of granting an item to a user */ public static class GrantedItemInstance implements Comparable { /** @@ -1691,7 +1748,6 @@ public int compareTo(GrantedItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class GrantItemsToCharacterRequest { @@ -1802,8 +1858,9 @@ public static class ItemGrant { public ArrayList KeysToRemove; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -1872,7 +1929,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class ListUsersCharactersRequest { @@ -1891,6 +1947,10 @@ public static class ListUsersCharactersResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventRequest { /** * PlayFab User Id of the player associated with this event. For non-player associated events, this must be null and EntityId must be set. @@ -1923,6 +1983,10 @@ public static class LogEventRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventResult { } @@ -2349,6 +2413,22 @@ public static class RedeemMatchmakerTicketResult { } + public static class RemovePlayerTagRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Unique tag for player profile. + */ + public String TagName; + + } + + public static class RemovePlayerTagResult { + + } + public static class RemoveSharedGroupMembersRequest { /** * Unique identifier for the shared group. @@ -2636,8 +2716,9 @@ public static class StatisticValue { public static class SteamPlayFabIdPair { /** - * Deprecated: Please use SteamStringId + * @deprecated Please use SteamStringId instead. */ + @Deprecated public Long SteamId; /** * Unique Steam identifier for a user. @@ -2777,8 +2858,9 @@ public static class UnlockContainerItemResult { public Map VirtualCurrency; } + /** - * Represents a single update ban request. + * Represents a single update ban request. */ public static class UpdateBanRequest { /** @@ -2988,6 +3070,10 @@ public static class UpdateUserInventoryItemDataRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -3000,6 +3086,10 @@ public static class UpdateUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsResult { } @@ -3087,9 +3177,10 @@ public static class UserCustomIdInfo { public String CustomId; } + /** - * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - */ + * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. + */ public static enum UserDataPermission { Private, Public diff --git a/PlayFabSDK/src/com/playfab/PlayFabSettings.java b/PlayFabSDK/src/com/playfab/PlayFabSettings.java index f6d5a266d..0ae8a6621 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabSettings.java +++ b/PlayFabSDK/src/com/playfab/PlayFabSettings.java @@ -3,9 +3,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.34.160822"; - public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.34.160822"; + public static String SdkVersion = "0.35.160829"; + public static String BuildIdentifier = "jbuild_javasdk_1"; + public static String SdkVersionString = "JavaSDK-0.35.160829"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java b/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java index 3a5800738..e0da889d8 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java @@ -4134,6 +4134,64 @@ private static PlayFabResult privateResetCharact return pfResult; } + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AddPlayerTagAsync(final AddPlayerTagRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddPlayerTagAsync(request); + } + }); + } + + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AddPlayerTag(final AddPlayerTagRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddPlayerTagAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAddPlayerTagAsync(final AddPlayerTagRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/AddPlayerTag", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + AddPlayerTagResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. */ @@ -4307,4 +4365,120 @@ private static PlayFabResult privateGetPlayersInSegme pfResult.Result = result; return pfResult; } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerTagsAsync(final GetPlayerTagsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerTags(final GetPlayerTagsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerTagsAsync(final GetPlayerTagsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/GetPlayerTags", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + GetPlayerTagsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemovePlayerTagAsync(final RemovePlayerTagRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemovePlayerTagAsync(request); + } + }); + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemovePlayerTag(final RemovePlayerTagRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemovePlayerTagAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemovePlayerTagAsync(final RemovePlayerTagRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/RemovePlayerTag", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + RemovePlayerTagResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } } diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java index b4eeac559..8a90a3ad7 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java @@ -45,6 +45,22 @@ public static class AddNewsResult { } + public static class AddPlayerTagRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Unique tag for player profile. + */ + public String TagName; + + } + + public static class AddPlayerTagResult { + + } + public static class AddServerBuildRequest { /** * unique identifier for the build executable @@ -144,8 +160,9 @@ public static class AddVirtualCurrencyTypesRequest { public ArrayList VirtualCurrencies; } + /** - * Contains information for a ban. + * Contains information for a ban. */ public static class BanInfo { /** @@ -182,8 +199,9 @@ public static class BanInfo { public Boolean Active; } + /** - * Represents a single ban request. + * Represents a single ban request. */ public static class BanRequest { /** @@ -228,8 +246,9 @@ public static class BanUsersResult { public static class BlankResult { } + /** - * A purchasable item from the item catalog + * A purchasable item from the item catalog */ public static class CatalogItem implements Comparable { /** @@ -297,13 +316,16 @@ public static class CatalogItem implements Comparable { * URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. */ public String ItemImageUrl; + /** + * if true, then only a fixed number can ever be granted. + */ + public Boolean IsLimitedEdition; public int compareTo(CatalogItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } - } public static class CatalogItemBundleInfo { @@ -339,8 +361,9 @@ public static class CatalogItemConsumableInfo { public String UsagePeriodGroup; } + /** - * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. + * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. */ public static class CatalogItemContainerInfo { /** @@ -963,6 +986,30 @@ public static class GetPlayerStatisticVersionsResult { } + public static class GetPlayerTagsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Optional namespace to filter results by + */ + public String Namespace; + + } + + public static class GetPlayerTagsResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Canonical tags (including namespace and tag's name) for the requested user + */ + public ArrayList Tags; + + } + public static class GetPublisherDataRequest { /** * array of keys to get back data from the Publisher data blob, set by the admin tools @@ -1018,8 +1065,9 @@ public static class GetServerBuildInfoRequest { public String BuildId; } + /** - * Information about a particular server build + * Information about a particular server build */ public static class GetServerBuildInfoResult implements Comparable { /** @@ -1065,7 +1113,6 @@ public int compareTo(GetServerBuildInfoResult other) { if (BuildId == null) return -1; return BuildId.compareTo(other.BuildId); } - } public static class GetServerBuildUploadURLRequest { @@ -1102,6 +1149,22 @@ public static class GetStoreItemsResult { */ @Unordered("ItemId") public ArrayList Store; + /** + * How the store was last updated (Admin or a third party). + */ + public SourceType Source; + /** + * The base catalog that this store is a part of. + */ + public String CatalogVersion; + /** + * The ID of this store. + */ + public String StoreId; + /** + * Additional data about the store. + */ + public StoreMarketingModel MarketingData; } @@ -1197,8 +1260,9 @@ public static class GetUserInventoryResult { public Map VirtualCurrencyRechargeTimes; } + /** - * Result of granting an item to a user + * Result of granting an item to a user */ public static class GrantedItemInstance implements Comparable { /** @@ -1279,7 +1343,6 @@ public int compareTo(GrantedItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class GrantItemsToUsersRequest { @@ -1346,8 +1409,9 @@ public static class ItemGrant { public ArrayList KeysToRemove; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -1416,7 +1480,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class ListBuildsRequest { @@ -1824,6 +1887,22 @@ public static enum Region { Australia } + public static class RemovePlayerTagRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Unique tag for player profile. + */ + public String TagName; + + } + + public static class RemovePlayerTagResult { + + } + public static class RemoveServerBuildRequest { /** * unique identifier of the previously uploaded build executable to be removed @@ -2045,6 +2124,15 @@ public static class SetupPushNotificationResult { } + public static enum SourceType { + Admin, + BackEnd, + GameClient, + GameServer, + Partner, + Stream + } + public static enum StatisticAggregationMethod { Last, Min, @@ -2067,28 +2155,55 @@ public static enum StatisticVersionArchivalStatus { InProgress, Complete } + /** - * A store entry that list a catalog item at a particular price + * A store entry that list a catalog item at a particular price */ public static class StoreItem implements Comparable { /** - * unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog + * Unique identifier of the item as it exists in the catalog - note that this must exactly match the ItemId from the catalog */ public String ItemId; /** - * price of this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) + * Override prices for this item in virtual currencies and "RM" (the base Real Money purchase price, in USD pennies) */ public Map VirtualCurrencyPrices; /** - * override prices for this item for specific currencies + * Override prices for this item for specific currencies */ public Map RealCurrencyPrices; + /** + * Store specific custom data. The data only exists as part of this store; it is not transferred to item instances + */ + public Object CustomData; + /** + * Intended display position for this item. Note that 0 is the first position + */ + public Long DisplayPosition; public int compareTo(StoreItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } + } + + /** + * Marketing data about a specific store + */ + public static class StoreMarketingModel { + /** + * Display name of a store as it will appear to users. + */ + public String DisplayName; + /** + * Tagline for a store. + */ + public String Description; + /** + * Custom data about a store. + */ + public Object Metadata; } @@ -2115,8 +2230,9 @@ public static enum TitleActivationStatus { ActivatedSteam, RevokedSteam } + /** - * Represents a single update ban request. + * Represents a single update ban request. */ public static class UpdateBanRequest { /** @@ -2188,8 +2304,9 @@ public static class UpdateCatalogItemsResult { public static class UpdateCloudScriptRequest { /** - * Deprecated - Do not use + * @deprecated Do not use */ + @Deprecated public Integer Version; /** * List of Cloud Script files to upload to create the new revision. Must have at least one file. @@ -2260,15 +2377,19 @@ public static class UpdateRandomResultTablesResult { public static class UpdateStoreItemsRequest { /** - * catalog version of the store to update. If null, uses the default catalog. + * Catalog version of the store to update. If null, uses the default catalog. */ public String CatalogVersion; /** - * unqiue identifier for the store which is to be updated + * Unique identifier for the store which is to be updated */ public String StoreId; /** - * array of store items - references to catalog items, with specific pricing - to be added + * Additional data about the store + */ + public StoreMarketingModel MarketingData; + /** + * Array of store items - references to catalog items, with specific pricing - to be added */ public ArrayList Store; @@ -2437,9 +2558,10 @@ public static class UserCustomIdInfo { public String CustomId; } + /** - * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - */ + * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. + */ public static enum UserDataPermission { Private, Public diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java index d6f2ec8ea..045a76723 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java @@ -248,7 +248,9 @@ public static enum PlayFabErrorCode { SessionLogNotFound(1244), InvalidSearchTerm(1245), TwoFactorAuthenticationTokenRequired(1246), - GameServerHostCountLimitExceeded(1247); + GameServerHostCountLimitExceeded(1247), + PlayerTagCountLimitExceeded(1248), + RequestAlreadyRunning(1249); public int id; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java index d43aab61f..28a1814e6 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java @@ -24,8 +24,9 @@ public static class AuthUserResponse { public String PlayFabId; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -94,7 +95,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class PlayerJoinedRequest { diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java index 5f078d35f..18d9483fd 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java @@ -1293,8 +1293,9 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> GetUserStatisticsAsync(final GetUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -1305,8 +1306,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult GetUserStatistics(final GetUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -1323,8 +1325,9 @@ public PlayFabResult call() throws Exception { } /** - * Retrieves the details of all title-specific statistics for the user + * @deprecated Please use GetPlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserStatisticsAsync(final GetUserStatisticsRequest request) throws Exception { if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); @@ -1757,8 +1760,9 @@ private static PlayFabResult privateUpdateUserReadOnlyData } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> UpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) { return new FutureTask(new Callable>() { @@ -1769,8 +1773,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult UpdateUserStatistics(final UpdateUserStatisticsRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -1787,8 +1792,9 @@ public PlayFabResult call() throws Exception { } /** - * Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features. + * @deprecated Please use UpdatePlayerStatistics instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) throws Exception { if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); @@ -3845,8 +3851,9 @@ private static PlayFabResult privateAwardSteamAchie } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static FutureTask> LogEventAsync(final LogEventRequest request) { return new FutureTask(new Callable>() { @@ -3857,8 +3864,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") public static PlayFabResult LogEvent(final LogEventRequest request) { FutureTask> task = new FutureTask(new Callable>() { @@ -3875,8 +3883,9 @@ public PlayFabResult call() throws Exception { } /** - * Logs a custom analytics event + * @deprecated Please use WritePlayerEvent instead. */ + @Deprecated @SuppressWarnings("unchecked") private static PlayFabResult privateLogEventAsync(final LogEventRequest request) throws Exception { if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); @@ -5352,6 +5361,64 @@ private static PlayFabResult privateUpdateCharacterRe return pfResult; } + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AddPlayerTagAsync(final AddPlayerTagRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddPlayerTagAsync(request); + } + }); + } + + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AddPlayerTag(final AddPlayerTagRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddPlayerTagAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Adds a given tag to a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAddPlayerTagAsync(final AddPlayerTagRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/AddPlayerTag", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + AddPlayerTagResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves an array of player segment definitions. Results from this can be used in subsequent API calls such as GetPlayersInSegment which requires a Segment ID. While segment names can change the ID for that segment will not change. */ @@ -5525,4 +5592,120 @@ private static PlayFabResult privateGetPlayersInSegme pfResult.Result = result; return pfResult; } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerTagsAsync(final GetPlayerTagsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerTags(final GetPlayerTagsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerTagsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get all tags with a given Namespace (optional) from a player profile. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerTagsAsync(final GetPlayerTagsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/GetPlayerTags", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + GetPlayerTagsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemovePlayerTagAsync(final RemovePlayerTagRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemovePlayerTagAsync(request); + } + }); + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemovePlayerTag(final RemovePlayerTagRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemovePlayerTagAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Remove a given tag from a player profile. The tag's namespace is automatically generated based on the source of the tag. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemovePlayerTagAsync(final RemovePlayerTagRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/RemovePlayerTag", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey); + 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()); + RemovePlayerTagResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } } diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java index 1651894f9..5630946d8 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java @@ -41,6 +41,22 @@ public static class AddCharacterVirtualCurrencyRequest { } + public static class AddPlayerTagRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Unique tag for player profile. + */ + public String TagName; + + } + + public static class AddPlayerTagResult { + + } + public static class AddSharedGroupMembersRequest { /** * Unique identifier for the shared group. @@ -120,8 +136,9 @@ public static class AwardSteamAchievementResult { public ArrayList AchievementResults; } + /** - * Contains information for a ban. + * Contains information for a ban. */ public static class BanInfo { /** @@ -158,8 +175,9 @@ public static class BanInfo { public Boolean Active; } + /** - * Represents a single ban request. + * Represents a single ban request. */ public static class BanRequest { /** @@ -200,8 +218,9 @@ public static class BanUsersResult { public ArrayList BanData; } + /** - * A purchasable item from the item catalog + * A purchasable item from the item catalog */ public static class CatalogItem implements Comparable { /** @@ -269,13 +288,16 @@ public static class CatalogItem implements Comparable { * URL to the item image. For Facebook purchase to display the image on the item purchase page, this must be set to an HTTP URL. */ public String ItemImageUrl; + /** + * if true, then only a fixed number can ever be granted. + */ + public Boolean IsLimitedEdition; public int compareTo(CatalogItem other) { if (other == null || other.ItemId == null) return 1; if (ItemId == null) return -1; return ItemId.compareTo(other.ItemId); } - } public static class CatalogItemBundleInfo { @@ -311,8 +333,9 @@ public static class CatalogItemConsumableInfo { public String UsagePeriodGroup; } + /** - * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. + * Containers are inventory items that can hold other items defined in the catalog, as well as virtual currency, which is added to the player inventory when the container is unlocked, using the UnlockContainerItem API. The items can be anything defined in the catalog, as well as RandomResultTable objects which will be resolved when the container is unlocked. Containers and their keys should be defined as Consumable (having a limited number of uses) in their catalog defintiions, unless the intent is for the player to be able to re-use them infinitely. */ public static class CatalogItemContainerInfo { /** @@ -1325,6 +1348,30 @@ public static class GetPlayerStatisticVersionsResult { } + public static class GetPlayerTagsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Optional namespace to filter results by + */ + public String Namespace; + + } + + public static class GetPlayerTagsResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Canonical tags (including namespace and tag's name) for the requested user + */ + public ArrayList Tags; + + } + public static class GetPlayFabIDsFromFacebookIDsRequest { /** * Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. @@ -1343,8 +1390,9 @@ public static class GetPlayFabIDsFromFacebookIDsResult { public static class GetPlayFabIDsFromSteamIDsRequest { /** - * Deprecated: Please use SteamStringIDs + * @deprecated Please use SteamStringIDs instead. */ + @Deprecated public ArrayList SteamIDs; /** * Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. @@ -1566,6 +1614,10 @@ public static class GetUserInventoryResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsRequest { /** * User for whom statistics are being requested. @@ -1574,6 +1626,10 @@ public static class GetUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class GetUserStatisticsResult { /** * PlayFab unique identifier of the user whose statistics are being returned. @@ -1609,8 +1665,9 @@ public static class GrantCharacterToUserResult { public String CharacterId; } + /** - * Result of granting an item to a user + * Result of granting an item to a user */ public static class GrantedItemInstance implements Comparable { /** @@ -1691,7 +1748,6 @@ public int compareTo(GrantedItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class GrantItemsToCharacterRequest { @@ -1802,8 +1858,9 @@ public static class ItemGrant { public ArrayList KeysToRemove; } + /** - * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. + * A unique instance of an item in a user's inventory. Note, to retrieve additional information for an item instance (such as Tags, Description, or Custom Data that are set on the root catalog item), a call to GetCatalogItems is required. The Item ID of the instance can then be matched to a catalog entry, which contains the additional information. Also note that Custom Data is only set here from a call to UpdateUserInventoryItemCustomData. */ public static class ItemInstance implements Comparable { /** @@ -1872,7 +1929,6 @@ public int compareTo(ItemInstance other) { if (ItemInstanceId == null) return -1; return ItemInstanceId.compareTo(other.ItemInstanceId); } - } public static class ListUsersCharactersRequest { @@ -1891,6 +1947,10 @@ public static class ListUsersCharactersResult { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventRequest { /** * PlayFab User Id of the player associated with this event. For non-player associated events, this must be null and EntityId must be set. @@ -1923,6 +1983,10 @@ public static class LogEventRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class LogEventResult { } @@ -2349,6 +2413,22 @@ public static class RedeemMatchmakerTicketResult { } + public static class RemovePlayerTagRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Unique tag for player profile. + */ + public String TagName; + + } + + public static class RemovePlayerTagResult { + + } + public static class RemoveSharedGroupMembersRequest { /** * Unique identifier for the shared group. @@ -2636,8 +2716,9 @@ public static class StatisticValue { public static class SteamPlayFabIdPair { /** - * Deprecated: Please use SteamStringId + * @deprecated Please use SteamStringId instead. */ + @Deprecated public Long SteamId; /** * Unique Steam identifier for a user. @@ -2777,8 +2858,9 @@ public static class UnlockContainerItemResult { public Map VirtualCurrency; } + /** - * Represents a single update ban request. + * Represents a single update ban request. */ public static class UpdateBanRequest { /** @@ -2988,6 +3070,10 @@ public static class UpdateUserInventoryItemDataRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -3000,6 +3086,10 @@ public static class UpdateUserStatisticsRequest { } + /** + * @deprecated Do not use + */ + @Deprecated public static class UpdateUserStatisticsResult { } @@ -3087,9 +3177,10 @@ public static class UserCustomIdInfo { public String CustomId; } + /** - * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. - */ + * Indicates whether a given data key is private (readable only by the player) or public (readable by all players). When a player makes a GetUserData request about another player, only keys marked Public will be returned. + */ public static enum UserDataPermission { Private, Public diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java b/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java index ce2c03904..dd5d6d524 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java @@ -3,9 +3,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - public static String SdkVersion = "0.34.160822"; - public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.34.160822"; + public static String SdkVersion = "0.35.160829"; + public static String BuildIdentifier = "jbuild_javasdk_1"; + public static String SdkVersionString = "JavaSDK-0.35.160829"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler;