From 4cc6a366af571d2cefd208280842c25f8a63317a Mon Sep 17 00:00:00 2001 From: Paul Gilmore Date: Mon, 1 Aug 2016 17:42:45 -0700 Subject: [PATCH] https://api.playfab.com/releaseNotes/#160801 (#79) * Automated 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 * 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 * 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 build from Jenkins * Automated pf-main build from Jenkins * Automated pf-main 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 * Automated pf-main build from Jenkins * Automated pf-main 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 * Automated pf-main build from Jenkins --- .../java/com/playfab/PlayFabClientAPI.java | 232 +++++++++++ .../java/com/playfab/PlayFabClientModels.java | 94 ++++- .../main/java/com/playfab/PlayFabErrors.java | 11 +- .../java/com/playfab/PlayFabSettings.java | 6 +- .../src/com/playfab/PlayFabClientAPI.java | 232 +++++++++++ .../src/com/playfab/PlayFabClientModels.java | 94 ++++- .../src/com/playfab/PlayFabErrors.java | 11 +- .../src/com/playfab/PlayFabSettings.java | 6 +- .../src/com/playfab/PlayFabAdminAPI.java | 232 +++++++++++ .../src/com/playfab/PlayFabAdminModels.java | 241 ++++++++++- .../src/com/playfab/PlayFabClientAPI.java | 232 +++++++++++ .../src/com/playfab/PlayFabClientModels.java | 94 ++++- PlayFabSDK/src/com/playfab/PlayFabErrors.java | 11 +- .../com/playfab/PlayFabMatchmakerModels.java | 2 +- .../src/com/playfab/PlayFabServerAPI.java | 232 +++++++++++ .../src/com/playfab/PlayFabServerModels.java | 378 +++++++++++++++++- .../src/com/playfab/PlayFabSettings.java | 6 +- .../src/com/playfab/PlayFabAdminAPI.java | 232 +++++++++++ .../src/com/playfab/PlayFabAdminModels.java | 241 ++++++++++- .../src/com/playfab/PlayFabErrors.java | 11 +- .../com/playfab/PlayFabMatchmakerModels.java | 2 +- .../src/com/playfab/PlayFabServerAPI.java | 232 +++++++++++ .../src/com/playfab/PlayFabServerModels.java | 378 +++++++++++++++++- .../src/com/playfab/PlayFabSettings.java | 6 +- 24 files changed, 3179 insertions(+), 37 deletions(-) diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java index 62c6e13e..157b7aa5 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java @@ -807,6 +807,64 @@ private static PlayFabResult privateRegisterPlayFabUs return pfResult; } + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AddGenericIDAsync(final AddGenericIDRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddGenericIDAsync(request); + } + }); + } + + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AddGenericID(final AddGenericIDRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddGenericIDAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAddGenericIDAsync(final AddGenericIDRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddGenericID", 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()); + AddGenericIDResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Adds playfab username/password auth to an existing semi-anonymous account created via a 3rd party auth method. */ @@ -1097,6 +1155,64 @@ private static PlayFabResult privateGetPla return pfResult; } + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromGenericIDsAsync(final GetPlayFabIDsFromGenericIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGenericIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromGenericIDs(final GetPlayFabIDsFromGenericIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGenericIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromGenericIDsAsync(final GetPlayFabIDsFromGenericIDsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGenericIDs", 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()); + GetPlayFabIDsFromGenericIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. */ @@ -1909,6 +2025,64 @@ private static PlayFabResult privateLinkTwitchAsync(fin return pfResult; } + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemoveGenericIDAsync(final RemoveGenericIDRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveGenericIDAsync(request); + } + }); + } + + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemoveGenericID(final RemoveGenericIDRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveGenericIDAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemoveGenericIDAsync(final RemoveGenericIDRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveGenericID", 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()); + RemoveGenericIDResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. */ @@ -7131,6 +7305,64 @@ private static PlayFabResult privateAttributeInstallAsyn return pfResult; } + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerSegmentsAsync(final GetPlayerSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerSegments(final GetPlayerSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerSegmentsAsync(final GetPlayerSegmentsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerSegments", 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()); + GetPlayerSegmentsResult 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 6e3a7aab..b2776366 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java @@ -57,6 +57,18 @@ public static class AddFriendResult { } + public static class AddGenericIDRequest { + /** + * Generic service identifier to add to the player account. + */ + public GenericServiceId GenericId; + + } + + public static class AddGenericIDResult { + + } + public static class AddSharedGroupMembersRequest { /** * Unique identifier for the shared group. @@ -894,6 +906,30 @@ public static class GameServerRegionsResult { } + public static class GenericPlayFabIdPair { + /** + * Unique generic service identifier for a user. + */ + public GenericServiceId GenericId; + /** + * Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the given generic identifier. + */ + public String PlayFabId; + + } + + public static class GenericServiceId { + /** + * Name of the service for which the player has a unique identifier. + */ + public String ServiceName; + /** + * Unique identifier of the player in that service. + */ + public String UserId; + + } + public static class GetAccountInfoRequest { /** * Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no other lookup identifier set. @@ -1465,6 +1501,18 @@ public static class GetPlayerCombinedInfoResultPayload { } + public static class GetPlayerSegmentsRequest { + + } + + public static class GetPlayerSegmentsResult { + /** + * Array of segments the requested player currently belongs to. + */ + public ArrayList Segments; + + } + public static class GetPlayerStatisticsRequest { /** * statistics to return (current version will be returned for each) @@ -1553,6 +1601,22 @@ public static class GetPlayFabIDsFromGameCenterIDsResult { } + public static class GetPlayFabIDsFromGenericIDsRequest { + /** + * Array of unique generic service identifiers for which the title needs to get PlayFab identifiers. Currently limited to a maximum of 10 in a single request. + */ + public ArrayList GenericIDs; + + } + + public static class GetPlayFabIDsFromGenericIDsResult { + /** + * Mapping of generic service identifiers to PlayFab identifiers. + */ + public ArrayList Data; + + } + public static class GetPlayFabIDsFromGoogleIDsRequest { /** * Array of unique Google identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. @@ -1673,6 +1737,22 @@ public static class GetPurchaseResult { } + public static class GetSegmentResult { + /** + * Unique identifier for this segment. + */ + public String Id; + /** + * Segment name. + */ + public String Name; + /** + * Identifier of the segments AB Test, if it is attached to one. + */ + public String ABTestParent; + + } + public static class GetSharedGroupDataRequest { /** * Unique identifier for the shared group. @@ -1968,7 +2048,7 @@ public static class GrantCharacterToUserResult { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** @@ -2947,6 +3027,18 @@ public static class RemoveFriendResult { } + public static class RemoveGenericIDRequest { + /** + * Generic service identifier to be removed from the player. + */ + public GenericServiceId GenericId; + + } + + public static class RemoveGenericIDResult { + + } + public static class RemoveSharedGroupMembersRequest { /** * Unique identifier for the shared group. diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java index 8af2be31..8fbfd1ec 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java @@ -236,7 +236,16 @@ public static enum PlayFabErrorCode { InvalidTwitchToken(1232), TwitchResponseError(1233), ProfaneDisplayName(1234), - UserAlreadyAdded(1235); + UserAlreadyAdded(1235), + InvalidVirtualCurrencyCode(1236), + VirtualCurrencyCannotBeDeleted(1237), + IdentifierAlreadyClaimed(1238), + IdentifierNotLinked(1239), + InvalidContinuationToken(1240), + ExpiredContinuationToken(1241), + InvalidSegment(1242), + InvalidSessionId(1243), + SessionLogNotFound(1244); 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 c78a0558..151fca09 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.31.160725"; - public static String BuildIdentifier = "jbuild_javasdk_1"; - public static String SdkVersionString = "JavaSDK-0.31.160725"; + public static String SdkVersion = "0.32.160801"; + public static String BuildIdentifier = "jbuild_javasdk_0"; + public static String SdkVersionString = "JavaSDK-0.32.160801"; 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 db14da34..4dc0f2f9 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java @@ -806,6 +806,64 @@ private static PlayFabResult privateRegisterPlayFabUs return pfResult; } + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AddGenericIDAsync(final AddGenericIDRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddGenericIDAsync(request); + } + }); + } + + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AddGenericID(final AddGenericIDRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddGenericIDAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAddGenericIDAsync(final AddGenericIDRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddGenericID", 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()); + AddGenericIDResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Adds playfab username/password auth to an existing semi-anonymous account created via a 3rd party auth method. */ @@ -1096,6 +1154,64 @@ private static PlayFabResult privateGetPla return pfResult; } + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromGenericIDsAsync(final GetPlayFabIDsFromGenericIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGenericIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromGenericIDs(final GetPlayFabIDsFromGenericIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGenericIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromGenericIDsAsync(final GetPlayFabIDsFromGenericIDsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGenericIDs", 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()); + GetPlayFabIDsFromGenericIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. */ @@ -1908,6 +2024,64 @@ private static PlayFabResult privateLinkTwitchAsync(fin return pfResult; } + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemoveGenericIDAsync(final RemoveGenericIDRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveGenericIDAsync(request); + } + }); + } + + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemoveGenericID(final RemoveGenericIDRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveGenericIDAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemoveGenericIDAsync(final RemoveGenericIDRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveGenericID", 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()); + RemoveGenericIDResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. */ @@ -7130,6 +7304,64 @@ private static PlayFabResult privateAttributeInstallAsyn return pfResult; } + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerSegmentsAsync(final GetPlayerSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerSegments(final GetPlayerSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerSegmentsAsync(final GetPlayerSegmentsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerSegments", 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()); + GetPlayerSegmentsResult 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 6e3a7aab..b2776366 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java @@ -57,6 +57,18 @@ public static class AddFriendResult { } + public static class AddGenericIDRequest { + /** + * Generic service identifier to add to the player account. + */ + public GenericServiceId GenericId; + + } + + public static class AddGenericIDResult { + + } + public static class AddSharedGroupMembersRequest { /** * Unique identifier for the shared group. @@ -894,6 +906,30 @@ public static class GameServerRegionsResult { } + public static class GenericPlayFabIdPair { + /** + * Unique generic service identifier for a user. + */ + public GenericServiceId GenericId; + /** + * Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the given generic identifier. + */ + public String PlayFabId; + + } + + public static class GenericServiceId { + /** + * Name of the service for which the player has a unique identifier. + */ + public String ServiceName; + /** + * Unique identifier of the player in that service. + */ + public String UserId; + + } + public static class GetAccountInfoRequest { /** * Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no other lookup identifier set. @@ -1465,6 +1501,18 @@ public static class GetPlayerCombinedInfoResultPayload { } + public static class GetPlayerSegmentsRequest { + + } + + public static class GetPlayerSegmentsResult { + /** + * Array of segments the requested player currently belongs to. + */ + public ArrayList Segments; + + } + public static class GetPlayerStatisticsRequest { /** * statistics to return (current version will be returned for each) @@ -1553,6 +1601,22 @@ public static class GetPlayFabIDsFromGameCenterIDsResult { } + public static class GetPlayFabIDsFromGenericIDsRequest { + /** + * Array of unique generic service identifiers for which the title needs to get PlayFab identifiers. Currently limited to a maximum of 10 in a single request. + */ + public ArrayList GenericIDs; + + } + + public static class GetPlayFabIDsFromGenericIDsResult { + /** + * Mapping of generic service identifiers to PlayFab identifiers. + */ + public ArrayList Data; + + } + public static class GetPlayFabIDsFromGoogleIDsRequest { /** * Array of unique Google identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. @@ -1673,6 +1737,22 @@ public static class GetPurchaseResult { } + public static class GetSegmentResult { + /** + * Unique identifier for this segment. + */ + public String Id; + /** + * Segment name. + */ + public String Name; + /** + * Identifier of the segments AB Test, if it is attached to one. + */ + public String ABTestParent; + + } + public static class GetSharedGroupDataRequest { /** * Unique identifier for the shared group. @@ -1968,7 +2048,7 @@ public static class GrantCharacterToUserResult { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** @@ -2947,6 +3027,18 @@ public static class RemoveFriendResult { } + public static class RemoveGenericIDRequest { + /** + * Generic service identifier to be removed from the player. + */ + public GenericServiceId GenericId; + + } + + public static class RemoveGenericIDResult { + + } + public static class RemoveSharedGroupMembersRequest { /** * Unique identifier for the shared group. diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java index 8af2be31..8fbfd1ec 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java @@ -236,7 +236,16 @@ public static enum PlayFabErrorCode { InvalidTwitchToken(1232), TwitchResponseError(1233), ProfaneDisplayName(1234), - UserAlreadyAdded(1235); + UserAlreadyAdded(1235), + InvalidVirtualCurrencyCode(1236), + VirtualCurrencyCannotBeDeleted(1237), + IdentifierAlreadyClaimed(1238), + IdentifierNotLinked(1239), + InvalidContinuationToken(1240), + ExpiredContinuationToken(1241), + InvalidSegment(1242), + InvalidSessionId(1243), + SessionLogNotFound(1244); public int id; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java b/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java index 5ea2dfde..543f888a 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.31.160725"; - public static String BuildIdentifier = "jbuild_javasdk_1"; - public static String SdkVersionString = "JavaSDK-0.31.160725"; + public static String SdkVersion = "0.32.160801"; + public static String BuildIdentifier = "jbuild_javasdk_0"; + public static String SdkVersionString = "JavaSDK-0.32.160801"; 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 7727c731..a227acb2 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java @@ -1930,6 +1930,64 @@ private static PlayFabResult privateListVirtualC return pfResult; } + /** + * Removes one or more virtual currencies from the set defined for the title. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemoveVirtualCurrencyTypesAsync(final RemoveVirtualCurrencyTypesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveVirtualCurrencyTypesAsync(request); + } + }); + } + + /** + * Removes one or more virtual currencies from the set defined for the title. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemoveVirtualCurrencyTypes(final RemoveVirtualCurrencyTypesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveVirtualCurrencyTypesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Removes one or more virtual currencies from the set defined for the title. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemoveVirtualCurrencyTypesAsync(final RemoveVirtualCurrencyTypesRequest 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/RemoveVirtualCurrencyTypes", 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()); + BlankResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Creates the catalog configuration of all virtual goods for the specified catalog version */ @@ -3727,4 +3785,178 @@ private static PlayFabResult privateResetCharact 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. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetAllSegmentsAsync(final GetAllSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetAllSegmentsAsync(request); + } + }); + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetAllSegments(final GetAllSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetAllSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetAllSegmentsAsync(final GetAllSegmentsRequest 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/GetAllSegments", 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()); + GetAllSegmentsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerSegmentsAsync(final GetPlayersSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerSegments(final GetPlayersSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerSegmentsAsync(final GetPlayersSegmentsRequest 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/GetPlayerSegments", 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()); + GetPlayerSegmentsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayersInSegmentAsync(final GetPlayersInSegmentRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayersInSegmentAsync(request); + } + }); + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayersInSegment(final GetPlayersInSegmentRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayersInSegmentAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayersInSegmentAsync(final GetPlayersInSegmentRequest 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/GetPlayersInSegment", 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()); + GetPlayersInSegmentResult 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 c72b74da..e892ca98 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java @@ -5,6 +5,22 @@ public class PlayFabAdminModels { + public static class AdCampaignAttribution { + /** + * Attribution network name + */ + public String Platform; + /** + * Attribution campaign identifier + */ + public String CampaignId; + /** + * UTC time stamp of attribution + */ + public Date AttributedAt; + + } + public static class AddNewsRequest { /** * Time this news was published. If not set, defaults to now. @@ -553,6 +569,18 @@ public static class GameModeInfo { } + public static class GetAllSegmentsRequest { + + } + + public static class GetAllSegmentsResult { + /** + * Array of segments for this title. + */ + public ArrayList Segments; + + } + public static class GetCatalogItemsRequest { /** * Which catalog is being requested. @@ -759,6 +787,58 @@ public static class GetMatchmakerGameModesResult { } + public static class GetPlayerSegmentsResult { + /** + * Array of segments the requested player currently belongs to. + */ + public ArrayList Segments; + + } + + public static class GetPlayersInSegmentRequest { + /** + * Unique identifier for this segment. + */ + public String SegmentId; + /** + * Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + public Long SecondsToLive; + /** + * Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. + */ + public Long MaxBatchSize; + /** + * Continuation token if retrieving subsequent pages of results. + */ + public String ContinuationToken; + + } + + public static class GetPlayersInSegmentResult { + /** + * Count of profiles matching this segment. + */ + public Integer ProfilesInSegment; + /** + * Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. + */ + public String ContinuationToken; + /** + * Array of player profiles in this segment. + */ + public ArrayList PlayerProfiles; + + } + + public static class GetPlayersSegmentsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + public static class GetPlayerStatisticDefinitionsRequest { } @@ -819,6 +899,22 @@ public static class GetRandomResultTablesResult { } + public static class GetSegmentResult { + /** + * Unique identifier for this segment. + */ + public String Id; + /** + * Segment name. + */ + public String Name; + /** + * Identifier of the segments AB Test, if it is attached to one. + */ + public String ABTestParent; + + } + public static class GetServerBuildInfoRequest { /** * unique identifier of the previously uploaded build executable for which information is being requested @@ -1139,7 +1235,7 @@ public static class ItemGrant { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** @@ -1237,6 +1333,22 @@ public static class ListVirtualCurrencyTypesResult { } + public static enum LoginIdentityProvider { + Unknown, + PlayFab, + Custom, + GameCenter, + GooglePlay, + Steam, + XBoxLive, + PSN, + Kongregate, + Facebook, + IOSDevice, + AndroidDevice, + Twitch + } + public static class LookupUserAccountInfoRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1381,6 +1493,102 @@ public static class ModifyUserVirtualCurrencyResult { } + public static class PlayerLinkedAccount { + /** + * Authentication platform + */ + public LoginIdentityProvider Platform; + /** + * Platform user identifier + */ + public String PlatformUserId; + /** + * Linked account's username + */ + public String Username; + /** + * Linked account's email + */ + public String Email; + + } + + public static class PlayerProfile { + /** + * PlayFab Player ID + */ + public String PlayerId; + /** + * Title ID this profile applies to + */ + public String TitleId; + /** + * Player Display Name + */ + public String DisplayName; + /** + * Player account origination + */ + public LoginIdentityProvider Origination; + /** + * Player record created + */ + public Date Created; + /** + * Last login + */ + public Date LastLogin; + /** + * Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. + */ + public Date BannedUntil; + /** + * Dictionary of player's statistics using only the latest version's value + */ + public Map Statistics; + /** + * Dictionary of player's virtual currency balances + */ + public Map VirtualCurrencyBalances; + /** + * Array of ad campaigns player has been attributed to + */ + public ArrayList AdCampaignAttributions; + /** + * Array of configured push notification end points + */ + public ArrayList PushNotificationRegistrations; + /** + * Array of third party accounts linked to this player + */ + public ArrayList LinkedAccounts; + /** + * Array of player statistics + */ + public ArrayList PlayerStatistics; + + } + + public static class PlayerStatistic { + /** + * Statistic ID + */ + public String Id; + /** + * Statistic version (0 if not a versioned statistic) + */ + public Integer StatisticVersion; + /** + * Current statistic value + */ + public Integer StatisticValue; + /** + * Statistic name + */ + public String Name; + + } + public static class PlayerStatisticDefinition { /** * unique name of the statistic @@ -1437,6 +1645,23 @@ public static class PlayerStatisticVersion { } + public static enum PushNotificationPlatform { + ApplePushNotificationService, + GoogleCloudMessaging + } + + public static class PushNotificationRegistration { + /** + * Push notification platform + */ + public PushNotificationPlatform Platform; + /** + * Notification configured endpoint + */ + public String NotificationEndpointARN; + + } + public static class RandomResultTable { /** * Unique name for this drop table @@ -1487,6 +1712,14 @@ public static class RemoveServerBuildResult { } + public static class RemoveVirtualCurrencyTypesRequest { + /** + * List of virtual currencies to delete + */ + public ArrayList VirtualCurrencies; + + } + public static class ResetCharacterStatisticsRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2004,15 +2237,15 @@ public static enum UserDataPermission { public static class UserDataRecord { /** - * User-supplied data for this user data key. + * Data stored for the specified user data key. */ public String Value; /** - * Timestamp indicating when this data was last updated. + * Timestamp for when this data was last updated. */ public Date LastUpdated; /** - * Permissions on this data key. + * Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData requests being made by one player about another player. */ public UserDataPermission Permission; diff --git a/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java b/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java index db14da34..4dc0f2f9 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java @@ -806,6 +806,64 @@ private static PlayFabResult privateRegisterPlayFabUs return pfResult; } + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AddGenericIDAsync(final AddGenericIDRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddGenericIDAsync(request); + } + }); + } + + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AddGenericID(final AddGenericIDRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAddGenericIDAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAddGenericIDAsync(final AddGenericIDRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddGenericID", 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()); + AddGenericIDResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Adds playfab username/password auth to an existing semi-anonymous account created via a 3rd party auth method. */ @@ -1096,6 +1154,64 @@ private static PlayFabResult privateGetPla return pfResult; } + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromGenericIDsAsync(final GetPlayFabIDsFromGenericIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGenericIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromGenericIDs(final GetPlayFabIDsFromGenericIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromGenericIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of generic service identifiers. A generic identifier is the service name plus the service-specific ID for the player, as specified by the title when the generic identifier was added to the player account. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromGenericIDsAsync(final GetPlayFabIDsFromGenericIDsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGenericIDs", 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()); + GetPlayFabIDsFromGenericIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. */ @@ -1908,6 +2024,64 @@ private static PlayFabResult privateLinkTwitchAsync(fin return pfResult; } + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemoveGenericIDAsync(final RemoveGenericIDRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveGenericIDAsync(request); + } + }); + } + + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemoveGenericID(final RemoveGenericIDRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveGenericIDAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Removes the specified generic service identifier from the player's PlayFab account. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemoveGenericIDAsync(final RemoveGenericIDRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveGenericID", 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()); + RemoveGenericIDResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. */ @@ -7130,6 +7304,64 @@ private static PlayFabResult privateAttributeInstallAsyn return pfResult; } + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerSegmentsAsync(final GetPlayerSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerSegments(final GetPlayerSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerSegmentsAsync(final GetPlayerSegmentsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerSegments", 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()); + GetPlayerSegmentsResult 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 6e3a7aab..b2776366 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java @@ -57,6 +57,18 @@ public static class AddFriendResult { } + public static class AddGenericIDRequest { + /** + * Generic service identifier to add to the player account. + */ + public GenericServiceId GenericId; + + } + + public static class AddGenericIDResult { + + } + public static class AddSharedGroupMembersRequest { /** * Unique identifier for the shared group. @@ -894,6 +906,30 @@ public static class GameServerRegionsResult { } + public static class GenericPlayFabIdPair { + /** + * Unique generic service identifier for a user. + */ + public GenericServiceId GenericId; + /** + * Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the given generic identifier. + */ + public String PlayFabId; + + } + + public static class GenericServiceId { + /** + * Name of the service for which the player has a unique identifier. + */ + public String ServiceName; + /** + * Unique identifier of the player in that service. + */ + public String UserId; + + } + public static class GetAccountInfoRequest { /** * Unique PlayFab identifier of the user whose info is being requested. Optional, defaults to the authenticated user if no other lookup identifier set. @@ -1465,6 +1501,18 @@ public static class GetPlayerCombinedInfoResultPayload { } + public static class GetPlayerSegmentsRequest { + + } + + public static class GetPlayerSegmentsResult { + /** + * Array of segments the requested player currently belongs to. + */ + public ArrayList Segments; + + } + public static class GetPlayerStatisticsRequest { /** * statistics to return (current version will be returned for each) @@ -1553,6 +1601,22 @@ public static class GetPlayFabIDsFromGameCenterIDsResult { } + public static class GetPlayFabIDsFromGenericIDsRequest { + /** + * Array of unique generic service identifiers for which the title needs to get PlayFab identifiers. Currently limited to a maximum of 10 in a single request. + */ + public ArrayList GenericIDs; + + } + + public static class GetPlayFabIDsFromGenericIDsResult { + /** + * Mapping of generic service identifiers to PlayFab identifiers. + */ + public ArrayList Data; + + } + public static class GetPlayFabIDsFromGoogleIDsRequest { /** * Array of unique Google identifiers (Google+ user IDs) for which the title needs to get PlayFab identifiers. @@ -1673,6 +1737,22 @@ public static class GetPurchaseResult { } + public static class GetSegmentResult { + /** + * Unique identifier for this segment. + */ + public String Id; + /** + * Segment name. + */ + public String Name; + /** + * Identifier of the segments AB Test, if it is attached to one. + */ + public String ABTestParent; + + } + public static class GetSharedGroupDataRequest { /** * Unique identifier for the shared group. @@ -1968,7 +2048,7 @@ public static class GrantCharacterToUserResult { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** @@ -2947,6 +3027,18 @@ public static class RemoveFriendResult { } + public static class RemoveGenericIDRequest { + /** + * Generic service identifier to be removed from the player. + */ + public GenericServiceId GenericId; + + } + + public static class RemoveGenericIDResult { + + } + public static class RemoveSharedGroupMembersRequest { /** * Unique identifier for the shared group. diff --git a/PlayFabSDK/src/com/playfab/PlayFabErrors.java b/PlayFabSDK/src/com/playfab/PlayFabErrors.java index 8af2be31..8fbfd1ec 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabSDK/src/com/playfab/PlayFabErrors.java @@ -236,7 +236,16 @@ public static enum PlayFabErrorCode { InvalidTwitchToken(1232), TwitchResponseError(1233), ProfaneDisplayName(1234), - UserAlreadyAdded(1235); + UserAlreadyAdded(1235), + InvalidVirtualCurrencyCode(1236), + VirtualCurrencyCannotBeDeleted(1237), + IdentifierAlreadyClaimed(1238), + IdentifierNotLinked(1239), + InvalidContinuationToken(1240), + ExpiredContinuationToken(1241), + InvalidSegment(1242), + InvalidSessionId(1243), + SessionLogNotFound(1244); public int id; diff --git a/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java b/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java index 8c6669e9..6884bf88 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java @@ -25,7 +25,7 @@ public static class AuthUserResponse { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java index 83d48257..8058c56b 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java @@ -480,6 +480,64 @@ private static PlayFabResult privateGetLeaderboa return pfResult; } + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerCombinedInfoAsync(final GetPlayerCombinedInfoRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerCombinedInfoAsync(request); + } + }); + } + + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerCombinedInfo(final GetPlayerCombinedInfoRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerCombinedInfoAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerCombinedInfoAsync(final GetPlayerCombinedInfoRequest 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/GetPlayerCombinedInfo", 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()); + GetPlayerCombinedInfoResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the current version and values for the indicated statistics, for the local player. */ @@ -4945,4 +5003,178 @@ private static PlayFabResult privateUpdateCharacterRe 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. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetAllSegmentsAsync(final GetAllSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetAllSegmentsAsync(request); + } + }); + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetAllSegments(final GetAllSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetAllSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetAllSegmentsAsync(final GetAllSegmentsRequest 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/GetAllSegments", 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()); + GetAllSegmentsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerSegmentsAsync(final GetPlayersSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerSegments(final GetPlayersSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerSegmentsAsync(final GetPlayersSegmentsRequest 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/GetPlayerSegments", 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()); + GetPlayerSegmentsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayersInSegmentAsync(final GetPlayersInSegmentRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayersInSegmentAsync(request); + } + }); + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayersInSegment(final GetPlayersInSegmentRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayersInSegmentAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayersInSegmentAsync(final GetPlayersInSegmentRequest 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/GetPlayersInSegment", 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()); + GetPlayersInSegmentResult 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 545cde1e..ce441b6d 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java @@ -5,6 +5,22 @@ public class PlayFabServerModels { + public static class AdCampaignAttribution { + /** + * Attribution network name + */ + public String Platform; + /** + * Attribution campaign identifier + */ + public String CampaignId; + /** + * UTC time stamp of attribution + */ + public Date AttributedAt; + + } + public static class AddCharacterVirtualCurrencyRequest { /** * PlayFab unique identifier of the user whose virtual currency balance is to be incremented. @@ -240,6 +256,18 @@ public static class CatalogItemContainerInfo { } + public static class CharacterInventory { + /** + * The id of this character. + */ + public String CharacterId; + /** + * The inventory of this character. + */ + public ArrayList Inventory; + + } + public static class CharacterLeaderboardEntry { /** * PlayFab unique identifier of the user for this leaderboard entry. @@ -690,6 +718,18 @@ public static enum GameInstanceState { Closed } + public static class GetAllSegmentsRequest { + + } + + public static class GetAllSegmentsResult { + /** + * Array of segments for this title. + */ + public ArrayList Segments; + + } + public static class GetCatalogItemsRequest { /** * Which catalog is being requested. @@ -976,6 +1016,191 @@ public static class GetLeaderboardResult { } + public static class GetPlayerCombinedInfoRequest { + /** + * PlayFabId of the user whose data will be returned + */ + public String PlayFabId; + /** + * Flags for which pieces of info to return for the user. + */ + public GetPlayerCombinedInfoRequestParams InfoRequestParameters; + + } + + public static class GetPlayerCombinedInfoRequestParams { + /** + * Whether to get the player's account Info. Defaults to false + */ + public Boolean GetUserAccountInfo; + /** + * Whether to get the player's inventory. Defaults to false + */ + public Boolean GetUserInventory; + /** + * Whether to get the player's virtual currency balances. Defaults to false + */ + public Boolean GetUserVirtualCurrency; + /** + * Whether to get the player's custom data. Defaults to false + */ + public Boolean GetUserData; + /** + * Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if UserDataKeys is false + */ + public ArrayList UserDataKeys; + /** + * Whether to get the player's read only data. Defaults to false + */ + public Boolean GetUserReadOnlyData; + /** + * Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserReadOnlyData is false + */ + public ArrayList UserReadOnlyDataKeys; + /** + * Whether to get character inventories. Defaults to false. + */ + public Boolean GetCharacterInventories; + /** + * Whether to get the list of characters. Defaults to false. + */ + public Boolean GetCharacterList; + /** + * Whether to get title data. Defaults to false. + */ + public Boolean GetTitleData; + /** + * Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetTitleData is false + */ + public ArrayList TitleDataKeys; + /** + * Whether to get player statistics. Defaults to false. + */ + public Boolean GetPlayerStatistics; + /** + * Specific statistics to retrieve. Leave null to get all keys. Has no effect if GetPlayerStatistics is false + */ + public ArrayList PlayerStatisticNames; + + } + + public static class GetPlayerCombinedInfoResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Results for requested info. + */ + public GetPlayerCombinedInfoResultPayload InfoResultPayload; + + } + + public static class GetPlayerCombinedInfoResultPayload { + /** + * Account information for the user. This is always retrieved. + */ + public UserAccountInfo AccountInfo; + /** + * Array of inventory items in the user's current inventory. + */ + @Unordered("ItemInstanceId") + public ArrayList UserInventory; + /** + * Dictionary of virtual currency balance(s) belonging to the user. + */ + public Map UserVirtualCurrency; + /** + * Dictionary of remaining times and timestamps for virtual currencies. + */ + public Map UserVirtualCurrencyRechargeTimes; + /** + * User specific custom data. + */ + public Map UserData; + /** + * The version of the UserData that was returned. + */ + public Long UserDataVersion; + /** + * User specific read-only data. + */ + public Map UserReadOnlyData; + /** + * The version of the Read-Only UserData that was returned. + */ + public Long UserReadOnlyDataVersion; + /** + * List of characters for the user. + */ + public ArrayList CharacterList; + /** + * Inventories for each character for the user. + */ + public ArrayList CharacterInventories; + /** + * Title data for this title. + */ + public Map TitleData; + /** + * List of statistics for this player. + */ + public ArrayList PlayerStatistics; + + } + + public static class GetPlayerSegmentsResult { + /** + * Array of segments the requested player currently belongs to. + */ + public ArrayList Segments; + + } + + public static class GetPlayersInSegmentRequest { + /** + * Unique identifier for this segment. + */ + public String SegmentId; + /** + * Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + public Long SecondsToLive; + /** + * Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. + */ + public Long MaxBatchSize; + /** + * Continuation token if retrieving subsequent pages of results. + */ + public String ContinuationToken; + + } + + public static class GetPlayersInSegmentResult { + /** + * Count of profiles matching this segment. + */ + public Integer ProfilesInSegment; + /** + * Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. + */ + public String ContinuationToken; + /** + * Array of player profiles in this segment. + */ + public ArrayList PlayerProfiles; + + } + + public static class GetPlayersSegmentsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + public static class GetPlayerStatisticsRequest { /** * user for whom statistics are being requested @@ -1072,6 +1297,22 @@ public static class GetPublisherDataResult { } + public static class GetSegmentResult { + /** + * Unique identifier for this segment. + */ + public String Id; + /** + * Segment name. + */ + public String Name; + /** + * Identifier of the segments AB Test, if it is attached to one. + */ + public String ABTestParent; + + } + public static class GetSharedGroupDataRequest { /** * Unique identifier for the shared group. @@ -1446,7 +1687,7 @@ public static class ItemGrant { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** @@ -1570,6 +1811,22 @@ public static class LogEventResult { } + public static enum LoginIdentityProvider { + Unknown, + PlayFab, + Custom, + GameCenter, + GooglePlay, + Steam, + XBoxLive, + PSN, + Kongregate, + Facebook, + IOSDevice, + AndroidDevice, + Twitch + } + public static class LogStatement { /** * 'Debug', 'Info', or 'Error' @@ -1755,6 +2012,102 @@ public static class PlayerLeaderboardEntry { } + public static class PlayerLinkedAccount { + /** + * Authentication platform + */ + public LoginIdentityProvider Platform; + /** + * Platform user identifier + */ + public String PlatformUserId; + /** + * Linked account's username + */ + public String Username; + /** + * Linked account's email + */ + public String Email; + + } + + public static class PlayerProfile { + /** + * PlayFab Player ID + */ + public String PlayerId; + /** + * Title ID this profile applies to + */ + public String TitleId; + /** + * Player Display Name + */ + public String DisplayName; + /** + * Player account origination + */ + public LoginIdentityProvider Origination; + /** + * Player record created + */ + public Date Created; + /** + * Last login + */ + public Date LastLogin; + /** + * Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. + */ + public Date BannedUntil; + /** + * Dictionary of player's statistics using only the latest version's value + */ + public Map Statistics; + /** + * Dictionary of player's virtual currency balances + */ + public Map VirtualCurrencyBalances; + /** + * Array of ad campaigns player has been attributed to + */ + public ArrayList AdCampaignAttributions; + /** + * Array of configured push notification end points + */ + public ArrayList PushNotificationRegistrations; + /** + * Array of third party accounts linked to this player + */ + public ArrayList LinkedAccounts; + /** + * Array of player statistics + */ + public ArrayList PlayerStatistics; + + } + + public static class PlayerStatistic { + /** + * Statistic ID + */ + public String Id; + /** + * Statistic version (0 if not a versioned statistic) + */ + public Integer StatisticVersion; + /** + * Current statistic value + */ + public Integer StatisticValue; + /** + * Statistic name + */ + public String Name; + + } + public static class PlayerStatisticVersion { /** * name of the statistic when the version became active @@ -1783,6 +2136,23 @@ public static class PlayerStatisticVersion { } + public static enum PushNotificationPlatform { + ApplePushNotificationService, + GoogleCloudMessaging + } + + public static class PushNotificationRegistration { + /** + * Push notification platform + */ + public PushNotificationPlatform Platform; + /** + * Notification configured endpoint + */ + public String NotificationEndpointARN; + + } + public static class RedeemCouponRequest { /** * Generated coupon code to redeem. @@ -2480,15 +2850,15 @@ public static enum UserDataPermission { public static class UserDataRecord { /** - * User-supplied data for this user data key. + * Data stored for the specified user data key. */ public String Value; /** - * Timestamp indicating when this data was last updated. + * Timestamp for when this data was last updated. */ public Date LastUpdated; /** - * Permissions on this data key. + * Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData requests being made by one player about another player. */ public UserDataPermission Permission; diff --git a/PlayFabSDK/src/com/playfab/PlayFabSettings.java b/PlayFabSDK/src/com/playfab/PlayFabSettings.java index 8259ea40..1d1bfb67 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.31.160725"; - public static String BuildIdentifier = "jbuild_javasdk_1"; - public static String SdkVersionString = "JavaSDK-0.31.160725"; + public static String SdkVersion = "0.32.160801"; + public static String BuildIdentifier = "jbuild_javasdk_0"; + public static String SdkVersionString = "JavaSDK-0.32.160801"; 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 7727c731..a227acb2 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java @@ -1930,6 +1930,64 @@ private static PlayFabResult privateListVirtualC return pfResult; } + /** + * Removes one or more virtual currencies from the set defined for the title. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RemoveVirtualCurrencyTypesAsync(final RemoveVirtualCurrencyTypesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveVirtualCurrencyTypesAsync(request); + } + }); + } + + /** + * Removes one or more virtual currencies from the set defined for the title. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RemoveVirtualCurrencyTypes(final RemoveVirtualCurrencyTypesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRemoveVirtualCurrencyTypesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Removes one or more virtual currencies from the set defined for the title. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRemoveVirtualCurrencyTypesAsync(final RemoveVirtualCurrencyTypesRequest 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/RemoveVirtualCurrencyTypes", 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()); + BlankResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Creates the catalog configuration of all virtual goods for the specified catalog version */ @@ -3727,4 +3785,178 @@ private static PlayFabResult privateResetCharact 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. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetAllSegmentsAsync(final GetAllSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetAllSegmentsAsync(request); + } + }); + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetAllSegments(final GetAllSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetAllSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetAllSegmentsAsync(final GetAllSegmentsRequest 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/GetAllSegments", 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()); + GetAllSegmentsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerSegmentsAsync(final GetPlayersSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerSegments(final GetPlayersSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerSegmentsAsync(final GetPlayersSegmentsRequest 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/GetPlayerSegments", 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()); + GetPlayerSegmentsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayersInSegmentAsync(final GetPlayersInSegmentRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayersInSegmentAsync(request); + } + }); + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayersInSegment(final GetPlayersInSegmentRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayersInSegmentAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayersInSegmentAsync(final GetPlayersInSegmentRequest 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/GetPlayersInSegment", 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()); + GetPlayersInSegmentResult 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 c72b74da..e892ca98 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java @@ -5,6 +5,22 @@ public class PlayFabAdminModels { + public static class AdCampaignAttribution { + /** + * Attribution network name + */ + public String Platform; + /** + * Attribution campaign identifier + */ + public String CampaignId; + /** + * UTC time stamp of attribution + */ + public Date AttributedAt; + + } + public static class AddNewsRequest { /** * Time this news was published. If not set, defaults to now. @@ -553,6 +569,18 @@ public static class GameModeInfo { } + public static class GetAllSegmentsRequest { + + } + + public static class GetAllSegmentsResult { + /** + * Array of segments for this title. + */ + public ArrayList Segments; + + } + public static class GetCatalogItemsRequest { /** * Which catalog is being requested. @@ -759,6 +787,58 @@ public static class GetMatchmakerGameModesResult { } + public static class GetPlayerSegmentsResult { + /** + * Array of segments the requested player currently belongs to. + */ + public ArrayList Segments; + + } + + public static class GetPlayersInSegmentRequest { + /** + * Unique identifier for this segment. + */ + public String SegmentId; + /** + * Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + public Long SecondsToLive; + /** + * Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. + */ + public Long MaxBatchSize; + /** + * Continuation token if retrieving subsequent pages of results. + */ + public String ContinuationToken; + + } + + public static class GetPlayersInSegmentResult { + /** + * Count of profiles matching this segment. + */ + public Integer ProfilesInSegment; + /** + * Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. + */ + public String ContinuationToken; + /** + * Array of player profiles in this segment. + */ + public ArrayList PlayerProfiles; + + } + + public static class GetPlayersSegmentsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + public static class GetPlayerStatisticDefinitionsRequest { } @@ -819,6 +899,22 @@ public static class GetRandomResultTablesResult { } + public static class GetSegmentResult { + /** + * Unique identifier for this segment. + */ + public String Id; + /** + * Segment name. + */ + public String Name; + /** + * Identifier of the segments AB Test, if it is attached to one. + */ + public String ABTestParent; + + } + public static class GetServerBuildInfoRequest { /** * unique identifier of the previously uploaded build executable for which information is being requested @@ -1139,7 +1235,7 @@ public static class ItemGrant { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** @@ -1237,6 +1333,22 @@ public static class ListVirtualCurrencyTypesResult { } + public static enum LoginIdentityProvider { + Unknown, + PlayFab, + Custom, + GameCenter, + GooglePlay, + Steam, + XBoxLive, + PSN, + Kongregate, + Facebook, + IOSDevice, + AndroidDevice, + Twitch + } + public static class LookupUserAccountInfoRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1381,6 +1493,102 @@ public static class ModifyUserVirtualCurrencyResult { } + public static class PlayerLinkedAccount { + /** + * Authentication platform + */ + public LoginIdentityProvider Platform; + /** + * Platform user identifier + */ + public String PlatformUserId; + /** + * Linked account's username + */ + public String Username; + /** + * Linked account's email + */ + public String Email; + + } + + public static class PlayerProfile { + /** + * PlayFab Player ID + */ + public String PlayerId; + /** + * Title ID this profile applies to + */ + public String TitleId; + /** + * Player Display Name + */ + public String DisplayName; + /** + * Player account origination + */ + public LoginIdentityProvider Origination; + /** + * Player record created + */ + public Date Created; + /** + * Last login + */ + public Date LastLogin; + /** + * Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. + */ + public Date BannedUntil; + /** + * Dictionary of player's statistics using only the latest version's value + */ + public Map Statistics; + /** + * Dictionary of player's virtual currency balances + */ + public Map VirtualCurrencyBalances; + /** + * Array of ad campaigns player has been attributed to + */ + public ArrayList AdCampaignAttributions; + /** + * Array of configured push notification end points + */ + public ArrayList PushNotificationRegistrations; + /** + * Array of third party accounts linked to this player + */ + public ArrayList LinkedAccounts; + /** + * Array of player statistics + */ + public ArrayList PlayerStatistics; + + } + + public static class PlayerStatistic { + /** + * Statistic ID + */ + public String Id; + /** + * Statistic version (0 if not a versioned statistic) + */ + public Integer StatisticVersion; + /** + * Current statistic value + */ + public Integer StatisticValue; + /** + * Statistic name + */ + public String Name; + + } + public static class PlayerStatisticDefinition { /** * unique name of the statistic @@ -1437,6 +1645,23 @@ public static class PlayerStatisticVersion { } + public static enum PushNotificationPlatform { + ApplePushNotificationService, + GoogleCloudMessaging + } + + public static class PushNotificationRegistration { + /** + * Push notification platform + */ + public PushNotificationPlatform Platform; + /** + * Notification configured endpoint + */ + public String NotificationEndpointARN; + + } + public static class RandomResultTable { /** * Unique name for this drop table @@ -1487,6 +1712,14 @@ public static class RemoveServerBuildResult { } + public static class RemoveVirtualCurrencyTypesRequest { + /** + * List of virtual currencies to delete + */ + public ArrayList VirtualCurrencies; + + } + public static class ResetCharacterStatisticsRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2004,15 +2237,15 @@ public static enum UserDataPermission { public static class UserDataRecord { /** - * User-supplied data for this user data key. + * Data stored for the specified user data key. */ public String Value; /** - * Timestamp indicating when this data was last updated. + * Timestamp for when this data was last updated. */ public Date LastUpdated; /** - * Permissions on this data key. + * Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData requests being made by one player about another player. */ public UserDataPermission Permission; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java index 8af2be31..8fbfd1ec 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java @@ -236,7 +236,16 @@ public static enum PlayFabErrorCode { InvalidTwitchToken(1232), TwitchResponseError(1233), ProfaneDisplayName(1234), - UserAlreadyAdded(1235); + UserAlreadyAdded(1235), + InvalidVirtualCurrencyCode(1236), + VirtualCurrencyCannotBeDeleted(1237), + IdentifierAlreadyClaimed(1238), + IdentifierNotLinked(1239), + InvalidContinuationToken(1240), + ExpiredContinuationToken(1241), + InvalidSegment(1242), + InvalidSessionId(1243), + SessionLogNotFound(1244); public int id; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java index 8c6669e9..6884bf88 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java @@ -25,7 +25,7 @@ public static class AuthUserResponse { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java index 83d48257..8058c56b 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java @@ -480,6 +480,64 @@ private static PlayFabResult privateGetLeaderboa return pfResult; } + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerCombinedInfoAsync(final GetPlayerCombinedInfoRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerCombinedInfoAsync(request); + } + }); + } + + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerCombinedInfo(final GetPlayerCombinedInfoRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerCombinedInfoAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Returns whatever info is requested in the response for the user. Note that PII (like email address, facebook id) may be returned. All parameters default to false. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerCombinedInfoAsync(final GetPlayerCombinedInfoRequest 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/GetPlayerCombinedInfo", 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()); + GetPlayerCombinedInfoResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the current version and values for the indicated statistics, for the local player. */ @@ -4945,4 +5003,178 @@ private static PlayFabResult privateUpdateCharacterRe 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. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetAllSegmentsAsync(final GetAllSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetAllSegmentsAsync(request); + } + }); + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetAllSegments(final GetAllSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetAllSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * 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. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetAllSegmentsAsync(final GetAllSegmentsRequest 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/GetAllSegments", 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()); + GetAllSegmentsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerSegmentsAsync(final GetPlayersSegmentsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerSegments(final GetPlayersSegmentsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerSegmentsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * List all segments that a player currently belongs to at this moment in time. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerSegmentsAsync(final GetPlayersSegmentsRequest 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/GetPlayerSegments", 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()); + GetPlayerSegmentsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayersInSegmentAsync(final GetPlayersInSegmentRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayersInSegmentAsync(request); + } + }); + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayersInSegment(final GetPlayersInSegmentRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayersInSegmentAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Allows for paging through all players in a given segment. This API creates a snapshot of all player profiles that match the segment definition at the time of its creation and lives through the Total Seconds to Live, refreshing its life span on each subsequent use of the Continuation Token. Profiles that change during the course of paging will not be reflected in the results. AB Test segments are currently not supported by this operation. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayersInSegmentAsync(final GetPlayersInSegmentRequest 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/GetPlayersInSegment", 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()); + GetPlayersInSegmentResult 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 545cde1e..ce441b6d 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java @@ -5,6 +5,22 @@ public class PlayFabServerModels { + public static class AdCampaignAttribution { + /** + * Attribution network name + */ + public String Platform; + /** + * Attribution campaign identifier + */ + public String CampaignId; + /** + * UTC time stamp of attribution + */ + public Date AttributedAt; + + } + public static class AddCharacterVirtualCurrencyRequest { /** * PlayFab unique identifier of the user whose virtual currency balance is to be incremented. @@ -240,6 +256,18 @@ public static class CatalogItemContainerInfo { } + public static class CharacterInventory { + /** + * The id of this character. + */ + public String CharacterId; + /** + * The inventory of this character. + */ + public ArrayList Inventory; + + } + public static class CharacterLeaderboardEntry { /** * PlayFab unique identifier of the user for this leaderboard entry. @@ -690,6 +718,18 @@ public static enum GameInstanceState { Closed } + public static class GetAllSegmentsRequest { + + } + + public static class GetAllSegmentsResult { + /** + * Array of segments for this title. + */ + public ArrayList Segments; + + } + public static class GetCatalogItemsRequest { /** * Which catalog is being requested. @@ -976,6 +1016,191 @@ public static class GetLeaderboardResult { } + public static class GetPlayerCombinedInfoRequest { + /** + * PlayFabId of the user whose data will be returned + */ + public String PlayFabId; + /** + * Flags for which pieces of info to return for the user. + */ + public GetPlayerCombinedInfoRequestParams InfoRequestParameters; + + } + + public static class GetPlayerCombinedInfoRequestParams { + /** + * Whether to get the player's account Info. Defaults to false + */ + public Boolean GetUserAccountInfo; + /** + * Whether to get the player's inventory. Defaults to false + */ + public Boolean GetUserInventory; + /** + * Whether to get the player's virtual currency balances. Defaults to false + */ + public Boolean GetUserVirtualCurrency; + /** + * Whether to get the player's custom data. Defaults to false + */ + public Boolean GetUserData; + /** + * Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if UserDataKeys is false + */ + public ArrayList UserDataKeys; + /** + * Whether to get the player's read only data. Defaults to false + */ + public Boolean GetUserReadOnlyData; + /** + * Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetUserReadOnlyData is false + */ + public ArrayList UserReadOnlyDataKeys; + /** + * Whether to get character inventories. Defaults to false. + */ + public Boolean GetCharacterInventories; + /** + * Whether to get the list of characters. Defaults to false. + */ + public Boolean GetCharacterList; + /** + * Whether to get title data. Defaults to false. + */ + public Boolean GetTitleData; + /** + * Specific keys to search for in the custom data. Leave null to get all keys. Has no effect if GetTitleData is false + */ + public ArrayList TitleDataKeys; + /** + * Whether to get player statistics. Defaults to false. + */ + public Boolean GetPlayerStatistics; + /** + * Specific statistics to retrieve. Leave null to get all keys. Has no effect if GetPlayerStatistics is false + */ + public ArrayList PlayerStatisticNames; + + } + + public static class GetPlayerCombinedInfoResult { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Results for requested info. + */ + public GetPlayerCombinedInfoResultPayload InfoResultPayload; + + } + + public static class GetPlayerCombinedInfoResultPayload { + /** + * Account information for the user. This is always retrieved. + */ + public UserAccountInfo AccountInfo; + /** + * Array of inventory items in the user's current inventory. + */ + @Unordered("ItemInstanceId") + public ArrayList UserInventory; + /** + * Dictionary of virtual currency balance(s) belonging to the user. + */ + public Map UserVirtualCurrency; + /** + * Dictionary of remaining times and timestamps for virtual currencies. + */ + public Map UserVirtualCurrencyRechargeTimes; + /** + * User specific custom data. + */ + public Map UserData; + /** + * The version of the UserData that was returned. + */ + public Long UserDataVersion; + /** + * User specific read-only data. + */ + public Map UserReadOnlyData; + /** + * The version of the Read-Only UserData that was returned. + */ + public Long UserReadOnlyDataVersion; + /** + * List of characters for the user. + */ + public ArrayList CharacterList; + /** + * Inventories for each character for the user. + */ + public ArrayList CharacterInventories; + /** + * Title data for this title. + */ + public Map TitleData; + /** + * List of statistics for this player. + */ + public ArrayList PlayerStatistics; + + } + + public static class GetPlayerSegmentsResult { + /** + * Array of segments the requested player currently belongs to. + */ + public ArrayList Segments; + + } + + public static class GetPlayersInSegmentRequest { + /** + * Unique identifier for this segment. + */ + public String SegmentId; + /** + * Number of seconds to keep the continuation token active. After token expiration it is not possible to continue paging results. Default is 300 (5 minutes). Maximum is 1,800 (30 minutes). + */ + public Long SecondsToLive; + /** + * Maximum number of profiles to load. Default is 1,000. Maximum is 10,000. + */ + public Long MaxBatchSize; + /** + * Continuation token if retrieving subsequent pages of results. + */ + public String ContinuationToken; + + } + + public static class GetPlayersInSegmentResult { + /** + * Count of profiles matching this segment. + */ + public Integer ProfilesInSegment; + /** + * Continuation token to use to retrieve subsequent pages of results. If token returns null there are no more results. + */ + public String ContinuationToken; + /** + * Array of player profiles in this segment. + */ + public ArrayList PlayerProfiles; + + } + + public static class GetPlayersSegmentsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + public static class GetPlayerStatisticsRequest { /** * user for whom statistics are being requested @@ -1072,6 +1297,22 @@ public static class GetPublisherDataResult { } + public static class GetSegmentResult { + /** + * Unique identifier for this segment. + */ + public String Id; + /** + * Segment name. + */ + public String Name; + /** + * Identifier of the segments AB Test, if it is attached to one. + */ + public String ABTestParent; + + } + public static class GetSharedGroupDataRequest { /** * Unique identifier for the shared group. @@ -1446,7 +1687,7 @@ public static class ItemGrant { } /** - * A unique instance of an item in a user's inventory + * 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. */ public static class ItemInstance implements Comparable { /** @@ -1570,6 +1811,22 @@ public static class LogEventResult { } + public static enum LoginIdentityProvider { + Unknown, + PlayFab, + Custom, + GameCenter, + GooglePlay, + Steam, + XBoxLive, + PSN, + Kongregate, + Facebook, + IOSDevice, + AndroidDevice, + Twitch + } + public static class LogStatement { /** * 'Debug', 'Info', or 'Error' @@ -1755,6 +2012,102 @@ public static class PlayerLeaderboardEntry { } + public static class PlayerLinkedAccount { + /** + * Authentication platform + */ + public LoginIdentityProvider Platform; + /** + * Platform user identifier + */ + public String PlatformUserId; + /** + * Linked account's username + */ + public String Username; + /** + * Linked account's email + */ + public String Email; + + } + + public static class PlayerProfile { + /** + * PlayFab Player ID + */ + public String PlayerId; + /** + * Title ID this profile applies to + */ + public String TitleId; + /** + * Player Display Name + */ + public String DisplayName; + /** + * Player account origination + */ + public LoginIdentityProvider Origination; + /** + * Player record created + */ + public Date Created; + /** + * Last login + */ + public Date LastLogin; + /** + * Banned until UTC Date. If permanent ban this is set for 20 years after the original ban date. + */ + public Date BannedUntil; + /** + * Dictionary of player's statistics using only the latest version's value + */ + public Map Statistics; + /** + * Dictionary of player's virtual currency balances + */ + public Map VirtualCurrencyBalances; + /** + * Array of ad campaigns player has been attributed to + */ + public ArrayList AdCampaignAttributions; + /** + * Array of configured push notification end points + */ + public ArrayList PushNotificationRegistrations; + /** + * Array of third party accounts linked to this player + */ + public ArrayList LinkedAccounts; + /** + * Array of player statistics + */ + public ArrayList PlayerStatistics; + + } + + public static class PlayerStatistic { + /** + * Statistic ID + */ + public String Id; + /** + * Statistic version (0 if not a versioned statistic) + */ + public Integer StatisticVersion; + /** + * Current statistic value + */ + public Integer StatisticValue; + /** + * Statistic name + */ + public String Name; + + } + public static class PlayerStatisticVersion { /** * name of the statistic when the version became active @@ -1783,6 +2136,23 @@ public static class PlayerStatisticVersion { } + public static enum PushNotificationPlatform { + ApplePushNotificationService, + GoogleCloudMessaging + } + + public static class PushNotificationRegistration { + /** + * Push notification platform + */ + public PushNotificationPlatform Platform; + /** + * Notification configured endpoint + */ + public String NotificationEndpointARN; + + } + public static class RedeemCouponRequest { /** * Generated coupon code to redeem. @@ -2480,15 +2850,15 @@ public static enum UserDataPermission { public static class UserDataRecord { /** - * User-supplied data for this user data key. + * Data stored for the specified user data key. */ public String Value; /** - * Timestamp indicating when this data was last updated. + * Timestamp for when this data was last updated. */ public Date LastUpdated; /** - * Permissions on this data key. + * Indicates whether this data can be read by all users (public) or only the user (private). This is used for GetUserData requests being made by one player about another player. */ public UserDataPermission Permission; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java b/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java index d105b041..b92efba1 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.31.160725"; - public static String BuildIdentifier = "jbuild_javasdk_1"; - public static String SdkVersionString = "JavaSDK-0.31.160725"; + public static String SdkVersion = "0.32.160801"; + public static String BuildIdentifier = "jbuild_javasdk_0"; + public static String SdkVersionString = "JavaSDK-0.32.160801"; 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;