Skip to content

Commit 8aaded4

Browse files
author
Playfab Jenkins Bot
committed
https://api.playfab.com/releaseNotes/#161017
1 parent e44ddca commit 8aaded4

File tree

5 files changed

+37
-125
lines changed

5 files changed

+37
-125
lines changed

PlayFabApiTest.js

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if (typeof QUnit == "undefined") {
1212
}
1313

1414
var PlayFabApiTests = {
15-
testTitleDataFilename: "testTitleData.json", // TODO: Do not hard code the location of this file (javascript can't really do relative paths either)
15+
testTitleDataFilename: "testTitleData.json", // Since you never want this to be public, a web page can ONLY load this if it's a local file in the same directory (Also can't convert to environment variable)
1616
titleData: {
1717
titleId: null, // put titleId here
1818
developerSecretKey: null, // put secretKey here
@@ -70,6 +70,7 @@ var PlayFabApiTests = {
7070
QUnit.test("LeaderBoard", PlayFabApiTests.LeaderBoard);
7171
QUnit.test("AccountInfo", PlayFabApiTests.AccountInfo);
7272
QUnit.test("CloudScript", PlayFabApiTests.CloudScript);
73+
QUnit.test("CloudScriptError", PlayFabApiTests.CloudScriptError);
7374
QUnit.test("WriteEvent", PlayFabApiTests.WriteEvent);
7475
}
7576
},
@@ -510,6 +511,32 @@ var PlayFabApiTests = {
510511
PlayFabClientSDK.ExecuteCloudScript(helloWorldRequest, PlayFabApiTests.CallbackWrapper("helloWorldCallback", helloWorldCallback, assert));
511512
},
512513

514+
/// <summary>
515+
/// CLIENT API
516+
/// Test that CloudScript errors can be deciphered
517+
/// </summary>
518+
CloudScriptError: function (assert) {
519+
var errDone = assert.async();
520+
521+
var errRequest = {
522+
// Currently, you need to look up the correct format for this object in the API-docs:
523+
// https://api.playfab.com/Documentation/Client/method/ExecuteCloudScript
524+
FunctionName: "throwError"
525+
};
526+
527+
var errCallback = function (result, error) {
528+
PlayFabApiTests.VerifyNullError(result, error, assert, "Testing Cloud Script Error result");
529+
if (result != null) {
530+
assert.ok(result.data.FunctionResult == null, "Testing Cloud Script Error result");
531+
assert.ok(result.data.Error != null, "Testing Cloud Script Error result message");
532+
assert.equal(result.data.Error.Error, "JavascriptException", "Testing Cloud Script Error result message");
533+
}
534+
errDone();
535+
};
536+
537+
PlayFabClientSDK.ExecuteCloudScript(errRequest, PlayFabApiTests.CallbackWrapper("errCallback", errCallback, assert));
538+
},
539+
513540
/// <summary>
514541
/// CLIENT API
515542
/// Test that the client can publish custom PlayStream events

PlayFabSDK/PlayFabAdminApi.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,21 @@ if(!PlayFab.settings) {
1111
// Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly
1212
disableAdvertising: false,
1313
AD_TYPE_IDFA: "Idfa",
14-
AD_TYPE_ANDROID_ID: "Android_Id"
14+
AD_TYPE_ANDROID_ID: "Adid"
1515
}
1616
}
1717

