diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/internal/PlayFabVersion.java b/AndroidStudioExample/app/src/main/java/com/playfab/internal/PlayFabVersion.java index 44e3b3a7..955bd363 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/internal/PlayFabVersion.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/internal/PlayFabVersion.java @@ -1,7 +1,7 @@ package com.playfab.internal; public class PlayFabVersion { - public static String SdkRevision = "0.17.160215"; + public static String SdkRevision = "0.18.160222"; public static String getVersionString() { return "JavaSDK-" + SdkRevision; } diff --git a/PlayFabClientSDK/src/com/playfab/internal/PlayFabVersion.java b/PlayFabClientSDK/src/com/playfab/internal/PlayFabVersion.java index 44e3b3a7..955bd363 100644 --- a/PlayFabClientSDK/src/com/playfab/internal/PlayFabVersion.java +++ b/PlayFabClientSDK/src/com/playfab/internal/PlayFabVersion.java @@ -1,7 +1,7 @@ package com.playfab.internal; public class PlayFabVersion { - public static String SdkRevision = "0.17.160215"; + public static String SdkRevision = "0.18.160222"; public static String getVersionString() { return "JavaSDK-" + SdkRevision; } diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java index 25440f56..ec70233c 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java @@ -132,6 +132,64 @@ private static PlayFabResult privateGetPlayF return pfResult; } + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromSteamIDsAsync(final GetPlayFabIDsFromSteamIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromSteamIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromSteamIDs(final GetPlayFabIDsFromSteamIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromSteamIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromSteamIDsAsync(final GetPlayFabIDsFromSteamIDsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/GetPlayFabIDsFromSteamIDs", 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()); + GetPlayFabIDsFromSteamIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the relevant details for a specified user */ @@ -422,6 +480,64 @@ private static PlayFabResult privateGetLeaderboa return pfResult; } + /** + * Retrieves the current version and values for the indicated statistics, for the local player. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerStatisticsAsync(final GetPlayerStatisticsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerStatisticsAsync(request); + } + }); + } + + /** + * Retrieves the current version and values for the indicated statistics, for the local player. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerStatistics(final GetPlayerStatisticsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerStatisticsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the current version and values for the indicated statistics, for the local player. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerStatisticsAsync(final GetPlayerStatisticsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/GetPlayerStatistics", 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()); + GetPlayerStatisticsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -828,6 +944,64 @@ private static PlayFabResult privateGetUserStatisticsAs return pfResult; } + /** + * Updates the values of the specified title-specific statistics for the user + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdatePlayerStatisticsAsync(final UpdatePlayerStatisticsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdatePlayerStatisticsAsync(request); + } + }); + } + + /** + * Updates the values of the specified title-specific statistics for the user + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdatePlayerStatistics(final UpdatePlayerStatisticsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdatePlayerStatisticsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Updates the values of the specified title-specific statistics for the user + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdatePlayerStatisticsAsync(final UpdatePlayerStatisticsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/UpdatePlayerStatistics", 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()); + UpdatePlayerStatisticsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Updates the title-specific custom data for the user which is readable and writable by the client */ diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java index 55e1e7c0..c33e18af 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java @@ -779,6 +779,26 @@ public static class GetCharacterStatisticsResult { } + public static class GetCloudScriptUrlRequest { + /** + * Cloud Script Version to use. Defaults to 1. + */ + public Integer Version; + /** + * Specifies whether the URL returned should be the one for the most recently uploaded Revision of the Cloud Script (true), or the Revision most recently set to live (false). Defaults to false. + */ + public Boolean Testing; + + } + + public static class GetCloudScriptUrlResult { + /** + * URL of the Cloud Script logic server. + */ + public String Url; + + } + public static class GetContentDownloadUrlRequest { /** * Key of the content item to fetch, usually formatted as a path, e.g. images/a.png @@ -999,6 +1019,26 @@ public static class GetPlayFabIDsFromFacebookIDsResult { } + public static class GetPlayFabIDsFromSteamIDsRequest { + /** + * Deprecated: Please use SteamStringIDs + */ + public ArrayList SteamIDs; + /** + * Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. + */ + public ArrayList SteamStringIDs; + + } + + public static class GetPlayFabIDsFromSteamIDsResult { + /** + * Mapping of Steam identifiers to PlayFab identifiers. + */ + public ArrayList Data; + + } + public static class GetPublisherDataRequest { /** * array of keys to get back data from the Publisher data blob, set by the admin tools @@ -1809,6 +1849,58 @@ public static class RevokeInventoryResult { } + public static class RunCloudScriptResult { + /** + * id of Cloud Script run + */ + public String ActionId; + /** + * version of Cloud Script run + */ + public Integer Version; + /** + * revision of Cloud Script run + */ + public Integer Revision; + /** + * return values from the server action as a dynamic object + */ + public Object Results; + /** + * return values from the server action as a JSON encoded string + */ + public String ResultsEncoded; + /** + * any log statements generated during the run of this action + */ + public String ActionLog; + /** + * time this script took to run, in seconds + */ + public Double ExecutionTime; + + } + + public static class RunServerCloudScriptRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * server action to trigger + */ + public String ActionId; + /** + * parameters to pass into the action (If you use this, don't use ParamsEncoded) + */ + public Object Params; + /** + * json-encoded parameters to pass into the action (If you use this, don't use Params) + */ + public String ParamsEncoded; + + } + public static class SendPushNotificationRequest { /** * PlayFabId of the recipient of the push notification. @@ -1913,6 +2005,22 @@ public static class StatisticValue { } + public static class SteamPlayFabIdPair { + /** + * Deprecated: Please use SteamStringId + */ + public Long SteamId; + /** + * Unique Steam identifier for a user. + */ + public String SteamStringId; + /** + * Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier. + */ + public String PlayFabId; + + } + public static class SubtractCharacterVirtualCurrencyRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. diff --git a/PlayFabSDK/src/com/playfab/internal/PlayFabVersion.java b/PlayFabSDK/src/com/playfab/internal/PlayFabVersion.java index 44e3b3a7..955bd363 100644 --- a/PlayFabSDK/src/com/playfab/internal/PlayFabVersion.java +++ b/PlayFabSDK/src/com/playfab/internal/PlayFabVersion.java @@ -1,7 +1,7 @@ package com.playfab.internal; public class PlayFabVersion { - public static String SdkRevision = "0.17.160215"; + public static String SdkRevision = "0.18.160222"; public static String getVersionString() { return "JavaSDK-" + SdkRevision; } diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java index 25440f56..ec70233c 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java @@ -132,6 +132,64 @@ private static PlayFabResult privateGetPlayF return pfResult; } + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromSteamIDsAsync(final GetPlayFabIDsFromSteamIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromSteamIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromSteamIDs(final GetPlayFabIDsFromSteamIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromSteamIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromSteamIDsAsync(final GetPlayFabIDsFromSteamIDsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/GetPlayFabIDsFromSteamIDs", 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()); + GetPlayFabIDsFromSteamIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the relevant details for a specified user */ @@ -422,6 +480,64 @@ private static PlayFabResult privateGetLeaderboa return pfResult; } + /** + * Retrieves the current version and values for the indicated statistics, for the local player. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayerStatisticsAsync(final GetPlayerStatisticsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerStatisticsAsync(request); + } + }); + } + + /** + * Retrieves the current version and values for the indicated statistics, for the local player. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayerStatistics(final GetPlayerStatisticsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayerStatisticsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the current version and values for the indicated statistics, for the local player. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayerStatisticsAsync(final GetPlayerStatisticsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/GetPlayerStatistics", 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()); + GetPlayerStatisticsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -828,6 +944,64 @@ private static PlayFabResult privateGetUserStatisticsAs return pfResult; } + /** + * Updates the values of the specified title-specific statistics for the user + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdatePlayerStatisticsAsync(final UpdatePlayerStatisticsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdatePlayerStatisticsAsync(request); + } + }); + } + + /** + * Updates the values of the specified title-specific statistics for the user + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdatePlayerStatistics(final UpdatePlayerStatisticsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdatePlayerStatisticsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Updates the values of the specified title-specific statistics for the user + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdatePlayerStatisticsAsync(final UpdatePlayerStatisticsRequest request) throws Exception { + if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/UpdatePlayerStatistics", 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()); + UpdatePlayerStatisticsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Updates the title-specific custom data for the user which is readable and writable by the client */ diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java index 55e1e7c0..c33e18af 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java @@ -779,6 +779,26 @@ public static class GetCharacterStatisticsResult { } + public static class GetCloudScriptUrlRequest { + /** + * Cloud Script Version to use. Defaults to 1. + */ + public Integer Version; + /** + * Specifies whether the URL returned should be the one for the most recently uploaded Revision of the Cloud Script (true), or the Revision most recently set to live (false). Defaults to false. + */ + public Boolean Testing; + + } + + public static class GetCloudScriptUrlResult { + /** + * URL of the Cloud Script logic server. + */ + public String Url; + + } + public static class GetContentDownloadUrlRequest { /** * Key of the content item to fetch, usually formatted as a path, e.g. images/a.png @@ -999,6 +1019,26 @@ public static class GetPlayFabIDsFromFacebookIDsResult { } + public static class GetPlayFabIDsFromSteamIDsRequest { + /** + * Deprecated: Please use SteamStringIDs + */ + public ArrayList SteamIDs; + /** + * Array of unique Steam identifiers (Steam profile IDs) for which the title needs to get PlayFab identifiers. + */ + public ArrayList SteamStringIDs; + + } + + public static class GetPlayFabIDsFromSteamIDsResult { + /** + * Mapping of Steam identifiers to PlayFab identifiers. + */ + public ArrayList Data; + + } + public static class GetPublisherDataRequest { /** * array of keys to get back data from the Publisher data blob, set by the admin tools @@ -1809,6 +1849,58 @@ public static class RevokeInventoryResult { } + public static class RunCloudScriptResult { + /** + * id of Cloud Script run + */ + public String ActionId; + /** + * version of Cloud Script run + */ + public Integer Version; + /** + * revision of Cloud Script run + */ + public Integer Revision; + /** + * return values from the server action as a dynamic object + */ + public Object Results; + /** + * return values from the server action as a JSON encoded string + */ + public String ResultsEncoded; + /** + * any log statements generated during the run of this action + */ + public String ActionLog; + /** + * time this script took to run, in seconds + */ + public Double ExecutionTime; + + } + + public static class RunServerCloudScriptRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * server action to trigger + */ + public String ActionId; + /** + * parameters to pass into the action (If you use this, don't use ParamsEncoded) + */ + public Object Params; + /** + * json-encoded parameters to pass into the action (If you use this, don't use Params) + */ + public String ParamsEncoded; + + } + public static class SendPushNotificationRequest { /** * PlayFabId of the recipient of the push notification. @@ -1913,6 +2005,22 @@ public static class StatisticValue { } + public static class SteamPlayFabIdPair { + /** + * Deprecated: Please use SteamStringId + */ + public Long SteamId; + /** + * Unique Steam identifier for a user. + */ + public String SteamStringId; + /** + * Unique PlayFab identifier for a user, or null if no PlayFab account is linked to the Steam identifier. + */ + public String PlayFabId; + + } + public static class SubtractCharacterVirtualCurrencyRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. diff --git a/PlayFabServerSDK/src/com/playfab/internal/PlayFabVersion.java b/PlayFabServerSDK/src/com/playfab/internal/PlayFabVersion.java index 44e3b3a7..955bd363 100644 --- a/PlayFabServerSDK/src/com/playfab/internal/PlayFabVersion.java +++ b/PlayFabServerSDK/src/com/playfab/internal/PlayFabVersion.java @@ -1,7 +1,7 @@ package com.playfab.internal; public class PlayFabVersion { - public static String SdkRevision = "0.17.160215"; + public static String SdkRevision = "0.18.160222"; public static String getVersionString() { return "JavaSDK-" + SdkRevision; }