diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java index 7d58e3063..c753d463d 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabClientModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -50,9 +51,9 @@ public PlayFabResult call() throws Exception */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPhotonAuthenticationTokenAsync(final GetPhotonAuthenticationTokenRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPhotonAuthenticationToken", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPhotonAuthenticationToken", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -67,11 +68,12 @@ private static PlayFabResult privateGetPhoto PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPhotonAuthenticationTokenResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -108,7 +110,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithAndroidDeviceIDAsync(final LoginWithAndroidDeviceIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithAndroidDeviceID", request, null, null); task.run(); @@ -125,12 +127,14 @@ private static PlayFabResult privateLoginWithAndroidDeviceIDAsync(f PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -167,7 +171,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithCustomIDAsync(final LoginWithCustomIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithCustomID", request, null, null); task.run(); @@ -184,12 +188,14 @@ private static PlayFabResult privateLoginWithCustomIDAsync(final Lo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -226,7 +232,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithEmailAddressAsync(final LoginWithEmailAddressRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithEmailAddress", request, null, null); task.run(); @@ -243,12 +249,14 @@ private static PlayFabResult privateLoginWithEmailAddressAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -285,7 +293,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithFacebookAsync(final LoginWithFacebookRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithFacebook", request, null, null); task.run(); @@ -302,12 +310,14 @@ private static PlayFabResult privateLoginWithFacebookAsync(final Lo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -344,7 +354,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithGameCenterAsync(final LoginWithGameCenterRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithGameCenter", request, null, null); task.run(); @@ -361,12 +371,14 @@ private static PlayFabResult privateLoginWithGameCenterAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Google account access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -403,7 +415,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithGoogleAccountAsync(final LoginWithGoogleAccountRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithGoogleAccount", request, null, null); task.run(); @@ -420,12 +432,14 @@ private static PlayFabResult privateLoginWithGoogleAccountAsync(fin PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -462,7 +476,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithIOSDeviceIDAsync(final LoginWithIOSDeviceIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithIOSDeviceID", request, null, null); task.run(); @@ -479,12 +493,14 @@ private static PlayFabResult privateLoginWithIOSDeviceIDAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Kongregate player account. */ @@ -521,7 +537,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithKongregateAsync(final LoginWithKongregateRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithKongregate", request, null, null); task.run(); @@ -538,12 +554,14 @@ private static PlayFabResult privateLoginWithKongregateAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -580,7 +598,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithPlayFabAsync(final LoginWithPlayFabRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithPlayFab", request, null, null); task.run(); @@ -597,12 +615,75 @@ private static PlayFabResult privateLoginWithPlayFabAsync(final Log PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static FutureTask> LoginWithPSNAsync(final LoginWithPSNRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithPSNAsync(request); + } + }); + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LoginWithPSN(final LoginWithPSNRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithPSNAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLoginWithPSNAsync(final LoginWithPSNRequest request) throws Exception { + request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithPSN", request, null, null); + 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()); + LoginResult result = resultData.data; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -639,7 +720,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithSteamAsync(final LoginWithSteamRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithSteam", request, null, null); task.run(); @@ -656,12 +737,75 @@ private static PlayFabResult privateLoginWithSteamAsync(final Login PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static FutureTask> LoginWithXboxAsync(final LoginWithXboxRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithXboxAsync(request); + } + }); + } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LoginWithXbox(final LoginWithXboxRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithXboxAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLoginWithXboxAsync(final LoginWithXboxRequest request) throws Exception { + request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithXbox", request, null, null); + 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()); + LoginResult result = resultData.data; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply either a username or an email address. */ @@ -698,7 +842,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateRegisterPlayFabUserAsync(final RegisterPlayFabUserRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterPlayFabUser", request, null, null); task.run(); @@ -715,12 +859,14 @@ private static PlayFabResult privateRegisterPlayFabUs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RegisterPlayFabUserResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds playfab username/password auth to an existing semi-anonymous account created via a 3rd party auth method. */ @@ -756,9 +902,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddUsernamePasswordAsync(final AddUsernamePasswordRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUsernamePassword", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUsernamePassword", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -773,11 +919,12 @@ private static PlayFabResult privateAddUsernamePasswo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddUsernamePasswordResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the user's PlayFab account details */ @@ -813,9 +960,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetAccountInfoAsync(final GetAccountInfoRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAccountInfo", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAccountInfo", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -830,11 +977,12 @@ private static PlayFabResult privateGetAccountInfoAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetAccountInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ @@ -870,9 +1018,9 @@ public PlayFabResult call() throws Exception */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromFacebookIDsAsync(final GetPlayFabIDsFromFacebookIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromFacebookIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromFacebookIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -887,11 +1035,12 @@ private static PlayFabResult privateGetPlayF PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromFacebookIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center Programming Guide as the Player Identifier). */ @@ -927,9 +1076,9 @@ public PlayFabResult call() throws Excepti */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromGameCenterIDsAsync(final GetPlayFabIDsFromGameCenterIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGameCenterIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGameCenterIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -944,11 +1093,12 @@ private static PlayFabResult privateGetPla PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromGameCenterIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. */ @@ -984,9 +1134,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromGoogleIDsAsync(final GetPlayFabIDsFromGoogleIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGoogleIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGoogleIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1001,11 +1151,70 @@ private static PlayFabResult privateGetPlayFab PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromGoogleIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromPSNAccountIDsAsync(final GetPlayFabIDsFromPSNAccountIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromPSNAccountIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromPSNAccountIDs(final GetPlayFabIDsFromPSNAccountIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromPSNAccountIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromPSNAccountIDsAsync(final GetPlayFabIDsFromPSNAccountIDsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromPSNAccountIDs", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + GetPlayFabIDsFromPSNAccountIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. */ @@ -1041,9 +1250,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromSteamIDsAsync(final GetPlayFabIDsFromSteamIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromSteamIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromSteamIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1058,11 +1267,12 @@ private static PlayFabResult privateGetPlayFabI PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromSteamIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. */ @@ -1098,9 +1308,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserCombinedInfo", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserCombinedInfo", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1115,11 +1325,12 @@ private static PlayFabResult privateGetUserCombinedIn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserCombinedInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Android device identifier to the user's PlayFab account */ @@ -1155,9 +1366,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkAndroidDeviceIDAsync(final LinkAndroidDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkAndroidDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkAndroidDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1172,11 +1383,12 @@ private static PlayFabResult privateLinkAndroidDevice PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkAndroidDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the custom identifier, generated by the title, to the user's PlayFab account */ @@ -1212,9 +1424,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkCustomIDAsync(final LinkCustomIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkCustomID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkCustomID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1229,11 +1441,12 @@ private static PlayFabResult privateLinkCustomIDAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkCustomIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account */ @@ -1269,9 +1482,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkFacebookAccountAsync(final LinkFacebookAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkFacebookAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkFacebookAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1286,11 +1499,12 @@ private static PlayFabResult privateLinkFacebookAccou PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkFacebookAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account */ @@ -1326,9 +1540,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkGameCenterAccountAsync(final LinkGameCenterAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGameCenterAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGameCenterAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1343,11 +1557,12 @@ private static PlayFabResult privateLinkGameCenterA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkGameCenterAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the currently signed-in user account to the Google account specified by the Google account access token */ @@ -1383,9 +1598,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkGoogleAccountAsync(final LinkGoogleAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGoogleAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGoogleAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1400,11 +1615,12 @@ private static PlayFabResult privateLinkGoogleAccountAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkGoogleAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the vendor-specific iOS device identifier to the user's PlayFab account */ @@ -1440,9 +1656,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkIOSDeviceIDAsync(final LinkIOSDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkIOSDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkIOSDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1457,11 +1673,12 @@ private static PlayFabResult privateLinkIOSDeviceIDAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkIOSDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Kongregate identifier to the user's PlayFab account */ @@ -1497,9 +1714,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkKongregateAsync(final LinkKongregateAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkKongregate", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkKongregate", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1514,11 +1731,70 @@ private static PlayFabResult privateLinkKongregateA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkKongregateAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkPSNAccountAsync(final LinkPSNAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkPSNAccountAsync(request); + } + }); + } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkPSNAccount(final LinkPSNAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkPSNAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkPSNAccountAsync(final LinkPSNAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkPSNAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkPSNAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account */ @@ -1554,9 +1830,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkSteamAccountAsync(final LinkSteamAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkSteamAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkSteamAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1571,11 +1847,70 @@ private static PlayFabResult privateLinkSteamAccountAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkSteamAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkXboxAccountAsync(final LinkXboxAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkXboxAccountAsync(request); + } + }); + } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkXboxAccount(final LinkXboxAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkXboxAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkXboxAccountAsync(final LinkXboxAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkXboxAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkXboxAccountResult 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 user's account, with a link allowing the user to change the password */ @@ -1611,7 +1946,7 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSendAccountRecoveryEmailAsync(final SendAccountRecoveryEmailRequest request) throws Exception { - + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SendAccountRecoveryEmail", request, null, null); task.run(); Object httpResult = task.get(); @@ -1627,11 +1962,12 @@ private static PlayFabResult privateSendAccountR PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SendAccountRecoveryEmailResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Android device identifier from the user's PlayFab account */ @@ -1667,9 +2003,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkAndroidDeviceIDAsync(final UnlinkAndroidDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkAndroidDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkAndroidDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1684,11 +2020,12 @@ private static PlayFabResult privateUnlinkAndroidDe PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkAndroidDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related custom identifier from the user's PlayFab account */ @@ -1724,9 +2061,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkCustomIDAsync(final UnlinkCustomIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkCustomID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkCustomID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1741,11 +2078,12 @@ private static PlayFabResult privateUnlinkCustomIDAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkCustomIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Facebook account from the user's PlayFab account */ @@ -1781,9 +2119,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkFacebookAccountAsync(final UnlinkFacebookAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkFacebookAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkFacebookAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1798,11 +2136,12 @@ private static PlayFabResult privateUnlinkFacebookA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkFacebookAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Game Center account from the user's PlayFab account */ @@ -1838,9 +2177,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkGameCenterAccountAsync(final UnlinkGameCenterAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGameCenterAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGameCenterAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1855,11 +2194,12 @@ private static PlayFabResult privateUnlinkGameCen PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkGameCenterAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Google account from the user's PlayFab account */ @@ -1895,9 +2235,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkGoogleAccountAsync(final UnlinkGoogleAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGoogleAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGoogleAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1912,11 +2252,12 @@ private static PlayFabResult privateUnlinkGoogleAccou PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkGoogleAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related iOS device identifier from the user's PlayFab account */ @@ -1952,9 +2293,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkIOSDeviceIDAsync(final UnlinkIOSDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkIOSDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkIOSDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1969,11 +2310,12 @@ private static PlayFabResult privateUnlinkIOSDeviceIDAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkIOSDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Kongregate identifier from the user's PlayFab account */ @@ -2009,9 +2351,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkKongregateAsync(final UnlinkKongregateAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkKongregate", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkKongregate", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2026,11 +2368,70 @@ private static PlayFabResult privateUnlinkKongreg PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkKongregateAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkPSNAccountAsync(final UnlinkPSNAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkPSNAccountAsync(request); + } + }); + } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkPSNAccount(final UnlinkPSNAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkPSNAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkPSNAccountAsync(final UnlinkPSNAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkPSNAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkPSNAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Unlinks the related Steam account from the user's PlayFab account */ @@ -2066,9 +2467,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkSteamAccountAsync(final UnlinkSteamAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkSteamAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkSteamAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2083,11 +2484,70 @@ private static PlayFabResult privateUnlinkSteamAccount PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkSteamAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkXboxAccountAsync(final UnlinkXboxAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkXboxAccountAsync(request); + } + }); + } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkXboxAccount(final UnlinkXboxAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkXboxAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkXboxAccountAsync(final UnlinkXboxAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkXboxAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkXboxAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Updates the title specific display name for the user */ @@ -2123,9 +2583,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserTitleDisplayNameAsync(final UpdateUserTitleDisplayNameRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserTitleDisplayName", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserTitleDisplayName", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2140,11 +2600,12 @@ private static PlayFabResult privateUpdateUser PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserTitleDisplayNameResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in the leaderboard */ @@ -2180,9 +2641,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAsync(final GetFriendLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2197,11 +2658,12 @@ private static PlayFabResult privateGetFriendLeaderboardAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user */ @@ -2237,9 +2699,9 @@ public PlayFabResult call() throws */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboardAroundCurrentUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboardAroundCurrentUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2254,11 +2716,12 @@ private static PlayFabResult privat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetFriendLeaderboardAroundCurrentUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ @@ -2294,9 +2757,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAsync(final GetLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2311,11 +2774,12 @@ private static PlayFabResult privateGetLeaderboardAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ @@ -2351,9 +2815,9 @@ public PlayFabResult call() throws Except */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCurrentUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCurrentUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2368,11 +2832,12 @@ private static PlayFabResult privateGetLe PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundCurrentUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -2408,9 +2873,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2425,11 +2890,12 @@ private static PlayFabResult privateGetUserDataAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ @@ -2465,9 +2931,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserPublisherDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2482,11 +2948,12 @@ private static PlayFabResult privateGetUserPublisherDataAsync PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which can only be read by the client */ @@ -2522,9 +2989,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserPublisherReadOnlyDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2539,11 +3006,12 @@ private static PlayFabResult privateGetUserPublisherReadOnlyD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which can only be read by the client */ @@ -2579,9 +3047,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserReadOnlyDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2596,11 +3064,12 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of all title-specific statistics for the user */ @@ -2636,9 +3105,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserStatisticsAsync(final GetUserStatisticsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserStatistics", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserStatistics", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2653,11 +3122,12 @@ private static PlayFabResult privateGetUserStatisticsAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the title-specific custom data for the user which is readable and writable by the client */ @@ -2693,9 +3163,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserDataAsync(final UpdateUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2710,11 +3180,12 @@ private static PlayFabResult privateUpdateUserDataAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the publisher-specific custom data for the user which is readable and writable by the client */ @@ -2750,9 +3221,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserPublisherDataAsync(final UpdateUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2767,11 +3238,12 @@ private static PlayFabResult privateUpdateUserPublisherDat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the values of the specified title-specific statistics for the user */ @@ -2807,9 +3279,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserStatistics", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserStatistics", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2824,11 +3296,12 @@ private static PlayFabResult privateUpdateUserStatis PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserStatisticsResult 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 */ @@ -2864,9 +3337,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCatalogItemsAsync(final GetCatalogItemsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCatalogItems", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCatalogItems", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2881,11 +3354,12 @@ private static PlayFabResult privateGetCatalogItemsAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the set of items defined for the specified store, including all prices defined */ @@ -2921,9 +3395,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetStoreItemsAsync(final GetStoreItemsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetStoreItems", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetStoreItems", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2938,11 +3412,12 @@ private static PlayFabResult privateGetStoreItemsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom title settings */ @@ -2978,9 +3453,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTitleDataAsync(final GetTitleDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2995,11 +3470,12 @@ private static PlayFabResult privateGetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title news feed, as configured in the developer portal */ @@ -3035,9 +3511,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTitleNewsAsync(final GetTitleNewsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleNews", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleNews", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3052,11 +3528,12 @@ private static PlayFabResult privateGetTitleNewsAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleNewsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the user's balance of the specified virtual currency by the stated amount */ @@ -3092,9 +3569,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddUserVirtualCurrencyAsync(final AddUserVirtualCurrencyRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUserVirtualCurrency", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUserVirtualCurrency", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3109,11 +3586,12 @@ private static PlayFabResult privateAddUserVirt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate */ @@ -3149,9 +3627,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateConfirmPurchaseAsync(final ConfirmPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConfirmPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConfirmPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3166,11 +3644,12 @@ private static PlayFabResult privateConfirmPurchaseAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ConfirmPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ @@ -3206,9 +3685,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateConsumeItemAsync(final ConsumeItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumeItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumeItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3223,11 +3702,12 @@ private static PlayFabResult privateConsumeItemAsync(final Co PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ConsumeItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified character's current inventory of virtual goods */ @@ -3263,9 +3743,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterInventoryAsync(final GetCharacterInventoryRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterInventory", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterInventory", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3280,11 +3760,12 @@ private static PlayFabResult privateGetCharacterInv PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a completed purchase along with its current PlayFab status. */ @@ -3320,9 +3801,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPurchaseAsync(final GetPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3337,11 +3818,12 @@ private static PlayFabResult privateGetPurchaseAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the user's current inventory of virtual goods */ @@ -3377,9 +3859,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserInventoryAsync(final GetUserInventoryRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserInventory", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserInventory", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3394,11 +3876,12 @@ private static PlayFabResult privateGetUserInventoryAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Selects a payment option for purchase order created via StartPurchase */ @@ -3434,9 +3917,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privatePayForPurchaseAsync(final PayForPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PayForPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PayForPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3451,11 +3934,12 @@ private static PlayFabResult privatePayForPurchaseAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PayForPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what the client believes the price to be. This lets the server fail the purchase if the price has changed. */ @@ -3491,9 +3975,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privatePurchaseItemAsync(final PurchaseItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PurchaseItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PurchaseItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3508,11 +3992,12 @@ private static PlayFabResult privatePurchaseItemAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PurchaseItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * 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/ */ @@ -3548,9 +4033,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRedeemCouponAsync(final RedeemCouponRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RedeemCoupon", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RedeemCoupon", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3565,11 +4050,12 @@ private static PlayFabResult privateRedeemCouponAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RedeemCouponResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. */ @@ -3605,9 +4091,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateReportPlayerAsync(final ReportPlayerClientRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ReportPlayer", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ReportPlayer", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3622,11 +4108,12 @@ private static PlayFabResult privateReportPlayerAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ReportPlayerClientResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates an order for a list of items from the title catalog */ @@ -3662,9 +4149,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateStartPurchaseAsync(final StartPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3679,11 +4166,12 @@ private static PlayFabResult privateStartPurchaseAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); StartPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the user's balance of the specified virtual currency by the stated amount */ @@ -3719,9 +4207,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSubtractUserVirtualCurrencyAsync(final SubtractUserVirtualCurrencyRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SubtractUserVirtualCurrency", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SubtractUserVirtualCurrency", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3736,11 +4224,12 @@ private static PlayFabResult privateSubtractUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlocks a container item in the user's inventory and consumes a key item of the type indicated by the container item */ @@ -3776,9 +4265,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlockContainerItemAsync(final UnlockContainerItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlockContainerItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlockContainerItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3793,11 +4282,12 @@ private static PlayFabResult privateUnlockContainerIt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlockContainerItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. */ @@ -3833,9 +4323,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddFriendAsync(final AddFriendRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddFriend", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddFriend", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3850,11 +4340,12 @@ private static PlayFabResult privateAddFriendAsync(final AddFri PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddFriendResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. */ @@ -3890,9 +4381,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendsListAsync(final GetFriendsListRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendsList", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendsList", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3907,11 +4398,12 @@ private static PlayFabResult privateGetFriendsListAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetFriendsListResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes a specified user from the friend list of the local user */ @@ -3947,9 +4439,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRemoveFriendAsync(final RemoveFriendRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveFriend", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveFriend", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3964,11 +4456,12 @@ private static PlayFabResult privateRemoveFriendAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveFriendResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the tag list for a specified user in the friend list of the local user */ @@ -4004,9 +4497,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSetFriendTagsAsync(final SetFriendTagsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SetFriendTags", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SetFriendTags", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4021,11 +4514,12 @@ private static PlayFabResult privateSetFriendTagsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetFriendTagsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Registers the iOS device to receive push notifications */ @@ -4061,9 +4555,9 @@ public PlayFabResult call() throws Excepti */ @SuppressWarnings("unchecked") private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4078,11 +4572,12 @@ private static PlayFabResult privateRegist PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RegisterForIOSPushNotificationResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Restores all in-app purchases based on the given refresh receipt. */ @@ -4118,9 +4613,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4135,11 +4630,12 @@ private static PlayFabResult privateRestoreIOSPurchas PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RestoreIOSPurchasesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item */ @@ -4175,9 +4671,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4192,11 +4688,12 @@ private static PlayFabResult privateValidateIOSReceipt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ValidateIOSReceiptResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Get details about all current running game servers matching the given parameters. */ @@ -4232,9 +4729,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCurrentGamesAsync(final CurrentGamesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCurrentGames", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCurrentGames", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4249,11 +4746,12 @@ private static PlayFabResult privateGetCurrentGamesAsync(fin PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CurrentGamesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Get details about the regions hosting game servers matching the given parameters. */ @@ -4289,9 +4787,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetGameServerRegionsAsync(final GameServerRegionsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetGameServerRegions", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetGameServerRegions", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4306,11 +4804,12 @@ private static PlayFabResult privateGetGameServerRegion PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GameServerRegionsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Attempts to locate a game session matching the given parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be GameNotFound. Note that EnableQueue is deprecated at this time. */ @@ -4346,9 +4845,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateMatchmakeAsync(final MatchmakeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/Matchmake", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/Matchmake", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4363,11 +4862,12 @@ private static PlayFabResult privateMatchmakeAsync(final Matchm PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MatchmakeResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Start a new game server with a given configuration, add the current player and return the connection information. */ @@ -4403,9 +4903,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateStartGameAsync(final StartGameRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartGame", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartGame", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4420,11 +4920,12 @@ private static PlayFabResult privateStartGameAsync(final StartG PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); StartGameResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Registers the Android device to receive push notifications */ @@ -4460,9 +4961,9 @@ public PlayFabResult call() thr */ @SuppressWarnings("unchecked") private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4477,11 +4978,12 @@ private static PlayFabResult pr PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AndroidDevicePushNotificationRegistrationResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Validates a Google Play purchase and gives the corresponding item to the player. */ @@ -4517,9 +5019,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4534,11 +5036,12 @@ private static PlayFabResult privateValidateGo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ValidateGooglePlayPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Logs a custom analytics event */ @@ -4574,9 +5077,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLogEventAsync(final LogEventRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LogEvent", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LogEvent", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4591,11 +5094,12 @@ private static PlayFabResult privateLogEventAsync(final LogEvent PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LogEventResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group can add new members. */ @@ -4631,9 +5135,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddSharedGroupMembersAsync(final AddSharedGroupMembersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddSharedGroupMembers", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddSharedGroupMembers", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4648,11 +5152,12 @@ private static PlayFabResult privateAddSharedGroupM PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. Upon creation, the current user will be the only member of the group. */ @@ -4688,9 +5193,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateCreateSharedGroupAsync(final CreateSharedGroupRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CreateSharedGroup", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CreateSharedGroup", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4705,11 +5210,12 @@ private static PlayFabResult privateCreateSharedGroupAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CreateSharedGroupResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom publisher settings */ @@ -4745,9 +5251,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPublisherDataAsync(final GetPublisherDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4762,11 +5268,12 @@ private static PlayFabResult privateGetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. */ @@ -4802,9 +5309,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetSharedGroupDataAsync(final GetSharedGroupDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetSharedGroupData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetSharedGroupData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4819,11 +5326,12 @@ private static PlayFabResult privateGetSharedGroupData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. */ @@ -4859,9 +5367,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRemoveSharedGroupMembersAsync(final RemoveSharedGroupMembersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveSharedGroupMembers", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveSharedGroupMembers", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4876,11 +5384,12 @@ private static PlayFabResult privateRemoveShared PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group can update the data. */ @@ -4916,9 +5425,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateSharedGroupDataAsync(final UpdateSharedGroupDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateSharedGroupData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateSharedGroupData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4933,11 +5442,128 @@ private static PlayFabResult privateUpdateSharedGro PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + public static FutureTask> ConsumePSNEntitlementsAsync(final ConsumePSNEntitlementsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateConsumePSNEntitlementsAsync(request); + } + }); + } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ConsumePSNEntitlements(final ConsumePSNEntitlementsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateConsumePSNEntitlementsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateConsumePSNEntitlementsAsync(final ConsumePSNEntitlementsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumePSNEntitlements", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ConsumePSNEntitlementsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + public static FutureTask> RefreshPSNAuthTokenAsync(final RefreshPSNAuthTokenRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRefreshPSNAuthTokenAsync(request); + } + }); + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RefreshPSNAuthToken(final RefreshPSNAuthTokenRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRefreshPSNAuthTokenAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRefreshPSNAuthTokenAsync(final RefreshPSNAuthTokenRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RefreshPSNAuthToken", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + EmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. */ @@ -4973,9 +5599,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCloudScriptUrl", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCloudScriptUrl", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4996,6 +5622,7 @@ private static PlayFabResult privateGetCloudScriptUrlAs pfResult.Result = result; return pfResult; } + /** * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. */ @@ -5031,9 +5658,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRunCloudScriptAsync(final RunCloudScriptRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetLogicURL() + "/Client/RunCloudScript", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetLogicURL() + "/Client/RunCloudScript", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5048,11 +5675,12 @@ private static PlayFabResult privateRunCloudScriptAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RunCloudScriptResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://support.playfab.com/support/discussions/topics/1000059929 */ @@ -5088,9 +5716,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetContentDownloadUrlAsync(final GetContentDownloadUrlRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetContentDownloadUrl", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetContentDownloadUrl", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5105,11 +5733,12 @@ private static PlayFabResult privateGetContentDownl PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentDownloadUrlResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Lists all of the characters that belong to a specific user. */ @@ -5145,9 +5774,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetAllUsersCharactersAsync(final ListUsersCharactersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAllUsersCharacters", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAllUsersCharacters", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5162,11 +5791,12 @@ private static PlayFabResult privateGetAllUsersCharac PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ @@ -5202,9 +5832,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterLeaderboardAsync(final GetCharacterLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5219,11 +5849,12 @@ private static PlayFabResult privateGetCharacterL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, centered on the currently signed-in user */ @@ -5259,9 +5890,9 @@ public PlayFabResult call() throws Exceptio */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCharacterAsync(final GetLeaderboardAroundCharacterRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCharacter", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCharacter", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5276,11 +5907,12 @@ private static PlayFabResult privateGetLead PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of all of the user's characters for the given statistic. */ @@ -5316,9 +5948,9 @@ public PlayFabResult call() throws Excep */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardForUserCharactersAsync(final GetLeaderboardForUsersCharactersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardForUserCharacters", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardForUserCharacters", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5333,11 +5965,12 @@ private static PlayFabResult privateGetL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardForUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Grants the specified character type to the user. */ @@ -5373,9 +6006,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGrantCharacterToUserAsync(final GrantCharacterToUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GrantCharacterToUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GrantCharacterToUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5390,11 +6023,12 @@ private static PlayFabResult privateGrantCharacterTo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantCharacterToUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the character which is readable and writable by the client */ @@ -5430,9 +6064,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterDataAsync(final GetCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5447,11 +6081,12 @@ private static PlayFabResult privateGetCharacterDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the character which can only be read by the client */ @@ -5487,9 +6122,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterReadOnlyDataAsync(final GetCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5504,11 +6139,12 @@ private static PlayFabResult privateGetCharacterReadOnly PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the title-specific custom data for the user's character which is readable and writable by the client */ @@ -5544,9 +6180,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateCharacterDataAsync(final UpdateCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateCharacterData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateCharacterData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5561,11 +6197,70 @@ private static PlayFabResult privateUpdateCharacterDa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateAmazonReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Accepts an open trade. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. */ @@ -5601,9 +6296,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAcceptTradeAsync(final AcceptTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AcceptTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AcceptTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5618,11 +6313,12 @@ private static PlayFabResult privateAcceptTradeAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AcceptTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Cancels an open trade. */ @@ -5658,9 +6354,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateCancelTradeAsync(final CancelTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CancelTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CancelTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5675,11 +6371,12 @@ private static PlayFabResult privateCancelTradeAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CancelTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Gets all trades the player has either opened or accepted, optionally filtered by trade status. */ @@ -5715,9 +6412,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayerTradesAsync(final GetPlayerTradesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTrades", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTrades", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5732,11 +6429,12 @@ private static PlayFabResult privateGetPlayerTradesAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayerTradesResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Gets the current status of an existing trade. */ @@ -5772,9 +6470,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTradeStatusAsync(final GetTradeStatusRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTradeStatus", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTradeStatus", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5789,11 +6487,12 @@ private static PlayFabResult privateGetTradeStatusAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTradeStatusResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Opens a new outstanding trade. */ @@ -5829,9 +6528,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateOpenTradeAsync(final OpenTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/OpenTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/OpenTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5846,13 +6545,85 @@ private static PlayFabResult privateOpenTradeAsync(final Open PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); OpenTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - private static String AuthKey = null; - + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AttributeInstallAsync(final AttributeInstallRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAttributeInstallAsync(request); + } + }); + } + + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AttributeInstall(final AttributeInstallRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAttributeInstallAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAttributeInstallAsync(final AttributeInstallRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AttributeInstall", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + AttributeInstallResult result = resultData.data; + PlayFabSettings.AdvertisingIdType += "_Successful"; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + public static void MultiStepClientLogin(Boolean needsAttribution) { + if (needsAttribution && !PlayFabSettings.DisableAdvertising && PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null) + { + PlayFabClientModels.AttributeInstallRequest request = new PlayFabClientModels.AttributeInstallRequest(); + if (PlayFabSettings.AdvertisingIdType == PlayFabSettings.AD_TYPE_IDFA) + request.Idfa = PlayFabSettings.AdvertisingIdValue; + else if (PlayFabSettings.AdvertisingIdType == PlayFabSettings.AD_TYPE_ANDROID_ID) + request.Android_Id = PlayFabSettings.AdvertisingIdValue; + else + return; + FutureTask> task = AttributeInstallAsync(request); + task.run(); + } + } + + private static String _authKey = null; } diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java index dcdc03797..ff2bbed0b 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java @@ -126,6 +126,22 @@ public static class AndroidDevicePushNotificationRegistrationResult { } + public static class AttributeInstallRequest { + /** + * The IdentifierForAdvertisers for iOS Devices. + */ + public String Idfa; + /** + * The Android Id for this Android device. + */ + public String Android_Id; + + } + + public static class AttributeInstallResult { + + } + public static class CancelTradeRequest { /** * Trade identifier. @@ -210,7 +226,7 @@ public static class CatalogItem implements Comparable { * list of item tags */ @Unordered - public ArrayList Tags; + public ArrayList Tags; /** * game specific custom data */ @@ -257,12 +273,12 @@ public static class CatalogItemBundleInfo { * unique ItemId values for all items which will be added to the player inventory when the bundle is added */ @Unordered - public ArrayList BundledItems; + public ArrayList BundledItems; /** * unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) */ @Unordered - public ArrayList BundledResultTables; + public ArrayList BundledResultTables; /** * virtual currency types and balances which will be added to the player inventory when the bundle is added */ @@ -297,12 +313,12 @@ public static class CatalogItemContainerInfo { * unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked */ @Unordered - public ArrayList ItemContents; + public ArrayList ItemContents; /** * unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) */ @Unordered - public ArrayList ResultTableContents; + public ArrayList ResultTableContents; /** * virtual currency types and balances which will be added to the player inventory when the container is unlocked */ @@ -418,7 +434,7 @@ public static class ConsumePSNEntitlementsResult { * Array of items granted to the player as a result of consuming entitlements. */ @Unordered("ItemInstanceId") - public ArrayList ItemsGranted; + public ArrayList ItemsGranted; } @@ -804,7 +820,7 @@ public static class GetCatalogItemsResult { * Array of inventory objects. */ @Unordered("ItemId") - public ArrayList Catalog; + public ArrayList Catalog; } @@ -873,7 +889,7 @@ public static class GetCharacterInventoryResult { * Array of inventory items belonging to the character. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the character. */ @@ -1131,6 +1147,22 @@ public static class GetPhotonAuthenticationTokenResult { } + public static class GetPlayerStatisticsRequest { + /** + * statistics to return + */ + public ArrayList StatisticNames; + + } + + public static class GetPlayerStatisticsResult { + /** + * User statistics for the requested user. + */ + public ArrayList Statistics; + + } + public static class GetPlayerTradesRequest { /** * Returns only trades with the given status. If null, returns all trades. @@ -1326,7 +1358,7 @@ public static class GetStoreItemsResult { * Array of store items. */ @Unordered("ItemId") - public ArrayList Store; + public ArrayList Store; } @@ -1440,7 +1472,7 @@ public static class GetUserCombinedInfoResult { * Array of inventory items in the user's current inventory. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1505,7 +1537,7 @@ public static class GetUserInventoryResult { * Array of inventory items in the user's current inventory. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1799,6 +1831,18 @@ public static class LinkSteamAccountResult { } + public static class LinkXboxAccountRequest { + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + + } + + public static class LinkXboxAccountResult { + + } + public static class ListUsersCharactersRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2061,6 +2105,22 @@ public static class LoginWithSteamRequest { } + public static class LoginWithXboxRequest { + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected + */ + public String TitleId; + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + /** + * Automatically create a PlayFab account if one is not currently linked to this Xbox Live account. + */ + public Boolean CreateAccount; + + } + public static class MatchmakeRequest { /** * build version to match against @@ -2709,6 +2769,38 @@ public static class StartPurchaseResult { } + public static class StatisticUpdate { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when setting the statistic value for the first time. + */ + public String Version; + /** + * statistic value for the player + */ + public Integer Value; + + } + + public static class StatisticValue { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * statistic value for the player + */ + public Integer Value; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded + */ + public String Version; + + } + public static class SteamPlayFabIdPair { /** * Unique Steam identifier for a user. @@ -2919,6 +3011,18 @@ public static class UnlinkSteamAccountResult { } + public static class UnlinkXboxAccountRequest { + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + + } + + public static class UnlinkXboxAccountResult { + + } + public static class UnlockContainerItemRequest { /** * Category ItemId of the container type to unlock. @@ -2983,6 +3087,18 @@ public static class UpdateCharacterDataResult { } + public static class UpdatePlayerStatisticsRequest { + /** + * Statistics to be updated with the provided values + */ + public ArrayList Statistics; + + } + + public static class UpdatePlayerStatisticsResult { + + } + public static class UpdateSharedGroupDataRequest { /** * Unique identifier for the shared group. @@ -3163,6 +3279,9 @@ public static class UserPrivateAccountInfo { } public static class UserSettings { + /** + * Boolean for whether this player is eligible for ad tracking. + */ public Boolean NeedsAttribution; } diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java index b9efd5962..9fa3ac356 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabErrors.java @@ -193,7 +193,11 @@ public static enum PlayFabErrorCode { ExpiredXboxLiveToken(1189), ResettableStatisticVersionRequired(1190), NotAuthorizedByTitle(1191), - NoPartnerEnabled(1192); + NoPartnerEnabled(1192), + InvalidPartnerResponse(1193), + APINotEnabledForGameServerAccess(1194), + StatisticNotFound(1195), + StatisticNameConflict(1196); 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 08fed0b4d..5dbed093a 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java @@ -3,11 +3,17 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - - public static String TitleId = null; + 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; - public static String LogicServerURL = null; + public static String LogicServerURL = null; // Assigned by GetCloudScriptUrl, used by RunCloudScript + public static String AdvertisingIdType = null; // Set this to the appropriate AD_TYPE_X constant below + public static String AdvertisingIdValue = null; // Set this to corresponding device value + // DisableAdvertising is provided for completeness, but changing it is not suggested + // Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly + public static Boolean DisableAdvertising = false; + public static final String AD_TYPE_IDFA = "Idfa"; + public static final String AD_TYPE_ANDROID_ID = "Android_Id"; public static String GetLogicURL() { return LogicServerURL; diff --git a/AndroidStudioExample/app/src/main/java/com/playfab/internal/PlayFabVersion.java b/AndroidStudioExample/app/src/main/java/com/playfab/internal/PlayFabVersion.java index 5eb9c8e6a..a8059d5e8 100644 --- a/AndroidStudioExample/app/src/main/java/com/playfab/internal/PlayFabVersion.java +++ b/AndroidStudioExample/app/src/main/java/com/playfab/internal/PlayFabVersion.java @@ -1,7 +1,7 @@ package com.playfab.internal; public class PlayFabVersion { - public static String SdkRevision = "0.10.151130"; + public static String SdkRevision = "0.11.151210"; public static String getVersionString() { return "JavaSDK-" + SdkRevision; } diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java b/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java index 7d58e3063..c753d463d 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabClientModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -50,9 +51,9 @@ public PlayFabResult call() throws Exception */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPhotonAuthenticationTokenAsync(final GetPhotonAuthenticationTokenRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPhotonAuthenticationToken", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPhotonAuthenticationToken", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -67,11 +68,12 @@ private static PlayFabResult privateGetPhoto PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPhotonAuthenticationTokenResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -108,7 +110,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithAndroidDeviceIDAsync(final LoginWithAndroidDeviceIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithAndroidDeviceID", request, null, null); task.run(); @@ -125,12 +127,14 @@ private static PlayFabResult privateLoginWithAndroidDeviceIDAsync(f PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -167,7 +171,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithCustomIDAsync(final LoginWithCustomIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithCustomID", request, null, null); task.run(); @@ -184,12 +188,14 @@ private static PlayFabResult privateLoginWithCustomIDAsync(final Lo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -226,7 +232,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithEmailAddressAsync(final LoginWithEmailAddressRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithEmailAddress", request, null, null); task.run(); @@ -243,12 +249,14 @@ private static PlayFabResult privateLoginWithEmailAddressAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -285,7 +293,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithFacebookAsync(final LoginWithFacebookRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithFacebook", request, null, null); task.run(); @@ -302,12 +310,14 @@ private static PlayFabResult privateLoginWithFacebookAsync(final Lo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -344,7 +354,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithGameCenterAsync(final LoginWithGameCenterRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithGameCenter", request, null, null); task.run(); @@ -361,12 +371,14 @@ private static PlayFabResult privateLoginWithGameCenterAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Google account access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -403,7 +415,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithGoogleAccountAsync(final LoginWithGoogleAccountRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithGoogleAccount", request, null, null); task.run(); @@ -420,12 +432,14 @@ private static PlayFabResult privateLoginWithGoogleAccountAsync(fin PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -462,7 +476,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithIOSDeviceIDAsync(final LoginWithIOSDeviceIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithIOSDeviceID", request, null, null); task.run(); @@ -479,12 +493,14 @@ private static PlayFabResult privateLoginWithIOSDeviceIDAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Kongregate player account. */ @@ -521,7 +537,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithKongregateAsync(final LoginWithKongregateRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithKongregate", request, null, null); task.run(); @@ -538,12 +554,14 @@ private static PlayFabResult privateLoginWithKongregateAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -580,7 +598,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithPlayFabAsync(final LoginWithPlayFabRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithPlayFab", request, null, null); task.run(); @@ -597,12 +615,75 @@ private static PlayFabResult privateLoginWithPlayFabAsync(final Log PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static FutureTask> LoginWithPSNAsync(final LoginWithPSNRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithPSNAsync(request); + } + }); + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LoginWithPSN(final LoginWithPSNRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithPSNAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLoginWithPSNAsync(final LoginWithPSNRequest request) throws Exception { + request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithPSN", request, null, null); + 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()); + LoginResult result = resultData.data; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -639,7 +720,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithSteamAsync(final LoginWithSteamRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithSteam", request, null, null); task.run(); @@ -656,12 +737,75 @@ private static PlayFabResult privateLoginWithSteamAsync(final Login PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static FutureTask> LoginWithXboxAsync(final LoginWithXboxRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithXboxAsync(request); + } + }); + } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LoginWithXbox(final LoginWithXboxRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithXboxAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLoginWithXboxAsync(final LoginWithXboxRequest request) throws Exception { + request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithXbox", request, null, null); + 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()); + LoginResult result = resultData.data; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply either a username or an email address. */ @@ -698,7 +842,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateRegisterPlayFabUserAsync(final RegisterPlayFabUserRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterPlayFabUser", request, null, null); task.run(); @@ -715,12 +859,14 @@ private static PlayFabResult privateRegisterPlayFabUs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RegisterPlayFabUserResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds playfab username/password auth to an existing semi-anonymous account created via a 3rd party auth method. */ @@ -756,9 +902,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddUsernamePasswordAsync(final AddUsernamePasswordRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUsernamePassword", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUsernamePassword", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -773,11 +919,12 @@ private static PlayFabResult privateAddUsernamePasswo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddUsernamePasswordResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the user's PlayFab account details */ @@ -813,9 +960,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetAccountInfoAsync(final GetAccountInfoRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAccountInfo", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAccountInfo", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -830,11 +977,12 @@ private static PlayFabResult privateGetAccountInfoAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetAccountInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ @@ -870,9 +1018,9 @@ public PlayFabResult call() throws Exception */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromFacebookIDsAsync(final GetPlayFabIDsFromFacebookIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromFacebookIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromFacebookIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -887,11 +1035,12 @@ private static PlayFabResult privateGetPlayF PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromFacebookIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center Programming Guide as the Player Identifier). */ @@ -927,9 +1076,9 @@ public PlayFabResult call() throws Excepti */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromGameCenterIDsAsync(final GetPlayFabIDsFromGameCenterIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGameCenterIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGameCenterIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -944,11 +1093,12 @@ private static PlayFabResult privateGetPla PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromGameCenterIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. */ @@ -984,9 +1134,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromGoogleIDsAsync(final GetPlayFabIDsFromGoogleIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGoogleIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGoogleIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1001,11 +1151,70 @@ private static PlayFabResult privateGetPlayFab PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromGoogleIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromPSNAccountIDsAsync(final GetPlayFabIDsFromPSNAccountIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromPSNAccountIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromPSNAccountIDs(final GetPlayFabIDsFromPSNAccountIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromPSNAccountIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromPSNAccountIDsAsync(final GetPlayFabIDsFromPSNAccountIDsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromPSNAccountIDs", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + GetPlayFabIDsFromPSNAccountIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. */ @@ -1041,9 +1250,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromSteamIDsAsync(final GetPlayFabIDsFromSteamIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromSteamIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromSteamIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1058,11 +1267,12 @@ private static PlayFabResult privateGetPlayFabI PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromSteamIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. */ @@ -1098,9 +1308,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserCombinedInfo", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserCombinedInfo", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1115,11 +1325,12 @@ private static PlayFabResult privateGetUserCombinedIn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserCombinedInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Android device identifier to the user's PlayFab account */ @@ -1155,9 +1366,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkAndroidDeviceIDAsync(final LinkAndroidDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkAndroidDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkAndroidDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1172,11 +1383,12 @@ private static PlayFabResult privateLinkAndroidDevice PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkAndroidDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the custom identifier, generated by the title, to the user's PlayFab account */ @@ -1212,9 +1424,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkCustomIDAsync(final LinkCustomIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkCustomID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkCustomID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1229,11 +1441,12 @@ private static PlayFabResult privateLinkCustomIDAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkCustomIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account */ @@ -1269,9 +1482,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkFacebookAccountAsync(final LinkFacebookAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkFacebookAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkFacebookAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1286,11 +1499,12 @@ private static PlayFabResult privateLinkFacebookAccou PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkFacebookAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account */ @@ -1326,9 +1540,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkGameCenterAccountAsync(final LinkGameCenterAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGameCenterAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGameCenterAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1343,11 +1557,12 @@ private static PlayFabResult privateLinkGameCenterA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkGameCenterAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the currently signed-in user account to the Google account specified by the Google account access token */ @@ -1383,9 +1598,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkGoogleAccountAsync(final LinkGoogleAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGoogleAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGoogleAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1400,11 +1615,12 @@ private static PlayFabResult privateLinkGoogleAccountAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkGoogleAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the vendor-specific iOS device identifier to the user's PlayFab account */ @@ -1440,9 +1656,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkIOSDeviceIDAsync(final LinkIOSDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkIOSDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkIOSDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1457,11 +1673,12 @@ private static PlayFabResult privateLinkIOSDeviceIDAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkIOSDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Kongregate identifier to the user's PlayFab account */ @@ -1497,9 +1714,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkKongregateAsync(final LinkKongregateAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkKongregate", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkKongregate", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1514,11 +1731,70 @@ private static PlayFabResult privateLinkKongregateA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkKongregateAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkPSNAccountAsync(final LinkPSNAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkPSNAccountAsync(request); + } + }); + } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkPSNAccount(final LinkPSNAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkPSNAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkPSNAccountAsync(final LinkPSNAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkPSNAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkPSNAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account */ @@ -1554,9 +1830,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkSteamAccountAsync(final LinkSteamAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkSteamAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkSteamAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1571,11 +1847,70 @@ private static PlayFabResult privateLinkSteamAccountAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkSteamAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkXboxAccountAsync(final LinkXboxAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkXboxAccountAsync(request); + } + }); + } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkXboxAccount(final LinkXboxAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkXboxAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkXboxAccountAsync(final LinkXboxAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkXboxAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkXboxAccountResult 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 user's account, with a link allowing the user to change the password */ @@ -1611,7 +1946,7 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSendAccountRecoveryEmailAsync(final SendAccountRecoveryEmailRequest request) throws Exception { - + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SendAccountRecoveryEmail", request, null, null); task.run(); Object httpResult = task.get(); @@ -1627,11 +1962,12 @@ private static PlayFabResult privateSendAccountR PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SendAccountRecoveryEmailResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Android device identifier from the user's PlayFab account */ @@ -1667,9 +2003,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkAndroidDeviceIDAsync(final UnlinkAndroidDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkAndroidDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkAndroidDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1684,11 +2020,12 @@ private static PlayFabResult privateUnlinkAndroidDe PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkAndroidDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related custom identifier from the user's PlayFab account */ @@ -1724,9 +2061,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkCustomIDAsync(final UnlinkCustomIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkCustomID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkCustomID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1741,11 +2078,12 @@ private static PlayFabResult privateUnlinkCustomIDAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkCustomIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Facebook account from the user's PlayFab account */ @@ -1781,9 +2119,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkFacebookAccountAsync(final UnlinkFacebookAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkFacebookAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkFacebookAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1798,11 +2136,12 @@ private static PlayFabResult privateUnlinkFacebookA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkFacebookAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Game Center account from the user's PlayFab account */ @@ -1838,9 +2177,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkGameCenterAccountAsync(final UnlinkGameCenterAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGameCenterAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGameCenterAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1855,11 +2194,12 @@ private static PlayFabResult privateUnlinkGameCen PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkGameCenterAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Google account from the user's PlayFab account */ @@ -1895,9 +2235,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkGoogleAccountAsync(final UnlinkGoogleAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGoogleAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGoogleAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1912,11 +2252,12 @@ private static PlayFabResult privateUnlinkGoogleAccou PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkGoogleAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related iOS device identifier from the user's PlayFab account */ @@ -1952,9 +2293,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkIOSDeviceIDAsync(final UnlinkIOSDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkIOSDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkIOSDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1969,11 +2310,12 @@ private static PlayFabResult privateUnlinkIOSDeviceIDAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkIOSDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Kongregate identifier from the user's PlayFab account */ @@ -2009,9 +2351,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkKongregateAsync(final UnlinkKongregateAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkKongregate", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkKongregate", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2026,11 +2368,70 @@ private static PlayFabResult privateUnlinkKongreg PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkKongregateAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkPSNAccountAsync(final UnlinkPSNAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkPSNAccountAsync(request); + } + }); + } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkPSNAccount(final UnlinkPSNAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkPSNAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkPSNAccountAsync(final UnlinkPSNAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkPSNAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkPSNAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Unlinks the related Steam account from the user's PlayFab account */ @@ -2066,9 +2467,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkSteamAccountAsync(final UnlinkSteamAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkSteamAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkSteamAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2083,11 +2484,70 @@ private static PlayFabResult privateUnlinkSteamAccount PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkSteamAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkXboxAccountAsync(final UnlinkXboxAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkXboxAccountAsync(request); + } + }); + } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkXboxAccount(final UnlinkXboxAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkXboxAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkXboxAccountAsync(final UnlinkXboxAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkXboxAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkXboxAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Updates the title specific display name for the user */ @@ -2123,9 +2583,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserTitleDisplayNameAsync(final UpdateUserTitleDisplayNameRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserTitleDisplayName", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserTitleDisplayName", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2140,11 +2600,12 @@ private static PlayFabResult privateUpdateUser PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserTitleDisplayNameResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in the leaderboard */ @@ -2180,9 +2641,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAsync(final GetFriendLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2197,11 +2658,12 @@ private static PlayFabResult privateGetFriendLeaderboardAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user */ @@ -2237,9 +2699,9 @@ public PlayFabResult call() throws */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboardAroundCurrentUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboardAroundCurrentUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2254,11 +2716,12 @@ private static PlayFabResult privat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetFriendLeaderboardAroundCurrentUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ @@ -2294,9 +2757,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAsync(final GetLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2311,11 +2774,12 @@ private static PlayFabResult privateGetLeaderboardAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ @@ -2351,9 +2815,9 @@ public PlayFabResult call() throws Except */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCurrentUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCurrentUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2368,11 +2832,12 @@ private static PlayFabResult privateGetLe PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundCurrentUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -2408,9 +2873,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2425,11 +2890,12 @@ private static PlayFabResult privateGetUserDataAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ @@ -2465,9 +2931,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserPublisherDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2482,11 +2948,12 @@ private static PlayFabResult privateGetUserPublisherDataAsync PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which can only be read by the client */ @@ -2522,9 +2989,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserPublisherReadOnlyDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2539,11 +3006,12 @@ private static PlayFabResult privateGetUserPublisherReadOnlyD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which can only be read by the client */ @@ -2579,9 +3047,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserReadOnlyDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2596,11 +3064,12 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of all title-specific statistics for the user */ @@ -2636,9 +3105,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserStatisticsAsync(final GetUserStatisticsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserStatistics", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserStatistics", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2653,11 +3122,12 @@ private static PlayFabResult privateGetUserStatisticsAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the title-specific custom data for the user which is readable and writable by the client */ @@ -2693,9 +3163,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserDataAsync(final UpdateUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2710,11 +3180,12 @@ private static PlayFabResult privateUpdateUserDataAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the publisher-specific custom data for the user which is readable and writable by the client */ @@ -2750,9 +3221,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserPublisherDataAsync(final UpdateUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2767,11 +3238,12 @@ private static PlayFabResult privateUpdateUserPublisherDat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the values of the specified title-specific statistics for the user */ @@ -2807,9 +3279,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserStatistics", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserStatistics", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2824,11 +3296,12 @@ private static PlayFabResult privateUpdateUserStatis PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserStatisticsResult 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 */ @@ -2864,9 +3337,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCatalogItemsAsync(final GetCatalogItemsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCatalogItems", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCatalogItems", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2881,11 +3354,12 @@ private static PlayFabResult privateGetCatalogItemsAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the set of items defined for the specified store, including all prices defined */ @@ -2921,9 +3395,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetStoreItemsAsync(final GetStoreItemsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetStoreItems", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetStoreItems", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2938,11 +3412,12 @@ private static PlayFabResult privateGetStoreItemsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom title settings */ @@ -2978,9 +3453,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTitleDataAsync(final GetTitleDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2995,11 +3470,12 @@ private static PlayFabResult privateGetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title news feed, as configured in the developer portal */ @@ -3035,9 +3511,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTitleNewsAsync(final GetTitleNewsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleNews", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleNews", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3052,11 +3528,12 @@ private static PlayFabResult privateGetTitleNewsAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleNewsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the user's balance of the specified virtual currency by the stated amount */ @@ -3092,9 +3569,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddUserVirtualCurrencyAsync(final AddUserVirtualCurrencyRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUserVirtualCurrency", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUserVirtualCurrency", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3109,11 +3586,12 @@ private static PlayFabResult privateAddUserVirt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate */ @@ -3149,9 +3627,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateConfirmPurchaseAsync(final ConfirmPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConfirmPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConfirmPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3166,11 +3644,12 @@ private static PlayFabResult privateConfirmPurchaseAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ConfirmPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ @@ -3206,9 +3685,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateConsumeItemAsync(final ConsumeItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumeItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumeItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3223,11 +3702,12 @@ private static PlayFabResult privateConsumeItemAsync(final Co PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ConsumeItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified character's current inventory of virtual goods */ @@ -3263,9 +3743,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterInventoryAsync(final GetCharacterInventoryRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterInventory", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterInventory", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3280,11 +3760,12 @@ private static PlayFabResult privateGetCharacterInv PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a completed purchase along with its current PlayFab status. */ @@ -3320,9 +3801,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPurchaseAsync(final GetPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3337,11 +3818,12 @@ private static PlayFabResult privateGetPurchaseAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the user's current inventory of virtual goods */ @@ -3377,9 +3859,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserInventoryAsync(final GetUserInventoryRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserInventory", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserInventory", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3394,11 +3876,12 @@ private static PlayFabResult privateGetUserInventoryAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Selects a payment option for purchase order created via StartPurchase */ @@ -3434,9 +3917,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privatePayForPurchaseAsync(final PayForPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PayForPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PayForPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3451,11 +3934,12 @@ private static PlayFabResult privatePayForPurchaseAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PayForPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what the client believes the price to be. This lets the server fail the purchase if the price has changed. */ @@ -3491,9 +3975,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privatePurchaseItemAsync(final PurchaseItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PurchaseItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PurchaseItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3508,11 +3992,12 @@ private static PlayFabResult privatePurchaseItemAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PurchaseItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * 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/ */ @@ -3548,9 +4033,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRedeemCouponAsync(final RedeemCouponRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RedeemCoupon", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RedeemCoupon", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3565,11 +4050,12 @@ private static PlayFabResult privateRedeemCouponAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RedeemCouponResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. */ @@ -3605,9 +4091,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateReportPlayerAsync(final ReportPlayerClientRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ReportPlayer", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ReportPlayer", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3622,11 +4108,12 @@ private static PlayFabResult privateReportPlayerAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ReportPlayerClientResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates an order for a list of items from the title catalog */ @@ -3662,9 +4149,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateStartPurchaseAsync(final StartPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3679,11 +4166,12 @@ private static PlayFabResult privateStartPurchaseAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); StartPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the user's balance of the specified virtual currency by the stated amount */ @@ -3719,9 +4207,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSubtractUserVirtualCurrencyAsync(final SubtractUserVirtualCurrencyRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SubtractUserVirtualCurrency", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SubtractUserVirtualCurrency", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3736,11 +4224,12 @@ private static PlayFabResult privateSubtractUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlocks a container item in the user's inventory and consumes a key item of the type indicated by the container item */ @@ -3776,9 +4265,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlockContainerItemAsync(final UnlockContainerItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlockContainerItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlockContainerItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3793,11 +4282,12 @@ private static PlayFabResult privateUnlockContainerIt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlockContainerItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. */ @@ -3833,9 +4323,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddFriendAsync(final AddFriendRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddFriend", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddFriend", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3850,11 +4340,12 @@ private static PlayFabResult privateAddFriendAsync(final AddFri PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddFriendResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. */ @@ -3890,9 +4381,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendsListAsync(final GetFriendsListRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendsList", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendsList", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3907,11 +4398,12 @@ private static PlayFabResult privateGetFriendsListAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetFriendsListResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes a specified user from the friend list of the local user */ @@ -3947,9 +4439,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRemoveFriendAsync(final RemoveFriendRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveFriend", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveFriend", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3964,11 +4456,12 @@ private static PlayFabResult privateRemoveFriendAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveFriendResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the tag list for a specified user in the friend list of the local user */ @@ -4004,9 +4497,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSetFriendTagsAsync(final SetFriendTagsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SetFriendTags", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SetFriendTags", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4021,11 +4514,12 @@ private static PlayFabResult privateSetFriendTagsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetFriendTagsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Registers the iOS device to receive push notifications */ @@ -4061,9 +4555,9 @@ public PlayFabResult call() throws Excepti */ @SuppressWarnings("unchecked") private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4078,11 +4572,12 @@ private static PlayFabResult privateRegist PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RegisterForIOSPushNotificationResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Restores all in-app purchases based on the given refresh receipt. */ @@ -4118,9 +4613,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4135,11 +4630,12 @@ private static PlayFabResult privateRestoreIOSPurchas PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RestoreIOSPurchasesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item */ @@ -4175,9 +4671,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4192,11 +4688,12 @@ private static PlayFabResult privateValidateIOSReceipt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ValidateIOSReceiptResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Get details about all current running game servers matching the given parameters. */ @@ -4232,9 +4729,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCurrentGamesAsync(final CurrentGamesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCurrentGames", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCurrentGames", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4249,11 +4746,12 @@ private static PlayFabResult privateGetCurrentGamesAsync(fin PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CurrentGamesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Get details about the regions hosting game servers matching the given parameters. */ @@ -4289,9 +4787,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetGameServerRegionsAsync(final GameServerRegionsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetGameServerRegions", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetGameServerRegions", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4306,11 +4804,12 @@ private static PlayFabResult privateGetGameServerRegion PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GameServerRegionsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Attempts to locate a game session matching the given parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be GameNotFound. Note that EnableQueue is deprecated at this time. */ @@ -4346,9 +4845,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateMatchmakeAsync(final MatchmakeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/Matchmake", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/Matchmake", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4363,11 +4862,12 @@ private static PlayFabResult privateMatchmakeAsync(final Matchm PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MatchmakeResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Start a new game server with a given configuration, add the current player and return the connection information. */ @@ -4403,9 +4903,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateStartGameAsync(final StartGameRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartGame", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartGame", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4420,11 +4920,12 @@ private static PlayFabResult privateStartGameAsync(final StartG PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); StartGameResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Registers the Android device to receive push notifications */ @@ -4460,9 +4961,9 @@ public PlayFabResult call() thr */ @SuppressWarnings("unchecked") private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4477,11 +4978,12 @@ private static PlayFabResult pr PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AndroidDevicePushNotificationRegistrationResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Validates a Google Play purchase and gives the corresponding item to the player. */ @@ -4517,9 +5019,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4534,11 +5036,12 @@ private static PlayFabResult privateValidateGo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ValidateGooglePlayPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Logs a custom analytics event */ @@ -4574,9 +5077,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLogEventAsync(final LogEventRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LogEvent", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LogEvent", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4591,11 +5094,12 @@ private static PlayFabResult privateLogEventAsync(final LogEvent PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LogEventResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group can add new members. */ @@ -4631,9 +5135,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddSharedGroupMembersAsync(final AddSharedGroupMembersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddSharedGroupMembers", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddSharedGroupMembers", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4648,11 +5152,12 @@ private static PlayFabResult privateAddSharedGroupM PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. Upon creation, the current user will be the only member of the group. */ @@ -4688,9 +5193,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateCreateSharedGroupAsync(final CreateSharedGroupRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CreateSharedGroup", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CreateSharedGroup", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4705,11 +5210,12 @@ private static PlayFabResult privateCreateSharedGroupAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CreateSharedGroupResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom publisher settings */ @@ -4745,9 +5251,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPublisherDataAsync(final GetPublisherDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4762,11 +5268,12 @@ private static PlayFabResult privateGetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. */ @@ -4802,9 +5309,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetSharedGroupDataAsync(final GetSharedGroupDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetSharedGroupData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetSharedGroupData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4819,11 +5326,12 @@ private static PlayFabResult privateGetSharedGroupData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. */ @@ -4859,9 +5367,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRemoveSharedGroupMembersAsync(final RemoveSharedGroupMembersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveSharedGroupMembers", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveSharedGroupMembers", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4876,11 +5384,12 @@ private static PlayFabResult privateRemoveShared PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group can update the data. */ @@ -4916,9 +5425,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateSharedGroupDataAsync(final UpdateSharedGroupDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateSharedGroupData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateSharedGroupData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4933,11 +5442,128 @@ private static PlayFabResult privateUpdateSharedGro PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + public static FutureTask> ConsumePSNEntitlementsAsync(final ConsumePSNEntitlementsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateConsumePSNEntitlementsAsync(request); + } + }); + } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ConsumePSNEntitlements(final ConsumePSNEntitlementsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateConsumePSNEntitlementsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateConsumePSNEntitlementsAsync(final ConsumePSNEntitlementsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumePSNEntitlements", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ConsumePSNEntitlementsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + public static FutureTask> RefreshPSNAuthTokenAsync(final RefreshPSNAuthTokenRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRefreshPSNAuthTokenAsync(request); + } + }); + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RefreshPSNAuthToken(final RefreshPSNAuthTokenRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRefreshPSNAuthTokenAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRefreshPSNAuthTokenAsync(final RefreshPSNAuthTokenRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RefreshPSNAuthToken", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + EmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. */ @@ -4973,9 +5599,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCloudScriptUrl", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCloudScriptUrl", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4996,6 +5622,7 @@ private static PlayFabResult privateGetCloudScriptUrlAs pfResult.Result = result; return pfResult; } + /** * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. */ @@ -5031,9 +5658,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRunCloudScriptAsync(final RunCloudScriptRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetLogicURL() + "/Client/RunCloudScript", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetLogicURL() + "/Client/RunCloudScript", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5048,11 +5675,12 @@ private static PlayFabResult privateRunCloudScriptAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RunCloudScriptResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://support.playfab.com/support/discussions/topics/1000059929 */ @@ -5088,9 +5716,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetContentDownloadUrlAsync(final GetContentDownloadUrlRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetContentDownloadUrl", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetContentDownloadUrl", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5105,11 +5733,12 @@ private static PlayFabResult privateGetContentDownl PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentDownloadUrlResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Lists all of the characters that belong to a specific user. */ @@ -5145,9 +5774,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetAllUsersCharactersAsync(final ListUsersCharactersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAllUsersCharacters", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAllUsersCharacters", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5162,11 +5791,12 @@ private static PlayFabResult privateGetAllUsersCharac PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ @@ -5202,9 +5832,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterLeaderboardAsync(final GetCharacterLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5219,11 +5849,12 @@ private static PlayFabResult privateGetCharacterL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, centered on the currently signed-in user */ @@ -5259,9 +5890,9 @@ public PlayFabResult call() throws Exceptio */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCharacterAsync(final GetLeaderboardAroundCharacterRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCharacter", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCharacter", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5276,11 +5907,12 @@ private static PlayFabResult privateGetLead PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of all of the user's characters for the given statistic. */ @@ -5316,9 +5948,9 @@ public PlayFabResult call() throws Excep */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardForUserCharactersAsync(final GetLeaderboardForUsersCharactersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardForUserCharacters", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardForUserCharacters", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5333,11 +5965,12 @@ private static PlayFabResult privateGetL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardForUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Grants the specified character type to the user. */ @@ -5373,9 +6006,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGrantCharacterToUserAsync(final GrantCharacterToUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GrantCharacterToUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GrantCharacterToUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5390,11 +6023,12 @@ private static PlayFabResult privateGrantCharacterTo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantCharacterToUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the character which is readable and writable by the client */ @@ -5430,9 +6064,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterDataAsync(final GetCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5447,11 +6081,12 @@ private static PlayFabResult privateGetCharacterDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the character which can only be read by the client */ @@ -5487,9 +6122,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterReadOnlyDataAsync(final GetCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5504,11 +6139,12 @@ private static PlayFabResult privateGetCharacterReadOnly PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the title-specific custom data for the user's character which is readable and writable by the client */ @@ -5544,9 +6180,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateCharacterDataAsync(final UpdateCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateCharacterData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateCharacterData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5561,11 +6197,70 @@ private static PlayFabResult privateUpdateCharacterDa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateAmazonReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Accepts an open trade. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. */ @@ -5601,9 +6296,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAcceptTradeAsync(final AcceptTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AcceptTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AcceptTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5618,11 +6313,12 @@ private static PlayFabResult privateAcceptTradeAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AcceptTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Cancels an open trade. */ @@ -5658,9 +6354,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateCancelTradeAsync(final CancelTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CancelTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CancelTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5675,11 +6371,12 @@ private static PlayFabResult privateCancelTradeAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CancelTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Gets all trades the player has either opened or accepted, optionally filtered by trade status. */ @@ -5715,9 +6412,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayerTradesAsync(final GetPlayerTradesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTrades", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTrades", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5732,11 +6429,12 @@ private static PlayFabResult privateGetPlayerTradesAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayerTradesResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Gets the current status of an existing trade. */ @@ -5772,9 +6470,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTradeStatusAsync(final GetTradeStatusRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTradeStatus", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTradeStatus", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5789,11 +6487,12 @@ private static PlayFabResult privateGetTradeStatusAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTradeStatusResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Opens a new outstanding trade. */ @@ -5829,9 +6528,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateOpenTradeAsync(final OpenTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/OpenTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/OpenTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5846,13 +6545,85 @@ private static PlayFabResult privateOpenTradeAsync(final Open PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); OpenTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - private static String AuthKey = null; - + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AttributeInstallAsync(final AttributeInstallRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAttributeInstallAsync(request); + } + }); + } + + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AttributeInstall(final AttributeInstallRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAttributeInstallAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAttributeInstallAsync(final AttributeInstallRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AttributeInstall", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + AttributeInstallResult result = resultData.data; + PlayFabSettings.AdvertisingIdType += "_Successful"; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + public static void MultiStepClientLogin(Boolean needsAttribution) { + if (needsAttribution && !PlayFabSettings.DisableAdvertising && PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null) + { + PlayFabClientModels.AttributeInstallRequest request = new PlayFabClientModels.AttributeInstallRequest(); + if (PlayFabSettings.AdvertisingIdType == PlayFabSettings.AD_TYPE_IDFA) + request.Idfa = PlayFabSettings.AdvertisingIdValue; + else if (PlayFabSettings.AdvertisingIdType == PlayFabSettings.AD_TYPE_ANDROID_ID) + request.Android_Id = PlayFabSettings.AdvertisingIdValue; + else + return; + FutureTask> task = AttributeInstallAsync(request); + task.run(); + } + } + + private static String _authKey = null; } diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java index dcdc03797..ff2bbed0b 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java @@ -126,6 +126,22 @@ public static class AndroidDevicePushNotificationRegistrationResult { } + public static class AttributeInstallRequest { + /** + * The IdentifierForAdvertisers for iOS Devices. + */ + public String Idfa; + /** + * The Android Id for this Android device. + */ + public String Android_Id; + + } + + public static class AttributeInstallResult { + + } + public static class CancelTradeRequest { /** * Trade identifier. @@ -210,7 +226,7 @@ public static class CatalogItem implements Comparable { * list of item tags */ @Unordered - public ArrayList Tags; + public ArrayList Tags; /** * game specific custom data */ @@ -257,12 +273,12 @@ public static class CatalogItemBundleInfo { * unique ItemId values for all items which will be added to the player inventory when the bundle is added */ @Unordered - public ArrayList BundledItems; + public ArrayList BundledItems; /** * unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) */ @Unordered - public ArrayList BundledResultTables; + public ArrayList BundledResultTables; /** * virtual currency types and balances which will be added to the player inventory when the bundle is added */ @@ -297,12 +313,12 @@ public static class CatalogItemContainerInfo { * unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked */ @Unordered - public ArrayList ItemContents; + public ArrayList ItemContents; /** * unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) */ @Unordered - public ArrayList ResultTableContents; + public ArrayList ResultTableContents; /** * virtual currency types and balances which will be added to the player inventory when the container is unlocked */ @@ -418,7 +434,7 @@ public static class ConsumePSNEntitlementsResult { * Array of items granted to the player as a result of consuming entitlements. */ @Unordered("ItemInstanceId") - public ArrayList ItemsGranted; + public ArrayList ItemsGranted; } @@ -804,7 +820,7 @@ public static class GetCatalogItemsResult { * Array of inventory objects. */ @Unordered("ItemId") - public ArrayList Catalog; + public ArrayList Catalog; } @@ -873,7 +889,7 @@ public static class GetCharacterInventoryResult { * Array of inventory items belonging to the character. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the character. */ @@ -1131,6 +1147,22 @@ public static class GetPhotonAuthenticationTokenResult { } + public static class GetPlayerStatisticsRequest { + /** + * statistics to return + */ + public ArrayList StatisticNames; + + } + + public static class GetPlayerStatisticsResult { + /** + * User statistics for the requested user. + */ + public ArrayList Statistics; + + } + public static class GetPlayerTradesRequest { /** * Returns only trades with the given status. If null, returns all trades. @@ -1326,7 +1358,7 @@ public static class GetStoreItemsResult { * Array of store items. */ @Unordered("ItemId") - public ArrayList Store; + public ArrayList Store; } @@ -1440,7 +1472,7 @@ public static class GetUserCombinedInfoResult { * Array of inventory items in the user's current inventory. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1505,7 +1537,7 @@ public static class GetUserInventoryResult { * Array of inventory items in the user's current inventory. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1799,6 +1831,18 @@ public static class LinkSteamAccountResult { } + public static class LinkXboxAccountRequest { + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + + } + + public static class LinkXboxAccountResult { + + } + public static class ListUsersCharactersRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2061,6 +2105,22 @@ public static class LoginWithSteamRequest { } + public static class LoginWithXboxRequest { + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected + */ + public String TitleId; + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + /** + * Automatically create a PlayFab account if one is not currently linked to this Xbox Live account. + */ + public Boolean CreateAccount; + + } + public static class MatchmakeRequest { /** * build version to match against @@ -2709,6 +2769,38 @@ public static class StartPurchaseResult { } + public static class StatisticUpdate { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when setting the statistic value for the first time. + */ + public String Version; + /** + * statistic value for the player + */ + public Integer Value; + + } + + public static class StatisticValue { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * statistic value for the player + */ + public Integer Value; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded + */ + public String Version; + + } + public static class SteamPlayFabIdPair { /** * Unique Steam identifier for a user. @@ -2919,6 +3011,18 @@ public static class UnlinkSteamAccountResult { } + public static class UnlinkXboxAccountRequest { + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + + } + + public static class UnlinkXboxAccountResult { + + } + public static class UnlockContainerItemRequest { /** * Category ItemId of the container type to unlock. @@ -2983,6 +3087,18 @@ public static class UpdateCharacterDataResult { } + public static class UpdatePlayerStatisticsRequest { + /** + * Statistics to be updated with the provided values + */ + public ArrayList Statistics; + + } + + public static class UpdatePlayerStatisticsResult { + + } + public static class UpdateSharedGroupDataRequest { /** * Unique identifier for the shared group. @@ -3163,6 +3279,9 @@ public static class UserPrivateAccountInfo { } public static class UserSettings { + /** + * Boolean for whether this player is eligible for ad tracking. + */ public Boolean NeedsAttribution; } diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java index b9efd5962..9fa3ac356 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabErrors.java @@ -193,7 +193,11 @@ public static enum PlayFabErrorCode { ExpiredXboxLiveToken(1189), ResettableStatisticVersionRequired(1190), NotAuthorizedByTitle(1191), - NoPartnerEnabled(1192); + NoPartnerEnabled(1192), + InvalidPartnerResponse(1193), + APINotEnabledForGameServerAccess(1194), + StatisticNotFound(1195), + StatisticNameConflict(1196); public int id; diff --git a/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java b/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java index 08fed0b4d..5dbed093a 100644 --- a/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java +++ b/PlayFabClientSDK/src/com/playfab/PlayFabSettings.java @@ -3,11 +3,17 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - - public static String TitleId = null; + 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; - public static String LogicServerURL = null; + public static String LogicServerURL = null; // Assigned by GetCloudScriptUrl, used by RunCloudScript + public static String AdvertisingIdType = null; // Set this to the appropriate AD_TYPE_X constant below + public static String AdvertisingIdValue = null; // Set this to corresponding device value + // DisableAdvertising is provided for completeness, but changing it is not suggested + // Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly + public static Boolean DisableAdvertising = false; + public static final String AD_TYPE_IDFA = "Idfa"; + public static final String AD_TYPE_ANDROID_ID = "Android_Id"; public static String GetLogicURL() { return LogicServerURL; diff --git a/PlayFabClientSDK/src/com/playfab/internal/PlayFabVersion.java b/PlayFabClientSDK/src/com/playfab/internal/PlayFabVersion.java index 5eb9c8e6a..a8059d5e8 100644 --- a/PlayFabClientSDK/src/com/playfab/internal/PlayFabVersion.java +++ b/PlayFabClientSDK/src/com/playfab/internal/PlayFabVersion.java @@ -1,7 +1,7 @@ package com.playfab.internal; public class PlayFabVersion { - public static String SdkRevision = "0.10.151130"; + public static String SdkRevision = "0.11.151210"; public static String getVersionString() { return "JavaSDK-" + SdkRevision; } diff --git a/PlayFabSDK/src/PlayFabApiTest.java b/PlayFabSDK/src/PlayFabApiTest.java index 08f96c486..f849edc20 100644 --- a/PlayFabSDK/src/PlayFabApiTest.java +++ b/PlayFabSDK/src/PlayFabApiTest.java @@ -55,7 +55,7 @@ private void VerifyResult(PlayFabResult result, boolean expectSuccess) assertNotNull(result.Error); } } - + private class TitleData { public String titleId; @@ -66,7 +66,7 @@ private class TitleData public String userPassword; public String characterName; } - + @BeforeClass public static void oneTimeSetUp() { String testTitleDataFile = System.getProperty("testTitleData"); @@ -91,10 +91,10 @@ public static void oneTimeSetUp() { return; } Gson gson = new GsonBuilder().create(); - TitleData resultData = gson.fromJson(testTitleJson, new TypeToken(){}.getType()); + TitleData resultData = gson.fromJson(testTitleJson, new TypeToken(){}.getType()); PlayFabSettings.TitleId = resultData.titleId; PlayFabSettings.DeveloperSecretKey = resultData.developerSecretKey; - TITLE_CAN_UPDATE_SETTINGS = Boolean.parseBoolean(resultData.titleCanUpdateSettings); + TITLE_CAN_UPDATE_SETTINGS = Boolean.parseBoolean(resultData.titleCanUpdateSettings); USER_NAME = resultData.userName; USER_EMAIL = resultData.userEmail; USER_PASSWORD = resultData.userPassword; @@ -106,7 +106,6 @@ public static void oneTimeSetUp() { public void InvalidLogin() { PlayFabClientModels.LoginWithEmailAddressRequest request = new PlayFabClientModels.LoginWithEmailAddressRequest(); - request.TitleId = PlayFabSettings.TitleId; request.Email = USER_EMAIL; request.Password = USER_PASSWORD + "invalid"; @@ -115,12 +114,11 @@ public void InvalidLogin() VerifyResult(result, false); assertTrue(result.Error.errorMessage.contains("password")); } - + @Test public void LoginOrRegister() { PlayFabClientModels.LoginWithEmailAddressRequest request = new PlayFabClientModels.LoginWithEmailAddressRequest(); - request.TitleId = PlayFabSettings.TitleId; request.Email = USER_EMAIL; request.Password = USER_PASSWORD; @@ -132,12 +130,31 @@ public void LoginOrRegister() // TODO: Register if the login failed } - + + /// + /// CLIENT API + /// Test that the login call sequence sends the AdvertisingId when set + /// + @Test + public void LoginWithAdvertisingId() + { + PlayFabSettings.AdvertisingIdType = PlayFabSettings.AD_TYPE_ANDROID_ID; + PlayFabSettings.AdvertisingIdValue = "PlayFabTestId"; + + PlayFabClientModels.LoginWithEmailAddressRequest request = new PlayFabClientModels.LoginWithEmailAddressRequest(); + request.TitleId = PlayFabSettings.TitleId; + request.Email = USER_EMAIL; + request.Password = USER_PASSWORD; + PlayFabResult result = PlayFabClientAPI.LoginWithEmailAddress(request); + + assertEquals(PlayFabSettings.AD_TYPE_ANDROID_ID + "_Successful", PlayFabSettings.AdvertisingIdType); + } + @Test public void UserDataApi() { LoginOrRegister(); - + PlayFabClientModels.GetUserDataRequest getRequest = new PlayFabClientModels.GetUserDataRequest(); PlayFabResult getDataResult = PlayFabClientAPI.GetUserData(getRequest); VerifyResult(getDataResult, true); @@ -159,7 +176,7 @@ public void UserDataApi() // Get the UTC timestamp for when the record was updated Date timeUpdated = tempRecord.LastUpdated; - + // Generate utc timestamps within 5 minutes of "now" Date now = new Date(); int utcOffset = Calendar.getInstance().getTimeZone().getRawOffset(); @@ -170,42 +187,42 @@ public void UserDataApi() // Verify that the update time is sufficiently close to now assertTrue(testMin.before(timeUpdated) && timeUpdated.before(testMax)); } - + @Test public void UserStatisticsApi() { LoginOrRegister(); - + PlayFabClientModels.GetUserStatisticsRequest getRequest = new PlayFabClientModels.GetUserStatisticsRequest(); PlayFabResult getStatsResult = PlayFabClientAPI.GetUserStatistics(getRequest); VerifyResult(getStatsResult, true); int testStatExpected = getStatsResult.Result.UserStatistics == null ? 0 : getStatsResult.Result.UserStatistics.get(TEST_STAT_NAME); 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); VerifyResult(updateStatsResult, true); - + getStatsResult = PlayFabClientAPI.GetUserStatistics(getRequest); VerifyResult(getStatsResult, true); int testStatActual = getStatsResult.Result.UserStatistics == null ? 0 : getStatsResult.Result.UserStatistics.get(TEST_STAT_NAME); assertEquals(testStatExpected, testStatActual); } - + @Test public void UserCharacter() { LoginOrRegister(); - + PlayFabServerModels.ListUsersCharactersRequest getRequest = new PlayFabServerModels.ListUsersCharactersRequest(); getRequest.PlayFabId = playFabId; PlayFabResult getCharsResult = PlayFabServerAPI.GetAllUsersCharacters(getRequest); VerifyResult(getCharsResult, true); SaveCharacterId(getCharsResult.Result.Characters); - + if (getCharsResult.Result.Characters == null || getCharsResult.Result.Characters.size() == 0) { PlayFabServerModels.GrantCharacterToUserRequest grantRequest = new PlayFabServerModels.GrantCharacterToUserRequest(); @@ -221,7 +238,7 @@ public void UserCharacter() VerifyResult(getCharsResult, true); SaveCharacterId(getCharsResult.Result.Characters); } - + assertTrue(characterId != null && characterId.length() > 0); } private void SaveCharacterId(List characters) @@ -230,23 +247,23 @@ private void SaveCharacterId(List character { PlayFabServerModels.CharacterResult eachChar = characters.get(i); if (eachChar.CharacterName.equals(CHAR_NAME)) - characterId = eachChar.CharacterId; + characterId = eachChar.CharacterId; } } - + @Test public void LeaderBoard() { LoginOrRegister(); UserStatisticsApi(); - + PlayFabClientModels.GetLeaderboardAroundCurrentUserRequest clientRequest = new PlayFabClientModels.GetLeaderboardAroundCurrentUserRequest(); clientRequest.MaxResultsCount = 3; clientRequest.StatisticName = TEST_STAT_NAME; PlayFabResult clientResult = PlayFabClientAPI.GetLeaderboardAroundCurrentUser(clientRequest); VerifyResult(clientResult, true); assertTrue(GetClLbCount(clientResult.Result.Leaderboard) > 0); - + PlayFabServerModels.GetLeaderboardAroundUserRequest serverRequest = new PlayFabServerModels.GetLeaderboardAroundUserRequest(); serverRequest.MaxResultsCount = 3; serverRequest.StatisticName = TEST_STAT_NAME; @@ -269,7 +286,7 @@ private int GetSvLbCount(List lb) count = lb.size(); return count; } - + /// /// CLIENT API /// Test that AccountInfo can be requested @@ -279,7 +296,7 @@ private int GetSvLbCount(List lb) public void AccountInfo() { LoginOrRegister(); - + PlayFabClientModels.GetAccountInfoRequest request = new PlayFabClientModels.GetAccountInfoRequest(); request.PlayFabId = playFabId; PlayFabResult result = PlayFabClientAPI.GetAccountInfo(request); diff --git a/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java b/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java index ad8871dce..37d40ae3a 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabAdminModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -67,11 +68,12 @@ private static PlayFabResult privateGetUserAccountI PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LookupUserAccountInfoResult 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 */ @@ -124,11 +126,12 @@ private static PlayFabResult privateResetUsersAsync(final ResetUser PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); BlankResult 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 */ @@ -181,11 +184,12 @@ private static PlayFabResult privateSendAccountR PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SendAccountRecoveryEmailResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title specific display name for a user */ @@ -238,11 +242,12 @@ private static PlayFabResult privateUpdateUser PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserTitleDisplayNameResult 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. */ @@ -295,11 +300,12 @@ private static PlayFabResult privateDeleteUsersAsync(final De PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); DeleteUsersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a download URL for the requested report */ @@ -352,11 +358,12 @@ private static PlayFabResult privateGetDataReportAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetDataReportResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -409,11 +416,12 @@ private static PlayFabResult privateGetUserDataAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which cannot be accessed by the client */ @@ -466,11 +474,12 @@ private static PlayFabResult privateGetUserInternalDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ @@ -523,11 +532,12 @@ private static PlayFabResult privateGetUserPublisherDataAsync PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ @@ -580,11 +590,12 @@ private static PlayFabResult privateGetUserPublisherInternalD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which can only be read by the client */ @@ -637,11 +648,12 @@ private static PlayFabResult privateGetUserPublisherReadOnlyD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which can only be read by the client */ @@ -694,11 +706,12 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Completely removes all statistics for the specified user, for the current game */ @@ -751,11 +764,12 @@ private static PlayFabResult privateResetUserStatisti PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ResetUserStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which is readable and writable by the client */ @@ -808,11 +822,12 @@ private static PlayFabResult privateUpdateUserDataAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which cannot be accessed by the client */ @@ -865,11 +880,12 @@ private static PlayFabResult privateUpdateUserInternalData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which is readable and writable by the client */ @@ -922,11 +938,12 @@ private static PlayFabResult privateUpdateUserPublisherDat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which cannot be accessed by the client */ @@ -979,11 +996,12 @@ private static PlayFabResult privateUpdateUserPublisherInt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which can only be read by the client */ @@ -1036,11 +1054,12 @@ private static PlayFabResult privateUpdateUserPublisherRea PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which can only be read by the client */ @@ -1093,11 +1112,12 @@ private static PlayFabResult privateUpdateUserReadOnlyData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds a new news item to the title's news feed */ @@ -1150,11 +1170,12 @@ private static PlayFabResult privateAddNewsAsync(final AddNewsReq PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddNewsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of 2,147,483,647 when granted to a player. Any value over that will be discarded. */ @@ -1207,11 +1228,12 @@ private static PlayFabResult privateAddVirtualCurrencyTypesAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); BlankResult 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 */ @@ -1264,11 +1286,12 @@ private static PlayFabResult privateGetCatalogItemsAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the random drop table configuration for the title */ @@ -1321,11 +1344,12 @@ private static PlayFabResult privateGetRandomResult PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetRandomResultTablesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the set of items defined for the specified store, including all prices defined */ @@ -1378,11 +1402,12 @@ private static PlayFabResult privateGetStoreItemsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom title settings */ @@ -1435,11 +1460,12 @@ private static PlayFabResult privateGetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retuns the list of all defined virtual currencies for the title */ @@ -1492,11 +1518,12 @@ private static PlayFabResult privateListVirtualC PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListVirtualCurrencyTypesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates the catalog configuration of all virtual goods for the specified catalog version */ @@ -1549,11 +1576,12 @@ private static PlayFabResult privateSetCatalogItemsAsy PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Sets all the items in one virtual store */ @@ -1606,11 +1634,12 @@ private static PlayFabResult privateSetStoreItemsAsync(f PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the key-value store of custom title settings */ @@ -1663,11 +1692,12 @@ private static PlayFabResult privateSetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device Messaging is not supported. */ @@ -1720,11 +1750,12 @@ private static PlayFabResult privateSetupPushNotifi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetupPushNotificationResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the catalog configuration for virtual goods in the specified catalog version */ @@ -1777,11 +1808,12 @@ private static PlayFabResult privateUpdateCatalogItems PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the random drop table configuration for the title */ @@ -1834,11 +1866,12 @@ private static PlayFabResult privateUpdateRandom PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateRandomResultTablesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates an existing virtual item store with new or modified items */ @@ -1891,11 +1924,12 @@ private static PlayFabResult privateUpdateStoreItemsAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the specified virtual currency by the stated amount */ @@ -1948,11 +1982,12 @@ private static PlayFabResult privateAddUserVirt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified user's current inventory of virtual goods */ @@ -2005,11 +2040,12 @@ private static PlayFabResult privateGetUserInventoryAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the specified items to the specified user inventories */ @@ -2062,11 +2098,12 @@ private static PlayFabResult privateGrantItemsToUsersAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantItemsToUsersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Revokes access to an item in a user's inventory */ @@ -2119,11 +2156,12 @@ private static PlayFabResult privateRevokeInventoryItemAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RevokeInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the specified virtual currency by the stated amount */ @@ -2176,11 +2214,12 @@ private static PlayFabResult privateSubtractUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details for a specific completed session, including links to standard out and standard error logs */ @@ -2233,11 +2272,12 @@ private static PlayFabResult privateGetMatchmakerGa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetMatchmakerGameInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of defined game modes for the specified game server executable */ @@ -2290,11 +2330,12 @@ private static PlayFabResult privateGetMatchmakerG PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetMatchmakerGameModesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the game server mode details for the specified game server executable */ @@ -2347,11 +2388,12 @@ private static PlayFabResult privateModifyMatch PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyMatchmakerGameModesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a client is permitted to request in a call to StartGame */ @@ -2404,11 +2446,12 @@ private static PlayFabResult privateAddServerBuildAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddServerBuildResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the build details for the specified game server executable */ @@ -2444,7 +2487,7 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetServerBuildInfoAsync(final GetServerBuildInfoRequest request) throws Exception { - + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/GetServerBuildInfo", request, null, null); task.run(); Object httpResult = task.get(); @@ -2460,11 +2503,12 @@ private static PlayFabResult privateGetServerBuildInfo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetServerBuildInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for use - see AddServerBuild) */ @@ -2517,11 +2561,12 @@ private static PlayFabResult privateGetServerBuil PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetServerBuildUploadURLResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the build details for all game server executables which are currently defined for the title */ @@ -2574,11 +2619,12 @@ private static PlayFabResult privateListServerBuildsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListBuildsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the build details for the specified game server executable */ @@ -2631,11 +2677,12 @@ private static PlayFabResult privateModifyServerBuildAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyServerBuildResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes the game server executable specified from the set of those a client is permitted to request in a call to StartGame */ @@ -2688,11 +2735,12 @@ private static PlayFabResult privateRemoveServerBuildAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveServerBuildResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom publisher settings */ @@ -2745,11 +2793,12 @@ private static PlayFabResult privateGetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value store of custom publisher settings */ @@ -2802,11 +2851,12 @@ private static PlayFabResult privateSetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Gets the contents and information of a specific Cloud Script revision. */ @@ -2859,11 +2909,12 @@ private static PlayFabResult privateGetCloudScript PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCloudScriptRevisionResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Lists all the current cloud script versions. For each version, information about the current published and latest revisions is also listed. */ @@ -2916,11 +2967,12 @@ private static PlayFabResult privateGetCloudScript PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCloudScriptVersionsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Sets the currently published revision of a title Cloud Script */ @@ -2973,11 +3025,12 @@ private static PlayFabResult privateSetPublishedRevi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetPublishedRevisionResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be submitted in the revision. */ @@ -3030,11 +3083,12 @@ private static PlayFabResult privateUpdateCloudScriptAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCloudScriptResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Delete a content file from the title */ @@ -3087,11 +3141,12 @@ private static PlayFabResult privateDeleteContentAsync(final Delete PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); BlankResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * List all contents of the title and get statistics such as size */ @@ -3144,11 +3199,12 @@ private static PlayFabResult privateGetContentListAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentListResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the content. */ @@ -3201,11 +3257,12 @@ private static PlayFabResult privateGetContentUploadU PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentUploadUrlResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Completely removes all statistics for the specified character, for the current game */ @@ -3258,11 +3315,9 @@ private static PlayFabResult privateResetCharact PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ResetCharacterStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - } diff --git a/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java b/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java index d0869529d..97eb195e6 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabAdminModels.java @@ -160,7 +160,7 @@ public static class CatalogItem implements Comparable { * list of item tags */ @Unordered - public ArrayList Tags; + public ArrayList Tags; /** * game specific custom data */ @@ -207,12 +207,12 @@ public static class CatalogItemBundleInfo { * unique ItemId values for all items which will be added to the player inventory when the bundle is added */ @Unordered - public ArrayList BundledItems; + public ArrayList BundledItems; /** * unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) */ @Unordered - public ArrayList BundledResultTables; + public ArrayList BundledResultTables; /** * virtual currency types and balances which will be added to the player inventory when the bundle is added */ @@ -247,12 +247,12 @@ public static class CatalogItemContainerInfo { * unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked */ @Unordered - public ArrayList ItemContents; + public ArrayList ItemContents; /** * unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) */ @Unordered - public ArrayList ResultTableContents; + public ArrayList ResultTableContents; /** * virtual currency types and balances which will be added to the player inventory when the container is unlocked */ @@ -304,6 +304,26 @@ public static class ContentInfo { } + public static class CreatePlayerStatisticDefinitionRequest { + /** + * unique name of the statistic + */ + public String Name; + /** + * interval at which the values of the statistic for all players are reset. Resets begin at the next interval boundary + */ + public Interval VersionChangeInterval; + + } + + public static class CreatePlayerStatisticDefinitionResult { + /** + * created statistic definition + */ + public PlayerStatisticDefinition Statistic; + + } + public static enum Currency { AED, AFN, @@ -530,7 +550,7 @@ public static class GetCatalogItemsResult { * Array of items which can be purchased. */ @Unordered("ItemId") - public ArrayList Catalog; + public ArrayList Catalog; } @@ -689,7 +709,7 @@ public static class GetMatchmakerGameInfoResult { * array of unique PlayFab identifiers for users currently connected to this Game Server Instance */ @Unordered - public ArrayList Players; + public ArrayList Players; /** * IP address for this Game Server Instance */ @@ -717,6 +737,34 @@ public static class GetMatchmakerGameModesResult { } + public static class GetPlayerStatisticDefinitionsRequest { + + } + + public static class GetPlayerStatisticDefinitionsResult { + /** + * definitions of all statistics for the title + */ + public ArrayList Statistics; + + } + + public static class GetPlayerStatisticVersionsRequest { + /** + * unique name of the statistic + */ + public String StatisticName; + + } + + public static class GetPlayerStatisticVersionsResult { + /** + * version change history of the statistic + */ + public ArrayList StatisticVersions; + + } + public static class GetPublisherDataRequest { /** * array of keys to get back data from the Publisher data blob, set by the admin tools @@ -768,7 +816,7 @@ public static class GetServerBuildInfoResult implements Comparable ActiveRegions; + public ArrayList ActiveRegions; /** * maximum number of game server instances that can run on a single host machine */ @@ -835,7 +883,7 @@ public static class GetStoreItemsResult { * Array of items which can be purchased from this store. */ @Unordered("ItemId") - public ArrayList Store; + public ArrayList Store; } @@ -904,7 +952,7 @@ public static class GetUserInventoryResult { * Array of inventory items belonging to the user. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1006,7 +1054,7 @@ public static class GrantItemsToUsersRequest { * Array of items to grant and the users to whom the items are to be granted. */ @Unordered - public ArrayList ItemGrants; + public ArrayList ItemGrants; } @@ -1018,6 +1066,29 @@ public static class GrantItemsToUsersResult { } + public static class IncrementPlayerStatisticVersionRequest { + /** + * unique name of the statistic + */ + public String StatisticName; + + } + + public static class IncrementPlayerStatisticVersionResult { + /** + * version change history of the statistic + */ + public PlayerStatisticVersion StatisticVersion; + + } + + public static enum Interval { + Hour, + Day, + Week, + Month + } + public static class ItemGrant { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1116,7 +1187,7 @@ public static class ListBuildsResult { * array of uploaded game server builds */ @Unordered("BuildId") - public ArrayList Builds; + public ArrayList Builds; } @@ -1129,7 +1200,7 @@ public static class ListVirtualCurrencyTypesResult { * List of virtual currency names defined for this title */ @Unordered - public ArrayList VirtualCurrencies; + public ArrayList VirtualCurrencies; } @@ -1269,6 +1340,50 @@ public static class ModifyUserVirtualCurrencyResult { } + public static class PlayerStatisticDefinition { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * current active version of the statistic, incremented each time the statistic resets + */ + public String CurrentVersion; + /** + * interval at which the values of the statistic for all players are reset + */ + public Interval VersionChangeInterval; + + } + + public static class PlayerStatisticVersion { + /** + * name of the statistic when the version became active + */ + public String StatisticName; + /** + * version of the statistic + */ + public String Version; + /** + * time for which the statistic version was scheduled to become active, based on the configured ResetInterval + */ + public Date ScheduledVersionChangeIntervalTime; + /** + * time when the statistic version became active + */ + public Date CreatedTime; + /** + * status of the process of saving player statistic values of the previous version to a downloadable archive, if configured + */ + public StatisticVersionArchivalStatus ArchivalStatus; + /** + * reset interval that triggered the version to become active, if configured + */ + public Interval ResetInterval; + + } + public static class RandomResultTable { /** * Unique name for this drop table @@ -1545,6 +1660,14 @@ public static class SetupPushNotificationResult { public String ARN; } + + public static enum StatisticVersionArchivalStatus { + NotScheduled, + Scheduled, + InProgress, + Failed, + Complete + } /** * A store entry that list a catalog item at a particular price */ @@ -1634,6 +1757,26 @@ public static class UpdateCloudScriptResult { } + public static class UpdatePlayerStatisticDefinitionRequest { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * interval at which the values of the statistic for all players are reset. Changes are effective at the next interval boundary + */ + public Interval VersionChangeInterval; + + } + + public static class UpdatePlayerStatisticDefinitionResult { + /** + * updated statistic definition + */ + public PlayerStatisticDefinition Statistic; + + } + public static class UpdateRandomResultTablesRequest { /** * which catalog is being updated. If null, update the current default catalog version diff --git a/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java b/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java index 7d58e3063..c753d463d 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabClientModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -50,9 +51,9 @@ public PlayFabResult call() throws Exception */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPhotonAuthenticationTokenAsync(final GetPhotonAuthenticationTokenRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPhotonAuthenticationToken", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPhotonAuthenticationToken", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -67,11 +68,12 @@ private static PlayFabResult privateGetPhoto PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPhotonAuthenticationTokenResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using the Android device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -108,7 +110,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithAndroidDeviceIDAsync(final LoginWithAndroidDeviceIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithAndroidDeviceID", request, null, null); task.run(); @@ -125,12 +127,14 @@ private static PlayFabResult privateLoginWithAndroidDeviceIDAsync(f PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a custom unique identifier generated by the title, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -167,7 +171,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithCustomIDAsync(final LoginWithCustomIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithCustomID", request, null, null); task.run(); @@ -184,12 +188,14 @@ private static PlayFabResult privateLoginWithCustomIDAsync(final Lo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -226,7 +232,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithEmailAddressAsync(final LoginWithEmailAddressRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithEmailAddress", request, null, null); task.run(); @@ -243,12 +249,14 @@ private static PlayFabResult privateLoginWithEmailAddressAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Facebook access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -285,7 +293,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithFacebookAsync(final LoginWithFacebookRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithFacebook", request, null, null); task.run(); @@ -302,12 +310,14 @@ private static PlayFabResult privateLoginWithFacebookAsync(final Lo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using an iOS Game Center player identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -344,7 +354,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithGameCenterAsync(final LoginWithGameCenterRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithGameCenter", request, null, null); task.run(); @@ -361,12 +371,14 @@ private static PlayFabResult privateLoginWithGameCenterAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Google account access token, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -403,7 +415,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithGoogleAccountAsync(final LoginWithGoogleAccountRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithGoogleAccount", request, null, null); task.run(); @@ -420,12 +432,14 @@ private static PlayFabResult privateLoginWithGoogleAccountAsync(fin PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using the vendor-specific iOS device identifier, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -462,7 +476,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithIOSDeviceIDAsync(final LoginWithIOSDeviceIDRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithIOSDeviceID", request, null, null); task.run(); @@ -479,12 +493,14 @@ private static PlayFabResult privateLoginWithIOSDeviceIDAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Kongregate player account. */ @@ -521,7 +537,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithKongregateAsync(final LoginWithKongregateRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithKongregate", request, null, null); task.run(); @@ -538,12 +554,14 @@ private static PlayFabResult privateLoginWithKongregateAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user into the PlayFab account, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -580,7 +598,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithPlayFabAsync(final LoginWithPlayFabRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithPlayFab", request, null, null); task.run(); @@ -597,12 +615,75 @@ private static PlayFabResult privateLoginWithPlayFabAsync(final Log PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static FutureTask> LoginWithPSNAsync(final LoginWithPSNRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithPSNAsync(request); + } + }); + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LoginWithPSN(final LoginWithPSNRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithPSNAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Signs the user in using a PlayStation Network authentication code, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLoginWithPSNAsync(final LoginWithPSNRequest request) throws Exception { + request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithPSN", request, null, null); + 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()); + LoginResult result = resultData.data; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Signs the user in using a Steam authentication ticket, returning a session identifier that can subsequently be used for API calls which require an authenticated user */ @@ -639,7 +720,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateLoginWithSteamAsync(final LoginWithSteamRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithSteam", request, null, null); task.run(); @@ -656,12 +737,75 @@ private static PlayFabResult privateLoginWithSteamAsync(final Login PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LoginResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static FutureTask> LoginWithXboxAsync(final LoginWithXboxRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithXboxAsync(request); + } + }); + } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LoginWithXbox(final LoginWithXboxRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLoginWithXboxAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Signs the user in using a Xbox Live Token, returning a session identifier that can subsequently be used for API calls which require an authenticated user + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLoginWithXboxAsync(final LoginWithXboxRequest request) throws Exception { + request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LoginWithXbox", request, null, null); + 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()); + LoginResult result = resultData.data; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Registers a new Playfab user account, returning a session identifier that can subsequently be used for API calls which require an authenticated user. You must supply either a username or an email address. */ @@ -698,7 +842,7 @@ public PlayFabResult call() throws Exception { @SuppressWarnings("unchecked") private static PlayFabResult privateRegisterPlayFabUserAsync(final RegisterPlayFabUserRequest request) throws Exception { request.TitleId = PlayFabSettings.TitleId != null ? PlayFabSettings.TitleId : request.TitleId; - if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); + if(request.TitleId == null) throw new Exception ("Must be have PlayFabSettings.TitleId set to call this method"); FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterPlayFabUser", request, null, null); task.run(); @@ -715,12 +859,14 @@ private static PlayFabResult privateRegisterPlayFabUs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RegisterPlayFabUserResult result = resultData.data; - AuthKey = result.SessionTicket != null ? result.SessionTicket : AuthKey; + _authKey = result.SessionTicket != null ? result.SessionTicket : _authKey; + MultiStepClientLogin(resultData.data.SettingsForUser.NeedsAttribution); PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds playfab username/password auth to an existing semi-anonymous account created via a 3rd party auth method. */ @@ -756,9 +902,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddUsernamePasswordAsync(final AddUsernamePasswordRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUsernamePassword", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUsernamePassword", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -773,11 +919,12 @@ private static PlayFabResult privateAddUsernamePasswo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddUsernamePasswordResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the user's PlayFab account details */ @@ -813,9 +960,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetAccountInfoAsync(final GetAccountInfoRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAccountInfo", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAccountInfo", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -830,11 +977,12 @@ private static PlayFabResult privateGetAccountInfoAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetAccountInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ @@ -870,9 +1018,9 @@ public PlayFabResult call() throws Exception */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromFacebookIDsAsync(final GetPlayFabIDsFromFacebookIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromFacebookIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromFacebookIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -887,11 +1035,12 @@ private static PlayFabResult privateGetPlayF PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromFacebookIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Game Center identifiers (referenced in the Game Center Programming Guide as the Player Identifier). */ @@ -927,9 +1076,9 @@ public PlayFabResult call() throws Excepti */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromGameCenterIDsAsync(final GetPlayFabIDsFromGameCenterIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGameCenterIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGameCenterIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -944,11 +1093,12 @@ private static PlayFabResult privateGetPla PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromGameCenterIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Google identifiers. The Google identifiers are the IDs for the user accounts, available as "id" in the Google+ People API calls. */ @@ -984,9 +1134,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromGoogleIDsAsync(final GetPlayFabIDsFromGoogleIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGoogleIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromGoogleIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1001,11 +1151,70 @@ private static PlayFabResult privateGetPlayFab PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromGoogleIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + public static FutureTask> GetPlayFabIDsFromPSNAccountIDsAsync(final GetPlayFabIDsFromPSNAccountIDsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromPSNAccountIDsAsync(request); + } + }); + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult GetPlayFabIDsFromPSNAccountIDs(final GetPlayFabIDsFromPSNAccountIDsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateGetPlayFabIDsFromPSNAccountIDsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Retrieves the unique PlayFab identifiers for the given set of PlayStation Network identifiers. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateGetPlayFabIDsFromPSNAccountIDsAsync(final GetPlayFabIDsFromPSNAccountIDsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromPSNAccountIDs", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + GetPlayFabIDsFromPSNAccountIDsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the unique PlayFab identifiers for the given set of Steam identifiers. The Steam identifiers are the profile IDs for the user accounts, available as SteamId in the Steamworks Community API calls. */ @@ -1041,9 +1250,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayFabIDsFromSteamIDsAsync(final GetPlayFabIDsFromSteamIDsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromSteamIDs", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayFabIDsFromSteamIDs", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1058,11 +1267,12 @@ private static PlayFabResult privateGetPlayFabI PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromSteamIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves all requested data for a user in one unified request. By default, this API returns all data for the locally signed-in user. The input parameters may be used to limit the data retrieved to any subset of the available data, as well as retrieve the available data for a different user. Note that certain data, including inventory, virtual currency balances, and personally identifying information, may only be retrieved for the locally signed-in user. In the example below, a request is made for the account details, virtual currency balances, and specified user data for the locally signed-in user. */ @@ -1098,9 +1308,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserCombinedInfoAsync(final GetUserCombinedInfoRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserCombinedInfo", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserCombinedInfo", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1115,11 +1325,12 @@ private static PlayFabResult privateGetUserCombinedIn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserCombinedInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Android device identifier to the user's PlayFab account */ @@ -1155,9 +1366,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkAndroidDeviceIDAsync(final LinkAndroidDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkAndroidDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkAndroidDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1172,11 +1383,12 @@ private static PlayFabResult privateLinkAndroidDevice PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkAndroidDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the custom identifier, generated by the title, to the user's PlayFab account */ @@ -1212,9 +1424,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkCustomIDAsync(final LinkCustomIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkCustomID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkCustomID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1229,11 +1441,12 @@ private static PlayFabResult privateLinkCustomIDAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkCustomIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Facebook account associated with the provided Facebook access token to the user's PlayFab account */ @@ -1269,9 +1482,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkFacebookAccountAsync(final LinkFacebookAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkFacebookAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkFacebookAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1286,11 +1499,12 @@ private static PlayFabResult privateLinkFacebookAccou PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkFacebookAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Game Center account associated with the provided Game Center ID to the user's PlayFab account */ @@ -1326,9 +1540,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkGameCenterAccountAsync(final LinkGameCenterAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGameCenterAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGameCenterAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1343,11 +1557,12 @@ private static PlayFabResult privateLinkGameCenterA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkGameCenterAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the currently signed-in user account to the Google account specified by the Google account access token */ @@ -1383,9 +1598,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkGoogleAccountAsync(final LinkGoogleAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGoogleAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkGoogleAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1400,11 +1615,12 @@ private static PlayFabResult privateLinkGoogleAccountAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkGoogleAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the vendor-specific iOS device identifier to the user's PlayFab account */ @@ -1440,9 +1656,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkIOSDeviceIDAsync(final LinkIOSDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkIOSDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkIOSDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1457,11 +1673,12 @@ private static PlayFabResult privateLinkIOSDeviceIDAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkIOSDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Links the Kongregate identifier to the user's PlayFab account */ @@ -1497,9 +1714,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkKongregateAsync(final LinkKongregateAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkKongregate", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkKongregate", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1514,11 +1731,70 @@ private static PlayFabResult privateLinkKongregateA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkKongregateAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkPSNAccountAsync(final LinkPSNAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkPSNAccountAsync(request); + } + }); + } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkPSNAccount(final LinkPSNAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkPSNAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Links the PlayStation Network account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkPSNAccountAsync(final LinkPSNAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkPSNAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkPSNAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Links the Steam account associated with the provided Steam authentication ticket to the user's PlayFab account */ @@ -1554,9 +1830,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLinkSteamAccountAsync(final LinkSteamAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkSteamAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkSteamAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1571,11 +1847,70 @@ private static PlayFabResult privateLinkSteamAccountAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LinkSteamAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> LinkXboxAccountAsync(final LinkXboxAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkXboxAccountAsync(request); + } + }); + } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult LinkXboxAccount(final LinkXboxAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateLinkXboxAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Links the Xbox Live account associated with the provided access code to the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateLinkXboxAccountAsync(final LinkXboxAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LinkXboxAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + LinkXboxAccountResult 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 user's account, with a link allowing the user to change the password */ @@ -1611,7 +1946,7 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSendAccountRecoveryEmailAsync(final SendAccountRecoveryEmailRequest request) throws Exception { - + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SendAccountRecoveryEmail", request, null, null); task.run(); Object httpResult = task.get(); @@ -1627,11 +1962,12 @@ private static PlayFabResult privateSendAccountR PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SendAccountRecoveryEmailResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Android device identifier from the user's PlayFab account */ @@ -1667,9 +2003,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkAndroidDeviceIDAsync(final UnlinkAndroidDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkAndroidDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkAndroidDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1684,11 +2020,12 @@ private static PlayFabResult privateUnlinkAndroidDe PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkAndroidDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related custom identifier from the user's PlayFab account */ @@ -1724,9 +2061,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkCustomIDAsync(final UnlinkCustomIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkCustomID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkCustomID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1741,11 +2078,12 @@ private static PlayFabResult privateUnlinkCustomIDAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkCustomIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Facebook account from the user's PlayFab account */ @@ -1781,9 +2119,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkFacebookAccountAsync(final UnlinkFacebookAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkFacebookAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkFacebookAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1798,11 +2136,12 @@ private static PlayFabResult privateUnlinkFacebookA PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkFacebookAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Game Center account from the user's PlayFab account */ @@ -1838,9 +2177,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkGameCenterAccountAsync(final UnlinkGameCenterAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGameCenterAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGameCenterAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1855,11 +2194,12 @@ private static PlayFabResult privateUnlinkGameCen PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkGameCenterAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Google account from the user's PlayFab account */ @@ -1895,9 +2235,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkGoogleAccountAsync(final UnlinkGoogleAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGoogleAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkGoogleAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1912,11 +2252,12 @@ private static PlayFabResult privateUnlinkGoogleAccou PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkGoogleAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related iOS device identifier from the user's PlayFab account */ @@ -1952,9 +2293,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkIOSDeviceIDAsync(final UnlinkIOSDeviceIDRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkIOSDeviceID", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkIOSDeviceID", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -1969,11 +2310,12 @@ private static PlayFabResult privateUnlinkIOSDeviceIDAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkIOSDeviceIDResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlinks the related Kongregate identifier from the user's PlayFab account */ @@ -2009,9 +2351,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkKongregateAsync(final UnlinkKongregateAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkKongregate", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkKongregate", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2026,11 +2368,70 @@ private static PlayFabResult privateUnlinkKongreg PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkKongregateAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkPSNAccountAsync(final UnlinkPSNAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkPSNAccountAsync(request); + } + }); + } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkPSNAccount(final UnlinkPSNAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkPSNAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Unlinks the related PSN account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkPSNAccountAsync(final UnlinkPSNAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkPSNAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkPSNAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Unlinks the related Steam account from the user's PlayFab account */ @@ -2066,9 +2467,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlinkSteamAccountAsync(final UnlinkSteamAccountRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkSteamAccount", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkSteamAccount", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2083,11 +2484,70 @@ private static PlayFabResult privateUnlinkSteamAccount PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlinkSteamAccountResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static FutureTask> UnlinkXboxAccountAsync(final UnlinkXboxAccountRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkXboxAccountAsync(request); + } + }); + } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + public static PlayFabResult UnlinkXboxAccount(final UnlinkXboxAccountRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateUnlinkXboxAccountAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Unlinks the related Xbox Live account from the user's PlayFab account + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateUnlinkXboxAccountAsync(final UnlinkXboxAccountRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlinkXboxAccount", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + UnlinkXboxAccountResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Updates the title specific display name for the user */ @@ -2123,9 +2583,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserTitleDisplayNameAsync(final UpdateUserTitleDisplayNameRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserTitleDisplayName", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserTitleDisplayName", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2140,11 +2600,12 @@ private static PlayFabResult privateUpdateUser PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserTitleDisplayNameResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in the leaderboard */ @@ -2180,9 +2641,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAsync(final GetFriendLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2197,11 +2658,12 @@ private static PlayFabResult privateGetFriendLeaderboardAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked friends of the current player for the given statistic, centered on the currently signed-in user */ @@ -2237,9 +2699,9 @@ public PlayFabResult call() throws */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendLeaderboardAroundCurrentUserAsync(final GetFriendLeaderboardAroundCurrentUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboardAroundCurrentUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendLeaderboardAroundCurrentUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2254,11 +2716,12 @@ private static PlayFabResult privat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetFriendLeaderboardAroundCurrentUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ @@ -2294,9 +2757,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAsync(final GetLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2311,11 +2774,12 @@ private static PlayFabResult privateGetLeaderboardAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ @@ -2351,9 +2815,9 @@ public PlayFabResult call() throws Except */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCurrentUserAsync(final GetLeaderboardAroundCurrentUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCurrentUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCurrentUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2368,11 +2832,12 @@ private static PlayFabResult privateGetLe PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundCurrentUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -2408,9 +2873,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2425,11 +2890,12 @@ private static PlayFabResult privateGetUserDataAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ @@ -2465,9 +2931,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserPublisherDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2482,11 +2948,12 @@ private static PlayFabResult privateGetUserPublisherDataAsync PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which can only be read by the client */ @@ -2522,9 +2989,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserPublisherReadOnlyDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserPublisherReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2539,11 +3006,12 @@ private static PlayFabResult privateGetUserPublisherReadOnlyD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which can only be read by the client */ @@ -2579,9 +3047,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserReadOnlyDataAsync(final GetUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2596,11 +3064,12 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of all title-specific statistics for the user */ @@ -2636,9 +3105,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserStatisticsAsync(final GetUserStatisticsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserStatistics", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserStatistics", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2653,11 +3122,12 @@ private static PlayFabResult privateGetUserStatisticsAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the title-specific custom data for the user which is readable and writable by the client */ @@ -2693,9 +3163,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserDataAsync(final UpdateUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2710,11 +3180,12 @@ private static PlayFabResult privateUpdateUserDataAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the publisher-specific custom data for the user which is readable and writable by the client */ @@ -2750,9 +3221,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserPublisherDataAsync(final UpdateUserDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2767,11 +3238,12 @@ private static PlayFabResult privateUpdateUserPublisherDat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the values of the specified title-specific statistics for the user */ @@ -2807,9 +3279,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateUserStatisticsAsync(final UpdateUserStatisticsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserStatistics", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateUserStatistics", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2824,11 +3296,12 @@ private static PlayFabResult privateUpdateUserStatis PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserStatisticsResult 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 */ @@ -2864,9 +3337,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCatalogItemsAsync(final GetCatalogItemsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCatalogItems", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCatalogItems", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2881,11 +3354,12 @@ private static PlayFabResult privateGetCatalogItemsAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the set of items defined for the specified store, including all prices defined */ @@ -2921,9 +3395,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetStoreItemsAsync(final GetStoreItemsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetStoreItems", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetStoreItems", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2938,11 +3412,12 @@ private static PlayFabResult privateGetStoreItemsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom title settings */ @@ -2978,9 +3453,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTitleDataAsync(final GetTitleDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -2995,11 +3470,12 @@ private static PlayFabResult privateGetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title news feed, as configured in the developer portal */ @@ -3035,9 +3511,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTitleNewsAsync(final GetTitleNewsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleNews", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitleNews", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3052,11 +3528,12 @@ private static PlayFabResult privateGetTitleNewsAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleNewsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the user's balance of the specified virtual currency by the stated amount */ @@ -3092,9 +3569,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddUserVirtualCurrencyAsync(final AddUserVirtualCurrencyRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUserVirtualCurrency", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddUserVirtualCurrency", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3109,11 +3586,12 @@ private static PlayFabResult privateAddUserVirt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Confirms with the payment provider that the purchase was approved (if applicable) and adjusts inventory and virtual currency balances as appropriate */ @@ -3149,9 +3627,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateConfirmPurchaseAsync(final ConfirmPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConfirmPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConfirmPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3166,11 +3644,12 @@ private static PlayFabResult privateConfirmPurchaseAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ConfirmPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory. */ @@ -3206,9 +3685,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateConsumeItemAsync(final ConsumeItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumeItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumeItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3223,11 +3702,12 @@ private static PlayFabResult privateConsumeItemAsync(final Co PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ConsumeItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified character's current inventory of virtual goods */ @@ -3263,9 +3743,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterInventoryAsync(final GetCharacterInventoryRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterInventory", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterInventory", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3280,11 +3760,12 @@ private static PlayFabResult privateGetCharacterInv PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a completed purchase along with its current PlayFab status. */ @@ -3320,9 +3801,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPurchaseAsync(final GetPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3337,11 +3818,12 @@ private static PlayFabResult privateGetPurchaseAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the user's current inventory of virtual goods */ @@ -3377,9 +3859,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetUserInventoryAsync(final GetUserInventoryRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserInventory", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetUserInventory", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3394,11 +3876,12 @@ private static PlayFabResult privateGetUserInventoryAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Selects a payment option for purchase order created via StartPurchase */ @@ -3434,9 +3917,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privatePayForPurchaseAsync(final PayForPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PayForPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PayForPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3451,11 +3934,12 @@ private static PlayFabResult privatePayForPurchaseAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PayForPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Buys a single item with virtual currency. You must specify both the virtual currency to use to purchase, as well as what the client believes the price to be. This lets the server fail the purchase if the price has changed. */ @@ -3491,9 +3975,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privatePurchaseItemAsync(final PurchaseItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PurchaseItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/PurchaseItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3508,11 +3992,12 @@ private static PlayFabResult privatePurchaseItemAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PurchaseItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * 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/ */ @@ -3548,9 +4033,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRedeemCouponAsync(final RedeemCouponRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RedeemCoupon", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RedeemCoupon", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3565,11 +4050,12 @@ private static PlayFabResult privateRedeemCouponAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RedeemCouponResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Submit a report for another player (due to bad bahavior, etc.), so that customer service representatives for the title can take action concerning potentially toxic players. */ @@ -3605,9 +4091,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateReportPlayerAsync(final ReportPlayerClientRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ReportPlayer", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ReportPlayer", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3622,11 +4108,12 @@ private static PlayFabResult privateReportPlayerAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ReportPlayerClientResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates an order for a list of items from the title catalog */ @@ -3662,9 +4149,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateStartPurchaseAsync(final StartPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3679,11 +4166,12 @@ private static PlayFabResult privateStartPurchaseAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); StartPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the user's balance of the specified virtual currency by the stated amount */ @@ -3719,9 +4207,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSubtractUserVirtualCurrencyAsync(final SubtractUserVirtualCurrencyRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SubtractUserVirtualCurrency", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SubtractUserVirtualCurrency", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3736,11 +4224,12 @@ private static PlayFabResult privateSubtractUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Unlocks a container item in the user's inventory and consumes a key item of the type indicated by the container item */ @@ -3776,9 +4265,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUnlockContainerItemAsync(final UnlockContainerItemRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlockContainerItem", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UnlockContainerItem", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3793,11 +4282,12 @@ private static PlayFabResult privateUnlockContainerIt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UnlockContainerItemResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the PlayFab user, based upon a match against a supplied unique identifier, to the friend list of the local user. At least one of FriendPlayFabId,FriendUsername,FriendEmail, or FriendTitleDisplayName should be initialized. */ @@ -3833,9 +4323,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddFriendAsync(final AddFriendRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddFriend", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddFriend", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3850,11 +4340,12 @@ private static PlayFabResult privateAddFriendAsync(final AddFri PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddFriendResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the current friend list for the local user, constrained to users who have PlayFab accounts. Friends from linked accounts (Facebook, Steam) are also included. You may optionally exclude some linked services' friends. */ @@ -3890,9 +4381,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetFriendsListAsync(final GetFriendsListRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendsList", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetFriendsList", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3907,11 +4398,12 @@ private static PlayFabResult privateGetFriendsListAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetFriendsListResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes a specified user from the friend list of the local user */ @@ -3947,9 +4439,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRemoveFriendAsync(final RemoveFriendRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveFriend", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveFriend", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -3964,11 +4456,12 @@ private static PlayFabResult privateRemoveFriendAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveFriendResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the tag list for a specified user in the friend list of the local user */ @@ -4004,9 +4497,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateSetFriendTagsAsync(final SetFriendTagsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SetFriendTags", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SetFriendTags", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4021,11 +4514,12 @@ private static PlayFabResult privateSetFriendTagsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetFriendTagsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Registers the iOS device to receive push notifications */ @@ -4061,9 +4555,9 @@ public PlayFabResult call() throws Excepti */ @SuppressWarnings("unchecked") private static PlayFabResult privateRegisterForIOSPushNotificationAsync(final RegisterForIOSPushNotificationRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RegisterForIOSPushNotification", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4078,11 +4572,12 @@ private static PlayFabResult privateRegist PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RegisterForIOSPushNotificationResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Restores all in-app purchases based on the given refresh receipt. */ @@ -4118,9 +4613,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRestoreIOSPurchasesAsync(final RestoreIOSPurchasesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RestoreIOSPurchases", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4135,11 +4630,12 @@ private static PlayFabResult privateRestoreIOSPurchas PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RestoreIOSPurchasesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Validates with the Apple store that the receipt for an iOS in-app purchase is valid and that it matches the purchased catalog item */ @@ -4175,9 +4671,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateValidateIOSReceiptAsync(final ValidateIOSReceiptRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateIOSReceipt", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4192,11 +4688,12 @@ private static PlayFabResult privateValidateIOSReceipt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ValidateIOSReceiptResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Get details about all current running game servers matching the given parameters. */ @@ -4232,9 +4729,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCurrentGamesAsync(final CurrentGamesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCurrentGames", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCurrentGames", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4249,11 +4746,12 @@ private static PlayFabResult privateGetCurrentGamesAsync(fin PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CurrentGamesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Get details about the regions hosting game servers matching the given parameters. */ @@ -4289,9 +4787,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetGameServerRegionsAsync(final GameServerRegionsRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetGameServerRegions", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetGameServerRegions", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4306,11 +4804,12 @@ private static PlayFabResult privateGetGameServerRegion PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GameServerRegionsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Attempts to locate a game session matching the given parameters. Note that parameters specified in the search are required (they are not weighting factors). If a slot is found in a server instance matching the parameters, the slot will be assigned to that player, removing it from the availabe set. In that case, the information on the game session will be returned, otherwise the Status returned will be GameNotFound. Note that EnableQueue is deprecated at this time. */ @@ -4346,9 +4845,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateMatchmakeAsync(final MatchmakeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/Matchmake", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/Matchmake", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4363,11 +4862,12 @@ private static PlayFabResult privateMatchmakeAsync(final Matchm PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MatchmakeResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Start a new game server with a given configuration, add the current player and return the connection information. */ @@ -4403,9 +4903,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateStartGameAsync(final StartGameRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartGame", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/StartGame", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4420,11 +4920,12 @@ private static PlayFabResult privateStartGameAsync(final StartG PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); StartGameResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Registers the Android device to receive push notifications */ @@ -4460,9 +4961,9 @@ public PlayFabResult call() thr */ @SuppressWarnings("unchecked") private static PlayFabResult privateAndroidDevicePushNotificationRegistrationAsync(final AndroidDevicePushNotificationRegistrationRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AndroidDevicePushNotificationRegistration", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4477,11 +4978,12 @@ private static PlayFabResult pr PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AndroidDevicePushNotificationRegistrationResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Validates a Google Play purchase and gives the corresponding item to the player. */ @@ -4517,9 +5019,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateValidateGooglePlayPurchaseAsync(final ValidateGooglePlayPurchaseRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4534,11 +5036,12 @@ private static PlayFabResult privateValidateGo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ValidateGooglePlayPurchaseResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Logs a custom analytics event */ @@ -4574,9 +5077,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateLogEventAsync(final LogEventRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LogEvent", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/LogEvent", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4591,11 +5094,12 @@ private static PlayFabResult privateLogEventAsync(final LogEvent PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LogEventResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group can add new members. */ @@ -4631,9 +5135,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAddSharedGroupMembersAsync(final AddSharedGroupMembersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddSharedGroupMembers", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AddSharedGroupMembers", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4648,11 +5152,12 @@ private static PlayFabResult privateAddSharedGroupM PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. Upon creation, the current user will be the only member of the group. */ @@ -4688,9 +5193,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateCreateSharedGroupAsync(final CreateSharedGroupRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CreateSharedGroup", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CreateSharedGroup", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4705,11 +5210,12 @@ private static PlayFabResult privateCreateSharedGroupAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CreateSharedGroupResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom publisher settings */ @@ -4745,9 +5251,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPublisherDataAsync(final GetPublisherDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPublisherData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPublisherData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4762,11 +5268,12 @@ private static PlayFabResult privateGetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves data stored in a shared group object, as well as the list of members in the group. Non-members of the group may use this to retrieve group data, including membership, but they will not receive data for keys marked as private. */ @@ -4802,9 +5309,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetSharedGroupDataAsync(final GetSharedGroupDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetSharedGroupData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetSharedGroupData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4819,11 +5326,12 @@ private static PlayFabResult privateGetSharedGroupData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. */ @@ -4859,9 +5367,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRemoveSharedGroupMembersAsync(final RemoveSharedGroupMembersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveSharedGroupMembers", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RemoveSharedGroupMembers", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4876,11 +5384,12 @@ private static PlayFabResult privateRemoveShared PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group can update the data. */ @@ -4916,9 +5425,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateSharedGroupDataAsync(final UpdateSharedGroupDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateSharedGroupData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateSharedGroupData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4933,11 +5442,128 @@ private static PlayFabResult privateUpdateSharedGro PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + public static FutureTask> ConsumePSNEntitlementsAsync(final ConsumePSNEntitlementsRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateConsumePSNEntitlementsAsync(request); + } + }); + } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ConsumePSNEntitlements(final ConsumePSNEntitlementsRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateConsumePSNEntitlementsAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Checks for any new consumable entitlements. If any are found, they are consumed and added as PlayFab items + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateConsumePSNEntitlementsAsync(final ConsumePSNEntitlementsRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ConsumePSNEntitlements", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ConsumePSNEntitlementsResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + public static FutureTask> RefreshPSNAuthTokenAsync(final RefreshPSNAuthTokenRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRefreshPSNAuthTokenAsync(request); + } + }); + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + public static PlayFabResult RefreshPSNAuthToken(final RefreshPSNAuthTokenRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateRefreshPSNAuthTokenAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Uses the supplied OAuth code to refresh the internally cached player PSN auth token + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateRefreshPSNAuthTokenAsync(final RefreshPSNAuthTokenRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/RefreshPSNAuthToken", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + EmptyResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves the title-specific URL for Cloud Script servers. This must be queried once, prior to making any calls to RunCloudScript. */ @@ -4973,9 +5599,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCloudScriptUrlAsync(final GetCloudScriptUrlRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCloudScriptUrl", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCloudScriptUrl", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -4996,6 +5622,7 @@ private static PlayFabResult privateGetCloudScriptUrlAs pfResult.Result = result; return pfResult; } + /** * Triggers a particular server action, passing the provided inputs to the hosted Cloud Script. An action in this context is a handler in the JavaScript. NOTE: Before calling this API, you must call GetCloudScriptUrl to be assigned a Cloud Script server URL. When using an official PlayFab SDK, this URL is stored internally in the SDK, but GetCloudScriptUrl must still be manually called. */ @@ -5031,9 +5658,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateRunCloudScriptAsync(final RunCloudScriptRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetLogicURL() + "/Client/RunCloudScript", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetLogicURL() + "/Client/RunCloudScript", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5048,11 +5675,12 @@ private static PlayFabResult privateRunCloudScriptAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RunCloudScriptResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://support.playfab.com/support/discussions/topics/1000059929 */ @@ -5088,9 +5716,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetContentDownloadUrlAsync(final GetContentDownloadUrlRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetContentDownloadUrl", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetContentDownloadUrl", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5105,11 +5733,12 @@ private static PlayFabResult privateGetContentDownl PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentDownloadUrlResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Lists all of the characters that belong to a specific user. */ @@ -5145,9 +5774,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetAllUsersCharactersAsync(final ListUsersCharactersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAllUsersCharacters", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetAllUsersCharacters", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5162,11 +5791,12 @@ private static PlayFabResult privateGetAllUsersCharac PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ @@ -5202,9 +5832,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterLeaderboardAsync(final GetCharacterLeaderboardRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterLeaderboard", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterLeaderboard", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5219,11 +5849,12 @@ private static PlayFabResult privateGetCharacterL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, centered on the currently signed-in user */ @@ -5259,9 +5890,9 @@ public PlayFabResult call() throws Exceptio */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardAroundCharacterAsync(final GetLeaderboardAroundCharacterRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCharacter", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardAroundCharacter", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5276,11 +5907,12 @@ private static PlayFabResult privateGetLead PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of all of the user's characters for the given statistic. */ @@ -5316,9 +5948,9 @@ public PlayFabResult call() throws Excep */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetLeaderboardForUserCharactersAsync(final GetLeaderboardForUsersCharactersRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardForUserCharacters", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetLeaderboardForUserCharacters", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5333,11 +5965,12 @@ private static PlayFabResult privateGetL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardForUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Grants the specified character type to the user. */ @@ -5373,9 +6006,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGrantCharacterToUserAsync(final GrantCharacterToUserRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GrantCharacterToUser", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GrantCharacterToUser", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5390,11 +6023,12 @@ private static PlayFabResult privateGrantCharacterTo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantCharacterToUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the character which is readable and writable by the client */ @@ -5430,9 +6064,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterDataAsync(final GetCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5447,11 +6081,12 @@ private static PlayFabResult privateGetCharacterDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the character which can only be read by the client */ @@ -5487,9 +6122,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetCharacterReadOnlyDataAsync(final GetCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterReadOnlyData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetCharacterReadOnlyData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5504,11 +6139,12 @@ private static PlayFabResult privateGetCharacterReadOnly PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the title-specific custom data for the user's character which is readable and writable by the client */ @@ -5544,9 +6180,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateUpdateCharacterDataAsync(final UpdateCharacterDataRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateCharacterData", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/UpdateCharacterData", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5561,11 +6197,70 @@ private static PlayFabResult privateUpdateCharacterDa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + public static FutureTask> ValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + public static PlayFabResult ValidateAmazonIAPReceipt(final ValidateAmazonReceiptRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateValidateAmazonIAPReceiptAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Validates with Amazon that the receipt for an Amazon App Store in-app purchase is valid and that it matches the purchased catalog item + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateValidateAmazonIAPReceiptAsync(final ValidateAmazonReceiptRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/ValidateAmazonIAPReceipt", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + ValidateAmazonReceiptResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Accepts an open trade. If the call is successful, the offered and accepted items will be swapped between the two players' inventories. */ @@ -5601,9 +6296,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateAcceptTradeAsync(final AcceptTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AcceptTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AcceptTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5618,11 +6313,12 @@ private static PlayFabResult privateAcceptTradeAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AcceptTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Cancels an open trade. */ @@ -5658,9 +6354,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateCancelTradeAsync(final CancelTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CancelTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/CancelTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5675,11 +6371,12 @@ private static PlayFabResult privateCancelTradeAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CancelTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Gets all trades the player has either opened or accepted, optionally filtered by trade status. */ @@ -5715,9 +6412,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetPlayerTradesAsync(final GetPlayerTradesRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTrades", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetPlayerTrades", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5732,11 +6429,12 @@ private static PlayFabResult privateGetPlayerTradesAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayerTradesResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Gets the current status of an existing trade. */ @@ -5772,9 +6470,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetTradeStatusAsync(final GetTradeStatusRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTradeStatus", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTradeStatus", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5789,11 +6487,12 @@ private static PlayFabResult privateGetTradeStatusAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTradeStatusResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Opens a new outstanding trade. */ @@ -5829,9 +6528,9 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateOpenTradeAsync(final OpenTradeRequest request) throws Exception { - if (AuthKey == null) throw new Exception ("Must be logged in to call this method"); + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); - FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/OpenTrade", request, "X-Authorization", AuthKey); + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/OpenTrade", request, "X-Authorization", _authKey); task.run(); Object httpResult = task.get(); if(httpResult instanceof PlayFabError) { @@ -5846,13 +6545,85 @@ private static PlayFabResult privateOpenTradeAsync(final Open PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); OpenTradeResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - private static String AuthKey = null; - + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + public static FutureTask> AttributeInstallAsync(final AttributeInstallRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAttributeInstallAsync(request); + } + }); + } + + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult AttributeInstall(final AttributeInstallRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateAttributeInstallAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Attributes an install for advertisment. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateAttributeInstallAsync(final AttributeInstallRequest request) throws Exception { + if (_authKey == null) throw new Exception ("Must be logged in to call this method"); + + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/AttributeInstall", request, "X-Authorization", _authKey); + task.run(); + Object httpResult = task.get(); + if(httpResult instanceof PlayFabError) { + PlayFabError error = (PlayFabError)httpResult; + if (PlayFabSettings.GlobalErrorHandler != null) + PlayFabSettings.GlobalErrorHandler.callback(error); + PlayFabResult result = new PlayFabResult(); + result.Error = error; + return result; + } + String resultRawJson = (String) httpResult; + + PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); + AttributeInstallResult result = resultData.data; + PlayFabSettings.AdvertisingIdType += "_Successful"; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + + public static void MultiStepClientLogin(Boolean needsAttribution) { + if (needsAttribution && !PlayFabSettings.DisableAdvertising && PlayFabSettings.AdvertisingIdType != null && PlayFabSettings.AdvertisingIdValue != null) + { + PlayFabClientModels.AttributeInstallRequest request = new PlayFabClientModels.AttributeInstallRequest(); + if (PlayFabSettings.AdvertisingIdType == PlayFabSettings.AD_TYPE_IDFA) + request.Idfa = PlayFabSettings.AdvertisingIdValue; + else if (PlayFabSettings.AdvertisingIdType == PlayFabSettings.AD_TYPE_ANDROID_ID) + request.Android_Id = PlayFabSettings.AdvertisingIdValue; + else + return; + FutureTask> task = AttributeInstallAsync(request); + task.run(); + } + } + + private static String _authKey = null; } diff --git a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java index dcdc03797..ff2bbed0b 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabClientModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabClientModels.java @@ -126,6 +126,22 @@ public static class AndroidDevicePushNotificationRegistrationResult { } + public static class AttributeInstallRequest { + /** + * The IdentifierForAdvertisers for iOS Devices. + */ + public String Idfa; + /** + * The Android Id for this Android device. + */ + public String Android_Id; + + } + + public static class AttributeInstallResult { + + } + public static class CancelTradeRequest { /** * Trade identifier. @@ -210,7 +226,7 @@ public static class CatalogItem implements Comparable { * list of item tags */ @Unordered - public ArrayList Tags; + public ArrayList Tags; /** * game specific custom data */ @@ -257,12 +273,12 @@ public static class CatalogItemBundleInfo { * unique ItemId values for all items which will be added to the player inventory when the bundle is added */ @Unordered - public ArrayList BundledItems; + public ArrayList BundledItems; /** * unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) */ @Unordered - public ArrayList BundledResultTables; + public ArrayList BundledResultTables; /** * virtual currency types and balances which will be added to the player inventory when the bundle is added */ @@ -297,12 +313,12 @@ public static class CatalogItemContainerInfo { * unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked */ @Unordered - public ArrayList ItemContents; + public ArrayList ItemContents; /** * unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) */ @Unordered - public ArrayList ResultTableContents; + public ArrayList ResultTableContents; /** * virtual currency types and balances which will be added to the player inventory when the container is unlocked */ @@ -418,7 +434,7 @@ public static class ConsumePSNEntitlementsResult { * Array of items granted to the player as a result of consuming entitlements. */ @Unordered("ItemInstanceId") - public ArrayList ItemsGranted; + public ArrayList ItemsGranted; } @@ -804,7 +820,7 @@ public static class GetCatalogItemsResult { * Array of inventory objects. */ @Unordered("ItemId") - public ArrayList Catalog; + public ArrayList Catalog; } @@ -873,7 +889,7 @@ public static class GetCharacterInventoryResult { * Array of inventory items belonging to the character. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the character. */ @@ -1131,6 +1147,22 @@ public static class GetPhotonAuthenticationTokenResult { } + public static class GetPlayerStatisticsRequest { + /** + * statistics to return + */ + public ArrayList StatisticNames; + + } + + public static class GetPlayerStatisticsResult { + /** + * User statistics for the requested user. + */ + public ArrayList Statistics; + + } + public static class GetPlayerTradesRequest { /** * Returns only trades with the given status. If null, returns all trades. @@ -1326,7 +1358,7 @@ public static class GetStoreItemsResult { * Array of store items. */ @Unordered("ItemId") - public ArrayList Store; + public ArrayList Store; } @@ -1440,7 +1472,7 @@ public static class GetUserCombinedInfoResult { * Array of inventory items in the user's current inventory. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1505,7 +1537,7 @@ public static class GetUserInventoryResult { * Array of inventory items in the user's current inventory. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1799,6 +1831,18 @@ public static class LinkSteamAccountResult { } + public static class LinkXboxAccountRequest { + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + + } + + public static class LinkXboxAccountResult { + + } + public static class ListUsersCharactersRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -2061,6 +2105,22 @@ public static class LoginWithSteamRequest { } + public static class LoginWithXboxRequest { + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected + */ + public String TitleId; + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + /** + * Automatically create a PlayFab account if one is not currently linked to this Xbox Live account. + */ + public Boolean CreateAccount; + + } + public static class MatchmakeRequest { /** * build version to match against @@ -2709,6 +2769,38 @@ public static class StartPurchaseResult { } + public static class StatisticUpdate { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when setting the statistic value for the first time. + */ + public String Version; + /** + * statistic value for the player + */ + public Integer Value; + + } + + public static class StatisticValue { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * statistic value for the player + */ + public Integer Value; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded + */ + public String Version; + + } + public static class SteamPlayFabIdPair { /** * Unique Steam identifier for a user. @@ -2919,6 +3011,18 @@ public static class UnlinkSteamAccountResult { } + public static class UnlinkXboxAccountRequest { + /** + * Token provided by the Xbox Live SDK/XDK method GetTokenAndSignatureAsync("POST", "https://playfabapi.com", ""). + */ + public String XboxToken; + + } + + public static class UnlinkXboxAccountResult { + + } + public static class UnlockContainerItemRequest { /** * Category ItemId of the container type to unlock. @@ -2983,6 +3087,18 @@ public static class UpdateCharacterDataResult { } + public static class UpdatePlayerStatisticsRequest { + /** + * Statistics to be updated with the provided values + */ + public ArrayList Statistics; + + } + + public static class UpdatePlayerStatisticsResult { + + } + public static class UpdateSharedGroupDataRequest { /** * Unique identifier for the shared group. @@ -3163,6 +3279,9 @@ public static class UserPrivateAccountInfo { } public static class UserSettings { + /** + * Boolean for whether this player is eligible for ad tracking. + */ public Boolean NeedsAttribution; } diff --git a/PlayFabSDK/src/com/playfab/PlayFabErrors.java b/PlayFabSDK/src/com/playfab/PlayFabErrors.java index b9efd5962..9fa3ac356 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabSDK/src/com/playfab/PlayFabErrors.java @@ -193,7 +193,11 @@ public static enum PlayFabErrorCode { ExpiredXboxLiveToken(1189), ResettableStatisticVersionRequired(1190), NotAuthorizedByTitle(1191), - NoPartnerEnabled(1192); + NoPartnerEnabled(1192), + InvalidPartnerResponse(1193), + APINotEnabledForGameServerAccess(1194), + StatisticNotFound(1195), + StatisticNameConflict(1196); public int id; diff --git a/PlayFabSDK/src/com/playfab/PlayFabMatchmakerAPI.java b/PlayFabSDK/src/com/playfab/PlayFabMatchmakerAPI.java index e8e0cbe58..47a138c45 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabMatchmakerAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabMatchmakerAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabMatchmakerModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -67,11 +68,12 @@ private static PlayFabResult privateAuthUserAsync(final AuthUs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AuthUserResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified */ @@ -124,11 +126,12 @@ private static PlayFabResult privatePlayerJoinedAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PlayerJoinedResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified */ @@ -181,11 +184,12 @@ private static PlayFabResult privatePlayerLeftAsync(final Pl PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PlayerLeftResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance */ @@ -238,11 +242,12 @@ private static PlayFabResult privateStartGameAsync(final Star PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); StartGameResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the relevant details for a specified user, which the external match-making service can then use to compute effective matches */ @@ -295,11 +300,9 @@ private static PlayFabResult privateUserInfoAsync(final UserIn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UserInfoResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - } diff --git a/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java b/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java index f8bc99235..bfb5b6bd4 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabMatchmakerModels.java @@ -205,7 +205,7 @@ public static class UserInfoResponse { * Array of inventory items in the user's current inventory. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java index 7825908a1..ba44ac410 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabServerModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -67,11 +68,12 @@ private static PlayFabResult privateAuthenticat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AuthenticateSessionTicketResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ @@ -124,11 +126,12 @@ private static PlayFabResult privateGetPlayF PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromFacebookIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the relevant details for a specified user */ @@ -181,11 +184,12 @@ private static PlayFabResult privateGetUserAccountInfo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserAccountInfoResult 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. */ @@ -238,11 +242,70 @@ private static PlayFabResult privateSendPushNotifica PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SendPushNotificationResult 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. + */ + @SuppressWarnings("unchecked") + public static FutureTask> DeleteUsersAsync(final DeleteUsersRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteUsersAsync(request); + } + }); + } + + /** + * Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult DeleteUsers(final DeleteUsersRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteUsersAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateDeleteUsersAsync(final DeleteUsersRequest 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/DeleteUsers", 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()); + DeleteUsersResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ @@ -295,11 +358,12 @@ private static PlayFabResult privateGetLeaderboardAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ @@ -352,11 +416,12 @@ private static PlayFabResult privateGetLeaderboa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -409,11 +474,12 @@ private static PlayFabResult privateGetUserDataAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which cannot be accessed by the client */ @@ -466,11 +532,12 @@ private static PlayFabResult privateGetUserInternalDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ @@ -523,11 +590,12 @@ private static PlayFabResult privateGetUserPublisherDataAsync PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ @@ -580,11 +648,12 @@ private static PlayFabResult privateGetUserPublisherInternalD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which can only be read by the client */ @@ -637,11 +706,12 @@ private static PlayFabResult privateGetUserPublisherReadOnlyD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which can only be read by the client */ @@ -694,11 +764,12 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of all title-specific statistics for the user */ @@ -751,11 +822,12 @@ private static PlayFabResult privateGetUserStatisticsAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which is readable and writable by the client */ @@ -808,11 +880,12 @@ private static PlayFabResult privateUpdateUserDataAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which cannot be accessed by the client */ @@ -865,11 +938,12 @@ private static PlayFabResult privateUpdateUserInternalData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which is readable and writable by the client */ @@ -922,11 +996,12 @@ private static PlayFabResult privateUpdateUserPublisherDat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which cannot be accessed by the client */ @@ -979,11 +1054,12 @@ private static PlayFabResult privateUpdateUserPublisherInt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which can only be read by the client */ @@ -1036,11 +1112,12 @@ private static PlayFabResult privateUpdateUserPublisherRea PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which can only be read by the client */ @@ -1093,11 +1170,12 @@ private static PlayFabResult privateUpdateUserReadOnlyData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the values of the specified title-specific statistics for the user */ @@ -1150,11 +1228,12 @@ private static PlayFabResult privateUpdateUserStatis PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserStatisticsResult 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 */ @@ -1207,11 +1286,12 @@ private static PlayFabResult privateGetCatalogItemsAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom title settings */ @@ -1264,11 +1344,12 @@ private static PlayFabResult privateGetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom internal title settings */ @@ -1321,11 +1402,12 @@ private static PlayFabResult privateGetTitleInternalDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title news feed, as configured in the developer portal */ @@ -1378,11 +1460,12 @@ private static PlayFabResult privateGetTitleNewsAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleNewsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value store of custom title settings */ @@ -1435,11 +1518,12 @@ private static PlayFabResult privateSetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value store of custom title settings */ @@ -1492,11 +1576,12 @@ private static PlayFabResult privateSetTitleInternalDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the character's balance of the specified virtual currency by the stated amount */ @@ -1549,11 +1634,12 @@ private static PlayFabResult privateAddCha PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyCharacterVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the user's balance of the specified virtual currency by the stated amount */ @@ -1606,11 +1692,12 @@ private static PlayFabResult privateAddUserVirt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified character's current inventory of virtual goods */ @@ -1663,11 +1750,12 @@ private static PlayFabResult privateGetCharacterInv PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified user's current inventory of virtual goods */ @@ -1720,11 +1808,12 @@ private static PlayFabResult privateGetUserInventoryAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the specified items to the specified character's inventory */ @@ -1777,11 +1866,12 @@ private static PlayFabResult privateGrantItemsToCha PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantItemsToCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the specified items to the specified user's inventory */ @@ -1834,11 +1924,12 @@ private static PlayFabResult privateGrantItemsToUserAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantItemsToUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the specified items to the specified user inventories */ @@ -1891,11 +1982,12 @@ private static PlayFabResult privateGrantItemsToUsersAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantItemsToUsersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Modifies the number of remaining uses of a player's inventory item */ @@ -1948,11 +2040,12 @@ private static PlayFabResult privateModifyItemUsesAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyItemUsesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Moves an item from a character's inventory into another of the users's character's inventory. */ @@ -2005,11 +2098,12 @@ private static PlayFabResult privateMove PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MoveItemToCharacterFromCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Moves an item from a user's inventory into their character's inventory. */ @@ -2062,11 +2156,12 @@ private static PlayFabResult privateMoveItemT PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MoveItemToCharacterFromUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Moves an item from a character's inventory into the owning user's inventory. */ @@ -2119,11 +2214,12 @@ private static PlayFabResult privateMoveItemT PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MoveItemToUserFromCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * 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 */ @@ -2176,11 +2272,12 @@ private static PlayFabResult privateRedeemCouponAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RedeemCouponResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service representatives for the title can take action concerning potentially poxic players. */ @@ -2233,11 +2330,12 @@ private static PlayFabResult privateReportPlayerAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ReportPlayerServerResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the character's balance of the specified virtual currency by the stated amount */ @@ -2290,11 +2388,12 @@ private static PlayFabResult privateSubtra PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyCharacterVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the user's balance of the specified virtual currency by the stated amount */ @@ -2347,11 +2446,12 @@ private static PlayFabResult privateSubtractUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value pair data tagged to the specified item, which is read-only from the client. */ @@ -2404,11 +2504,12 @@ private static PlayFabResult privateUpdateUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserInventoryItemDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Informs the PlayFab match-making service that the user specified has left the Game Server Instance */ @@ -2461,11 +2562,12 @@ private static PlayFabResult privateNotifyMatc PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); NotifyMatchmakerPlayerLeftResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Validates a Game Server session ticket and returns details about the user */ @@ -2518,11 +2620,12 @@ private static PlayFabResult privateRedeemMatchmak PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RedeemMatchmakerTicketResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Awards the specified users the specified Steam achievements */ @@ -2575,11 +2678,12 @@ private static PlayFabResult privateAwardSteamAchie PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AwardSteamAchievementResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Logs a custom analytics event */ @@ -2632,11 +2736,12 @@ private static PlayFabResult privateLogEventAsync(final LogEvent PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LogEventResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group (and the server) can add new members. */ @@ -2689,11 +2794,12 @@ private static PlayFabResult privateAddSharedGroupM PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. When created by a server, the group will initially have no members. */ @@ -2746,11 +2852,12 @@ private static PlayFabResult privateCreateSharedGroupAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CreateSharedGroupResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Deletes a shared group, freeing up the shared group ID to be reused for a new group */ @@ -2803,11 +2910,12 @@ private static PlayFabResult privateDeleteSharedGroupAsync(final De PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); EmptyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom publisher settings */ @@ -2860,11 +2968,12 @@ private static PlayFabResult privateGetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all public and private group data. */ @@ -2917,11 +3026,12 @@ private static PlayFabResult privateGetSharedGroupData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. */ @@ -2974,11 +3084,12 @@ private static PlayFabResult privateRemoveShared PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value store of custom publisher settings */ @@ -3031,11 +3142,12 @@ private static PlayFabResult privateSetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group (and the server) can update the data. */ @@ -3088,11 +3200,12 @@ private static PlayFabResult privateUpdateSharedGro PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://support.playfab.com/support/discussions/topics/1000059929 */ @@ -3145,11 +3258,12 @@ private static PlayFabResult privateGetContentDownl PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentDownloadUrlResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Deletes the specific character ID from the specified user. */ @@ -3202,11 +3316,12 @@ private static PlayFabResult privateDeleteCharact PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); DeleteCharacterFromUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Lists all of the characters that belong to a specific user. */ @@ -3259,11 +3374,12 @@ private static PlayFabResult privateGetAllUsersCharac PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ @@ -3316,11 +3432,12 @@ private static PlayFabResult privateGetCharacterL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of all title-specific statistics for the specific character */ @@ -3373,11 +3490,12 @@ private static PlayFabResult privateGetCharacterSt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, centered on the requested user */ @@ -3430,11 +3548,12 @@ private static PlayFabResult privateGetLead PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of all of the user's characters for the given statistic. */ @@ -3487,11 +3606,12 @@ private static PlayFabResult privateGetL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardForUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Grants the specified character type to the user. */ @@ -3544,11 +3664,12 @@ private static PlayFabResult privateGrantCharacterTo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantCharacterToUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the values of the specified title-specific statistics for the specific character */ @@ -3601,11 +3722,12 @@ private static PlayFabResult privateUpdateChara PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -3658,11 +3780,12 @@ private static PlayFabResult privateGetCharacterDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user's character which cannot be accessed by the client */ @@ -3715,11 +3838,12 @@ private static PlayFabResult privateGetCharacterInternal PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user's character which can only be read by the client */ @@ -3772,11 +3896,12 @@ private static PlayFabResult privateGetCharacterReadOnly PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user's chjaracter which is readable and writable by the client */ @@ -3829,11 +3954,12 @@ private static PlayFabResult privateUpdateCharacterDa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user's character which cannot be accessed by the client */ @@ -3886,11 +4012,12 @@ private static PlayFabResult privateUpdateCharacterIn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user's character which can only be read by the client */ @@ -3943,11 +4070,9 @@ private static PlayFabResult privateUpdateCharacterRe PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - } diff --git a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java index 0f867ef10..0bb8fa3ad 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabSDK/src/com/playfab/PlayFabServerModels.java @@ -164,7 +164,7 @@ public static class CatalogItem implements Comparable { * list of item tags */ @Unordered - public ArrayList Tags; + public ArrayList Tags; /** * game specific custom data */ @@ -211,12 +211,12 @@ public static class CatalogItemBundleInfo { * unique ItemId values for all items which will be added to the player inventory when the bundle is added */ @Unordered - public ArrayList BundledItems; + public ArrayList BundledItems; /** * unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) */ @Unordered - public ArrayList BundledResultTables; + public ArrayList BundledResultTables; /** * virtual currency types and balances which will be added to the player inventory when the bundle is added */ @@ -251,12 +251,12 @@ public static class CatalogItemContainerInfo { * unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked */ @Unordered - public ArrayList ItemContents; + public ArrayList ItemContents; /** * unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) */ @Unordered - public ArrayList ResultTableContents; + public ArrayList ResultTableContents; /** * virtual currency types and balances which will be added to the player inventory when the container is unlocked */ @@ -512,6 +512,22 @@ public static class DeleteSharedGroupRequest { } + public static class DeleteUsersRequest { + /** + * An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public ArrayList PlayFabIds; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected + */ + public String TitleId; + + } + + public static class DeleteUsersResult { + + } + public static class EmptyResult { } @@ -577,7 +593,7 @@ public static class GetCatalogItemsResult { * Array of items which can be purchased. */ @Unordered("ItemId") - public ArrayList Catalog; + public ArrayList Catalog; } @@ -650,7 +666,7 @@ public static class GetCharacterInventoryResult { * Array of inventory items belonging to the character. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the character. */ @@ -902,6 +918,30 @@ public static class GetLeaderboardResult { } + public static class GetPlayerStatisticsRequest { + /** + * user for whom statistics are being requested + */ + public String PlayFabId; + /** + * statistics to return + */ + public ArrayList StatisticNames; + + } + + public static class GetPlayerStatisticsResult { + /** + * PlayFab unique identifier of the user whose statistics are being returned + */ + public String PlayFabId; + /** + * User statistics for the requested user. + */ + public ArrayList Statistics; + + } + public static class GetPlayFabIDsFromFacebookIDsRequest { /** * Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. @@ -1059,7 +1099,7 @@ public static class GetUserInventoryResult { * Array of inventory items belonging to the user. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1265,7 +1305,7 @@ public static class GrantItemsToUsersRequest { * Array of items to grant and the users to whom the items are to be granted. */ @Unordered - public ArrayList ItemGrants; + public ArrayList ItemGrants; } @@ -1765,6 +1805,38 @@ public static class SharedGroupDataRecord { } + public static class StatisticUpdate { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when setting the statistic value for the first time. + */ + public String Version; + /** + * statistic value for the player + */ + public Integer Value; + + } + + public static class StatisticValue { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * statistic value for the player + */ + public Integer Value; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded + */ + public String Version; + + } + public static class SubtractCharacterVirtualCurrencyRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1881,6 +1953,22 @@ public static class UpdateCharacterStatisticsResult { } + public static class UpdatePlayerStatisticsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Statistics to be updated with the provided values + */ + public ArrayList Statistics; + + } + + public static class UpdatePlayerStatisticsResult { + + } + public static class UpdateSharedGroupDataRequest { /** * Unique identifier for the shared group. diff --git a/PlayFabSDK/src/com/playfab/PlayFabSettings.java b/PlayFabSDK/src/com/playfab/PlayFabSettings.java index b2f0d1228..bed0c9053 100644 --- a/PlayFabSDK/src/com/playfab/PlayFabSettings.java +++ b/PlayFabSDK/src/com/playfab/PlayFabSettings.java @@ -3,12 +3,18 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - - public static String TitleId = null; + 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; - public static String LogicServerURL = null; - public static String DeveloperSecretKey = null; + public static String DeveloperSecretKey = 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 String LogicServerURL = null; // Assigned by GetCloudScriptUrl, used by RunCloudScript + public static String AdvertisingIdType = null; // Set this to the appropriate AD_TYPE_X constant below + public static String AdvertisingIdValue = null; // Set this to corresponding device value + // DisableAdvertising is provided for completeness, but changing it is not suggested + // Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly + public static Boolean DisableAdvertising = false; + public static final String AD_TYPE_IDFA = "Idfa"; + public static final String AD_TYPE_ANDROID_ID = "Android_Id"; public static String GetLogicURL() { return LogicServerURL; diff --git a/PlayFabSDK/src/com/playfab/internal/PlayFabVersion.java b/PlayFabSDK/src/com/playfab/internal/PlayFabVersion.java index 5eb9c8e6a..a8059d5e8 100644 --- a/PlayFabSDK/src/com/playfab/internal/PlayFabVersion.java +++ b/PlayFabSDK/src/com/playfab/internal/PlayFabVersion.java @@ -1,7 +1,7 @@ package com.playfab.internal; public class PlayFabVersion { - public static String SdkRevision = "0.10.151130"; + public static String SdkRevision = "0.11.151210"; public static String getVersionString() { return "JavaSDK-" + SdkRevision; } diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java b/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java index ad8871dce..37d40ae3a 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabAdminModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -67,11 +68,12 @@ private static PlayFabResult privateGetUserAccountI PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LookupUserAccountInfoResult 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 */ @@ -124,11 +126,12 @@ private static PlayFabResult privateResetUsersAsync(final ResetUser PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); BlankResult 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 */ @@ -181,11 +184,12 @@ private static PlayFabResult privateSendAccountR PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SendAccountRecoveryEmailResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title specific display name for a user */ @@ -238,11 +242,12 @@ private static PlayFabResult privateUpdateUser PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserTitleDisplayNameResult 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. */ @@ -295,11 +300,12 @@ private static PlayFabResult privateDeleteUsersAsync(final De PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); DeleteUsersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a download URL for the requested report */ @@ -352,11 +358,12 @@ private static PlayFabResult privateGetDataReportAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetDataReportResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -409,11 +416,12 @@ private static PlayFabResult privateGetUserDataAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which cannot be accessed by the client */ @@ -466,11 +474,12 @@ private static PlayFabResult privateGetUserInternalDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ @@ -523,11 +532,12 @@ private static PlayFabResult privateGetUserPublisherDataAsync PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ @@ -580,11 +590,12 @@ private static PlayFabResult privateGetUserPublisherInternalD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which can only be read by the client */ @@ -637,11 +648,12 @@ private static PlayFabResult privateGetUserPublisherReadOnlyD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which can only be read by the client */ @@ -694,11 +706,12 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Completely removes all statistics for the specified user, for the current game */ @@ -751,11 +764,12 @@ private static PlayFabResult privateResetUserStatisti PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ResetUserStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which is readable and writable by the client */ @@ -808,11 +822,12 @@ private static PlayFabResult privateUpdateUserDataAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which cannot be accessed by the client */ @@ -865,11 +880,12 @@ private static PlayFabResult privateUpdateUserInternalData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which is readable and writable by the client */ @@ -922,11 +938,12 @@ private static PlayFabResult privateUpdateUserPublisherDat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which cannot be accessed by the client */ @@ -979,11 +996,12 @@ private static PlayFabResult privateUpdateUserPublisherInt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which can only be read by the client */ @@ -1036,11 +1054,12 @@ private static PlayFabResult privateUpdateUserPublisherRea PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which can only be read by the client */ @@ -1093,11 +1112,12 @@ private static PlayFabResult privateUpdateUserReadOnlyData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds a new news item to the title's news feed */ @@ -1150,11 +1170,12 @@ private static PlayFabResult privateAddNewsAsync(final AddNewsReq PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddNewsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds one or more virtual currencies to the set defined for the title. Virtual Currencies have a maximum value of 2,147,483,647 when granted to a player. Any value over that will be discarded. */ @@ -1207,11 +1228,12 @@ private static PlayFabResult privateAddVirtualCurrencyTypesAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); BlankResult 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 */ @@ -1264,11 +1286,12 @@ private static PlayFabResult privateGetCatalogItemsAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the random drop table configuration for the title */ @@ -1321,11 +1344,12 @@ private static PlayFabResult privateGetRandomResult PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetRandomResultTablesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the set of items defined for the specified store, including all prices defined */ @@ -1378,11 +1402,12 @@ private static PlayFabResult privateGetStoreItemsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom title settings */ @@ -1435,11 +1460,12 @@ private static PlayFabResult privateGetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retuns the list of all defined virtual currencies for the title */ @@ -1492,11 +1518,12 @@ private static PlayFabResult privateListVirtualC PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListVirtualCurrencyTypesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates the catalog configuration of all virtual goods for the specified catalog version */ @@ -1549,11 +1576,12 @@ private static PlayFabResult privateSetCatalogItemsAsy PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Sets all the items in one virtual store */ @@ -1606,11 +1634,12 @@ private static PlayFabResult privateSetStoreItemsAsync(f PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates and updates the key-value store of custom title settings */ @@ -1663,11 +1692,12 @@ private static PlayFabResult privateSetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Sets the Amazon Resource Name (ARN) for iOS and Android push notifications. Documentation on the exact restrictions can be found at: http://docs.aws.amazon.com/sns/latest/api/API_CreatePlatformApplication.html. Currently, Amazon device Messaging is not supported. */ @@ -1720,11 +1750,12 @@ private static PlayFabResult privateSetupPushNotifi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetupPushNotificationResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the catalog configuration for virtual goods in the specified catalog version */ @@ -1777,11 +1808,12 @@ private static PlayFabResult privateUpdateCatalogItems PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the random drop table configuration for the title */ @@ -1834,11 +1866,12 @@ private static PlayFabResult privateUpdateRandom PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateRandomResultTablesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates an existing virtual item store with new or modified items */ @@ -1891,11 +1924,12 @@ private static PlayFabResult privateUpdateStoreItemsAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateStoreItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the specified virtual currency by the stated amount */ @@ -1948,11 +1982,12 @@ private static PlayFabResult privateAddUserVirt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified user's current inventory of virtual goods */ @@ -2005,11 +2040,12 @@ private static PlayFabResult privateGetUserInventoryAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the specified items to the specified user inventories */ @@ -2062,11 +2098,12 @@ private static PlayFabResult privateGrantItemsToUsersAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantItemsToUsersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Revokes access to an item in a user's inventory */ @@ -2119,11 +2156,12 @@ private static PlayFabResult privateRevokeInventoryItemAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RevokeInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the specified virtual currency by the stated amount */ @@ -2176,11 +2214,12 @@ private static PlayFabResult privateSubtractUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details for a specific completed session, including links to standard out and standard error logs */ @@ -2233,11 +2272,12 @@ private static PlayFabResult privateGetMatchmakerGa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetMatchmakerGameInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of defined game modes for the specified game server executable */ @@ -2290,11 +2330,12 @@ private static PlayFabResult privateGetMatchmakerG PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetMatchmakerGameModesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the game server mode details for the specified game server executable */ @@ -2347,11 +2388,12 @@ private static PlayFabResult privateModifyMatch PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyMatchmakerGameModesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the game server executable specified (previously uploaded - see GetServerBuildUploadUrl) to the set of those a client is permitted to request in a call to StartGame */ @@ -2404,11 +2446,12 @@ private static PlayFabResult privateAddServerBuildAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddServerBuildResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the build details for the specified game server executable */ @@ -2444,7 +2487,7 @@ public PlayFabResult call() throws Exception { */ @SuppressWarnings("unchecked") private static PlayFabResult privateGetServerBuildInfoAsync(final GetServerBuildInfoRequest request) throws Exception { - + FutureTask task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/GetServerBuildInfo", request, null, null); task.run(); Object httpResult = task.get(); @@ -2460,11 +2503,12 @@ private static PlayFabResult privateGetServerBuildInfo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetServerBuildInfoResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the pre-authorized URL for uploading a game server package containing a build (does not enable the build for use - see AddServerBuild) */ @@ -2517,11 +2561,12 @@ private static PlayFabResult privateGetServerBuil PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetServerBuildUploadURLResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the build details for all game server executables which are currently defined for the title */ @@ -2574,11 +2619,12 @@ private static PlayFabResult privateListServerBuildsAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListBuildsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the build details for the specified game server executable */ @@ -2631,11 +2677,12 @@ private static PlayFabResult privateModifyServerBuildAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyServerBuildResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes the game server executable specified from the set of those a client is permitted to request in a call to StartGame */ @@ -2688,11 +2735,12 @@ private static PlayFabResult privateRemoveServerBuildAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveServerBuildResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom publisher settings */ @@ -2745,11 +2793,12 @@ private static PlayFabResult privateGetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value store of custom publisher settings */ @@ -2802,11 +2851,12 @@ private static PlayFabResult privateSetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Gets the contents and information of a specific Cloud Script revision. */ @@ -2859,11 +2909,12 @@ private static PlayFabResult privateGetCloudScript PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCloudScriptRevisionResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Lists all the current cloud script versions. For each version, information about the current published and latest revisions is also listed. */ @@ -2916,11 +2967,12 @@ private static PlayFabResult privateGetCloudScript PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCloudScriptVersionsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Sets the currently published revision of a title Cloud Script */ @@ -2973,11 +3025,12 @@ private static PlayFabResult privateSetPublishedRevi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetPublishedRevisionResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Creates a new Cloud Script revision and uploads source code to it. Note that at this time, only one file should be submitted in the revision. */ @@ -3030,11 +3083,12 @@ private static PlayFabResult privateUpdateCloudScriptAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCloudScriptResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Delete a content file from the title */ @@ -3087,11 +3141,12 @@ private static PlayFabResult privateDeleteContentAsync(final Delete PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); BlankResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * List all contents of the title and get statistics such as size */ @@ -3144,11 +3199,12 @@ private static PlayFabResult privateGetContentListAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentListResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the pre-signed URL for uploading a content file. A subsequent HTTP PUT to the returned URL uploads the content. */ @@ -3201,11 +3257,12 @@ private static PlayFabResult privateGetContentUploadU PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentUploadUrlResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Completely removes all statistics for the specified character, for the current game */ @@ -3258,11 +3315,9 @@ private static PlayFabResult privateResetCharact PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ResetCharacterStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - } diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java index d0869529d..97eb195e6 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabAdminModels.java @@ -160,7 +160,7 @@ public static class CatalogItem implements Comparable { * list of item tags */ @Unordered - public ArrayList Tags; + public ArrayList Tags; /** * game specific custom data */ @@ -207,12 +207,12 @@ public static class CatalogItemBundleInfo { * unique ItemId values for all items which will be added to the player inventory when the bundle is added */ @Unordered - public ArrayList BundledItems; + public ArrayList BundledItems; /** * unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) */ @Unordered - public ArrayList BundledResultTables; + public ArrayList BundledResultTables; /** * virtual currency types and balances which will be added to the player inventory when the bundle is added */ @@ -247,12 +247,12 @@ public static class CatalogItemContainerInfo { * unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked */ @Unordered - public ArrayList ItemContents; + public ArrayList ItemContents; /** * unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) */ @Unordered - public ArrayList ResultTableContents; + public ArrayList ResultTableContents; /** * virtual currency types and balances which will be added to the player inventory when the container is unlocked */ @@ -304,6 +304,26 @@ public static class ContentInfo { } + public static class CreatePlayerStatisticDefinitionRequest { + /** + * unique name of the statistic + */ + public String Name; + /** + * interval at which the values of the statistic for all players are reset. Resets begin at the next interval boundary + */ + public Interval VersionChangeInterval; + + } + + public static class CreatePlayerStatisticDefinitionResult { + /** + * created statistic definition + */ + public PlayerStatisticDefinition Statistic; + + } + public static enum Currency { AED, AFN, @@ -530,7 +550,7 @@ public static class GetCatalogItemsResult { * Array of items which can be purchased. */ @Unordered("ItemId") - public ArrayList Catalog; + public ArrayList Catalog; } @@ -689,7 +709,7 @@ public static class GetMatchmakerGameInfoResult { * array of unique PlayFab identifiers for users currently connected to this Game Server Instance */ @Unordered - public ArrayList Players; + public ArrayList Players; /** * IP address for this Game Server Instance */ @@ -717,6 +737,34 @@ public static class GetMatchmakerGameModesResult { } + public static class GetPlayerStatisticDefinitionsRequest { + + } + + public static class GetPlayerStatisticDefinitionsResult { + /** + * definitions of all statistics for the title + */ + public ArrayList Statistics; + + } + + public static class GetPlayerStatisticVersionsRequest { + /** + * unique name of the statistic + */ + public String StatisticName; + + } + + public static class GetPlayerStatisticVersionsResult { + /** + * version change history of the statistic + */ + public ArrayList StatisticVersions; + + } + public static class GetPublisherDataRequest { /** * array of keys to get back data from the Publisher data blob, set by the admin tools @@ -768,7 +816,7 @@ public static class GetServerBuildInfoResult implements Comparable ActiveRegions; + public ArrayList ActiveRegions; /** * maximum number of game server instances that can run on a single host machine */ @@ -835,7 +883,7 @@ public static class GetStoreItemsResult { * Array of items which can be purchased from this store. */ @Unordered("ItemId") - public ArrayList Store; + public ArrayList Store; } @@ -904,7 +952,7 @@ public static class GetUserInventoryResult { * Array of inventory items belonging to the user. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1006,7 +1054,7 @@ public static class GrantItemsToUsersRequest { * Array of items to grant and the users to whom the items are to be granted. */ @Unordered - public ArrayList ItemGrants; + public ArrayList ItemGrants; } @@ -1018,6 +1066,29 @@ public static class GrantItemsToUsersResult { } + public static class IncrementPlayerStatisticVersionRequest { + /** + * unique name of the statistic + */ + public String StatisticName; + + } + + public static class IncrementPlayerStatisticVersionResult { + /** + * version change history of the statistic + */ + public PlayerStatisticVersion StatisticVersion; + + } + + public static enum Interval { + Hour, + Day, + Week, + Month + } + public static class ItemGrant { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1116,7 +1187,7 @@ public static class ListBuildsResult { * array of uploaded game server builds */ @Unordered("BuildId") - public ArrayList Builds; + public ArrayList Builds; } @@ -1129,7 +1200,7 @@ public static class ListVirtualCurrencyTypesResult { * List of virtual currency names defined for this title */ @Unordered - public ArrayList VirtualCurrencies; + public ArrayList VirtualCurrencies; } @@ -1269,6 +1340,50 @@ public static class ModifyUserVirtualCurrencyResult { } + public static class PlayerStatisticDefinition { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * current active version of the statistic, incremented each time the statistic resets + */ + public String CurrentVersion; + /** + * interval at which the values of the statistic for all players are reset + */ + public Interval VersionChangeInterval; + + } + + public static class PlayerStatisticVersion { + /** + * name of the statistic when the version became active + */ + public String StatisticName; + /** + * version of the statistic + */ + public String Version; + /** + * time for which the statistic version was scheduled to become active, based on the configured ResetInterval + */ + public Date ScheduledVersionChangeIntervalTime; + /** + * time when the statistic version became active + */ + public Date CreatedTime; + /** + * status of the process of saving player statistic values of the previous version to a downloadable archive, if configured + */ + public StatisticVersionArchivalStatus ArchivalStatus; + /** + * reset interval that triggered the version to become active, if configured + */ + public Interval ResetInterval; + + } + public static class RandomResultTable { /** * Unique name for this drop table @@ -1545,6 +1660,14 @@ public static class SetupPushNotificationResult { public String ARN; } + + public static enum StatisticVersionArchivalStatus { + NotScheduled, + Scheduled, + InProgress, + Failed, + Complete + } /** * A store entry that list a catalog item at a particular price */ @@ -1634,6 +1757,26 @@ public static class UpdateCloudScriptResult { } + public static class UpdatePlayerStatisticDefinitionRequest { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * interval at which the values of the statistic for all players are reset. Changes are effective at the next interval boundary + */ + public Interval VersionChangeInterval; + + } + + public static class UpdatePlayerStatisticDefinitionResult { + /** + * updated statistic definition + */ + public PlayerStatisticDefinition Statistic; + + } + public static class UpdateRandomResultTablesRequest { /** * which catalog is being updated. If null, update the current default catalog version diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java index b9efd5962..9fa3ac356 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabErrors.java @@ -193,7 +193,11 @@ public static enum PlayFabErrorCode { ExpiredXboxLiveToken(1189), ResettableStatisticVersionRequired(1190), NotAuthorizedByTitle(1191), - NoPartnerEnabled(1192); + NoPartnerEnabled(1192), + InvalidPartnerResponse(1193), + APINotEnabledForGameServerAccess(1194), + StatisticNotFound(1195), + StatisticNameConflict(1196); public int id; diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerAPI.java b/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerAPI.java index e8e0cbe58..47a138c45 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabMatchmakerModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -67,11 +68,12 @@ private static PlayFabResult privateAuthUserAsync(final AuthUs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AuthUserResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Informs the PlayFab game server hosting service that the indicated user has joined the Game Server Instance specified */ @@ -124,11 +126,12 @@ private static PlayFabResult privatePlayerJoinedAsync(fina PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PlayerJoinedResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Informs the PlayFab game server hosting service that the indicated user has left the Game Server Instance specified */ @@ -181,11 +184,12 @@ private static PlayFabResult privatePlayerLeftAsync(final Pl PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); PlayerLeftResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Instructs the PlayFab game server hosting service to instantiate a new Game Server Instance */ @@ -238,11 +242,12 @@ private static PlayFabResult privateStartGameAsync(final Star PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); StartGameResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the relevant details for a specified user, which the external match-making service can then use to compute effective matches */ @@ -295,11 +300,9 @@ private static PlayFabResult privateUserInfoAsync(final UserIn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UserInfoResponse result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - } diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java index f8bc99235..bfb5b6bd4 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabMatchmakerModels.java @@ -205,7 +205,7 @@ public static class UserInfoResponse { * Array of inventory items in the user's current inventory. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java index 7825908a1..ba44ac410 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerAPI.java @@ -3,6 +3,7 @@ import com.playfab.internal.*; import com.playfab.PlayFabServerModels.*; import com.playfab.PlayFabErrors.*; +import com.playfab.PlayFabSettings; import java.util.concurrent.*; import java.util.*; import com.google.gson.*; @@ -67,11 +68,12 @@ private static PlayFabResult privateAuthenticat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AuthenticateSessionTicketResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the unique PlayFab identifiers for the given set of Facebook identifiers. */ @@ -124,11 +126,12 @@ private static PlayFabResult privateGetPlayF PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPlayFabIDsFromFacebookIDsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the relevant details for a specified user */ @@ -181,11 +184,12 @@ private static PlayFabResult privateGetUserAccountInfo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserAccountInfoResult 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. */ @@ -238,11 +242,70 @@ private static PlayFabResult privateSendPushNotifica PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SendPushNotificationResult 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. + */ + @SuppressWarnings("unchecked") + public static FutureTask> DeleteUsersAsync(final DeleteUsersRequest request) { + return new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteUsersAsync(request); + } + }); + } + + /** + * Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. + */ + @SuppressWarnings("unchecked") + public static PlayFabResult DeleteUsers(final DeleteUsersRequest request) { + FutureTask> task = new FutureTask(new Callable>() { + public PlayFabResult call() throws Exception { + return privateDeleteUsersAsync(request); + } + }); + try { + task.run(); + return task.get(); + } catch(Exception e) { + return null; + } + } + + /** + * Deletes the users for the provided game. Deletes custom data, all account linkages, and statistics. + */ + @SuppressWarnings("unchecked") + private static PlayFabResult privateDeleteUsersAsync(final DeleteUsersRequest 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/DeleteUsers", 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()); + DeleteUsersResult result = resultData.data; + + PlayFabResult pfResult = new PlayFabResult(); + pfResult.Result = result; + return pfResult; + } + /** * Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard */ @@ -295,11 +358,12 @@ private static PlayFabResult privateGetLeaderboardAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked users for the given statistic, centered on the currently signed-in user */ @@ -352,11 +416,12 @@ private static PlayFabResult privateGetLeaderboa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -409,11 +474,12 @@ private static PlayFabResult privateGetUserDataAsync(final Ge PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which cannot be accessed by the client */ @@ -466,11 +532,12 @@ private static PlayFabResult privateGetUserInternalDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which is readable and writable by the client */ @@ -523,11 +590,12 @@ private static PlayFabResult privateGetUserPublisherDataAsync PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which cannot be accessed by the client */ @@ -580,11 +648,12 @@ private static PlayFabResult privateGetUserPublisherInternalD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the publisher-specific custom data for the user which can only be read by the client */ @@ -637,11 +706,12 @@ private static PlayFabResult privateGetUserPublisherReadOnlyD PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which can only be read by the client */ @@ -694,11 +764,12 @@ private static PlayFabResult privateGetUserReadOnlyDataAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of all title-specific statistics for the user */ @@ -751,11 +822,12 @@ private static PlayFabResult privateGetUserStatisticsAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which is readable and writable by the client */ @@ -808,11 +880,12 @@ private static PlayFabResult privateUpdateUserDataAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which cannot be accessed by the client */ @@ -865,11 +938,12 @@ private static PlayFabResult privateUpdateUserInternalData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which is readable and writable by the client */ @@ -922,11 +996,12 @@ private static PlayFabResult privateUpdateUserPublisherDat PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which cannot be accessed by the client */ @@ -979,11 +1054,12 @@ private static PlayFabResult privateUpdateUserPublisherInt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the publisher-specific custom data for the user which can only be read by the client */ @@ -1036,11 +1112,12 @@ private static PlayFabResult privateUpdateUserPublisherRea PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user which can only be read by the client */ @@ -1093,11 +1170,12 @@ private static PlayFabResult privateUpdateUserReadOnlyData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the values of the specified title-specific statistics for the user */ @@ -1150,11 +1228,12 @@ private static PlayFabResult privateUpdateUserStatis PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserStatisticsResult 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 */ @@ -1207,11 +1286,12 @@ private static PlayFabResult privateGetCatalogItemsAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCatalogItemsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom title settings */ @@ -1264,11 +1344,12 @@ private static PlayFabResult privateGetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom internal title settings */ @@ -1321,11 +1402,12 @@ private static PlayFabResult privateGetTitleInternalDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title news feed, as configured in the developer portal */ @@ -1378,11 +1460,12 @@ private static PlayFabResult privateGetTitleNewsAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetTitleNewsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value store of custom title settings */ @@ -1435,11 +1518,12 @@ private static PlayFabResult privateSetTitleDataAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value store of custom title settings */ @@ -1492,11 +1576,12 @@ private static PlayFabResult privateSetTitleInternalDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetTitleDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the character's balance of the specified virtual currency by the stated amount */ @@ -1549,11 +1634,12 @@ private static PlayFabResult privateAddCha PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyCharacterVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Increments the user's balance of the specified virtual currency by the stated amount */ @@ -1606,11 +1692,12 @@ private static PlayFabResult privateAddUserVirt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified character's current inventory of virtual goods */ @@ -1663,11 +1750,12 @@ private static PlayFabResult privateGetCharacterInv PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the specified user's current inventory of virtual goods */ @@ -1720,11 +1808,12 @@ private static PlayFabResult privateGetUserInventoryAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetUserInventoryResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the specified items to the specified character's inventory */ @@ -1777,11 +1866,12 @@ private static PlayFabResult privateGrantItemsToCha PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantItemsToCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the specified items to the specified user's inventory */ @@ -1834,11 +1924,12 @@ private static PlayFabResult privateGrantItemsToUserAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantItemsToUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds the specified items to the specified user inventories */ @@ -1891,11 +1982,12 @@ private static PlayFabResult privateGrantItemsToUsersAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantItemsToUsersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Modifies the number of remaining uses of a player's inventory item */ @@ -1948,11 +2040,12 @@ private static PlayFabResult privateModifyItemUsesAsync(fi PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyItemUsesResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Moves an item from a character's inventory into another of the users's character's inventory. */ @@ -2005,11 +2098,12 @@ private static PlayFabResult privateMove PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MoveItemToCharacterFromCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Moves an item from a user's inventory into their character's inventory. */ @@ -2062,11 +2156,12 @@ private static PlayFabResult privateMoveItemT PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MoveItemToCharacterFromUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Moves an item from a character's inventory into the owning user's inventory. */ @@ -2119,11 +2214,12 @@ private static PlayFabResult privateMoveItemT PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); MoveItemToUserFromCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * 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 */ @@ -2176,11 +2272,12 @@ private static PlayFabResult privateRedeemCouponAsync(final PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RedeemCouponResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service representatives for the title can take action concerning potentially poxic players. */ @@ -2233,11 +2330,12 @@ private static PlayFabResult privateReportPlayerAsync( PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ReportPlayerServerResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the character's balance of the specified virtual currency by the stated amount */ @@ -2290,11 +2388,12 @@ private static PlayFabResult privateSubtra PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyCharacterVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Decrements the user's balance of the specified virtual currency by the stated amount */ @@ -2347,11 +2446,12 @@ private static PlayFabResult privateSubtractUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ModifyUserVirtualCurrencyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value pair data tagged to the specified item, which is read-only from the client. */ @@ -2404,11 +2504,12 @@ private static PlayFabResult privateUpdateUse PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateUserInventoryItemDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Informs the PlayFab match-making service that the user specified has left the Game Server Instance */ @@ -2461,11 +2562,12 @@ private static PlayFabResult privateNotifyMatc PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); NotifyMatchmakerPlayerLeftResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Validates a Game Server session ticket and returns details about the user */ @@ -2518,11 +2620,12 @@ private static PlayFabResult privateRedeemMatchmak PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RedeemMatchmakerTicketResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Awards the specified users the specified Steam achievements */ @@ -2575,11 +2678,12 @@ private static PlayFabResult privateAwardSteamAchie PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AwardSteamAchievementResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Logs a custom analytics event */ @@ -2632,11 +2736,12 @@ private static PlayFabResult privateLogEventAsync(final LogEvent PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); LogEventResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds users to the set of those able to update both the shared data, as well as the set of users in the group. Only users in the group (and the server) can add new members. */ @@ -2689,11 +2794,12 @@ private static PlayFabResult privateAddSharedGroupM PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); AddSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Requests the creation of a shared group object, containing key/value pairs which may be updated by all members of the group. When created by a server, the group will initially have no members. */ @@ -2746,11 +2852,12 @@ private static PlayFabResult privateCreateSharedGroupAs PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); CreateSharedGroupResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Deletes a shared group, freeing up the shared group ID to be reused for a new group */ @@ -2803,11 +2910,12 @@ private static PlayFabResult privateDeleteSharedGroupAsync(final De PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); EmptyResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the key-value store of custom publisher settings */ @@ -2860,11 +2968,12 @@ private static PlayFabResult privateGetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves data stored in a shared group object, as well as the list of members in the group. The server can access all public and private group data. */ @@ -2917,11 +3026,12 @@ private static PlayFabResult privateGetSharedGroupData PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Removes users from the set of those able to update the shared data and the set of users in the group. Only users in the group can remove members. If as a result of the call, zero users remain with access, the group and its associated data will be deleted. */ @@ -2974,11 +3084,12 @@ private static PlayFabResult privateRemoveShared PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); RemoveSharedGroupMembersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the key-value store of custom publisher settings */ @@ -3031,11 +3142,12 @@ private static PlayFabResult privateSetPublisherDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); SetPublisherDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Adds, updates, and removes data keys for a shared group object. If the permission is set to Public, all fields updated or added in this call will be readable by users not in the group. By default, data permissions are set to Private. Regardless of the permission setting, only members of the group (and the server) can update the data. */ @@ -3088,11 +3200,12 @@ private static PlayFabResult privateUpdateSharedGro PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateSharedGroupDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * This API retrieves a pre-signed URL for accessing a content file for the title. A subsequent HTTP GET to the returned URL will attempt to download the content. A HEAD query to the returned URL will attempt to retrieve the metadata of the content. Note that a successful result does not guarantee the existence of this content - if it has not been uploaded, the query to retrieve the data will fail. See this post for more information: https://support.playfab.com/support/discussions/topics/1000059929 */ @@ -3145,11 +3258,12 @@ private static PlayFabResult privateGetContentDownl PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetContentDownloadUrlResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Deletes the specific character ID from the specified user. */ @@ -3202,11 +3316,12 @@ private static PlayFabResult privateDeleteCharact PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); DeleteCharacterFromUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Lists all of the characters that belong to a specific user. */ @@ -3259,11 +3374,12 @@ private static PlayFabResult privateGetAllUsersCharac PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); ListUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, starting from the indicated point in the leaderboard */ @@ -3316,11 +3432,12 @@ private static PlayFabResult privateGetCharacterL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterLeaderboardResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the details of all title-specific statistics for the specific character */ @@ -3373,11 +3490,12 @@ private static PlayFabResult privateGetCharacterSt PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of ranked characters for the given statistic, centered on the requested user */ @@ -3430,11 +3548,12 @@ private static PlayFabResult privateGetLead PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardAroundCharacterResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves a list of all of the user's characters for the given statistic. */ @@ -3487,11 +3606,12 @@ private static PlayFabResult privateGetL PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetLeaderboardForUsersCharactersResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Grants the specified character type to the user. */ @@ -3544,11 +3664,12 @@ private static PlayFabResult privateGrantCharacterTo PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GrantCharacterToUserResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the values of the specified title-specific statistics for the specific character */ @@ -3601,11 +3722,12 @@ private static PlayFabResult privateUpdateChara PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterStatisticsResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user which is readable and writable by the client */ @@ -3658,11 +3780,12 @@ private static PlayFabResult privateGetCharacterDataAsyn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user's character which cannot be accessed by the client */ @@ -3715,11 +3838,12 @@ private static PlayFabResult privateGetCharacterInternal PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Retrieves the title-specific custom data for the user's character which can only be read by the client */ @@ -3772,11 +3896,12 @@ private static PlayFabResult privateGetCharacterReadOnly PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); GetCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user's chjaracter which is readable and writable by the client */ @@ -3829,11 +3954,12 @@ private static PlayFabResult privateUpdateCharacterDa PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user's character which cannot be accessed by the client */ @@ -3886,11 +4012,12 @@ private static PlayFabResult privateUpdateCharacterIn PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } + /** * Updates the title-specific custom data for the user's character which can only be read by the client */ @@ -3943,11 +4070,9 @@ private static PlayFabResult privateUpdateCharacterRe PlayFabJsonSuccess resultData = gson.fromJson(resultRawJson, new TypeToken>(){}.getType()); UpdateCharacterDataResult result = resultData.data; - + PlayFabResult pfResult = new PlayFabResult(); pfResult.Result = result; return pfResult; } - - } diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java index 0f867ef10..0bb8fa3ad 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabServerModels.java @@ -164,7 +164,7 @@ public static class CatalogItem implements Comparable { * list of item tags */ @Unordered - public ArrayList Tags; + public ArrayList Tags; /** * game specific custom data */ @@ -211,12 +211,12 @@ public static class CatalogItemBundleInfo { * unique ItemId values for all items which will be added to the player inventory when the bundle is added */ @Unordered - public ArrayList BundledItems; + public ArrayList BundledItems; /** * unique TableId values for all RandomResultTable objects which are part of the bundle (random tables will be resolved and add the relevant items to the player inventory when the bundle is added) */ @Unordered - public ArrayList BundledResultTables; + public ArrayList BundledResultTables; /** * virtual currency types and balances which will be added to the player inventory when the bundle is added */ @@ -251,12 +251,12 @@ public static class CatalogItemContainerInfo { * unique ItemId values for all items which will be added to the player inventory, once the container has been unlocked */ @Unordered - public ArrayList ItemContents; + public ArrayList ItemContents; /** * unique TableId values for all RandomResultTable objects which are part of the container (once unlocked, random tables will be resolved and add the relevant items to the player inventory) */ @Unordered - public ArrayList ResultTableContents; + public ArrayList ResultTableContents; /** * virtual currency types and balances which will be added to the player inventory when the container is unlocked */ @@ -512,6 +512,22 @@ public static class DeleteSharedGroupRequest { } + public static class DeleteUsersRequest { + /** + * An array of unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public ArrayList PlayFabIds; + /** + * Unique identifier for the title, found in the Settings > Game Properties section of the PlayFab developer site when a title has been selected + */ + public String TitleId; + + } + + public static class DeleteUsersResult { + + } + public static class EmptyResult { } @@ -577,7 +593,7 @@ public static class GetCatalogItemsResult { * Array of items which can be purchased. */ @Unordered("ItemId") - public ArrayList Catalog; + public ArrayList Catalog; } @@ -650,7 +666,7 @@ public static class GetCharacterInventoryResult { * Array of inventory items belonging to the character. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the character. */ @@ -902,6 +918,30 @@ public static class GetLeaderboardResult { } + public static class GetPlayerStatisticsRequest { + /** + * user for whom statistics are being requested + */ + public String PlayFabId; + /** + * statistics to return + */ + public ArrayList StatisticNames; + + } + + public static class GetPlayerStatisticsResult { + /** + * PlayFab unique identifier of the user whose statistics are being returned + */ + public String PlayFabId; + /** + * User statistics for the requested user. + */ + public ArrayList Statistics; + + } + public static class GetPlayFabIDsFromFacebookIDsRequest { /** * Array of unique Facebook identifiers for which the title needs to get PlayFab identifiers. @@ -1059,7 +1099,7 @@ public static class GetUserInventoryResult { * Array of inventory items belonging to the user. */ @Unordered("ItemInstanceId") - public ArrayList Inventory; + public ArrayList Inventory; /** * Array of virtual currency balance(s) belonging to the user. */ @@ -1265,7 +1305,7 @@ public static class GrantItemsToUsersRequest { * Array of items to grant and the users to whom the items are to be granted. */ @Unordered - public ArrayList ItemGrants; + public ArrayList ItemGrants; } @@ -1765,6 +1805,38 @@ public static class SharedGroupDataRecord { } + public static class StatisticUpdate { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded. Null when setting the statistic value for the first time. + */ + public String Version; + /** + * statistic value for the player + */ + public Integer Value; + + } + + public static class StatisticValue { + /** + * unique name of the statistic + */ + public String StatisticName; + /** + * statistic value for the player + */ + public Integer Value; + /** + * for updates to an existing statistic value for a player, the version of the statistic when it was loaded + */ + public String Version; + + } + public static class SubtractCharacterVirtualCurrencyRequest { /** * Unique PlayFab assigned ID of the user on whom the operation will be performed. @@ -1881,6 +1953,22 @@ public static class UpdateCharacterStatisticsResult { } + public static class UpdatePlayerStatisticsRequest { + /** + * Unique PlayFab assigned ID of the user on whom the operation will be performed. + */ + public String PlayFabId; + /** + * Statistics to be updated with the provided values + */ + public ArrayList Statistics; + + } + + public static class UpdatePlayerStatisticsResult { + + } + public static class UpdateSharedGroupDataRequest { /** * Unique identifier for the shared group. diff --git a/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java b/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java index b2f0d1228..be2f953e9 100644 --- a/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java +++ b/PlayFabServerSDK/src/com/playfab/PlayFabSettings.java @@ -3,16 +3,9 @@ import com.playfab.PlayFabErrors.ErrorCallback; public class PlayFabSettings { - - public static String TitleId = null; + 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; - public static String LogicServerURL = null; - public static String DeveloperSecretKey = null; - - - public static String GetLogicURL() { - return LogicServerURL; - } + public static String DeveloperSecretKey = 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 String GetURL() { return "https://" + TitleId + ".playfabapi.com"; diff --git a/PlayFabServerSDK/src/com/playfab/internal/PlayFabVersion.java b/PlayFabServerSDK/src/com/playfab/internal/PlayFabVersion.java index 5eb9c8e6a..a8059d5e8 100644 --- a/PlayFabServerSDK/src/com/playfab/internal/PlayFabVersion.java +++ b/PlayFabServerSDK/src/com/playfab/internal/PlayFabVersion.java @@ -1,7 +1,7 @@ package com.playfab.internal; public class PlayFabVersion { - public static String SdkRevision = "0.10.151130"; + public static String SdkRevision = "0.11.151210"; public static String getVersionString() { return "JavaSDK-" + SdkRevision; }