From 88a19b5c4d9405f03c2bf54e16162cd5f04da241 Mon Sep 17 00:00:00 2001 From: Playfab Jenkins Bot Date: Mon, 7 Nov 2016 23:29:39 +0000 Subject: [PATCH] https://api.playfab.com/releaseNotes/#161107 --- .../java/com/playfab/PlayFabClientModels.java | 18 +- .../main/java/com/playfab/PlayFabErrors.java | 6 +- .../java/com/playfab/PlayFabSettings.java | 4 +- .../src/com/playfab/PlayFabClientModels.java | 18 +- .../src/com/playfab/PlayFabErrors.java | 6 +- .../src/com/playfab/PlayFabSettings.java | 4 +- .../src/com/playfab/PlayFabAdminAPI.java | 580 +++++++++++++ .../src/com/playfab/PlayFabAdminModels.java | 778 +++++++++++++++++- .../src/com/playfab/PlayFabClientModels.java | 18 +- PlayFabSDK/src/com/playfab/PlayFabErrors.java | 6 +- .../src/com/playfab/PlayFabServerModels.java | 372 ++++++++- .../src/com/playfab/PlayFabSettings.java | 4 +- .../src/com/playfab/PlayFabAdminAPI.java | 580 +++++++++++++ .../src/com/playfab/PlayFabAdminModels.java | 778 +++++++++++++++++- .../src/com/playfab/PlayFabErrors.java | 6 +- .../src/com/playfab/PlayFabServerModels.java | 372 ++++++++- .../src/com/playfab/PlayFabSettings.java | 4 +- 17 files changed, 3527 insertions(+), 27 deletions(-) diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java index 26ce8d63..45c2c6e9 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java @@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable { */ public Boolean IsLimitedEdition; /** - * BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. + * If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. */ public Integer InitialLimitedEditionCount; @@ -898,6 +898,14 @@ public static class GameInfo { * last heartbeat of the game server instance, used in external game server provider mode */ public Date LastHeartbeat; + /** + * IP address of the server + */ + public String ServerHostname; + /** + * port number to use for non-http communications with the server + */ + public Integer ServerPort; } @@ -964,7 +972,7 @@ public static class GetAccountInfoRequest { */ public String Email; /** - * Title-specific username for the account to find (if no Email is set). + * Title-specific username for the account to find (if no Email is set). Note that if the non-unique Title Display Names option is enabled for the title, attempts to look up users by Title Display Name will always return AccountNotFound. */ public String TitleDisplayName; @@ -2906,6 +2914,10 @@ public static class RedeemCouponRequest { * Catalog version of the coupon. If null, uses the default catalog */ public String CatalogVersion; + /** + * Optional identifier for the Character that should receive the item. If null, item is added to the player + */ + public String CharacterId; } @@ -4177,7 +4189,7 @@ public static class WriteClientPlayerEventRequest { public static class WriteEventResponse { /** - * The unique identifier of the event. This can be used to retrieve the event's properties using the GetEvent API. The values of this identifier consist of ASCII characters and are not constrained to any particular format. + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to any particular format. */ public String EventId; diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java index bcff9514..6df7c14b 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java @@ -259,7 +259,11 @@ public static enum PlayFabErrorCode { ScheduledTaskCreateConflict(1255), InvalidScheduledTaskName(1256), InvalidTaskSchedule(1257), - SteamNotEnabledForTitle(1258); + SteamNotEnabledForTitle(1258), + LimitNotAnUpgradeOption(1259), + NoSecretKeyEnabledForCloudScript(1260), + TaskNotFound(1261), + TaskInstanceNotFound(1262); 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 224abcef..56c404db 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.39.161017"; + public static String SdkVersion = "0.40.161107"; public static String BuildIdentifier = "jbuild_javasdk_1"; - public static String SdkVersionString = "JavaSDK-0.39.161017"; + public static String SdkVersionString = "JavaSDK-0.40.161107"; 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/PlayFabClientModels.java b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java index 26ce8d63..45c2c6e9 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java @@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable { */ public Boolean IsLimitedEdition; /** - * BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. + * If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. */ public Integer InitialLimitedEditionCount; @@ -898,6 +898,14 @@ public static class GameInfo { * last heartbeat of the game server instance, used in external game server provider mode */ public Date LastHeartbeat; + /** + * IP address of the server + */ + public String ServerHostname; + /** + * port number to use for non-http communications with the server + */ + public Integer ServerPort; } @@ -964,7 +972,7 @@ public static class GetAccountInfoRequest { */ public String Email; /** - * Title-specific username for the account to find (if no Email is set). + * Title-specific username for the account to find (if no Email is set). Note that if the non-unique Title Display Names option is enabled for the title, attempts to look up users by Title Display Name will always return AccountNotFound. */ public String TitleDisplayName; @@ -2906,6 +2914,10 @@ public static class RedeemCouponRequest { * Catalog version of the coupon. If null, uses the default catalog */ public String CatalogVersion; + /** + * Optional identifier for the Character that should receive the item. If null, item is added to the player + */ + public String CharacterId; } @@ -4177,7 +4189,7 @@ public static class WriteClientPlayerEventRequest { public static class WriteEventResponse { /** - * The unique identifier of the event. This can be used to retrieve the event's properties using the GetEvent API. The values of this identifier consist of ASCII characters and are not constrained to any particular format. + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to any particular format. */ public String EventId; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java index bcff9514..6df7c14b 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java @@ -259,7 +259,11 @@ public static enum PlayFabErrorCode { ScheduledTaskCreateConflict(1255), InvalidScheduledTaskName(1256), InvalidTaskSchedule(1257), - SteamNotEnabledForTitle(1258); + SteamNotEnabledForTitle(1258), + LimitNotAnUpgradeOption(1259), + NoSecretKeyEnabledForCloudScript(1260), + TaskNotFound(1261), + TaskInstanceNotFound(1262); public int id; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java b/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java index a1460694..466c9ae2 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.39.161017"; + public static String SdkVersion = "0.40.161107"; public static String BuildIdentifier = "jbuild_javasdk_1"; - public static String SdkVersionString = "JavaSDK-0.39.161017"; + public static String SdkVersionString = "JavaSDK-0.40.161107"; 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 667d9faa..058d5ed2 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java @@ -4655,4 +4655,584 @@ private static PlayFabResult privateRemovePlayerTagAsync( pfResult.Result = result; return pfResult; } + + /** + * Abort an ongoing task instance. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AbortTaskInstanceAsync(final AbortTaskInstanceRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAbortTaskInstanceAsync(request); + } + }); + } + + /** + * Abort an ongoing task instance. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AbortTaskInstance(final AbortTaskInstanceRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAbortTaskInstanceAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Abort an ongoing task instance. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAbortTaskInstanceAsync(final AbortTaskInstanceRequest 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/AbortTaskInstance", 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()); + EmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. + */ + @SuppressWarnings("unchecked") + public static FutureTask> CreateActionsOnPlayersInSegmentTaskAsync(final CreateActionsOnPlayerSegmentTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateCreateActionsOnPlayersInSegmentTaskAsync(request); + } + }); + } + + /** + * Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult CreateActionsOnPlayersInSegmentTask(final CreateActionsOnPlayerSegmentTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateCreateActionsOnPlayersInSegmentTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateCreateActionsOnPlayersInSegmentTaskAsync(final CreateActionsOnPlayerSegmentTaskRequest 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/CreateActionsOnPlayersInSegmentTask", 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()); + CreateTaskResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Create a CloudScript task, which can run a CloudScript on a schedule. + */ + @SuppressWarnings("unchecked") + public static FutureTask> CreateCloudScriptTaskAsync(final CreateCloudScriptTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateCreateCloudScriptTaskAsync(request); + } + }); + } + + /** + * Create a CloudScript task, which can run a CloudScript on a schedule. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult CreateCloudScriptTask(final CreateCloudScriptTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateCreateCloudScriptTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Create a CloudScript task, which can run a CloudScript on a schedule. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateCreateCloudScriptTaskAsync(final CreateCloudScriptTaskRequest 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/CreateCloudScriptTask", 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()); + CreateTaskResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Delete a task. + */ + @SuppressWarnings("unchecked") + public static FutureTask> DeleteTaskAsync(final DeleteTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteTaskAsync(request); + } + }); + } + + /** + * Delete a task. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult DeleteTask(final DeleteTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Delete a task. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateDeleteTaskAsync(final DeleteTaskRequest 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/DeleteTask", 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()); + EmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Get information about a ActionsOnPlayersInSegment task instance. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetActionsOnPlayersInSegmentTaskInstanceAsync(final GetTaskInstanceRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetActionsOnPlayersInSegmentTaskInstanceAsync(request); + } + }); + } + + /** + * Get information about a ActionsOnPlayersInSegment task instance. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetActionsOnPlayersInSegmentTaskInstance(final GetTaskInstanceRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetActionsOnPlayersInSegmentTaskInstanceAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get information about a ActionsOnPlayersInSegment task instance. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetActionsOnPlayersInSegmentTaskInstanceAsync(final GetTaskInstanceRequest 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/GetActionsOnPlayersInSegmentTaskInstance", 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()); + GetActionsOnPlayersInSegmentTaskInstanceResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Get detail information about a CloudScript task instance. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetCloudScriptTaskInstanceAsync(final GetTaskInstanceRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetCloudScriptTaskInstanceAsync(request); + } + }); + } + + /** + * Get detail information about a CloudScript task instance. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetCloudScriptTaskInstance(final GetTaskInstanceRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetCloudScriptTaskInstanceAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get detail information about a CloudScript task instance. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetCloudScriptTaskInstanceAsync(final GetTaskInstanceRequest 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/GetCloudScriptTaskInstance", 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()); + GetCloudScriptTaskInstanceResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Query for task instances by task, status, or time range. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetTaskInstancesAsync(final GetTaskInstancesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetTaskInstancesAsync(request); + } + }); + } + + /** + * Query for task instances by task, status, or time range. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetTaskInstances(final GetTaskInstancesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetTaskInstancesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Query for task instances by task, status, or time range. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetTaskInstancesAsync(final GetTaskInstancesRequest 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/GetTaskInstances", 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()); + GetTaskInstancesResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Get definition information on a specified task or all tasks within a title. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetTasksAsync(final GetTasksRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetTasksAsync(request); + } + }); + } + + /** + * Get definition information on a specified task or all tasks within a title. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetTasks(final GetTasksRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetTasksAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get definition information on a specified task or all tasks within a title. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetTasksAsync(final GetTasksRequest 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/GetTasks", 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()); + GetTasksResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Run a task immediately regardless of its schedule. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RunTaskAsync(final RunTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRunTaskAsync(request); + } + }); + } + + /** + * Run a task immediately regardless of its schedule. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RunTask(final RunTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRunTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Run a task immediately regardless of its schedule. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRunTaskAsync(final RunTaskRequest 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/RunTask", 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()); + RunTaskResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Update an existing task. + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateTaskAsync(final UpdateTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateTaskAsync(request); + } + }); + } + + /** + * Update an existing task. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateTask(final UpdateTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Update an existing task. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateTaskAsync(final UpdateTaskRequest 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/UpdateTask", 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()); + EmptyResult 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 3c4b76d8..6ea3971c 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java @@ -5,6 +5,78 @@ public class PlayFabAdminModels { + public static class AbortTaskInstanceRequest { + /** + * ID of a task instance that is being aborted. + */ + public String TaskInstanceId; + + } + + public static class ActionsOnPlayersInSegmentTaskParameter { + /** + * ID of the segment to perform actions on. + */ + public String SegmentId; + /** + * ID of the action to perform on each player in segment. + */ + public String ActionId; + + } + + public static class ActionsOnPlayersInSegmentTaskSummary { + /** + * ID of the task instance. + */ + public String TaskInstanceId; + /** + * Identifier of the task this instance belongs to. + */ + public NameIdentifier TaskIdentifier; + /** + * UTC timestamp when the task started. + */ + public Date StartedAt; + /** + * UTC timestamp when the task completed. + */ + public Date CompletedAt; + /** + * Current status of the task instance. + */ + public TaskInstanceStatus Status; + /** + * Progress represented as percentage. + */ + public Double PercentComplete; + /** + * Estimated time remaining in seconds. + */ + public Double EstimatedSecondsRemaining; + /** + * If manually scheduled, ID of user who scheduled the task. + */ + public String ScheduledByUserId; + /** + * Error message for last processing attempt, if an error occured. + */ + public String ErrorMessage; + /** + * Flag indicating if the error was fatal, if false job will be retried. + */ + public Boolean ErrorWasFatal; + /** + * Total players in segment when task was started. + */ + public Integer TotalPlayersInSegment; + /** + * Total number of players that have had the actions applied to. + */ + public Integer TotalPlayersProcessed; + + } + public static class AdCampaignAttribution { /** * Attribution network name @@ -321,7 +393,7 @@ public static class CatalogItem implements Comparable { */ public Boolean IsLimitedEdition; /** - * BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. + * If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. */ public Integer InitialLimitedEditionCount; @@ -403,6 +475,58 @@ public static class CloudScriptFile { } + public static class CloudScriptTaskParameter { + /** + * Name of the CloudScript function to execute. + */ + public String FunctionName; + /** + * Argument to pass to the CloudScript function. + */ + public Object Argument; + + } + + public static class CloudScriptTaskSummary { + /** + * ID of the task instance. + */ + public String TaskInstanceId; + /** + * Identifier of the task this instance belongs to. + */ + public NameIdentifier TaskIdentifier; + /** + * UTC timestamp when the task started. + */ + public Date StartedAt; + /** + * UTC timestamp when the task completed. + */ + public Date CompletedAt; + /** + * Current status of the task instance. + */ + public TaskInstanceStatus Status; + /** + * Progress represented as percentage. + */ + public Double PercentComplete; + /** + * Estimated time remaining in seconds. + */ + public Double EstimatedSecondsRemaining; + /** + * If manually scheduled, ID of user who scheduled the task. + */ + public String ScheduledByUserId; + /** + * Result of CloudScript execution + */ + public ExecuteCloudScriptResult Result; + + } + public static class CloudScriptVersionStatus { /** * Version number @@ -435,6 +559,316 @@ public static class ContentInfo { } + public static enum ContinentCode { + AF, + AN, + AS, + EU, + NA, + OC, + SA + } + + public static enum CountryCode { + AF, + AX, + AL, + DZ, + AS, + AD, + AO, + AI, + AQ, + AG, + AR, + AM, + AW, + AU, + AT, + AZ, + BS, + BH, + BD, + BB, + BY, + BE, + BZ, + BJ, + BM, + BT, + BO, + BQ, + BA, + BW, + BV, + BR, + IO, + BN, + BG, + BF, + BI, + KH, + CM, + CA, + CV, + KY, + CF, + TD, + CL, + CN, + CX, + CC, + CO, + KM, + CG, + CD, + CK, + CR, + CI, + HR, + CU, + CW, + CY, + CZ, + DK, + DJ, + DM, + DO, + EC, + EG, + SV, + GQ, + ER, + EE, + ET, + FK, + FO, + FJ, + FI, + FR, + GF, + PF, + TF, + GA, + GM, + GE, + DE, + GH, + GI, + GR, + GL, + GD, + GP, + GU, + GT, + GG, + GN, + GW, + GY, + HT, + HM, + VA, + HN, + HK, + HU, + IS, + IN, + ID, + IR, + IQ, + IE, + IM, + IL, + IT, + JM, + JP, + JE, + JO, + KZ, + KE, + KI, + KP, + KR, + KW, + KG, + LA, + LV, + LB, + LS, + LR, + LY, + LI, + LT, + LU, + MO, + MK, + MG, + MW, + MY, + MV, + ML, + MT, + MH, + MQ, + MR, + MU, + YT, + MX, + FM, + MD, + MC, + MN, + ME, + MS, + MA, + MZ, + MM, + NA, + NR, + NP, + NL, + NC, + NZ, + NI, + NE, + NG, + NU, + NF, + MP, + NO, + OM, + PK, + PW, + PS, + PA, + PG, + PY, + PE, + PH, + PN, + PL, + PT, + PR, + QA, + RE, + RO, + RU, + RW, + BL, + SH, + KN, + LC, + MF, + PM, + VC, + WS, + SM, + ST, + SA, + SN, + RS, + SC, + SL, + SG, + SX, + SK, + SI, + SB, + SO, + ZA, + GS, + SS, + ES, + LK, + SD, + SR, + SJ, + SZ, + SE, + CH, + SY, + TW, + TJ, + TZ, + TH, + TL, + TG, + TK, + TO, + TT, + TN, + TR, + TM, + TC, + TV, + UG, + UA, + AE, + GB, + US, + UM, + UY, + UZ, + VU, + VE, + VN, + VG, + VI, + WF, + EH, + YE, + ZM, + ZW + } + + public static class CreateActionsOnPlayerSegmentTaskRequest { + /** + * Name of the task. This is a unique identifier for tasks in the title. + */ + public String Name; + /** + * Description the task + */ + public String Description; + /** + * Cron expression for the run schedule of the task. The expression should be in UTC. + */ + public String Schedule; + /** + * Whether the schedule is active. Inactive schedule will not trigger task execution. + */ + public Boolean IsActive; + /** + * Task details related to segment and action + */ + public ActionsOnPlayersInSegmentTaskParameter Parameter; + + } + + public static class CreateCloudScriptTaskRequest { + /** + * Name of the task. This is a unique identifier for tasks in the title. + */ + public String Name; + /** + * Description the task + */ + public String Description; + /** + * Cron expression for the run schedule of the task. The expression should be in UTC. + */ + public String Schedule; + /** + * Whether the schedule is active. Inactive schedule will not trigger task execution. + */ + public Boolean IsActive; + /** + * Task details related to CloudScript + */ + public CloudScriptTaskParameter Parameter; + + } + public static class CreatePlayerStatisticDefinitionRequest { /** * unique name of the statistic @@ -459,6 +893,14 @@ public static class CreatePlayerStatisticDefinitionResult { } + public static class CreateTaskResult { + /** + * ID of the task + */ + public String TaskId; + + } + public static enum Currency { AED, AFN, @@ -648,6 +1090,14 @@ public static class DeleteStoreResult { } + public static class DeleteTaskRequest { + /** + * Specify either the task ID or the name of task to be deleted. + */ + public NameIdentifier Identifier; + + } + public static class DeleteUsersRequest { /** * An array of unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -664,6 +1114,48 @@ public static class DeleteUsersResult { } + public static class EmptyResult { + + } + + public static class ExecuteCloudScriptResult { + /** + * The name of the function that executed + */ + public String FunctionName; + /** + * The revision of the CloudScript that executed + */ + public Integer Revision; + /** + * The object returned from the CloudScript function, if any + */ + public Object FunctionResult; + /** + * Entries logged during the function execution. These include both entries logged in the function code using log.info() and log.error() and error entries for API and HTTP request failures. + */ + public ArrayList Logs; + public Double ExecutionTimeSeconds; + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP requests. + */ + public Double ProcessorTimeSeconds; + public Long MemoryConsumedBytes; + /** + * Number of PlayFab API requests issued by the CloudScript function + */ + public Integer APIRequestsIssued; + /** + * Number of external HTTP requests issued by the CloudScript function + */ + public Integer HttpRequestsIssued; + /** + * Information about the error, if any, that occured during execution + */ + public ScriptExecutionError Error; + + } + public static enum GameBuildStatus { Available, Validating, @@ -704,6 +1196,18 @@ public static class GetActionGroupResult { } + public static class GetActionsOnPlayersInSegmentTaskInstanceResult { + /** + * Status summary of the actions-on-players-in-segment task instance + */ + public ActionsOnPlayersInSegmentTaskSummary Summary; + /** + * Parameter of this task instance + */ + public ActionsOnPlayersInSegmentTaskParameter Parameter; + + } + public static class GetAllActionGroupsRequest { } @@ -781,6 +1285,18 @@ public static class GetCloudScriptRevisionResult { } + public static class GetCloudScriptTaskInstanceResult { + /** + * Status summary of the CloudScript task instance + */ + public CloudScriptTaskSummary Summary; + /** + * Parameter of this task instance + */ + public CloudScriptTaskParameter Parameter; + + } + public static class GetCloudScriptVersionsRequest { } @@ -1196,6 +1712,58 @@ public static class GetStoreItemsResult { } + public static class GetTaskInstanceRequest { + /** + * ID of the requested task instance. + */ + public String TaskInstanceId; + + } + + public static class GetTaskInstancesRequest { + /** + * Name or ID of the task whose instances are being queried. If not specified, return all task instances that satisfy conditions set by other filters. + */ + public NameIdentifier TaskIdentifier; + /** + * Optional filter for task instances that are of a specific status. + */ + public TaskInstanceStatus StatusFilter; + /** + * Optional range-from filter for task instances' StartedAt timestamp. + */ + public Date StartedAtRangeFrom; + /** + * Optional range-to filter for task instances' StartedAt timestamp. + */ + public Date StartedAtRangeTo; + + } + + public static class GetTaskInstancesResult { + /** + * Basic status summaries of the queried task instances. Empty If no task instances meets the filter criteria. To get detailed status summary, use Get*TaskInstance API according to task type (e.g. GetActionsOnPlayersInSegmentTaskInstance). + */ + public ArrayList Summaries; + + } + + public static class GetTasksRequest { + /** + * Provide either the task ID or the task name to get a specific task. If not specified, return all defined tasks. + */ + public NameIdentifier Identifier; + + } + + public static class GetTasksResult { + /** + * Result tasks. Empty if there is no task found. + */ + public ArrayList Tasks; + + } + public static class GetTitleDataRequest { /** * Specific keys to search for in the title data (leave null to get all keys) @@ -1552,6 +2120,19 @@ public static enum LoginIdentityProvider { Twitch } + public static class LogStatement { + /** + * 'Debug', 'Info', or 'Error' + */ + public String Level; + public String Message; + /** + * Optional object accompanying the message as contextual information + */ + public Object Data; + + } + public static class LookupUserAccountInfoRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1696,6 +2277,15 @@ public static class ModifyUserVirtualCurrencyResult { } + /** + * Identifier by either name or ID. Note that a name may change due to renaming, or reused after being deleted. ID is immutable and unique. + */ + public static class NameIdentifier { + public String Name; + public String Id; + + } + public static class PlayerLinkedAccount { /** * Authentication platform @@ -1716,6 +2306,30 @@ public static class PlayerLinkedAccount { } + public static class PlayerLocation { + /** + * The two-character continent code for this location + */ + public ContinentCode ContinentCode; + /** + * The two-character ISO 3166-1 country code for the country associated with the location + */ + public CountryCode CountryCode; + /** + * City of the player's geographic location. + */ + public String City; + /** + * Latitude coordinate of the player's geographic location. + */ + public Double Latitude; + /** + * Longitude coordinate of the player's geographic location. + */ + public Double Longitude; + + } + public static class PlayerProfile { /** * PlayFab Player ID @@ -1765,6 +2379,10 @@ public static class PlayerProfile { * List of player's tags for segmentation. */ public ArrayList Tags; + /** + * Dictionary of player's locations by type. + */ + public Map Locations; /** * Dictionary of player's virtual currency balances */ @@ -2122,6 +2740,83 @@ public static class RevokeInventoryResult { } + public static class RunTaskRequest { + /** + * Provide either the task ID or the task name to run a task. + */ + public NameIdentifier Identifier; + + } + + public static class RunTaskResult { + /** + * ID of the task instance that is started. This can be used in Get*TaskInstance (e.g. GetCloudScriptTaskInstance) API call to retrieve status for the task instance. + */ + public String TaskInstanceId; + + } + + public static class ScheduledTask { + /** + * ID of the task + */ + public String TaskId; + /** + * Name of the task. This is a unique identifier for tasks in the title. + */ + public String Name; + /** + * Description the task + */ + public String Description; + /** + * Cron expression for the run schedule of the task. The expression should be in UTC. + */ + public String Schedule; + /** + * Whether the schedule is active. Inactive schedule will not trigger task execution. + */ + public Boolean IsActive; + /** + * Task type. + */ + public ScheduledTaskType Type; + /** + * Task parameter. Different types of task have different parameter structure. See each task type's create API documentation for the details. + */ + public Object Parameter; + /** + * UTC time of last run + */ + public Date LastRunTime; + /** + * UTC time of next run + */ + public Date NextRunTime; + + } + + public static enum ScheduledTaskType { + CloudScript, + ActionsOnPlayerSegment + } + + public static class ScriptExecutionError { + /** + * Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + public String Error; + /** + * Details about the error + */ + public String Message; + /** + * Point during the execution of the script at which the error occurred, if any + */ + public String StackTrace; + + } + public static class SendAccountRecoveryEmailRequest { /** * User email address attached to their account @@ -2312,6 +3007,55 @@ public static class SubtractUserVirtualCurrencyRequest { } + public static class TaskInstanceBasicSummary { + /** + * ID of the task instance. + */ + public String TaskInstanceId; + /** + * Identifier of the task this instance belongs to. + */ + public NameIdentifier TaskIdentifier; + /** + * UTC timestamp when the task started. + */ + public Date StartedAt; + /** + * UTC timestamp when the task completed. + */ + public Date CompletedAt; + /** + * Current status of the task instance. + */ + public TaskInstanceStatus Status; + /** + * Progress represented as percentage. + */ + public Double PercentComplete; + /** + * Estimated time remaining in seconds. + */ + public Double EstimatedSecondsRemaining; + /** + * If manually scheduled, ID of user who scheduled the task. + */ + public String ScheduledByUserId; + /** + * Type of the task. + */ + public ScheduledTaskType Type; + + } + + public static enum TaskInstanceStatus { + Succeeded, + Starting, + InProgress, + Failed, + Aborted, + Pending + } + public static enum TitleActivationStatus { None, ActivatedTitleKey, @@ -2483,6 +3227,38 @@ public static class UpdateStoreItemsResult { } + public static class UpdateTaskRequest { + /** + * Specify either the task ID or the name of the task to be updated. + */ + public NameIdentifier Identifier; + /** + * Name of the task. This is a unique identifier for tasks in the title. + */ + public String Name; + /** + * Description the task + */ + public String Description; + /** + * Cron expression for the run schedule of the task. The expression should be in UTC. + */ + public String Schedule; + /** + * Whether the schedule is active. Inactive schedule will not trigger task execution. + */ + public Boolean IsActive; + /** + * Task type. + */ + public ScheduledTaskType Type; + /** + * Parameter object specific to the task type. See each task type's create API documentation for details. + */ + public Object Parameter; + + } + public static class UpdateUserDataRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. diff --git a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java index 26ce8d63..45c2c6e9 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java @@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable { */ public Boolean IsLimitedEdition; /** - * BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. + * If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. */ public Integer InitialLimitedEditionCount; @@ -898,6 +898,14 @@ public static class GameInfo { * last heartbeat of the game server instance, used in external game server provider mode */ public Date LastHeartbeat; + /** + * IP address of the server + */ + public String ServerHostname; + /** + * port number to use for non-http communications with the server + */ + public Integer ServerPort; } @@ -964,7 +972,7 @@ public static class GetAccountInfoRequest { */ public String Email; /** - * Title-specific username for the account to find (if no Email is set). + * Title-specific username for the account to find (if no Email is set). Note that if the non-unique Title Display Names option is enabled for the title, attempts to look up users by Title Display Name will always return AccountNotFound. */ public String TitleDisplayName; @@ -2906,6 +2914,10 @@ public static class RedeemCouponRequest { * Catalog version of the coupon. If null, uses the default catalog */ public String CatalogVersion; + /** + * Optional identifier for the Character that should receive the item. If null, item is added to the player + */ + public String CharacterId; } @@ -4177,7 +4189,7 @@ public static class WriteClientPlayerEventRequest { public static class WriteEventResponse { /** - * The unique identifier of the event. This can be used to retrieve the event's properties using the GetEvent API. The values of this identifier consist of ASCII characters and are not constrained to any particular format. + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to any particular format. */ public String EventId; diff --git a/PlayFabSDK/src/com/playfab/PlayFabErrors.java b/PlayFabSDK/src/com/playfab/PlayFabErrors.java index bcff9514..6df7c14b 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabSDK/src/com/playfab/PlayFabErrors.java @@ -259,7 +259,11 @@ public static enum PlayFabErrorCode { ScheduledTaskCreateConflict(1255), InvalidScheduledTaskName(1256), InvalidTaskSchedule(1257), - SteamNotEnabledForTitle(1258); + SteamNotEnabledForTitle(1258), + LimitNotAnUpgradeOption(1259), + NoSecretKeyEnabledForCloudScript(1260), + TaskNotFound(1261), + TaskInstanceNotFound(1262); public int id; diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java index d5cf7cc9..464c7abc 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java @@ -5,6 +5,58 @@ public class PlayFabServerModels { + public static class ActionsOnPlayersInSegmentTaskSummary { + /** + * ID of the task instance. + */ + public String TaskInstanceId; + /** + * Identifier of the task this instance belongs to. + */ + public NameIdentifier TaskIdentifier; + /** + * UTC timestamp when the task started. + */ + public Date StartedAt; + /** + * UTC timestamp when the task completed. + */ + public Date CompletedAt; + /** + * Current status of the task instance. + */ + public TaskInstanceStatus Status; + /** + * Progress represented as percentage. + */ + public Double PercentComplete; + /** + * Estimated time remaining in seconds. + */ + public Double EstimatedSecondsRemaining; + /** + * If manually scheduled, ID of user who scheduled the task. + */ + public String ScheduledByUserId; + /** + * Error message for last processing attempt, if an error occured. + */ + public String ErrorMessage; + /** + * Flag indicating if the error was fatal, if false job will be retried. + */ + public Boolean ErrorWasFatal; + /** + * Total players in segment when task was started. + */ + public Integer TotalPlayersInSegment; + /** + * Total number of players that have had the actions applied to. + */ + public Integer TotalPlayersProcessed; + + } + public static class AdCampaignAttribution { /** * Attribution network name @@ -317,7 +369,7 @@ public static class CatalogItem implements Comparable { */ public Boolean IsLimitedEdition; /** - * BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. + * If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. */ public Integer InitialLimitedEditionCount; @@ -485,6 +537,268 @@ public static class ConsumeItemResult { } + public static enum ContinentCode { + AF, + AN, + AS, + EU, + NA, + OC, + SA + } + + public static enum CountryCode { + AF, + AX, + AL, + DZ, + AS, + AD, + AO, + AI, + AQ, + AG, + AR, + AM, + AW, + AU, + AT, + AZ, + BS, + BH, + BD, + BB, + BY, + BE, + BZ, + BJ, + BM, + BT, + BO, + BQ, + BA, + BW, + BV, + BR, + IO, + BN, + BG, + BF, + BI, + KH, + CM, + CA, + CV, + KY, + CF, + TD, + CL, + CN, + CX, + CC, + CO, + KM, + CG, + CD, + CK, + CR, + CI, + HR, + CU, + CW, + CY, + CZ, + DK, + DJ, + DM, + DO, + EC, + EG, + SV, + GQ, + ER, + EE, + ET, + FK, + FO, + FJ, + FI, + FR, + GF, + PF, + TF, + GA, + GM, + GE, + DE, + GH, + GI, + GR, + GL, + GD, + GP, + GU, + GT, + GG, + GN, + GW, + GY, + HT, + HM, + VA, + HN, + HK, + HU, + IS, + IN, + ID, + IR, + IQ, + IE, + IM, + IL, + IT, + JM, + JP, + JE, + JO, + KZ, + KE, + KI, + KP, + KR, + KW, + KG, + LA, + LV, + LB, + LS, + LR, + LY, + LI, + LT, + LU, + MO, + MK, + MG, + MW, + MY, + MV, + ML, + MT, + MH, + MQ, + MR, + MU, + YT, + MX, + FM, + MD, + MC, + MN, + ME, + MS, + MA, + MZ, + MM, + NA, + NR, + NP, + NL, + NC, + NZ, + NI, + NE, + NG, + NU, + NF, + MP, + NO, + OM, + PK, + PW, + PS, + PA, + PG, + PY, + PE, + PH, + PN, + PL, + PT, + PR, + QA, + RE, + RO, + RU, + RW, + BL, + SH, + KN, + LC, + MF, + PM, + VC, + WS, + SM, + ST, + SA, + SN, + RS, + SC, + SL, + SG, + SX, + SK, + SI, + SB, + SO, + ZA, + GS, + SS, + ES, + LK, + SD, + SR, + SJ, + SZ, + SE, + CH, + SY, + TW, + TJ, + TZ, + TH, + TL, + TG, + TK, + TO, + TT, + TN, + TR, + TM, + TC, + TV, + UG, + UA, + AE, + GB, + US, + UM, + UY, + UZ, + VU, + VE, + VN, + VG, + VI, + WF, + EH, + YE, + ZM, + ZW + } + public static class CreateSharedGroupRequest { /** * Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). @@ -2199,6 +2513,15 @@ public static class MoveItemToUserFromCharacterResult { } + /** + * Identifier by either name or ID. Note that a name may change due to renaming, or reused after being deleted. ID is immutable and unique. + */ + public static class NameIdentifier { + public String Name; + public String Id; + + } + public static class NotifyMatchmakerPlayerLeftRequest { /** * Unique identifier of the Game Instance the user is leaving. @@ -2266,6 +2589,30 @@ public static class PlayerLinkedAccount { } + public static class PlayerLocation { + /** + * The two-character continent code for this location + */ + public ContinentCode ContinentCode; + /** + * The two-character ISO 3166-1 country code for the country associated with the location + */ + public CountryCode CountryCode; + /** + * City of the player's geographic location. + */ + public String City; + /** + * Latitude coordinate of the player's geographic location. + */ + public Double Latitude; + /** + * Longitude coordinate of the player's geographic location. + */ + public Double Longitude; + + } + public static class PlayerProfile { /** * PlayFab Player ID @@ -2315,6 +2662,10 @@ public static class PlayerProfile { * List of player's tags for segmentation. */ public ArrayList Tags; + /** + * Dictionary of player's locations by type. + */ + public Map Locations; /** * Dictionary of player's virtual currency balances */ @@ -2432,6 +2783,10 @@ public static class RedeemCouponRequest { * Catalog version of the coupon. */ public String CatalogVersion; + /** + * Optional identifier for the Character that should receive the item. If null, item is added to the player + */ + public String CharacterId; } @@ -2906,6 +3261,15 @@ public static class SubtractUserVirtualCurrencyRequest { } + public static enum TaskInstanceStatus { + Succeeded, + Starting, + InProgress, + Failed, + Aborted, + Pending + } + public static enum TitleActivationStatus { None, ActivatedTitleKey, @@ -3110,6 +3474,10 @@ public static class UpdatePlayerStatisticsRequest { * Statistics to be updated with the provided values */ public ArrayList Statistics; + /** + * Indicates whether the statistics provided should be set, regardless of the aggregation method set on the statistic. Default is false. + */ + public Boolean ForceUpdate; } @@ -3503,7 +3871,7 @@ public static class VirtualCurrencyRechargeTime { public static class WriteEventResponse { /** - * The unique identifier of the event. This can be used to retrieve the event's properties using the GetEvent API. The values of this identifier consist of ASCII characters and are not constrained to any particular format. + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to any particular format. */ public String EventId; diff --git a/PlayFabSDK/src/com/playfab/PlayFabSettings.java b/PlayFabSDK/src/com/playfab/PlayFabSettings.java index 7ce85e23..1dbb4ccf 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.39.161017"; + public static String SdkVersion = "0.40.161107"; public static String BuildIdentifier = "jbuild_javasdk_1"; - public static String SdkVersionString = "JavaSDK-0.39.161017"; + public static String SdkVersionString = "JavaSDK-0.40.161107"; 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 667d9faa..058d5ed2 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java @@ -4655,4 +4655,584 @@ private static PlayFabResult privateRemovePlayerTagAsync( pfResult.Result = result; return pfResult; } + + /** + * Abort an ongoing task instance. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AbortTaskInstanceAsync(final AbortTaskInstanceRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAbortTaskInstanceAsync(request); + } + }); + } + + /** + * Abort an ongoing task instance. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AbortTaskInstance(final AbortTaskInstanceRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAbortTaskInstanceAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Abort an ongoing task instance. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAbortTaskInstanceAsync(final AbortTaskInstanceRequest 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/AbortTaskInstance", 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()); + EmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. + */ + @SuppressWarnings("unchecked") + public static FutureTask> CreateActionsOnPlayersInSegmentTaskAsync(final CreateActionsOnPlayerSegmentTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateCreateActionsOnPlayersInSegmentTaskAsync(request); + } + }); + } + + /** + * Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult CreateActionsOnPlayersInSegmentTask(final CreateActionsOnPlayerSegmentTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateCreateActionsOnPlayersInSegmentTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Create an ActionsOnPlayersInSegment task, which iterates through all players in a segment to execute action. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateCreateActionsOnPlayersInSegmentTaskAsync(final CreateActionsOnPlayerSegmentTaskRequest 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/CreateActionsOnPlayersInSegmentTask", 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()); + CreateTaskResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Create a CloudScript task, which can run a CloudScript on a schedule. + */ + @SuppressWarnings("unchecked") + public static FutureTask> CreateCloudScriptTaskAsync(final CreateCloudScriptTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateCreateCloudScriptTaskAsync(request); + } + }); + } + + /** + * Create a CloudScript task, which can run a CloudScript on a schedule. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult CreateCloudScriptTask(final CreateCloudScriptTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateCreateCloudScriptTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Create a CloudScript task, which can run a CloudScript on a schedule. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateCreateCloudScriptTaskAsync(final CreateCloudScriptTaskRequest 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/CreateCloudScriptTask", 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()); + CreateTaskResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Delete a task. + */ + @SuppressWarnings("unchecked") + public static FutureTask> DeleteTaskAsync(final DeleteTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteTaskAsync(request); + } + }); + } + + /** + * Delete a task. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult DeleteTask(final DeleteTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Delete a task. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateDeleteTaskAsync(final DeleteTaskRequest 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/DeleteTask", 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()); + EmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Get information about a ActionsOnPlayersInSegment task instance. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetActionsOnPlayersInSegmentTaskInstanceAsync(final GetTaskInstanceRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetActionsOnPlayersInSegmentTaskInstanceAsync(request); + } + }); + } + + /** + * Get information about a ActionsOnPlayersInSegment task instance. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetActionsOnPlayersInSegmentTaskInstance(final GetTaskInstanceRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetActionsOnPlayersInSegmentTaskInstanceAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get information about a ActionsOnPlayersInSegment task instance. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetActionsOnPlayersInSegmentTaskInstanceAsync(final GetTaskInstanceRequest 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/GetActionsOnPlayersInSegmentTaskInstance", 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()); + GetActionsOnPlayersInSegmentTaskInstanceResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Get detail information about a CloudScript task instance. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetCloudScriptTaskInstanceAsync(final GetTaskInstanceRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetCloudScriptTaskInstanceAsync(request); + } + }); + } + + /** + * Get detail information about a CloudScript task instance. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetCloudScriptTaskInstance(final GetTaskInstanceRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetCloudScriptTaskInstanceAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get detail information about a CloudScript task instance. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetCloudScriptTaskInstanceAsync(final GetTaskInstanceRequest 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/GetCloudScriptTaskInstance", 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()); + GetCloudScriptTaskInstanceResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Query for task instances by task, status, or time range. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetTaskInstancesAsync(final GetTaskInstancesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetTaskInstancesAsync(request); + } + }); + } + + /** + * Query for task instances by task, status, or time range. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetTaskInstances(final GetTaskInstancesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetTaskInstancesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Query for task instances by task, status, or time range. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetTaskInstancesAsync(final GetTaskInstancesRequest 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/GetTaskInstances", 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()); + GetTaskInstancesResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Get definition information on a specified task or all tasks within a title. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetTasksAsync(final GetTasksRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetTasksAsync(request); + } + }); + } + + /** + * Get definition information on a specified task or all tasks within a title. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetTasks(final GetTasksRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetTasksAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Get definition information on a specified task or all tasks within a title. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetTasksAsync(final GetTasksRequest 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/GetTasks", 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()); + GetTasksResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Run a task immediately regardless of its schedule. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RunTaskAsync(final RunTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRunTaskAsync(request); + } + }); + } + + /** + * Run a task immediately regardless of its schedule. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RunTask(final RunTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRunTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Run a task immediately regardless of its schedule. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRunTaskAsync(final RunTaskRequest 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/RunTask", 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()); + RunTaskResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Update an existing task. + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateTaskAsync(final UpdateTaskRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateTaskAsync(request); + } + }); + } + + /** + * Update an existing task. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateTask(final UpdateTaskRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateTaskAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Update an existing task. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateTaskAsync(final UpdateTaskRequest 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/UpdateTask", 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()); + EmptyResult 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 3c4b76d8..6ea3971c 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java @@ -5,6 +5,78 @@ public class PlayFabAdminModels { + public static class AbortTaskInstanceRequest { + /** + * ID of a task instance that is being aborted. + */ + public String TaskInstanceId; + + } + + public static class ActionsOnPlayersInSegmentTaskParameter { + /** + * ID of the segment to perform actions on. + */ + public String SegmentId; + /** + * ID of the action to perform on each player in segment. + */ + public String ActionId; + + } + + public static class ActionsOnPlayersInSegmentTaskSummary { + /** + * ID of the task instance. + */ + public String TaskInstanceId; + /** + * Identifier of the task this instance belongs to. + */ + public NameIdentifier TaskIdentifier; + /** + * UTC timestamp when the task started. + */ + public Date StartedAt; + /** + * UTC timestamp when the task completed. + */ + public Date CompletedAt; + /** + * Current status of the task instance. + */ + public TaskInstanceStatus Status; + /** + * Progress represented as percentage. + */ + public Double PercentComplete; + /** + * Estimated time remaining in seconds. + */ + public Double EstimatedSecondsRemaining; + /** + * If manually scheduled, ID of user who scheduled the task. + */ + public String ScheduledByUserId; + /** + * Error message for last processing attempt, if an error occured. + */ + public String ErrorMessage; + /** + * Flag indicating if the error was fatal, if false job will be retried. + */ + public Boolean ErrorWasFatal; + /** + * Total players in segment when task was started. + */ + public Integer TotalPlayersInSegment; + /** + * Total number of players that have had the actions applied to. + */ + public Integer TotalPlayersProcessed; + + } + public static class AdCampaignAttribution { /** * Attribution network name @@ -321,7 +393,7 @@ public static class CatalogItem implements Comparable { */ public Boolean IsLimitedEdition; /** - * BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. + * If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. */ public Integer InitialLimitedEditionCount; @@ -403,6 +475,58 @@ public static class CloudScriptFile { } + public static class CloudScriptTaskParameter { + /** + * Name of the CloudScript function to execute. + */ + public String FunctionName; + /** + * Argument to pass to the CloudScript function. + */ + public Object Argument; + + } + + public static class CloudScriptTaskSummary { + /** + * ID of the task instance. + */ + public String TaskInstanceId; + /** + * Identifier of the task this instance belongs to. + */ + public NameIdentifier TaskIdentifier; + /** + * UTC timestamp when the task started. + */ + public Date StartedAt; + /** + * UTC timestamp when the task completed. + */ + public Date CompletedAt; + /** + * Current status of the task instance. + */ + public TaskInstanceStatus Status; + /** + * Progress represented as percentage. + */ + public Double PercentComplete; + /** + * Estimated time remaining in seconds. + */ + public Double EstimatedSecondsRemaining; + /** + * If manually scheduled, ID of user who scheduled the task. + */ + public String ScheduledByUserId; + /** + * Result of CloudScript execution + */ + public ExecuteCloudScriptResult Result; + + } + public static class CloudScriptVersionStatus { /** * Version number @@ -435,6 +559,316 @@ public static class ContentInfo { } + public static enum ContinentCode { + AF, + AN, + AS, + EU, + NA, + OC, + SA + } + + public static enum CountryCode { + AF, + AX, + AL, + DZ, + AS, + AD, + AO, + AI, + AQ, + AG, + AR, + AM, + AW, + AU, + AT, + AZ, + BS, + BH, + BD, + BB, + BY, + BE, + BZ, + BJ, + BM, + BT, + BO, + BQ, + BA, + BW, + BV, + BR, + IO, + BN, + BG, + BF, + BI, + KH, + CM, + CA, + CV, + KY, + CF, + TD, + CL, + CN, + CX, + CC, + CO, + KM, + CG, + CD, + CK, + CR, + CI, + HR, + CU, + CW, + CY, + CZ, + DK, + DJ, + DM, + DO, + EC, + EG, + SV, + GQ, + ER, + EE, + ET, + FK, + FO, + FJ, + FI, + FR, + GF, + PF, + TF, + GA, + GM, + GE, + DE, + GH, + GI, + GR, + GL, + GD, + GP, + GU, + GT, + GG, + GN, + GW, + GY, + HT, + HM, + VA, + HN, + HK, + HU, + IS, + IN, + ID, + IR, + IQ, + IE, + IM, + IL, + IT, + JM, + JP, + JE, + JO, + KZ, + KE, + KI, + KP, + KR, + KW, + KG, + LA, + LV, + LB, + LS, + LR, + LY, + LI, + LT, + LU, + MO, + MK, + MG, + MW, + MY, + MV, + ML, + MT, + MH, + MQ, + MR, + MU, + YT, + MX, + FM, + MD, + MC, + MN, + ME, + MS, + MA, + MZ, + MM, + NA, + NR, + NP, + NL, + NC, + NZ, + NI, + NE, + NG, + NU, + NF, + MP, + NO, + OM, + PK, + PW, + PS, + PA, + PG, + PY, + PE, + PH, + PN, + PL, + PT, + PR, + QA, + RE, + RO, + RU, + RW, + BL, + SH, + KN, + LC, + MF, + PM, + VC, + WS, + SM, + ST, + SA, + SN, + RS, + SC, + SL, + SG, + SX, + SK, + SI, + SB, + SO, + ZA, + GS, + SS, + ES, + LK, + SD, + SR, + SJ, + SZ, + SE, + CH, + SY, + TW, + TJ, + TZ, + TH, + TL, + TG, + TK, + TO, + TT, + TN, + TR, + TM, + TC, + TV, + UG, + UA, + AE, + GB, + US, + UM, + UY, + UZ, + VU, + VE, + VN, + VG, + VI, + WF, + EH, + YE, + ZM, + ZW + } + + public static class CreateActionsOnPlayerSegmentTaskRequest { + /** + * Name of the task. This is a unique identifier for tasks in the title. + */ + public String Name; + /** + * Description the task + */ + public String Description; + /** + * Cron expression for the run schedule of the task. The expression should be in UTC. + */ + public String Schedule; + /** + * Whether the schedule is active. Inactive schedule will not trigger task execution. + */ + public Boolean IsActive; + /** + * Task details related to segment and action + */ + public ActionsOnPlayersInSegmentTaskParameter Parameter; + + } + + public static class CreateCloudScriptTaskRequest { + /** + * Name of the task. This is a unique identifier for tasks in the title. + */ + public String Name; + /** + * Description the task + */ + public String Description; + /** + * Cron expression for the run schedule of the task. The expression should be in UTC. + */ + public String Schedule; + /** + * Whether the schedule is active. Inactive schedule will not trigger task execution. + */ + public Boolean IsActive; + /** + * Task details related to CloudScript + */ + public CloudScriptTaskParameter Parameter; + + } + public static class CreatePlayerStatisticDefinitionRequest { /** * unique name of the statistic @@ -459,6 +893,14 @@ public static class CreatePlayerStatisticDefinitionResult { } + public static class CreateTaskResult { + /** + * ID of the task + */ + public String TaskId; + + } + public static enum Currency { AED, AFN, @@ -648,6 +1090,14 @@ public static class DeleteStoreResult { } + public static class DeleteTaskRequest { + /** + * Specify either the task ID or the name of task to be deleted. + */ + public NameIdentifier Identifier; + + } + public static class DeleteUsersRequest { /** * An array of unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -664,6 +1114,48 @@ public static class DeleteUsersResult { } + public static class EmptyResult { + + } + + public static class ExecuteCloudScriptResult { + /** + * The name of the function that executed + */ + public String FunctionName; + /** + * The revision of the CloudScript that executed + */ + public Integer Revision; + /** + * The object returned from the CloudScript function, if any + */ + public Object FunctionResult; + /** + * Entries logged during the function execution. These include both entries logged in the function code using log.info() and log.error() and error entries for API and HTTP request failures. + */ + public ArrayList Logs; + public Double ExecutionTimeSeconds; + /** + * Processor time consumed while executing the function. This does not include time spent waiting on API calls or HTTP requests. + */ + public Double ProcessorTimeSeconds; + public Long MemoryConsumedBytes; + /** + * Number of PlayFab API requests issued by the CloudScript function + */ + public Integer APIRequestsIssued; + /** + * Number of external HTTP requests issued by the CloudScript function + */ + public Integer HttpRequestsIssued; + /** + * Information about the error, if any, that occured during execution + */ + public ScriptExecutionError Error; + + } + public static enum GameBuildStatus { Available, Validating, @@ -704,6 +1196,18 @@ public static class GetActionGroupResult { } + public static class GetActionsOnPlayersInSegmentTaskInstanceResult { + /** + * Status summary of the actions-on-players-in-segment task instance + */ + public ActionsOnPlayersInSegmentTaskSummary Summary; + /** + * Parameter of this task instance + */ + public ActionsOnPlayersInSegmentTaskParameter Parameter; + + } + public static class GetAllActionGroupsRequest { } @@ -781,6 +1285,18 @@ public static class GetCloudScriptRevisionResult { } + public static class GetCloudScriptTaskInstanceResult { + /** + * Status summary of the CloudScript task instance + */ + public CloudScriptTaskSummary Summary; + /** + * Parameter of this task instance + */ + public CloudScriptTaskParameter Parameter; + + } + public static class GetCloudScriptVersionsRequest { } @@ -1196,6 +1712,58 @@ public static class GetStoreItemsResult { } + public static class GetTaskInstanceRequest { + /** + * ID of the requested task instance. + */ + public String TaskInstanceId; + + } + + public static class GetTaskInstancesRequest { + /** + * Name or ID of the task whose instances are being queried. If not specified, return all task instances that satisfy conditions set by other filters. + */ + public NameIdentifier TaskIdentifier; + /** + * Optional filter for task instances that are of a specific status. + */ + public TaskInstanceStatus StatusFilter; + /** + * Optional range-from filter for task instances' StartedAt timestamp. + */ + public Date StartedAtRangeFrom; + /** + * Optional range-to filter for task instances' StartedAt timestamp. + */ + public Date StartedAtRangeTo; + + } + + public static class GetTaskInstancesResult { + /** + * Basic status summaries of the queried task instances. Empty If no task instances meets the filter criteria. To get detailed status summary, use Get*TaskInstance API according to task type (e.g. GetActionsOnPlayersInSegmentTaskInstance). + */ + public ArrayList Summaries; + + } + + public static class GetTasksRequest { + /** + * Provide either the task ID or the task name to get a specific task. If not specified, return all defined tasks. + */ + public NameIdentifier Identifier; + + } + + public static class GetTasksResult { + /** + * Result tasks. Empty if there is no task found. + */ + public ArrayList Tasks; + + } + public static class GetTitleDataRequest { /** * Specific keys to search for in the title data (leave null to get all keys) @@ -1552,6 +2120,19 @@ public static enum LoginIdentityProvider { Twitch } + public static class LogStatement { + /** + * 'Debug', 'Info', or 'Error' + */ + public String Level; + public String Message; + /** + * Optional object accompanying the message as contextual information + */ + public Object Data; + + } + public static class LookupUserAccountInfoRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1696,6 +2277,15 @@ public static class ModifyUserVirtualCurrencyResult { } + /** + * Identifier by either name or ID. Note that a name may change due to renaming, or reused after being deleted. ID is immutable and unique. + */ + public static class NameIdentifier { + public String Name; + public String Id; + + } + public static class PlayerLinkedAccount { /** * Authentication platform @@ -1716,6 +2306,30 @@ public static class PlayerLinkedAccount { } + public static class PlayerLocation { + /** + * The two-character continent code for this location + */ + public ContinentCode ContinentCode; + /** + * The two-character ISO 3166-1 country code for the country associated with the location + */ + public CountryCode CountryCode; + /** + * City of the player's geographic location. + */ + public String City; + /** + * Latitude coordinate of the player's geographic location. + */ + public Double Latitude; + /** + * Longitude coordinate of the player's geographic location. + */ + public Double Longitude; + + } + public static class PlayerProfile { /** * PlayFab Player ID @@ -1765,6 +2379,10 @@ public static class PlayerProfile { * List of player's tags for segmentation. */ public ArrayList Tags; + /** + * Dictionary of player's locations by type. + */ + public Map Locations; /** * Dictionary of player's virtual currency balances */ @@ -2122,6 +2740,83 @@ public static class RevokeInventoryResult { } + public static class RunTaskRequest { + /** + * Provide either the task ID or the task name to run a task. + */ + public NameIdentifier Identifier; + + } + + public static class RunTaskResult { + /** + * ID of the task instance that is started. This can be used in Get*TaskInstance (e.g. GetCloudScriptTaskInstance) API call to retrieve status for the task instance. + */ + public String TaskInstanceId; + + } + + public static class ScheduledTask { + /** + * ID of the task + */ + public String TaskId; + /** + * Name of the task. This is a unique identifier for tasks in the title. + */ + public String Name; + /** + * Description the task + */ + public String Description; + /** + * Cron expression for the run schedule of the task. The expression should be in UTC. + */ + public String Schedule; + /** + * Whether the schedule is active. Inactive schedule will not trigger task execution. + */ + public Boolean IsActive; + /** + * Task type. + */ + public ScheduledTaskType Type; + /** + * Task parameter. Different types of task have different parameter structure. See each task type's create API documentation for the details. + */ + public Object Parameter; + /** + * UTC time of last run + */ + public Date LastRunTime; + /** + * UTC time of next run + */ + public Date NextRunTime; + + } + + public static enum ScheduledTaskType { + CloudScript, + ActionsOnPlayerSegment + } + + public static class ScriptExecutionError { + /** + * Error code, such as CloudScriptNotFound, JavascriptException, CloudScriptFunctionArgumentSizeExceeded, CloudScriptAPIRequestCountExceeded, CloudScriptAPIRequestError, or CloudScriptHTTPRequestError + */ + public String Error; + /** + * Details about the error + */ + public String Message; + /** + * Point during the execution of the script at which the error occurred, if any + */ + public String StackTrace; + + } + public static class SendAccountRecoveryEmailRequest { /** * User email address attached to their account @@ -2312,6 +3007,55 @@ public static class SubtractUserVirtualCurrencyRequest { } + public static class TaskInstanceBasicSummary { + /** + * ID of the task instance. + */ + public String TaskInstanceId; + /** + * Identifier of the task this instance belongs to. + */ + public NameIdentifier TaskIdentifier; + /** + * UTC timestamp when the task started. + */ + public Date StartedAt; + /** + * UTC timestamp when the task completed. + */ + public Date CompletedAt; + /** + * Current status of the task instance. + */ + public TaskInstanceStatus Status; + /** + * Progress represented as percentage. + */ + public Double PercentComplete; + /** + * Estimated time remaining in seconds. + */ + public Double EstimatedSecondsRemaining; + /** + * If manually scheduled, ID of user who scheduled the task. + */ + public String ScheduledByUserId; + /** + * Type of the task. + */ + public ScheduledTaskType Type; + + } + + public static enum TaskInstanceStatus { + Succeeded, + Starting, + InProgress, + Failed, + Aborted, + Pending + } + public static enum TitleActivationStatus { None, ActivatedTitleKey, @@ -2483,6 +3227,38 @@ public static class UpdateStoreItemsResult { } + public static class UpdateTaskRequest { + /** + * Specify either the task ID or the name of the task to be updated. + */ + public NameIdentifier Identifier; + /** + * Name of the task. This is a unique identifier for tasks in the title. + */ + public String Name; + /** + * Description the task + */ + public String Description; + /** + * Cron expression for the run schedule of the task. The expression should be in UTC. + */ + public String Schedule; + /** + * Whether the schedule is active. Inactive schedule will not trigger task execution. + */ + public Boolean IsActive; + /** + * Task type. + */ + public ScheduledTaskType Type; + /** + * Parameter object specific to the task type. See each task type's create API documentation for details. + */ + public Object Parameter; + + } + public static class UpdateUserDataRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java index bcff9514..6df7c14b 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java @@ -259,7 +259,11 @@ public static enum PlayFabErrorCode { ScheduledTaskCreateConflict(1255), InvalidScheduledTaskName(1256), InvalidTaskSchedule(1257), - SteamNotEnabledForTitle(1258); + SteamNotEnabledForTitle(1258), + LimitNotAnUpgradeOption(1259), + NoSecretKeyEnabledForCloudScript(1260), + TaskNotFound(1261), + TaskInstanceNotFound(1262); public int id; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java index d5cf7cc9..464c7abc 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java @@ -5,6 +5,58 @@ public class PlayFabServerModels { + public static class ActionsOnPlayersInSegmentTaskSummary { + /** + * ID of the task instance. + */ + public String TaskInstanceId; + /** + * Identifier of the task this instance belongs to. + */ + public NameIdentifier TaskIdentifier; + /** + * UTC timestamp when the task started. + */ + public Date StartedAt; + /** + * UTC timestamp when the task completed. + */ + public Date CompletedAt; + /** + * Current status of the task instance. + */ + public TaskInstanceStatus Status; + /** + * Progress represented as percentage. + */ + public Double PercentComplete; + /** + * Estimated time remaining in seconds. + */ + public Double EstimatedSecondsRemaining; + /** + * If manually scheduled, ID of user who scheduled the task. + */ + public String ScheduledByUserId; + /** + * Error message for last processing attempt, if an error occured. + */ + public String ErrorMessage; + /** + * Flag indicating if the error was fatal, if false job will be retried. + */ + public Boolean ErrorWasFatal; + /** + * Total players in segment when task was started. + */ + public Integer TotalPlayersInSegment; + /** + * Total number of players that have had the actions applied to. + */ + public Integer TotalPlayersProcessed; + + } + public static class AdCampaignAttribution { /** * Attribution network name @@ -317,7 +369,7 @@ public static class CatalogItem implements Comparable { */ public Boolean IsLimitedEdition; /** - * BETA: If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. + * If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1. */ public Integer InitialLimitedEditionCount; @@ -485,6 +537,268 @@ public static class ConsumeItemResult { } + public static enum ContinentCode { + AF, + AN, + AS, + EU, + NA, + OC, + SA + } + + public static enum CountryCode { + AF, + AX, + AL, + DZ, + AS, + AD, + AO, + AI, + AQ, + AG, + AR, + AM, + AW, + AU, + AT, + AZ, + BS, + BH, + BD, + BB, + BY, + BE, + BZ, + BJ, + BM, + BT, + BO, + BQ, + BA, + BW, + BV, + BR, + IO, + BN, + BG, + BF, + BI, + KH, + CM, + CA, + CV, + KY, + CF, + TD, + CL, + CN, + CX, + CC, + CO, + KM, + CG, + CD, + CK, + CR, + CI, + HR, + CU, + CW, + CY, + CZ, + DK, + DJ, + DM, + DO, + EC, + EG, + SV, + GQ, + ER, + EE, + ET, + FK, + FO, + FJ, + FI, + FR, + GF, + PF, + TF, + GA, + GM, + GE, + DE, + GH, + GI, + GR, + GL, + GD, + GP, + GU, + GT, + GG, + GN, + GW, + GY, + HT, + HM, + VA, + HN, + HK, + HU, + IS, + IN, + ID, + IR, + IQ, + IE, + IM, + IL, + IT, + JM, + JP, + JE, + JO, + KZ, + KE, + KI, + KP, + KR, + KW, + KG, + LA, + LV, + LB, + LS, + LR, + LY, + LI, + LT, + LU, + MO, + MK, + MG, + MW, + MY, + MV, + ML, + MT, + MH, + MQ, + MR, + MU, + YT, + MX, + FM, + MD, + MC, + MN, + ME, + MS, + MA, + MZ, + MM, + NA, + NR, + NP, + NL, + NC, + NZ, + NI, + NE, + NG, + NU, + NF, + MP, + NO, + OM, + PK, + PW, + PS, + PA, + PG, + PY, + PE, + PH, + PN, + PL, + PT, + PR, + QA, + RE, + RO, + RU, + RW, + BL, + SH, + KN, + LC, + MF, + PM, + VC, + WS, + SM, + ST, + SA, + SN, + RS, + SC, + SL, + SG, + SX, + SK, + SI, + SB, + SO, + ZA, + GS, + SS, + ES, + LK, + SD, + SR, + SJ, + SZ, + SE, + CH, + SY, + TW, + TJ, + TZ, + TH, + TL, + TG, + TK, + TO, + TT, + TN, + TR, + TM, + TC, + TV, + UG, + UA, + AE, + GB, + US, + UM, + UY, + UZ, + VU, + VE, + VN, + VG, + VI, + WF, + EH, + YE, + ZM, + ZW + } + public static class CreateSharedGroupRequest { /** * Unique identifier for the shared group (a random identifier will be assigned, if one is not specified). @@ -2199,6 +2513,15 @@ public static class MoveItemToUserFromCharacterResult { } + /** + * Identifier by either name or ID. Note that a name may change due to renaming, or reused after being deleted. ID is immutable and unique. + */ + public static class NameIdentifier { + public String Name; + public String Id; + + } + public static class NotifyMatchmakerPlayerLeftRequest { /** * Unique identifier of the Game Instance the user is leaving. @@ -2266,6 +2589,30 @@ public static class PlayerLinkedAccount { } + public static class PlayerLocation { + /** + * The two-character continent code for this location + */ + public ContinentCode ContinentCode; + /** + * The two-character ISO 3166-1 country code for the country associated with the location + */ + public CountryCode CountryCode; + /** + * City of the player's geographic location. + */ + public String City; + /** + * Latitude coordinate of the player's geographic location. + */ + public Double Latitude; + /** + * Longitude coordinate of the player's geographic location. + */ + public Double Longitude; + + } + public static class PlayerProfile { /** * PlayFab Player ID @@ -2315,6 +2662,10 @@ public static class PlayerProfile { * List of player's tags for segmentation. */ public ArrayList Tags; + /** + * Dictionary of player's locations by type. + */ + public Map Locations; /** * Dictionary of player's virtual currency balances */ @@ -2432,6 +2783,10 @@ public static class RedeemCouponRequest { * Catalog version of the coupon. */ public String CatalogVersion; + /** + * Optional identifier for the Character that should receive the item. If null, item is added to the player + */ + public String CharacterId; } @@ -2906,6 +3261,15 @@ public static class SubtractUserVirtualCurrencyRequest { } + public static enum TaskInstanceStatus { + Succeeded, + Starting, + InProgress, + Failed, + Aborted, + Pending + } + public static enum TitleActivationStatus { None, ActivatedTitleKey, @@ -3110,6 +3474,10 @@ public static class UpdatePlayerStatisticsRequest { * Statistics to be updated with the provided values */ public ArrayList Statistics; + /** + * Indicates whether the statistics provided should be set, regardless of the aggregation method set on the statistic. Default is false. + */ + public Boolean ForceUpdate; } @@ -3503,7 +3871,7 @@ public static class VirtualCurrencyRechargeTime { public static class WriteEventResponse { /** - * The unique identifier of the event. This can be used to retrieve the event's properties using the GetEvent API. The values of this identifier consist of ASCII characters and are not constrained to any particular format. + * The unique identifier of the event. The values of this identifier consist of ASCII characters and are not constrained to any particular format. */ public String EventId; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java b/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java index 244fec77..f02ba1d6 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.39.161017"; + public static String SdkVersion = "0.40.161107"; public static String BuildIdentifier = "jbuild_javasdk_1"; - public static String SdkVersionString = "JavaSDK-0.39.161017"; + public static String SdkVersionString = "JavaSDK-0.40.161107"; 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;