Skip to content

Commit cf20b06

Browse files
https://api.playfab.com/releaseNotes/#180906
1 parent 532d600 commit cf20b06

31 files changed

+504
-83
lines changed

PlayFabSdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "playfab-web-sdk",
3-
"version": "1.29.180829",
3+
"version": "1.30.180906",
44
"description": "Playfab SDK for JS client applications",
55
"license": "Apache-2.0",
66
"repository": {

PlayFabSdk/src/PlayFab/PlayFabAdminApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121
if(!PlayFab._internalSettings) {
2222
PlayFab._internalSettings = {
2323
entityToken: null,
24-
sdkVersion: "1.29.180829",
24+
sdkVersion: "1.30.180906",
2525
requestGetParams: {
26-
sdk: "JavaScriptSDK-1.29.180829"
26+
sdk: "JavaScriptSDK-1.30.180906"
2727
},
2828
sessionTicket: null,
2929
productionServerUrl: ".playfabapi.com",
@@ -147,8 +147,8 @@ if(!PlayFab._internalSettings) {
147147
}
148148
}
149149

150-
PlayFab.buildIdentifier = "default_manual_build";
151-
PlayFab.sdkVersion = "1.29.180829";
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152152
PlayFab.GenerateErrorReport = function (error) {
153153
if (error == null)
154154
return "";

PlayFabSdk/src/PlayFab/PlayFabAuthenticationApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121
if(!PlayFab._internalSettings) {
2222
PlayFab._internalSettings = {
2323
entityToken: null,
24-
sdkVersion: "1.29.180829",
24+
sdkVersion: "1.30.180906",
2525
requestGetParams: {
26-
sdk: "JavaScriptSDK-1.29.180829"
26+
sdk: "JavaScriptSDK-1.30.180906"
2727
},
2828
sessionTicket: null,
2929
productionServerUrl: ".playfabapi.com",
@@ -147,8 +147,8 @@ if(!PlayFab._internalSettings) {
147147
}
148148
}
149149

150-
PlayFab.buildIdentifier = "default_manual_build";
151-
PlayFab.sdkVersion = "1.29.180829";
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152152
PlayFab.GenerateErrorReport = function (error) {
153153
if (error == null)
154154
return "";

PlayFabSdk/src/PlayFab/PlayFabClientApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121
if(!PlayFab._internalSettings) {
2222
PlayFab._internalSettings = {
2323
entityToken: null,
24-
sdkVersion: "1.29.180829",
24+
sdkVersion: "1.30.180906",
2525
requestGetParams: {
26-
sdk: "JavaScriptSDK-1.29.180829"
26+
sdk: "JavaScriptSDK-1.30.180906"
2727
},
2828
sessionTicket: null,
2929
productionServerUrl: ".playfabapi.com",
@@ -147,8 +147,8 @@ if(!PlayFab._internalSettings) {
147147
}
148148
}
149149

150-
PlayFab.buildIdentifier = "default_manual_build";
151-
PlayFab.sdkVersion = "1.29.180829";
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152152
PlayFab.GenerateErrorReport = function (error) {
153153
if (error == null)
154154
return "";

PlayFabSdk/src/PlayFab/PlayFabCloudScriptApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121
if(!PlayFab._internalSettings) {
2222
PlayFab._internalSettings = {
2323
entityToken: null,
24-
sdkVersion: "1.29.180829",
24+
sdkVersion: "1.30.180906",
2525
requestGetParams: {
26-
sdk: "JavaScriptSDK-1.29.180829"
26+
sdk: "JavaScriptSDK-1.30.180906"
2727
},
2828
sessionTicket: null,
2929
productionServerUrl: ".playfabapi.com",
@@ -147,8 +147,8 @@ if(!PlayFab._internalSettings) {
147147
}
148148
}
149149

150-
PlayFab.buildIdentifier = "default_manual_build";
151-
PlayFab.sdkVersion = "1.29.180829";
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152152
PlayFab.GenerateErrorReport = function (error) {
153153
if (error == null)
154154
return "";

PlayFabSdk/src/PlayFab/PlayFabDataApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121
if(!PlayFab._internalSettings) {
2222
PlayFab._internalSettings = {
2323
entityToken: null,
24-
sdkVersion: "1.29.180829",
24+
sdkVersion: "1.30.180906",
2525
requestGetParams: {
26-
sdk: "JavaScriptSDK-1.29.180829"
26+
sdk: "JavaScriptSDK-1.30.180906"
2727
},
2828
sessionTicket: null,
2929
productionServerUrl: ".playfabapi.com",
@@ -147,8 +147,8 @@ if(!PlayFab._internalSettings) {
147147
}
148148
}
149149

150-
PlayFab.buildIdentifier = "default_manual_build";
151-
PlayFab.sdkVersion = "1.29.180829";
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152152
PlayFab.GenerateErrorReport = function (error) {
153153
if (error == null)
154154
return "";

PlayFabSdk/src/PlayFab/PlayFabEventsApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121
if(!PlayFab._internalSettings) {
2222
PlayFab._internalSettings = {
2323
entityToken: null,
24-
sdkVersion: "1.29.180829",
24+
sdkVersion: "1.30.180906",
2525
requestGetParams: {
26-
sdk: "JavaScriptSDK-1.29.180829"
26+
sdk: "JavaScriptSDK-1.30.180906"
2727
},
2828
sessionTicket: null,
2929
productionServerUrl: ".playfabapi.com",
@@ -147,8 +147,8 @@ if(!PlayFab._internalSettings) {
147147
}
148148
}
149149

150-
PlayFab.buildIdentifier = "default_manual_build";
151-
PlayFab.sdkVersion = "1.29.180829";
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152152
PlayFab.GenerateErrorReport = function (error) {
153153
if (error == null)
154154
return "";

PlayFabSdk/src/PlayFab/PlayFabGroupsApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121
if(!PlayFab._internalSettings) {
2222
PlayFab._internalSettings = {
2323
entityToken: null,
24-
sdkVersion: "1.29.180829",
24+
sdkVersion: "1.30.180906",
2525
requestGetParams: {
26-
sdk: "JavaScriptSDK-1.29.180829"
26+
sdk: "JavaScriptSDK-1.30.180906"
2727
},
2828
sessionTicket: null,
2929
productionServerUrl: ".playfabapi.com",
@@ -147,8 +147,8 @@ if(!PlayFab._internalSettings) {
147147
}
148148
}
149149

150-
PlayFab.buildIdentifier = "default_manual_build";
151-
PlayFab.sdkVersion = "1.29.180829";
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152152
PlayFab.GenerateErrorReport = function (error) {
153153
if (error == null)
154154
return "";
Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
/// <reference path="../typings/PlayFab/PlayFabLocalizationApi.d.ts" />
2+
3+
var PlayFab = typeof PlayFab != "undefined" ? PlayFab : {};
4+
5+
if(!PlayFab.settings) {
6+
PlayFab.settings = {
7+
titleId: null, // You must set this value for PlayFabSdk to work properly (Found in the Game Manager for your title, at the PlayFab Website)
8+
developerSecretKey: null, // For security reasons you must never expose this value to the client or players - You must set this value for Server-APIs to work properly (Found in the Game Manager for your title, at the PlayFab Website)
9+
advertisingIdType: null,
10+
advertisingIdValue: null,
11+
GlobalHeaderInjection: null,
12+
13+
// disableAdvertising is provided for completeness, but changing it is not suggested
14+
// Disabling this may prevent your advertising-related PlayFab marketplace partners from working correctly
15+
disableAdvertising: false,
16+
AD_TYPE_IDFA: "Idfa",
17+
AD_TYPE_ANDROID_ID: "Adid"
18+
}
19+
}
20+
21+
if(!PlayFab._internalSettings) {
22+
PlayFab._internalSettings = {
23+
entityToken: null,
24+
sdkVersion: "1.30.180906",
25+
requestGetParams: {
26+
sdk: "JavaScriptSDK-1.30.180906"
27+
},
28+
sessionTicket: null,
29+
productionServerUrl: ".playfabapi.com",
30+
errorTitleId: "Must be have PlayFab.settings.titleId set to call this method",
31+
errorLoggedIn: "Must be logged in to call this method",
32+
errorEntityToken: "You must successfully call GetEntityToken before calling this",
33+
errorSecretKey: "Must have PlayFab.settings.developerSecretKey set to call this method",
34+
35+
GetServerUrl: function () {
36+
return "https://" + PlayFab.settings.titleId + PlayFab._internalSettings.productionServerUrl;
37+
},
38+
39+
InjectHeaders: function (xhr, headersObj) {
40+
if (!headersObj)
41+
return;
42+
43+
for (var headerKey in headersObj)
44+
{
45+
try {
46+
xhr.setRequestHeader(gHeaderKey, headersObj[headerKey]);
47+
} catch (e) {
48+
console.log("Failed to append header: " + headerKey + " = " + headersObj[headerKey] + "Error: " + e);
49+
}
50+
}
51+
},
52+
53+
ExecuteRequest: function (url, request, authkey, authValue, callback, customData, extraHeaders) {
54+
if (callback != null && typeof (callback) != "function")
55+
throw "Callback must be null of a function";
56+
57+
if (request == null)
58+
request = {};
59+
60+
var startTime = new Date();
61+
var requestBody = JSON.stringify(request);
62+
63+
var urlArr = [url];
64+
var getParams = PlayFab._internalSettings.requestGetParams;
65+
if (getParams != null) {
66+
var firstParam = true;
67+
for (var key in getParams) {
68+
if (firstParam) {
69+
urlArr.push("?");
70+
firstParam = false;
71+
} else {
72+
urlArr.push("&");
73+
}
74+
urlArr.push(key);
75+
urlArr.push("=");
76+
urlArr.push(getParams[key]);
77+
}
78+
}
79+
80+
var completeUrl = urlArr.join("");
81+
82+
var xhr = new XMLHttpRequest();
83+
// window.console.log("URL: " + completeUrl);
84+
xhr.open("POST", completeUrl, true);
85+
86+
xhr.setRequestHeader("Content-Type", "application/json");
87+
xhr.setRequestHeader("X-PlayFabSDK", "JavaScriptSDK-" + PlayFab._internalSettings.sdkVersion);
88+
if (authkey != null)
89+
xhr.setRequestHeader(authkey, authValue);
90+
PlayFab._internalSettings.InjectHeaders(xhr, PlayFab.settings.GlobalHeaderInjection);
91+
PlayFab._internalSettings.InjectHeaders(xhr, extraHeaders);
92+
93+
xhr.onloadend = function () {
94+
if (callback == null)
95+
return;
96+
97+
var result;
98+
try {
99+
// window.console.log("parsing json result: " + xhr.responseText);
100+
result = JSON.parse(xhr.responseText);
101+
} catch (e) {
102+
result = {
103+
code: 503, // Service Unavailable
104+
status: "Service Unavailable",
105+
error: "Connection error",
106+
errorCode: 2, // PlayFabErrorCode.ConnectionError
107+
errorMessage: xhr.responseText
108+
};
109+
}
110+
111+
result.CallBackTimeMS = new Date() - startTime;
112+
result.Request = request;
113+
result.CustomData = customData;
114+
115+
if (result.code === 200)
116+
callback(result, null);
117+
else
118+
callback(null, result);
119+
}
120+
121+
xhr.onerror = function () {
122+
if (callback == null)
123+
return;
124+
125+
var result;
126+
try {
127+
result = JSON.parse(xhr.responseText);
128+
} catch (e) {
129+
result = {
130+
code: 503, // Service Unavailable
131+
status: "Service Unavailable",
132+
error: "Connection error",
133+
errorCode: 2, // PlayFabErrorCode.ConnectionError
134+
errorMessage: xhr.responseText
135+
};
136+
}
137+
138+
result.CallBackTimeMS = new Date() - startTime;
139+
result.Request = request;
140+
result.CustomData = customData;
141+
142+
callback(null, result);
143+
}
144+
145+
xhr.send(requestBody);
146+
}
147+
}
148+
}
149+
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152+
PlayFab.GenerateErrorReport = function (error) {
153+
if (error == null)
154+
return "";
155+
var fullErrors = error.errorMessage;
156+
for (var paramName in error.errorDetails)
157+
for (var msgIdx in error.errorDetails[paramName])
158+
fullErrors += "\n" + paramName + ": " + error.errorDetails[paramName][msgIdx];
159+
return fullErrors;
160+
};
161+
162+
PlayFab.LocalizationApi = {
163+
ForgetAllCredentials: function () {
164+
PlayFab._internalSettings.sessionTicket = null;
165+
PlayFab._internalSettings.entityToken = null;
166+
},
167+
168+
GetLanguageList: function (request, callback, customData, extraHeaders) {
169+
if (!PlayFab._internalSettings.entityToken) throw PlayFab._internalSettings.errorEntityToken;
170+
PlayFab._internalSettings.ExecuteRequest(PlayFab._internalSettings.GetServerUrl() + "/Locale/GetLanguageList", request, "X-EntityToken", PlayFab._internalSettings.entityToken, callback, customData, extraHeaders);
171+
},
172+
};
173+
174+
var PlayFabLocalizationSDK = PlayFab.LocalizationApi;
175+

PlayFabSdk/src/PlayFab/PlayFabMatchmakerApi.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ if(!PlayFab.settings) {
2121
if(!PlayFab._internalSettings) {
2222
PlayFab._internalSettings = {
2323
entityToken: null,
24-
sdkVersion: "1.29.180829",
24+
sdkVersion: "1.30.180906",
2525
requestGetParams: {
26-
sdk: "JavaScriptSDK-1.29.180829"
26+
sdk: "JavaScriptSDK-1.30.180906"
2727
},
2828
sessionTicket: null,
2929
productionServerUrl: ".playfabapi.com",
@@ -147,8 +147,8 @@ if(!PlayFab._internalSettings) {
147147
}
148148
}
149149

150-
PlayFab.buildIdentifier = "default_manual_build";
151-
PlayFab.sdkVersion = "1.29.180829";
150+
PlayFab.buildIdentifier = "jbuild_javascriptsdk__sdk-slave2016-3_1";
151+
PlayFab.sdkVersion = "1.30.180906";
152152
PlayFab.GenerateErrorReport = function (error) {
153153
if (error == null)
154154
return "";

0 commit comments

Comments
 (0)