Skip to content

Commit e47cacb

Browse files
author
pgilmorepf
committed
https://api.playfab.com/releaseNotes/#160919
2 parents ff9fbdb + 2062151 commit e47cacb

File tree

7 files changed

+83
-15
lines changed

7 files changed

+83
-15
lines changed

PlayFabApiTest.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<div id="qunit-fixture"></div>
1111
<script src="https://code.jquery.com/jquery-1.7.1.min.js"></script><!-- HTTP vs HTTPS here should match where this file is hosted (This file is not strictly meant to be hosted, but rather run locally) -->
1212
<script src="code.jquery.com/qunit/qunit-1.19.0.js"></script>
13-
<script src="PlayFabSDK/PlayFabAdminApi.js"></script>
14-
<script src="PlayFabSDK/PlayFabClientApi.js"></script>
15-
<script src="PlayFabSDK/PlayFabMatchmakerApi.js"></script>
16-
<script src="PlayFabSDK/PlayFabServerApi.js"></script>
13+
<script src="https://download.playfab.com/PlayFabAdminApi.js"></script>
14+
<script src="https://download.playfab.com/PlayFabClientApi.js"></script>
15+
<script src="https://download.playfab.com/PlayFabMatchmakerApi.js"></script>
16+
<script src="https://download.playfab.com/PlayFabServerApi.js"></script>
1717
<script src="PlayFabApiTest.js"></script>
1818
</body>
1919
</html>