1818
if(!PlayFab._internalSettings) {
1919
PlayFab._internalSettings = {
2020
sessionTicket: null,
21-
sdkVersion: "0.31.161003",
21+
sdkVersion: "0.32.161017",
2222
buildIdentifier: "jbuild_javascriptsdk_1",
2323
productionServerUrl: ".playfabapi.com",
24-
logicServerUrl: null,
2524

2625
GetServerUrl: function () {
2726
return "https://" + PlayFab.settings.titleId + PlayFab._internalSettings.productionServerUrl;
2827
},
2928

30-
GetLogicServerUrl: function () {
31-
return PlayFab._internalSettings.logicServerUrl;
32-
},
33-
3429
ExecuteRequest: function (completeUrl, data, authkey, authValue, callback) {
3530
if (callback != null && typeof (callback) != "function")
3631
throw "Callback must be null of a function";

PlayFabSDK/PlayFabClientApi.js

Lines changed: 3 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,21 @@ if(!PlayFab.settings) {
1111
// Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly
1212
disableAdvertising: false,
1313
AD_TYPE_IDFA: "Idfa",
14-
AD_TYPE_ANDROID_ID: "Android_Id"
14+
AD_TYPE_ANDROID_ID: "Adid"
1515
}
1616
}
1717

1818
if(!PlayFab._internalSettings) {
1919
PlayFab._internalSettings = {
2020
sessionTicket: null,
21-
sdkVersion: "0.31.161003",
21+
sdkVersion: "0.32.161017",
2222
buildIdentifier: "jbuild_javascriptsdk_1",
2323
productionServerUrl: ".playfabapi.com",
24-
logicServerUrl: null,
2524

2625
GetServerUrl: function () {
2726
return "https://" + PlayFab.settings.titleId + PlayFab._internalSettings.productionServerUrl;
2827
},
2928

30-
GetLogicServerUrl: function () {
31-
return PlayFab._internalSettings.logicServerUrl;
32-
},
33-
3429
ExecuteRequest: function (completeUrl, data, authkey, authValue, callback) {
3530
if (callback != null && typeof (callback) != "function")
3631
throw "Callback must be null of a function";
@@ -496,15 +491,6 @@ PlayFab.ClientApi = {
496491
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/GetFriendLeaderboard", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
497492
},
498493

499-
/**
500-
* @deprecated Please use GetFriendLeaderboardAroundPlayer instead.
501-
*/
502-
GetFriendLeaderboardAroundCurrentUser: function (request, callback) {
503-
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
504-
505-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/GetFriendLeaderboardAroundCurrentUser", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
506-
},
507-
508494
GetFriendLeaderboardAroundPlayer: function (request, callback) {
509495
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
510496

@@ -517,15 +503,6 @@ PlayFab.ClientApi = {
517503
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/GetLeaderboard", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
518504
},
519505

520-
/**
521-
* @deprecated Please use GetLeaderboardAroundPlayer instead.
522-
*/
523-
GetLeaderboardAroundCurrentUser: function (request, callback) {
524-
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
525-
526-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/GetLeaderboardAroundCurrentUser", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
527-
},
528-
529506
GetLeaderboardAroundPlayer: function (request, callback) {
530507
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
531508

@@ -568,15 +545,6 @@ PlayFab.ClientApi = {
568545
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/GetUserReadOnlyData", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
569546
},
570547

571-
/**
572-
* @deprecated Please use GetPlayerStatistics instead.
573-
*/
574-
GetUserStatistics: function (request, callback) {
575-
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
576-
577-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/GetUserStatistics", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
578-
},
579-
580548
UpdatePlayerStatistics: function (request, callback) {
581549
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
582550

@@ -595,15 +563,6 @@ PlayFab.ClientApi = {
595563
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/UpdateUserPublisherData", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
596564
},
597565

598-
/**
599-
* @deprecated Please use UpdatePlayerStatistics instead.
600-
*/
601-
UpdateUserStatistics: function (request, callback) {
602-
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
603-
604-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/UpdateUserStatistics", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
605-
},
606-
607566
GetCatalogItems: function (request, callback) {
608567
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
609568

@@ -796,15 +755,6 @@ PlayFab.ClientApi = {
796755
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/ValidateGooglePlayPurchase", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
797756
},
798757

799-
/**
800-
* @deprecated Please use WritePlayerEvent instead.
801-
*/
802-
LogEvent: function (request, callback) {
803-
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
804-
805-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/LogEvent", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
806-
},
807-
808758
WriteCharacterEvent: function (request, callback) {
809759
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
810760

@@ -859,29 +809,6 @@ PlayFab.ClientApi = {
859809
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/ExecuteCloudScript", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
860810
},
861811

862-
/**
863-
* @deprecated Please use ExecuteCloudScript instead.
864-
*/
865-
GetCloudScriptUrl: function (request, callback) {
866-
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
867-
868-
var overloadCallback = function (result, error) {
869-
PlayFab._internalSettings.logicServerUrl = result.data.Url;
870-
if (callback != null && typeof (callback) == "function")
871-
callback(result, error);
872-
};
873-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Client/GetCloudScriptUrl", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, overloadCallback);
874-
},
875-
876-
/**
877-
* @deprecated Please use ExecuteCloudScript instead.
878-
*/
879-
RunCloudScript: function (request, callback) {
880-
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
881-
882-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetLogicServerUrl() + "/Client/RunCloudScript", request, "X-Authorization", PlayFab._internalSettings.sessionTicket, callback);
883-
},
884-
885812
GetContentDownloadUrl: function (request, callback) {
886813
if (PlayFab._internalSettings.sessionTicket == null) throw "Must be logged in to call this method";
887814

@@ -1015,7 +942,7 @@ PlayFab.ClientApi = {
1015942
if (PlayFab.settings.advertisingIdType === PlayFab.settings.AD_TYPE_IDFA)
1016943
request.Idfa = PlayFab.settings.advertisingIdValue;
1017944
else if (PlayFab.settings.advertisingIdType === PlayFab.settings.AD_TYPE_ANDROID_ID)
1018-
request.Android_Id = PlayFab.settings.advertisingIdValue;
945+
request.Adid = PlayFab.settings.advertisingIdValue;
1019946
else
1020947
return;
1021948
PlayFab.ClientApi.AttributeInstall(request, null);

PlayFabSDK/PlayFabMatchmakerApi.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,21 @@ if(!PlayFab.settings) {
1111
// Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly
1212
disableAdvertising: false,
1313
AD_TYPE_IDFA: "Idfa",
14-
AD_TYPE_ANDROID_ID: "Android_Id"
14+
AD_TYPE_ANDROID_ID: "Adid"
1515
}
1616
}
1717

1818
if(!PlayFab._internalSettings) {
1919
PlayFab._internalSettings = {
2020
sessionTicket: null,
21-
sdkVersion: "0.31.161003",
21+
sdkVersion: "0.32.161017",
2222
buildIdentifier: "jbuild_javascriptsdk_1",
2323
productionServerUrl: ".playfabapi.com",
24-
logicServerUrl: null,
2524

2625
GetServerUrl: function () {
2726
return "https://" + PlayFab.settings.titleId + PlayFab._internalSettings.productionServerUrl;
2827
},
2928

30-
GetLogicServerUrl: function () {
31-
return PlayFab._internalSettings.logicServerUrl;
32-
},
33-
3429
ExecuteRequest: function (completeUrl, data, authkey, authValue, callback) {
3530
if (callback != null && typeof (callback) != "function")
3631
throw "Callback must be null of a function";

PlayFabSDK/PlayFabServerApi.js

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,21 @@ if(!PlayFab.settings) {
1111
// Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly
1212
disableAdvertising: false,
1313
AD_TYPE_IDFA: "Idfa",
14-
AD_TYPE_ANDROID_ID: "Android_Id"
14+
AD_TYPE_ANDROID_ID: "Adid"
1515
}
1616
}
1717

1818
if(!PlayFab._internalSettings) {
1919
PlayFab._internalSettings = {
2020
sessionTicket: null,
21-
sdkVersion: "0.31.161003",
21+
sdkVersion: "0.32.161017",
2222
buildIdentifier: "jbuild_javascriptsdk_1",
2323
productionServerUrl: ".playfabapi.com",
24-
logicServerUrl: null,
2524

2625
GetServerUrl: function () {
2726
return "https://" + PlayFab.settings.titleId + PlayFab._internalSettings.productionServerUrl;
2827
},
2928

30-
GetLogicServerUrl: function () {
31-
return PlayFab._internalSettings.logicServerUrl;
32-
},
33-
3429
ExecuteRequest: function (completeUrl, data, authkey, authValue, callback) {
3530
if (callback != null && typeof (callback) != "function")
3631
throw "Callback must be null of a function";
@@ -244,15 +239,6 @@ PlayFab.ServerApi = {
244239
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/GetUserReadOnlyData", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
245240
},
246241

247-
/**
248-
* @deprecated Please use GetPlayerStatistics instead.
249-
*/
250-
GetUserStatistics: function (request, callback) {
251-
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
252-
253-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/GetUserStatistics", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
254-
},
255-
256242
UpdatePlayerStatistics: function (request, callback) {
257243
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
258244

@@ -295,15 +281,6 @@ PlayFab.ServerApi = {
295281
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/UpdateUserReadOnlyData", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
296282
},
297283

298-
/**
299-
* @deprecated Please use UpdatePlayerStatistics instead.
300-
*/
301-
UpdateUserStatistics: function (request, callback) {
302-
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
303-
304-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/UpdateUserStatistics", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
305-
},
306-
307284
GetCatalogItems: function (request, callback) {
308285
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
309286

@@ -562,15 +539,6 @@ PlayFab.ServerApi = {
562539
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/AwardSteamAchievement", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
563540
},
564541

565-
/**
566-
* @deprecated Please use WritePlayerEvent instead.
567-
*/
568-
LogEvent: function (request, callback) {
569-
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
570-
571-
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/LogEvent", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
572-
},
573-
574542
WriteCharacterEvent: function (request, callback) {
575543
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
576544

0 commit comments

Comments
 (0)