diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java index b9136857c..ca860193e 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java @@ -4519,7 +4519,7 @@ private static PlayFabResult privatePurchaseItemAsync(final } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static FutureTask> RedeemCouponAsync(final RedeemCouponRequest request) { @@ -4531,7 +4531,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static PlayFabResult RedeemCoupon(final RedeemCouponRequest request) { @@ -4549,7 +4549,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") private static PlayFabResult privateRedeemCouponAsync(final RedeemCouponRequest request) throws Exception { diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java index 2b987dc6b..d2db8f907 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java @@ -2470,7 +2470,7 @@ public static class LoginWithGoogleAccountRequest { */ public Boolean CreateAccount; /** - * Deprecated - unused + * Deprecated - Do not use */ public String PublisherId; /** @@ -2639,7 +2639,7 @@ public static class MatchmakeRequest { */ public CollectionFilter TagFilter; /** - * [deprecated] + * Deprecated - Do not use */ public Boolean EnableQueue; @@ -2659,7 +2659,7 @@ public static class MatchmakeResult { */ public Integer ServerPort; /** - * server authorization ticket (used by RedeemCoupon to validate user insertion into the game) + * server authorization ticket (used by RedeemMatchmakerTicket to validate user insertion into the game) */ public String Ticket; /** @@ -2899,7 +2899,7 @@ public static class RedeemCouponRequest { */ public String CouponCode; /** - * Catalog version of the coupon. + * Catalog version of the coupon. If null, uses the default catalog */ public String CatalogVersion; @@ -2989,7 +2989,7 @@ public static class RegisterPlayFabUserRequest { */ public String DisplayName; /** - * [Deprecated - The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. + * The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. */ public String Origination; @@ -3165,7 +3165,7 @@ public static class SendAccountRecoveryEmailRequest { */ public String TitleId; /** - * Deprecated - unused + * Deprecated - Do not use */ public String PublisherId; diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java index 9a8c01efe..d6f2ec8ea 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java @@ -246,7 +246,9 @@ public static enum PlayFabErrorCode { InvalidSegment(1242), InvalidSessionId(1243), SessionLogNotFound(1244), - InvalidSearchTerm(1245); + InvalidSearchTerm(1245), + TwoFactorAuthenticationTokenRequired(1246), + GameServerHostCountLimitExceeded(1247); 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 3d39dc0ca..5a14855f5 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.33.160815"; + public static String SdkVersion = "0.34.160822"; public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.33.160815"; + public static String SdkVersionString = "JavaSDK-0.34.160822"; public static String TitleId = null; // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website) public static ErrorCallback GlobalErrorHandler; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java b/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java index 5d476a3d3..0030d21d3 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java @@ -4518,7 +4518,7 @@ private static PlayFabResult privatePurchaseItemAsync(final } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static FutureTask> RedeemCouponAsync(final RedeemCouponRequest request) { @@ -4530,7 +4530,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static PlayFabResult RedeemCoupon(final RedeemCouponRequest request) { @@ -4548,7 +4548,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") private static PlayFabResult privateRedeemCouponAsync(final RedeemCouponRequest request) throws Exception { diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java index 2b987dc6b..d2db8f907 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java @@ -2470,7 +2470,7 @@ public static class LoginWithGoogleAccountRequest { */ public Boolean CreateAccount; /** - * Deprecated - unused + * Deprecated - Do not use */ public String PublisherId; /** @@ -2639,7 +2639,7 @@ public static class MatchmakeRequest { */ public CollectionFilter TagFilter; /** - * [deprecated] + * Deprecated - Do not use */ public Boolean EnableQueue; @@ -2659,7 +2659,7 @@ public static class MatchmakeResult { */ public Integer ServerPort; /** - * server authorization ticket (used by RedeemCoupon to validate user insertion into the game) + * server authorization ticket (used by RedeemMatchmakerTicket to validate user insertion into the game) */ public String Ticket; /** @@ -2899,7 +2899,7 @@ public static class RedeemCouponRequest { */ public String CouponCode; /** - * Catalog version of the coupon. + * Catalog version of the coupon. If null, uses the default catalog */ public String CatalogVersion; @@ -2989,7 +2989,7 @@ public static class RegisterPlayFabUserRequest { */ public String DisplayName; /** - * [Deprecated - The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. + * The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. */ public String Origination; @@ -3165,7 +3165,7 @@ public static class SendAccountRecoveryEmailRequest { */ public String TitleId; /** - * Deprecated - unused + * Deprecated - Do not use */ public String PublisherId; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java index 9a8c01efe..d6f2ec8ea 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java @@ -246,7 +246,9 @@ public static enum PlayFabErrorCode { InvalidSegment(1242), InvalidSessionId(1243), SessionLogNotFound(1244), - InvalidSearchTerm(1245); + InvalidSearchTerm(1245), + TwoFactorAuthenticationTokenRequired(1246), + GameServerHostCountLimitExceeded(1247); public int id; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java b/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java index 22535d603..224d4ca68 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.33.160815"; + public static String SdkVersion = "0.34.160822"; public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.33.160815"; + public static String SdkVersionString = "JavaSDK-0.34.160822"; 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/PlayFabApiTest.java b/PlayFabSDK/src/PlayFabApiTest.java index 00097fed0..526dfaeca 100644 --- a/PlayFabSDK/src/PlayFabApiTest.java +++ b/PlayFabSDK/src/PlayFabApiTest.java @@ -1,13 +1,7 @@ import static org.junit.Assert.*; import org.junit.*; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import java.util.List; -import java.util.Date; -import java.util.Calendar; -import java.util.TimeZone; +import java.util.*; import java.io.*; import java.util.Properties; @@ -248,33 +242,40 @@ public void UserDataApi() /// Test a sequence of calls that modifies saved data, /// and verifies that the next sequential API call contains updated data. /// Verify that the data is saved correctly, and that specific types are tested - /// Parameter types tested: Dictionary + /// Parameter types tested: Dictionary /// @Test - public void UserStatisticsApi() + public void PlayerStatisticsApi() { LoginOrRegister(); + Gson gson = new GsonBuilder().create(); - PlayFabClientModels.GetUserStatisticsRequest getRequest = new PlayFabClientModels.GetUserStatisticsRequest(); - PlayFabResult getStatsResult = PlayFabClientAPI.GetUserStatistics(getRequest); - VerifyResult(getStatsResult, true); - boolean hasStat = getStatsResult.Result.UserStatistics != null && getStatsResult.Result.UserStatistics.containsKey(TEST_STAT_NAME); - int testStatExpected = !hasStat ? 0 : getStatsResult.Result.UserStatistics.get(TEST_STAT_NAME); + PlayFabClientModels.GetPlayerStatisticsRequest getRequest = new PlayFabClientModels.GetPlayerStatisticsRequest(); + PlayFabResult getStatsResult1 = PlayFabClientAPI.GetPlayerStatistics(getRequest); + VerifyResult(getStatsResult1, true); + int testStatExpected = 0; + for(PlayFabClientModels.StatisticValue eachStat : getStatsResult1.Result.Statistics) + if (eachStat.StatisticName.equals(TEST_STAT_NAME)) + testStatExpected = eachStat.Value; testStatExpected = (testStatExpected + 1) % 100; // This test is about the expected value changing - but not testing more complicated issues like bounds - PlayFabClientModels.UpdateUserStatisticsRequest updateRequest = new PlayFabClientModels.UpdateUserStatisticsRequest(); - updateRequest.UserStatistics = new HashMap(); - updateRequest.UserStatistics.put(TEST_STAT_NAME, testStatExpected); - PlayFabResult updateStatsResult = PlayFabClientAPI.UpdateUserStatistics(updateRequest); + PlayFabClientModels.UpdatePlayerStatisticsRequest updateRequest = new PlayFabClientModels.UpdatePlayerStatisticsRequest(); + updateRequest.Statistics = new ArrayList(); + PlayFabClientModels.StatisticUpdate statUpdate = new PlayFabClientModels.StatisticUpdate(); + statUpdate.StatisticName = TEST_STAT_NAME; + statUpdate.Value = testStatExpected; + updateRequest.Statistics.add(statUpdate); + PlayFabResult updateStatsResult = PlayFabClientAPI.UpdatePlayerStatistics(updateRequest); VerifyResult(updateStatsResult, true); - getStatsResult = PlayFabClientAPI.GetUserStatistics(getRequest); - VerifyResult(getStatsResult, true); - hasStat = getStatsResult.Result.UserStatistics != null && getStatsResult.Result.UserStatistics.containsKey(TEST_STAT_NAME); - assertTrue(hasStat); - int testStatActual = getStatsResult.Result.UserStatistics.get(TEST_STAT_NAME); - - assertEquals(testStatExpected, testStatActual); + PlayFabResult getStatsResult2 = PlayFabClientAPI.GetPlayerStatistics(getRequest); + VerifyResult(getStatsResult2, true); + int testStatActual = -1000; + for(PlayFabClientModels.StatisticValue eachStat : getStatsResult2.Result.Statistics) + if (eachStat.StatisticName.equals(TEST_STAT_NAME)) + testStatActual = eachStat.Value; + assertTrue(String.format("Stat not found: %d, Actual: %d", testStatExpected, testStatActual), testStatActual != -1000); + assertEquals(String.format("Stats were not updated. Expected: %d, Actual: %d", testStatExpected, testStatActual), testStatExpected, testStatActual); } /// @@ -330,7 +331,7 @@ private void SaveCharacterId(List character public void LeaderBoard() { LoginOrRegister(); - UserStatisticsApi(); + PlayerStatisticsApi(); PlayFabClientModels.GetLeaderboardRequest clientRequest = new PlayFabClientModels.GetLeaderboardRequest(); clientRequest.MaxResultsCount = 3; diff --git a/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java b/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java index a227acb20..3a5800738 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java @@ -16,6 +16,64 @@ public class PlayFabAdminAPI { private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create(); + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + public static FutureTask> BanUsersAsync(final BanUsersRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateBanUsersAsync(request); + } + }); + } + + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult BanUsers(final BanUsersRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateBanUsersAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateBanUsersAsync(final BanUsersRequest 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/BanUsers", 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()); + BanUsersResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier */ @@ -74,6 +132,64 @@ private static PlayFabResult privateGetUserAccountI return pfResult; } + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetUserBansAsync(final GetUserBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetUserBansAsync(request); + } + }); + } + + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetUserBans(final GetUserBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetUserBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetUserBansAsync(final GetUserBansRequest 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/GetUserBans", 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()); + GetUserBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Resets all title-specific information about a particular account, including user data, virtual currency balances, inventory, purchase history, and statistics */ @@ -132,6 +248,122 @@ private static PlayFabResult privateResetUsersAsync(final ResetUser return pfResult; } + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RevokeAllBansForUserAsync(final RevokeAllBansForUserRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeAllBansForUserAsync(request); + } + }); + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RevokeAllBansForUser(final RevokeAllBansForUserRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeAllBansForUserAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRevokeAllBansForUserAsync(final RevokeAllBansForUserRequest 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/RevokeAllBansForUser", 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()); + RevokeAllBansForUserResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RevokeBansAsync(final RevokeBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeBansAsync(request); + } + }); + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RevokeBans(final RevokeBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRevokeBansAsync(final RevokeBansRequest 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/RevokeBans", 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()); + RevokeBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Forces an email to be sent to the registered email address for the specified account, with a link allowing the user to change the password */ @@ -190,6 +422,64 @@ private static PlayFabResult privateSendAccountR return pfResult; } + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateBansAsync(final UpdateBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateBansAsync(request); + } + }); + } + + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateBans(final UpdateBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateBansAsync(final UpdateBansRequest 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/UpdateBans", 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()); + UpdateBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Updates the title specific display name for a user */ @@ -1524,6 +1814,64 @@ private static PlayFabResult privateAddVirtualCurrencyTypesAsync(fi return pfResult; } + /** + * Deletes an existing virtual item store + */ + @SuppressWarnings("unchecked") + public static FutureTask> DeleteStoreAsync(final DeleteStoreRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteStoreAsync(request); + } + }); + } + + /** + * Deletes an existing virtual item store + */ + @SuppressWarnings("unchecked") + public static PlayFabResult DeleteStore(final DeleteStoreRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteStoreAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Deletes an existing virtual item store + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateDeleteStoreAsync(final DeleteStoreRequest 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/DeleteStore", 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()); + DeleteStoreResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ diff --git a/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java b/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java index 04c291b62..b4eeac559 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java @@ -143,6 +143,86 @@ public static class AddVirtualCurrencyTypesRequest { */ public ArrayList VirtualCurrencies; + } + /** + * Contains information for a ban. + */ + public static class BanInfo { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * The unique Ban Id associated with this ban. + */ + public String BanId; + /** + * The IP address on which the ban was applied. May affect multiple players. + */ + public String IPAddress; + /** + * The MAC address on which the ban was applied. May affect multiple players. + */ + public String MACAddress; + /** + * The time when this ban was applied. + */ + public Date Created; + /** + * The time when this ban expires. Permanent bans do not have expiration date. + */ + public Date Expires; + /** + * The reason why this ban was applied. + */ + public String Reason; + /** + * The active state of this ban. Expired bans may still have this value set to true but they will have no effect. + */ + public Boolean Active; + + } + /** + * Represents a single ban request. + */ + public static class BanRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * IP address to be banned. May affect multiple players. + */ + public String IPAddress; + /** + * MAC address to be banned. May affect multiple players. + */ + public String MACAddress; + /** + * The reason for this ban. Maximum 140 characters. + */ + public String Reason; + /** + * The duration in hours for the ban. Leave this blank for a permanent ban. + */ + public Long DurationInHours; + + } + + public static class BanUsersRequest { + /** + * List of ban requests to be applied. Maximum 100. + */ + public ArrayList Bans; + + } + + public static class BanUsersResult { + /** + * Information on the bans that were applied + */ + public ArrayList BanData; + } public static class BlankResult { @@ -525,6 +605,22 @@ public static class DeleteContentRequest { } + public static class DeleteStoreRequest { + /** + * catalog version of the store to delete. If null, uses the default catalog. + */ + public String CatalogVersion; + /** + * unqiue identifier for the store which is to be deleted + */ + public String StoreId; + + } + + public static class DeleteStoreResult { + + } + public static class DeleteUsersRequest { /** * An array of unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1025,6 +1121,22 @@ public static class GetTitleDataResult { } + public static class GetUserBansRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + + public static class GetUserBansResult { + /** + * Information about the bans + */ + public ArrayList BanData; + + } + public static class GetUserDataRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1526,6 +1638,10 @@ public static class PlayerProfile { * Player Display Name */ public String DisplayName; + /** + * Publisher this player belongs to + */ + public String PublisherId; /** * Player account origination */ @@ -1550,6 +1666,10 @@ public static class PlayerProfile { * Dictionary of player's total currency purchases. The key VTD is a sum of all player_realmoney_purchase events OrderTotals. */ public Map ValuesToDate; + /** + * List of player's tags for segmentation. + */ + public ArrayList Tags; /** * Dictionary of player's virtual currency balances */ @@ -1781,6 +1901,38 @@ public static enum ResultTableNodeType { TableId } + public static class RevokeAllBansForUserRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + + public static class RevokeAllBansForUserResult { + /** + * Information on the bans that were revoked. + */ + public ArrayList BanData; + + } + + public static class RevokeBansRequest { + /** + * Ids of the bans to be revoked. Maximum 100. + */ + public ArrayList BanIds; + + } + + public static class RevokeBansResult { + /** + * Information on the bans that were revoked + */ + public ArrayList BanData; + + } + public static class RevokeInventoryItemRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1963,12 +2115,66 @@ public static enum TitleActivationStatus { ActivatedSteam, RevokedSteam } + /** + * Represents a single update ban request. + */ + public static class UpdateBanRequest { + /** + * The id of the ban to be updated. + */ + public String BanId; + /** + * The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. + */ + public String Reason; + /** + * The updated expiration date for the ban. Null for no change. + */ + public Date Expires; + /** + * The updated IP address for the ban. Null for no change. + */ + public String IPAddress; + /** + * The updated MAC address for the ban. Null for no change. + */ + public String MACAddress; + /** + * Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. + */ + public Boolean Permanent; + /** + * The updated active state for the ban. Null for no change. + */ + public Boolean Active; + + } + + public static class UpdateBansRequest { + /** + * List of bans to be updated. Maximum 100. + */ + public ArrayList Bans; + + } + + public static class UpdateBansResult { + /** + * Information on the bans that were updated + */ + public ArrayList BanData; + + } public static class UpdateCatalogItemsRequest { /** * Which catalog is being updated. If null, uses the default catalog. */ public String CatalogVersion; + /** + * Should this catalog be set as the default catalog. Defaults to true. If there is currently no default catalog, this will always set it. + */ + public Boolean SetAsDefaultCatalog; /** * Array of catalog items to be submitted. Note that while CatalogItem has a parameter for CatalogVersion, it is not required and ignored in this call. */ @@ -1982,7 +2188,7 @@ public static class UpdateCatalogItemsResult { public static class UpdateCloudScriptRequest { /** - * Deprecated - unused + * Deprecated - Do not use */ public Integer Version; /** diff --git a/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java b/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java index 5d476a3d3..0030d21d3 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java @@ -4518,7 +4518,7 @@ private static PlayFabResult privatePurchaseItemAsync(final } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static FutureTask> RedeemCouponAsync(final RedeemCouponRequest request) { @@ -4530,7 +4530,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static PlayFabResult RedeemCoupon(final RedeemCouponRequest request) { @@ -4548,7 +4548,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/ + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") private static PlayFabResult privateRedeemCouponAsync(final RedeemCouponRequest request) throws Exception { diff --git a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java index 2b987dc6b..d2db8f907 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java @@ -2470,7 +2470,7 @@ public static class LoginWithGoogleAccountRequest { */ public Boolean CreateAccount; /** - * Deprecated - unused + * Deprecated - Do not use */ public String PublisherId; /** @@ -2639,7 +2639,7 @@ public static class MatchmakeRequest { */ public CollectionFilter TagFilter; /** - * [deprecated] + * Deprecated - Do not use */ public Boolean EnableQueue; @@ -2659,7 +2659,7 @@ public static class MatchmakeResult { */ public Integer ServerPort; /** - * server authorization ticket (used by RedeemCoupon to validate user insertion into the game) + * server authorization ticket (used by RedeemMatchmakerTicket to validate user insertion into the game) */ public String Ticket; /** @@ -2899,7 +2899,7 @@ public static class RedeemCouponRequest { */ public String CouponCode; /** - * Catalog version of the coupon. + * Catalog version of the coupon. If null, uses the default catalog */ public String CatalogVersion; @@ -2989,7 +2989,7 @@ public static class RegisterPlayFabUserRequest { */ public String DisplayName; /** - * [Deprecated - The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. + * The Origination of a user is determined by the API call used to create the account. In the case of RegisterPlayFabUser, it will be Organic. */ public String Origination; @@ -3165,7 +3165,7 @@ public static class SendAccountRecoveryEmailRequest { */ public String TitleId; /** - * Deprecated - unused + * Deprecated - Do not use */ public String PublisherId; diff --git a/PlayFabSDK/src/com/playfab/PlayFabErrors.java b/PlayFabSDK/src/com/playfab/PlayFabErrors.java index 9a8c01efe..d6f2ec8ea 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabSDK/src/com/playfab/PlayFabErrors.java @@ -246,7 +246,9 @@ public static enum PlayFabErrorCode { InvalidSegment(1242), InvalidSessionId(1243), SessionLogNotFound(1244), - InvalidSearchTerm(1245); + InvalidSearchTerm(1245), + TwoFactorAuthenticationTokenRequired(1246), + GameServerHostCountLimitExceeded(1247); public int id; diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java index 8058c56b2..5f078d35f 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java @@ -74,6 +74,64 @@ private static PlayFabResult privateAuthenticat return pfResult; } + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + public static FutureTask> BanUsersAsync(final BanUsersRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateBanUsersAsync(request); + } + }); + } + + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult BanUsers(final BanUsersRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateBanUsersAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateBanUsersAsync(final BanUsersRequest 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/BanUsers", 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()); + BanUsersResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ @@ -248,6 +306,180 @@ private static PlayFabResult privateGetUserAccountInfo return pfResult; } + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetUserBansAsync(final GetUserBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetUserBansAsync(request); + } + }); + } + + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetUserBans(final GetUserBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetUserBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetUserBansAsync(final GetUserBansRequest 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/GetUserBans", 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()); + GetUserBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RevokeAllBansForUserAsync(final RevokeAllBansForUserRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeAllBansForUserAsync(request); + } + }); + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RevokeAllBansForUser(final RevokeAllBansForUserRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeAllBansForUserAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRevokeAllBansForUserAsync(final RevokeAllBansForUserRequest 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/RevokeAllBansForUser", 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()); + RevokeAllBansForUserResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RevokeBansAsync(final RevokeBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeBansAsync(request); + } + }); + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RevokeBans(final RevokeBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRevokeBansAsync(final RevokeBansRequest 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/RevokeBans", 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()); + RevokeBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. */ @@ -306,6 +538,64 @@ private static PlayFabResult privateSendPushNotifica return pfResult; } + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateBansAsync(final UpdateBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateBansAsync(request); + } + }); + } + + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateBans(final UpdateBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateBansAsync(final UpdateBansRequest 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/UpdateBans", 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()); + UpdateBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. */ @@ -2278,6 +2568,64 @@ private static PlayFabResult privateGetCharacterInv return pfResult; } + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetRandomResultTablesAsync(final GetRandomResultTablesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetRandomResultTablesAsync(request); + } + }); + } + + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetRandomResultTables(final GetRandomResultTablesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetRandomResultTablesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetRandomResultTablesAsync(final GetRandomResultTablesRequest 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/GetRandomResultTables", 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()); + GetRandomResultTablesResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the specified user's current inventory of virtual goods */ @@ -2743,7 +3091,7 @@ private static PlayFabResult privateMoveItemT } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static FutureTask> RedeemCouponAsync(final RedeemCouponRequest request) { @@ -2755,7 +3103,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static PlayFabResult RedeemCoupon(final RedeemCouponRequest request) { @@ -2773,7 +3121,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") private static PlayFabResult privateRedeemCouponAsync(final RedeemCouponRequest request) throws Exception { diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java index 1489d62ee..1651894f9 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java @@ -119,6 +119,86 @@ public static class AwardSteamAchievementResult { */ public ArrayList AchievementResults; + } + /** + * Contains information for a ban. + */ + public static class BanInfo { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * The unique Ban Id associated with this ban. + */ + public String BanId; + /** + * The IP address on which the ban was applied. May affect multiple players. + */ + public String IPAddress; + /** + * The MAC address on which the ban was applied. May affect multiple players. + */ + public String MACAddress; + /** + * The time when this ban was applied. + */ + public Date Created; + /** + * The time when this ban expires. Permanent bans do not have expiration date. + */ + public Date Expires; + /** + * The reason why this ban was applied. + */ + public String Reason; + /** + * The active state of this ban. Expired bans may still have this value set to true but they will have no effect. + */ + public Boolean Active; + + } + /** + * Represents a single ban request. + */ + public static class BanRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * IP address to be banned. May affect multiple players. + */ + public String IPAddress; + /** + * MAC address to be banned. May affect multiple players. + */ + public String MACAddress; + /** + * The reason for this ban. Maximum 140 characters. + */ + public String Reason; + /** + * The duration in hours for the ban. Leave this blank for a permanent ban. + */ + public Long DurationInHours; + + } + + public static class BanUsersRequest { + /** + * List of ban requests to be applied. Maximum 100. + */ + public ArrayList Bans; + + } + + public static class BanUsersResult { + /** + * Information on the bans that were applied + */ + public ArrayList BanData; + } /** * A purchasable item from the item catalog @@ -1297,6 +1377,26 @@ public static class GetPublisherDataResult { } + public static class GetRandomResultTablesRequest { + /** + * Specifies the catalog version that should be used to retrieve the Random Result Tables. If unspecified, uses default/primary catalog. + */ + public String CatalogVersion; + /** + * The unique identifier of the Random Result Table to use. + */ + public ArrayList TableIDs; + + } + + public static class GetRandomResultTablesResult { + /** + * array of random result tables currently available + */ + public Map Tables; + + } + public static class GetSegmentResult { /** * Unique identifier for this segment. @@ -1389,6 +1489,22 @@ public static class GetUserAccountInfoResult { } + public static class GetUserBansRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + + public static class GetUserBansResult { + /** + * Information about the bans + */ + public ArrayList BanData; + + } + public static class GetUserDataRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2045,6 +2161,10 @@ public static class PlayerProfile { * Player Display Name */ public String DisplayName; + /** + * Publisher this player belongs to + */ + public String PublisherId; /** * Player account origination */ @@ -2069,6 +2189,10 @@ public static class PlayerProfile { * Dictionary of player's total currency purchases. The key VTD is a sum of all player_realmoney_purchase events OrderTotals. */ public Map ValuesToDate; + /** + * List of player's tags for segmentation. + */ + public ArrayList Tags; /** * Dictionary of player's virtual currency balances */ @@ -2157,6 +2281,22 @@ public static class PushNotificationRegistration { } + public static class RandomResultTableListing { + /** + * Catalog version this table is associated with + */ + public String CatalogVersion; + /** + * Unique name for this drop table + */ + public String TableId; + /** + * Child nodes that indicate what kind of drop table item this actually is. + */ + public ArrayList Nodes; + + } + public static class RedeemCouponRequest { /** * Generated coupon code to redeem. @@ -2257,6 +2397,59 @@ public static class ReportPlayerServerResult { } + public static class ResultTableNode { + /** + * Whether this entry in the table is an item or a link to another table + */ + public ResultTableNodeType ResultItemType; + /** + * Either an ItemId, or the TableId of another random result table + */ + public String ResultItem; + /** + * How likely this is to be rolled - larger numbers add more weight + */ + public Integer Weight; + + } + + public static enum ResultTableNodeType { + ItemId, + TableId + } + + public static class RevokeAllBansForUserRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + + public static class RevokeAllBansForUserResult { + /** + * Information on the bans that were revoked. + */ + public ArrayList BanData; + + } + + public static class RevokeBansRequest { + /** + * Ids of the bans to be revoked. Maximum 100. + */ + public ArrayList BanIds; + + } + + public static class RevokeBansResult { + /** + * Information on the bans that were revoked + */ + public ArrayList BanData; + + } + public static class RevokeInventoryItemRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2583,6 +2776,56 @@ public static class UnlockContainerItemResult { */ public Map VirtualCurrency; + } + /** + * Represents a single update ban request. + */ + public static class UpdateBanRequest { + /** + * The id of the ban to be updated. + */ + public String BanId; + /** + * The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. + */ + public String Reason; + /** + * The updated expiration date for the ban. Null for no change. + */ + public Date Expires; + /** + * The updated IP address for the ban. Null for no change. + */ + public String IPAddress; + /** + * The updated MAC address for the ban. Null for no change. + */ + public String MACAddress; + /** + * Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. + */ + public Boolean Permanent; + /** + * The updated active state for the ban. Null for no change. + */ + public Boolean Active; + + } + + public static class UpdateBansRequest { + /** + * List of bans to be updated. Maximum 100. + */ + public ArrayList Bans; + + } + + public static class UpdateBansResult { + /** + * Information on the bans that were updated + */ + public ArrayList BanData; + } public static class UpdateCharacterDataRequest { diff --git a/PlayFabSDK/src/com/playfab/PlayFabSettings.java b/PlayFabSDK/src/com/playfab/PlayFabSettings.java index c75349370..f6d5a266d 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.33.160815"; + public static String SdkVersion = "0.34.160822"; public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.33.160815"; + public static String SdkVersionString = "JavaSDK-0.34.160822"; 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 a227acb20..3a5800738 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java @@ -16,6 +16,64 @@ public class PlayFabAdminAPI { private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create(); + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + public static FutureTask> BanUsersAsync(final BanUsersRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateBanUsersAsync(request); + } + }); + } + + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult BanUsers(final BanUsersRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateBanUsersAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateBanUsersAsync(final BanUsersRequest 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/BanUsers", 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()); + BanUsersResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the relevant details for a specified user, based upon a match against a supplied unique identifier */ @@ -74,6 +132,64 @@ private static PlayFabResult privateGetUserAccountI return pfResult; } + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetUserBansAsync(final GetUserBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetUserBansAsync(request); + } + }); + } + + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetUserBans(final GetUserBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetUserBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetUserBansAsync(final GetUserBansRequest 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/GetUserBans", 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()); + GetUserBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Resets all title-specific information about a particular account, including user data, virtual currency balances, inventory, purchase history, and statistics */ @@ -132,6 +248,122 @@ private static PlayFabResult privateResetUsersAsync(final ResetUser return pfResult; } + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RevokeAllBansForUserAsync(final RevokeAllBansForUserRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeAllBansForUserAsync(request); + } + }); + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RevokeAllBansForUser(final RevokeAllBansForUserRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeAllBansForUserAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRevokeAllBansForUserAsync(final RevokeAllBansForUserRequest 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/RevokeAllBansForUser", 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()); + RevokeAllBansForUserResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RevokeBansAsync(final RevokeBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeBansAsync(request); + } + }); + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RevokeBans(final RevokeBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRevokeBansAsync(final RevokeBansRequest 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/RevokeBans", 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()); + RevokeBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Forces an email to be sent to the registered email address for the specified account, with a link allowing the user to change the password */ @@ -190,6 +422,64 @@ private static PlayFabResult privateSendAccountR return pfResult; } + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateBansAsync(final UpdateBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateBansAsync(request); + } + }); + } + + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateBans(final UpdateBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateBansAsync(final UpdateBansRequest 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/UpdateBans", 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()); + UpdateBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Updates the title specific display name for a user */ @@ -1524,6 +1814,64 @@ private static PlayFabResult privateAddVirtualCurrencyTypesAsync(fi return pfResult; } + /** + * Deletes an existing virtual item store + */ + @SuppressWarnings("unchecked") + public static FutureTask> DeleteStoreAsync(final DeleteStoreRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteStoreAsync(request); + } + }); + } + + /** + * Deletes an existing virtual item store + */ + @SuppressWarnings("unchecked") + public static PlayFabResult DeleteStore(final DeleteStoreRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteStoreAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Deletes an existing virtual item store + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateDeleteStoreAsync(final DeleteStoreRequest 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/DeleteStore", 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()); + DeleteStoreResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the specified version of the title's catalog of virtual goods, including all defined properties */ diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java index 04c291b62..b4eeac559 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java @@ -143,6 +143,86 @@ public static class AddVirtualCurrencyTypesRequest { */ public ArrayList VirtualCurrencies; + } + /** + * Contains information for a ban. + */ + public static class BanInfo { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * The unique Ban Id associated with this ban. + */ + public String BanId; + /** + * The IP address on which the ban was applied. May affect multiple players. + */ + public String IPAddress; + /** + * The MAC address on which the ban was applied. May affect multiple players. + */ + public String MACAddress; + /** + * The time when this ban was applied. + */ + public Date Created; + /** + * The time when this ban expires. Permanent bans do not have expiration date. + */ + public Date Expires; + /** + * The reason why this ban was applied. + */ + public String Reason; + /** + * The active state of this ban. Expired bans may still have this value set to true but they will have no effect. + */ + public Boolean Active; + + } + /** + * Represents a single ban request. + */ + public static class BanRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * IP address to be banned. May affect multiple players. + */ + public String IPAddress; + /** + * MAC address to be banned. May affect multiple players. + */ + public String MACAddress; + /** + * The reason for this ban. Maximum 140 characters. + */ + public String Reason; + /** + * The duration in hours for the ban. Leave this blank for a permanent ban. + */ + public Long DurationInHours; + + } + + public static class BanUsersRequest { + /** + * List of ban requests to be applied. Maximum 100. + */ + public ArrayList Bans; + + } + + public static class BanUsersResult { + /** + * Information on the bans that were applied + */ + public ArrayList BanData; + } public static class BlankResult { @@ -525,6 +605,22 @@ public static class DeleteContentRequest { } + public static class DeleteStoreRequest { + /** + * catalog version of the store to delete. If null, uses the default catalog. + */ + public String CatalogVersion; + /** + * unqiue identifier for the store which is to be deleted + */ + public String StoreId; + + } + + public static class DeleteStoreResult { + + } + public static class DeleteUsersRequest { /** * An array of unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1025,6 +1121,22 @@ public static class GetTitleDataResult { } + public static class GetUserBansRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + + public static class GetUserBansResult { + /** + * Information about the bans + */ + public ArrayList BanData; + + } + public static class GetUserDataRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1526,6 +1638,10 @@ public static class PlayerProfile { * Player Display Name */ public String DisplayName; + /** + * Publisher this player belongs to + */ + public String PublisherId; /** * Player account origination */ @@ -1550,6 +1666,10 @@ public static class PlayerProfile { * Dictionary of player's total currency purchases. The key VTD is a sum of all player_realmoney_purchase events OrderTotals. */ public Map ValuesToDate; + /** + * List of player's tags for segmentation. + */ + public ArrayList Tags; /** * Dictionary of player's virtual currency balances */ @@ -1781,6 +1901,38 @@ public static enum ResultTableNodeType { TableId } + public static class RevokeAllBansForUserRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + + public static class RevokeAllBansForUserResult { + /** + * Information on the bans that were revoked. + */ + public ArrayList BanData; + + } + + public static class RevokeBansRequest { + /** + * Ids of the bans to be revoked. Maximum 100. + */ + public ArrayList BanIds; + + } + + public static class RevokeBansResult { + /** + * Information on the bans that were revoked + */ + public ArrayList BanData; + + } + public static class RevokeInventoryItemRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1963,12 +2115,66 @@ public static enum TitleActivationStatus { ActivatedSteam, RevokedSteam } + /** + * Represents a single update ban request. + */ + public static class UpdateBanRequest { + /** + * The id of the ban to be updated. + */ + public String BanId; + /** + * The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. + */ + public String Reason; + /** + * The updated expiration date for the ban. Null for no change. + */ + public Date Expires; + /** + * The updated IP address for the ban. Null for no change. + */ + public String IPAddress; + /** + * The updated MAC address for the ban. Null for no change. + */ + public String MACAddress; + /** + * Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. + */ + public Boolean Permanent; + /** + * The updated active state for the ban. Null for no change. + */ + public Boolean Active; + + } + + public static class UpdateBansRequest { + /** + * List of bans to be updated. Maximum 100. + */ + public ArrayList Bans; + + } + + public static class UpdateBansResult { + /** + * Information on the bans that were updated + */ + public ArrayList BanData; + + } public static class UpdateCatalogItemsRequest { /** * Which catalog is being updated. If null, uses the default catalog. */ public String CatalogVersion; + /** + * Should this catalog be set as the default catalog. Defaults to true. If there is currently no default catalog, this will always set it. + */ + public Boolean SetAsDefaultCatalog; /** * Array of catalog items to be submitted. Note that while CatalogItem has a parameter for CatalogVersion, it is not required and ignored in this call. */ @@ -1982,7 +2188,7 @@ public static class UpdateCatalogItemsResult { public static class UpdateCloudScriptRequest { /** - * Deprecated - unused + * Deprecated - Do not use */ public Integer Version; /** diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java index 9a8c01efe..d6f2ec8ea 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java @@ -246,7 +246,9 @@ public static enum PlayFabErrorCode { InvalidSegment(1242), InvalidSessionId(1243), SessionLogNotFound(1244), - InvalidSearchTerm(1245); + InvalidSearchTerm(1245), + TwoFactorAuthenticationTokenRequired(1246), + GameServerHostCountLimitExceeded(1247); public int id; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java index 8058c56b2..5f078d35f 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java @@ -74,6 +74,64 @@ private static PlayFabResult privateAuthenticat return pfResult; } + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + public static FutureTask> BanUsersAsync(final BanUsersRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateBanUsersAsync(request); + } + }); + } + + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult BanUsers(final BanUsersRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateBanUsersAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Bans users by PlayFab ID with optional IP address, or MAC address for the provided game. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateBanUsersAsync(final BanUsersRequest 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/BanUsers", 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()); + BanUsersResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ @@ -248,6 +306,180 @@ private static PlayFabResult privateGetUserAccountInfo return pfResult; } + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetUserBansAsync(final GetUserBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetUserBansAsync(request); + } + }); + } + + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetUserBans(final GetUserBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetUserBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Gets all bans for a user. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetUserBansAsync(final GetUserBansRequest 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/GetUserBans", 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()); + GetUserBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RevokeAllBansForUserAsync(final RevokeAllBansForUserRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeAllBansForUserAsync(request); + } + }); + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RevokeAllBansForUser(final RevokeAllBansForUserRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeAllBansForUserAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Revoke all active bans for a user. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRevokeAllBansForUserAsync(final RevokeAllBansForUserRequest 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/RevokeAllBansForUser", 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()); + RevokeAllBansForUserResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + public static FutureTask> RevokeBansAsync(final RevokeBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeBansAsync(request); + } + }); + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RevokeBans(final RevokeBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRevokeBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Revoke all active bans specified with BanId. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRevokeBansAsync(final RevokeBansRequest 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/RevokeBans", 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()); + RevokeBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Sends an iOS/Android Push Notification to a specific user, if that user's device has been configured for Push Notifications in PlayFab. If a user has linked both Android and iOS devices, both will be notified. */ @@ -306,6 +538,64 @@ private static PlayFabResult privateSendPushNotifica return pfResult; } + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + public static FutureTask> UpdateBansAsync(final UpdateBansRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateBansAsync(request); + } + }); + } + + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UpdateBans(final UpdateBansRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUpdateBansAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Updates information of a list of existing bans specified with Ban Ids. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUpdateBansAsync(final UpdateBansRequest 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/UpdateBans", 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()); + UpdateBansResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. */ @@ -2278,6 +2568,64 @@ private static PlayFabResult privateGetCharacterInv return pfResult; } + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetRandomResultTablesAsync(final GetRandomResultTablesRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetRandomResultTablesAsync(request); + } + }); + } + + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetRandomResultTables(final GetRandomResultTablesRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetRandomResultTablesAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the configuration information for the specified random results tables for the title, including all ItemId values and weights + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetRandomResultTablesAsync(final GetRandomResultTablesRequest 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/GetRandomResultTables", 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()); + GetRandomResultTablesResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the specified user's current inventory of virtual goods */ @@ -2743,7 +3091,7 @@ private static PlayFabResult privateMoveItemT } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static FutureTask> RedeemCouponAsync(final RedeemCouponRequest request) { @@ -2755,7 +3103,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") public static PlayFabResult RedeemCoupon(final RedeemCouponRequest request) { @@ -2773,7 +3121,7 @@ public PlayFabResult call() throws Exception { } /** - * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager + * Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Economy->Catalogs tab in the PlayFab Game Manager. */ @SuppressWarnings("unchecked") private static PlayFabResult privateRedeemCouponAsync(final RedeemCouponRequest request) throws Exception { diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java index 1489d62ee..1651894f9 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java @@ -119,6 +119,86 @@ public static class AwardSteamAchievementResult { */ public ArrayList AchievementResults; + } + /** + * Contains information for a ban. + */ + public static class BanInfo { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * The unique Ban Id associated with this ban. + */ + public String BanId; + /** + * The IP address on which the ban was applied. May affect multiple players. + */ + public String IPAddress; + /** + * The MAC address on which the ban was applied. May affect multiple players. + */ + public String MACAddress; + /** + * The time when this ban was applied. + */ + public Date Created; + /** + * The time when this ban expires. Permanent bans do not have expiration date. + */ + public Date Expires; + /** + * The reason why this ban was applied. + */ + public String Reason; + /** + * The active state of this ban. Expired bans may still have this value set to true but they will have no effect. + */ + public Boolean Active; + + } + /** + * Represents a single ban request. + */ + public static class BanRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * IP address to be banned. May affect multiple players. + */ + public String IPAddress; + /** + * MAC address to be banned. May affect multiple players. + */ + public String MACAddress; + /** + * The reason for this ban. Maximum 140 characters. + */ + public String Reason; + /** + * The duration in hours for the ban. Leave this blank for a permanent ban. + */ + public Long DurationInHours; + + } + + public static class BanUsersRequest { + /** + * List of ban requests to be applied. Maximum 100. + */ + public ArrayList Bans; + + } + + public static class BanUsersResult { + /** + * Information on the bans that were applied + */ + public ArrayList BanData; + } /** * A purchasable item from the item catalog @@ -1297,6 +1377,26 @@ public static class GetPublisherDataResult { } + public static class GetRandomResultTablesRequest { + /** + * Specifies the catalog version that should be used to retrieve the Random Result Tables. If unspecified, uses default/primary catalog. + */ + public String CatalogVersion; + /** + * The unique identifier of the Random Result Table to use. + */ + public ArrayList TableIDs; + + } + + public static class GetRandomResultTablesResult { + /** + * array of random result tables currently available + */ + public Map Tables; + + } + public static class GetSegmentResult { /** * Unique identifier for this segment. @@ -1389,6 +1489,22 @@ public static class GetUserAccountInfoResult { } + public static class GetUserBansRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + + public static class GetUserBansResult { + /** + * Information about the bans + */ + public ArrayList BanData; + + } + public static class GetUserDataRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2045,6 +2161,10 @@ public static class PlayerProfile { * Player Display Name */ public String DisplayName; + /** + * Publisher this player belongs to + */ + public String PublisherId; /** * Player account origination */ @@ -2069,6 +2189,10 @@ public static class PlayerProfile { * Dictionary of player's total currency purchases. The key VTD is a sum of all player_realmoney_purchase events OrderTotals. */ public Map ValuesToDate; + /** + * List of player's tags for segmentation. + */ + public ArrayList Tags; /** * Dictionary of player's virtual currency balances */ @@ -2157,6 +2281,22 @@ public static class PushNotificationRegistration { } + public static class RandomResultTableListing { + /** + * Catalog version this table is associated with + */ + public String CatalogVersion; + /** + * Unique name for this drop table + */ + public String TableId; + /** + * Child nodes that indicate what kind of drop table item this actually is. + */ + public ArrayList Nodes; + + } + public static class RedeemCouponRequest { /** * Generated coupon code to redeem. @@ -2257,6 +2397,59 @@ public static class ReportPlayerServerResult { } + public static class ResultTableNode { + /** + * Whether this entry in the table is an item or a link to another table + */ + public ResultTableNodeType ResultItemType; + /** + * Either an ItemId, or the TableId of another random result table + */ + public String ResultItem; + /** + * How likely this is to be rolled - larger numbers add more weight + */ + public Integer Weight; + + } + + public static enum ResultTableNodeType { + ItemId, + TableId + } + + public static class RevokeAllBansForUserRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + + } + + public static class RevokeAllBansForUserResult { + /** + * Information on the bans that were revoked. + */ + public ArrayList BanData; + + } + + public static class RevokeBansRequest { + /** + * Ids of the bans to be revoked. Maximum 100. + */ + public ArrayList BanIds; + + } + + public static class RevokeBansResult { + /** + * Information on the bans that were revoked + */ + public ArrayList BanData; + + } + public static class RevokeInventoryItemRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2583,6 +2776,56 @@ public static class UnlockContainerItemResult { */ public Map VirtualCurrency; + } + /** + * Represents a single update ban request. + */ + public static class UpdateBanRequest { + /** + * The id of the ban to be updated. + */ + public String BanId; + /** + * The updated reason for the ban to be updated. Maximum 140 characters. Null for no change. + */ + public String Reason; + /** + * The updated expiration date for the ban. Null for no change. + */ + public Date Expires; + /** + * The updated IP address for the ban. Null for no change. + */ + public String IPAddress; + /** + * The updated MAC address for the ban. Null for no change. + */ + public String MACAddress; + /** + * Whether to make this ban permanent. Set to true to make this ban permanent. This will not modify Active state. + */ + public Boolean Permanent; + /** + * The updated active state for the ban. Null for no change. + */ + public Boolean Active; + + } + + public static class UpdateBansRequest { + /** + * List of bans to be updated. Maximum 100. + */ + public ArrayList Bans; + + } + + public static class UpdateBansResult { + /** + * Information on the bans that were updated + */ + public ArrayList BanData; + } public static class UpdateCharacterDataRequest { diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java b/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java index fdf196b17..ce2c03904 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.33.160815"; + public static String SdkVersion = "0.34.160822"; public static String BuildIdentifier = "jbuild_javasdk_0"; - public static String SdkVersionString = "JavaSDK-0.33.160815"; + public static String SdkVersionString = "JavaSDK-0.34.160822"; 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;