diff --git a/PlayFabApiTest.js b/PlayFabApiTest.js index c299b10a..0e0a5788 100644 --- a/PlayFabApiTest.js +++ b/PlayFabApiTest.js @@ -67,7 +67,7 @@ var PlayFabApiTests = { } else { // Continue with other tests that require login QUnit.test("UserDataApi", PlayFabApiTests.UserDataApi); - QUnit.test("UserStatisticsApi", PlayFabApiTests.UserStatisticsApi); + QUnit.test("PlayerStatisticsApi", PlayFabApiTests.PlayerStatisticsApi); QUnit.test("UserCharacter", PlayFabApiTests.UserCharacter); QUnit.test("LeaderBoard", PlayFabApiTests.LeaderBoard); QUnit.test("AccountInfo", PlayFabApiTests.AccountInfo); @@ -317,7 +317,7 @@ var PlayFabApiTests = { /// Verify that the data is saved correctly, and that specific types are tested /// Parameter types tested: Dictionary /// - UserStatisticsApi: function (assert) { + PlayerStatisticsApi: function (assert) { var getStatsRequest = {}; // null also works // This test is always exactly 3 async calls @@ -326,40 +326,43 @@ var PlayFabApiTests = { var get2Done = assert.async(); var getStatsCallback2 = function (result, error) { - PlayFabApiTests.VerifyNullError(result, error, assert, "Testing GetUserStats result"); - assert.ok(result.data.UserStatistics != null, "Testing GetUserData Stats"); - assert.ok(result.data.UserStatistics.hasOwnProperty(PlayFabApiTests.testConstants.TEST_STAT_NAME), "Testing GetUserData Stat-value"); + PlayFabApiTests.VerifyNullError(result, error, assert, "Testing GetPlayerStats result"); + assert.ok(result.data.Statistics != null, "Testing GetUserData Stats"); - var actualtestNumber = result.data.UserStatistics[PlayFabApiTests.testConstants.TEST_STAT_NAME]; + var actualtestNumber = -1000; + for (var i = 0; i < result.data.Statistics.length; i++) + if (result.data.Statistics[i].StatisticName === PlayFabApiTests.testConstants.TEST_STAT_NAME) + actualtestNumber = result.data.Statistics[i].Value; assert.equal(PlayFabApiTests.testData.testNumber, actualtestNumber, "Testing incrementing stat: " + PlayFabApiTests.testData.testNumber + "==" + actualtestNumber); get2Done(); }; var updateStatsCallback = function (result, error) { - PlayFabApiTests.VerifyNullError(result, error, assert, "Testing UpdateUserStats result"); - PlayFabClientSDK.GetUserStatistics(getStatsRequest, PlayFabApiTests.CallbackWrapper("getStatsCallback2", getStatsCallback2, assert)); + PlayFabApiTests.VerifyNullError(result, error, assert, "Testing UpdatePlayerStats result"); + PlayFabClientSDK.GetPlayerStatistics(getStatsRequest, PlayFabApiTests.CallbackWrapper("getStatsCallback2", getStatsCallback2, assert)); updateDone(); }; var getStatsCallback1 = function (result, error) { - PlayFabApiTests.VerifyNullError(result, error, assert, "Testing GetUserStats result"); - assert.ok(result.data.UserStatistics != null, "Testing GetUserData Stats"); + PlayFabApiTests.VerifyNullError(result, error, assert, "Testing GetPlayerStats result"); + assert.ok(result.data.Statistics != null, "Testing GetUserData Stats"); - var hasData = result.data.UserStatistics.hasOwnProperty(PlayFabApiTests.testConstants.TEST_STAT_NAME); - PlayFabApiTests.testData.testNumber = !hasData ? 1 : result.data.UserStatistics[PlayFabApiTests.testConstants.TEST_STAT_NAME]; + PlayFabApiTests.testData.testNumber = 0; + for (var i = 0; i < result.data.Statistics.length; i++) + if (result.data.Statistics[i].StatisticName === PlayFabApiTests.testConstants.TEST_STAT_NAME) + PlayFabApiTests.testData.testNumber = result.data.Statistics[i].Value; PlayFabApiTests.testData.testNumber = (PlayFabApiTests.testData.testNumber + 1) % 100; // This test is about the expected value changing - but not testing more complicated issues like bounds var updateStatsRequest = { // Currently, you need to look up the correct format for this object in the API-docs: - // https://api.playfab.com/Documentation/Client/method/UpdateUserStatistics - UserStatistics: {} // Can't pre-define properties because the param-name is in a string + // https://api.playfab.com/Documentation/Client/method/UpdatePlayerStatistics + Statistics: [{ StatisticName: PlayFabApiTests.testConstants.TEST_STAT_NAME, Value: PlayFabApiTests.testData.testNumber }] }; - updateStatsRequest.UserStatistics[PlayFabApiTests.testConstants.TEST_STAT_NAME] = PlayFabApiTests.testData.testNumber; - PlayFabClientSDK.UpdateUserStatistics(updateStatsRequest, PlayFabApiTests.CallbackWrapper("updateStatsCallback", updateStatsCallback, assert)); + PlayFabClientSDK.UpdatePlayerStatistics(updateStatsRequest, PlayFabApiTests.CallbackWrapper("updateStatsCallback", updateStatsCallback, assert)); get1Done(); }; // Kick off this test process - PlayFabClientSDK.GetUserStatistics(getStatsRequest, PlayFabApiTests.CallbackWrapper("getStatsCallback1", getStatsCallback1, assert)); + PlayFabClientSDK.GetPlayerStatistics(getStatsRequest, PlayFabApiTests.CallbackWrapper("getStatsCallback1", getStatsCallback1, assert)); }, /// diff --git a/PlayFabSDK/PlayFabAdminApi.js b/PlayFabSDK/PlayFabAdminApi.js index 1267cf2b..205b35b4 100644 --- a/PlayFabSDK/PlayFabAdminApi.js +++ b/PlayFabSDK/PlayFabAdminApi.js @@ -18,7 +18,7 @@ if(!PlayFab.settings) { if(!PlayFab._internalSettings) { PlayFab._internalSettings = { sessionTicket: null, - sdkVersion: "0.26.160815", + sdkVersion: "0.27.160822", buildIdentifier: "jbuild_javascriptsdk_0", productionServerUrl: ".playfabapi.com", logicServerUrl: null, @@ -106,24 +106,54 @@ if(!PlayFab._internalSettings) { PlayFab.AdminApi = { + BanUsers: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/BanUsers", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + GetUserAccountInfo: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/GetUserAccountInfo", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + GetUserBans: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/GetUserBans", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + ResetUsers: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/ResetUsers", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + RevokeAllBansForUser: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/RevokeAllBansForUser", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + + RevokeBans: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/RevokeBans", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + SendAccountRecoveryEmail: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/SendAccountRecoveryEmail", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + UpdateBans: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/UpdateBans", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + UpdateUserTitleDisplayName: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; @@ -262,6 +292,12 @@ PlayFab.AdminApi = { PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/AddVirtualCurrencyTypes", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + DeleteStore: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/DeleteStore", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + GetCatalogItems: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; diff --git a/PlayFabSDK/PlayFabClientApi.js b/PlayFabSDK/PlayFabClientApi.js index 1d219a71..2f2902bf 100644 --- a/PlayFabSDK/PlayFabClientApi.js +++ b/PlayFabSDK/PlayFabClientApi.js @@ -18,7 +18,7 @@ if(!PlayFab.settings) { if(!PlayFab._internalSettings) { PlayFab._internalSettings = { sessionTicket: null, - sdkVersion: "0.26.160815", + sdkVersion: "0.27.160822", buildIdentifier: "jbuild_javascriptsdk_0", productionServerUrl: ".playfabapi.com", logicServerUrl: null, diff --git a/PlayFabSDK/PlayFabMatchmakerApi.js b/PlayFabSDK/PlayFabMatchmakerApi.js index a64e34ab..6a733e4b 100644 --- a/PlayFabSDK/PlayFabMatchmakerApi.js +++ b/PlayFabSDK/PlayFabMatchmakerApi.js @@ -18,7 +18,7 @@ if(!PlayFab.settings) { if(!PlayFab._internalSettings) { PlayFab._internalSettings = { sessionTicket: null, - sdkVersion: "0.26.160815", + sdkVersion: "0.27.160822", buildIdentifier: "jbuild_javascriptsdk_0", productionServerUrl: ".playfabapi.com", logicServerUrl: null, diff --git a/PlayFabSDK/PlayFabServerApi.js b/PlayFabSDK/PlayFabServerApi.js index 780487b5..2d8b45c6 100644 --- a/PlayFabSDK/PlayFabServerApi.js +++ b/PlayFabSDK/PlayFabServerApi.js @@ -18,7 +18,7 @@ if(!PlayFab.settings) { if(!PlayFab._internalSettings) { PlayFab._internalSettings = { sessionTicket: null, - sdkVersion: "0.26.160815", + sdkVersion: "0.27.160822", buildIdentifier: "jbuild_javascriptsdk_0", productionServerUrl: ".playfabapi.com", logicServerUrl: null, @@ -112,6 +112,12 @@ PlayFab.ServerApi = { PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/AuthenticateSessionTicket", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + BanUsers: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/BanUsers", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + GetPlayFabIDsFromFacebookIDs: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; @@ -130,12 +136,36 @@ PlayFab.ServerApi = { PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/GetUserAccountInfo", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + GetUserBans: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/GetUserBans", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + + RevokeAllBansForUser: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/RevokeAllBansForUser", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + + RevokeBans: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/RevokeBans", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + SendPushNotification: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/SendPushNotification", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + UpdateBans: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/UpdateBans", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + DeleteUsers: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; @@ -340,6 +370,12 @@ PlayFab.ServerApi = { PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/GetCharacterInventory", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); }, + GetRandomResultTables: function (request, callback) { + if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method"; + + PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/GetRandomResultTables", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback); + }, + GetUserInventory: function (request, callback) { if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";