PlayFabApiTest.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,17 @@ QUnit.done(function (details) {
588588
FunctionParameter: { customId: PlayFab._internalSettings.buildIdentifier, testReport: PfTestReport },
589589
GeneratePlayStreamEvent: true
590590
};
591+
var onSaveResultsFinal = function (result, error) {
592+
if (result && !error) {
593+
console.log(PlayFabApiTests.testData.playFabId, ", Test report saved to CloudScript: ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
594+
} else {
595+
console.log(PlayFabApiTests.testData.playFabId, ", Failed to save test report to CloudScript (CS Error): ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
596+
}
597+
};
591598
if (PlayFabClientSDK.IsClientLoggedIn()) {
592-
PlayFabClientSDK.ExecuteCloudScript(saveResultsRequest, null);
593-
console.log(PlayFabApiTests.testData.playFabId, ", Test report saved to CloudScript: ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
599+
PlayFabClientSDK.ExecuteCloudScript(saveResultsRequest, onSaveResultsFinal);
594600
} else {
595-
console.log(PlayFabApiTests.testData.playFabId, ", Failed to save test report to CloudScript: ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
601+
console.log(PlayFabApiTests.testData.playFabId, ", Failed to save test report to CloudScript (Login): ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
596602
}
597603
});
598604

PlayFabSDK/PlayFabAdminApi.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ if(!PlayFab.settings) {
1818
if(!PlayFab._internalSettings) {
1919
PlayFab._internalSettings = {
2020
sessionTicket: null,
21-
sdkVersion: "0.29.160912",
22-
buildIdentifier: "jbuild_javascriptsdk_1",
21+
sdkVersion: "0.30.160919",
22+
buildIdentifier: "jbuild_javascriptsdk_0",
2323
productionServerUrl: ".playfabapi.com",
2424
logicServerUrl: null,
2525

@@ -232,12 +232,24 @@ PlayFab.AdminApi = {
232232
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/IncrementPlayerStatisticVersion", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
233233
},
234234

235+
RefundPurchase: function (request, callback) {
236+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
237+
238+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/RefundPurchase", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
239+
},
240+
235241
ResetUserStatistics: function (request, callback) {
236242
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
237243

238244
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/ResetUserStatistics", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
239245
},
240246

247+
ResolvePurchaseDispute: function (request, callback) {
248+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
249+
250+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Admin/ResolvePurchaseDispute", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
251+
},
252+
241253
UpdatePlayerStatisticDefinition: function (request, callback) {
242254
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
243255

PlayFabSDK/PlayFabClientApi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ if(!PlayFab.settings) {
1818
if(!PlayFab._internalSettings) {
1919
PlayFab._internalSettings = {
2020
sessionTicket: null,
21-
sdkVersion: "0.29.160912",
22-
buildIdentifier: "jbuild_javascriptsdk_1",
21+
sdkVersion: "0.30.160919",
22+
buildIdentifier: "jbuild_javascriptsdk_0",
2323
productionServerUrl: ".playfabapi.com",
2424
logicServerUrl: null,
2525

PlayFabSDK/PlayFabMatchmakerApi.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ if(!PlayFab.settings) {
1818
if(!PlayFab._internalSettings) {
1919
PlayFab._internalSettings = {
2020
sessionTicket: null,
21-
sdkVersion: "0.29.160912",
22-
buildIdentifier: "jbuild_javascriptsdk_1",
21+
sdkVersion: "0.30.160919",
22+
buildIdentifier: "jbuild_javascriptsdk_0",
2323
productionServerUrl: ".playfabapi.com",
2424
logicServerUrl: null,
2525

PlayFabSDK/PlayFabServerApi.js

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ if(!PlayFab.settings) {
1818
if(!PlayFab._internalSettings) {
1919
PlayFab._internalSettings = {
2020
sessionTicket: null,
21-
sdkVersion: "0.29.160912",
22-
buildIdentifier: "jbuild_javascriptsdk_1",
21+
sdkVersion: "0.30.160919",
22+
buildIdentifier: "jbuild_javascriptsdk_0",
2323
productionServerUrl: ".playfabapi.com",
2424
logicServerUrl: null,
2525

@@ -172,6 +172,12 @@ PlayFab.ServerApi = {
172172
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/DeleteUsers", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
173173
},
174174

175+
GetFriendLeaderboard: function (request, callback) {
176+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
177+
178+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/GetFriendLeaderboard", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
179+
},
180+
175181
GetLeaderboard: function (request, callback) {
176182
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
177183

@@ -478,6 +484,30 @@ PlayFab.ServerApi = {
478484
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/UpdateUserInventoryItemCustomData", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
479485
},
480486

487+
AddFriend: function (request, callback) {
488+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
489+
490+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/AddFriend", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
491+
},
492+
493+
GetFriendsList: function (request, callback) {
494+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
495+
496+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/GetFriendsList", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
497+
},
498+
499+
RemoveFriend: function (request, callback) {
500+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
501+
502+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/RemoveFriend", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
503+
},
504+
505+
DeregisterGame: function (request, callback) {
506+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
507+
508+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/DeregisterGame", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
509+
},
510+
481511
NotifyMatchmakerPlayerLeft: function (request, callback) {
482512
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
483513

@@ -490,6 +520,18 @@ PlayFab.ServerApi = {
490520
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/RedeemMatchmakerTicket", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
491521
},
492522

523+
RefreshGameServerInstanceHeartbeat: function (request, callback) {
524+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
525+
526+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/RefreshGameServerInstanceHeartbeat", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
527+
},
528+
529+
RegisterGame: function (request, callback) {
530+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
531+
532+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/RegisterGame", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
533+
},
534+
493535
SetGameServerInstanceData: function (request, callback) {
494536
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
495537

@@ -502,6 +544,12 @@ PlayFab.ServerApi = {
502544
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/SetGameServerInstanceState", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
503545
},
504546

547+
SetGameServerInstanceTags: function (request, callback) {
548+
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
549+
550+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Server/SetGameServerInstanceTags", request, "X-SecretKey", PlayFab.settings.developerSecretKey, callback);
551+
},
552+
505553
AwardSteamAchievement: function (request, callback) {
506554
if (PlayFab.settings.developerSecretKey == null) throw "Must have PlayFab.settings.developerSecretKey set to call this method";
507555

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ These files are an internal PlayFab testing project, which activates and tests t
2222

2323
They require a testTitleData.json file to exist, which is described below.
2424

25+
This SDK can alternatively be obtained via our CDN. Additional details can be found [here](https://playfab.com/playfab-now-serving-javascript-sdk-via-cdn/).
26+
2527

2628
4. testTitleData.json file required for example test files.
2729
----

0 commit comments

Comments
 (0)