Skip to content

Commit e174619

Browse files
author
Playfab Jenkins Bot
committed
https://api.playfab.com/releaseNotes/#161121
2 parents cc40800 + a63615d commit e174619

File tree

13 files changed

+408
-34
lines changed

13 files changed

+408
-34
lines changed

AndroidStudioExample/app/src/main/java/com/playfab/PlayFabClientModels.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
288288
*/
289289
public Boolean IsLimitedEdition;
290290
/**
291-
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
291+
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
292292
*/
293293
public Integer InitialLimitedEditionCount;
294294

@@ -323,7 +323,7 @@ public static class CatalogItemConsumableInfo {
323323
*/
324324
public Long UsageCount;
325325
/**
326-
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
326+
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
327327
*/
328328
public Long UsagePeriod;
329329
/**

AndroidStudioExample/app/src/main/java/com/playfab/PlayFabSettings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import com.playfab.PlayFabErrors.ErrorCallback;
55

66
public class PlayFabSettings {
7-
public static String SdkVersion = "0.40.161107";
7+
public static String SdkVersion = "0.41.161121";
88
public static String BuildIdentifier = "jbuild_javasdk_1";
9-
public static String SdkVersionString = "JavaSDK-0.40.161107";
9+
public static String SdkVersionString = "JavaSDK-0.41.161121";
1010

1111
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)
1212
public static ErrorCallback GlobalErrorHandler;

PlayFabClientSDK/src/com/playfab/PlayFabClientModels.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
288288
*/
289289
public Boolean IsLimitedEdition;
290290
/**
291-
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
291+
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
292292
*/
293293
public Integer InitialLimitedEditionCount;
294294

@@ -323,7 +323,7 @@ public static class CatalogItemConsumableInfo {
323323
*/
324324
public Long UsageCount;
325325
/**
326-
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
326+
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
327327
*/
328328
public Long UsagePeriod;
329329
/**

PlayFabClientSDK/src/com/playfab/PlayFabSettings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import com.playfab.PlayFabErrors.ErrorCallback;
44

55
public class PlayFabSettings {
6-
public static String SdkVersion = "0.40.161107";
6+
public static String SdkVersion = "0.41.161121";
77
public static String BuildIdentifier = "jbuild_javasdk_1";
8-
public static String SdkVersionString = "JavaSDK-0.40.161107";
8+
public static String SdkVersionString = "JavaSDK-0.41.161121";
99

1010
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)
1111
public static ErrorCallback GlobalErrorHandler;

PlayFabSDK/src/com/playfab/PlayFabAdminAPI.java

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,122 @@
1616
public class PlayFabAdminAPI {
1717
private static Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'").create();
1818

19+
/**
20+
* Gets the requested policy.
21+
*/
22+
@SuppressWarnings("unchecked")
23+
public static FutureTask<PlayFabResult<GetPolicyResponse>> GetPolicyAsync(final GetPolicyRequest request) {
24+
return new FutureTask(new Callable<PlayFabResult<GetPolicyResponse>>() {
25+
public PlayFabResult<GetPolicyResponse> call() throws Exception {
26+
return privateGetPolicyAsync(request);
27+
}
28+
});
29+
}
30+
31+
/**
32+
* Gets the requested policy.
33+
*/
34+
@SuppressWarnings("unchecked")
35+
public static PlayFabResult<GetPolicyResponse> GetPolicy(final GetPolicyRequest request) {
36+
FutureTask<PlayFabResult<GetPolicyResponse>> task = new FutureTask(new Callable<PlayFabResult<GetPolicyResponse>>() {
37+
public PlayFabResult<GetPolicyResponse> call() throws Exception {
38+
return privateGetPolicyAsync(request);
39+
}
40+
});
41+
try {
42+
task.run();
43+
return task.get();
44+
} catch(Exception e) {
45+
return null;
46+
}
47+
}
48+
49+
/**
50+
* Gets the requested policy.
51+
*/
52+
@SuppressWarnings("unchecked")
53+
private static PlayFabResult<GetPolicyResponse> privateGetPolicyAsync(final GetPolicyRequest request) throws Exception {
54+
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");
55+
56+
FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/GetPolicy", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
57+
task.run();
58+
Object httpResult = task.get();
59+
if(httpResult instanceof PlayFabError) {
60+
PlayFabError error = (PlayFabError)httpResult;
61+
if (PlayFabSettings.GlobalErrorHandler != null)
62+
PlayFabSettings.GlobalErrorHandler.callback(error);
63+
PlayFabResult result = new PlayFabResult<GetPolicyResponse>();
64+
result.Error = error;
65+
return result;
66+
}
67+
String resultRawJson = (String) httpResult;
68+
69+
PlayFabJsonSuccess<GetPolicyResponse> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<GetPolicyResponse>>(){}.getType());
70+
GetPolicyResponse result = resultData.data;
71+
72+
PlayFabResult<GetPolicyResponse> pfResult = new PlayFabResult<GetPolicyResponse>();
73+
pfResult.Result = result;
74+
return pfResult;
75+
}
76+
77+
/**
78+
* Changes a policy for a title
79+
*/
80+
@SuppressWarnings("unchecked")
81+
public static FutureTask<PlayFabResult<UpdatePolicyResponse>> UpdatePolicyAsync(final UpdatePolicyRequest request) {
82+
return new FutureTask(new Callable<PlayFabResult<UpdatePolicyResponse>>() {
83+
public PlayFabResult<UpdatePolicyResponse> call() throws Exception {
84+
return privateUpdatePolicyAsync(request);
85+
}
86+
});
87+
}
88+
89+
/**
90+
* Changes a policy for a title
91+
*/
92+
@SuppressWarnings("unchecked")
93+
public static PlayFabResult<UpdatePolicyResponse> UpdatePolicy(final UpdatePolicyRequest request) {
94+
FutureTask<PlayFabResult<UpdatePolicyResponse>> task = new FutureTask(new Callable<PlayFabResult<UpdatePolicyResponse>>() {
95+
public PlayFabResult<UpdatePolicyResponse> call() throws Exception {
96+
return privateUpdatePolicyAsync(request);
97+
}
98+
});
99+
try {
100+
task.run();
101+
return task.get();
102+
} catch(Exception e) {
103+
return null;
104+
}
105+
}
106+
107+
/**
108+
* Changes a policy for a title
109+
*/
110+
@SuppressWarnings("unchecked")
111+
private static PlayFabResult<UpdatePolicyResponse> privateUpdatePolicyAsync(final UpdatePolicyRequest request) throws Exception {
112+
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");
113+
114+
FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Admin/UpdatePolicy", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
115+
task.run();
116+
Object httpResult = task.get();
117+
if(httpResult instanceof PlayFabError) {
118+
PlayFabError error = (PlayFabError)httpResult;
119+
if (PlayFabSettings.GlobalErrorHandler != null)
120+
PlayFabSettings.GlobalErrorHandler.callback(error);
121+
PlayFabResult result = new PlayFabResult<UpdatePolicyResponse>();
122+
result.Error = error;
123+
return result;
124+
}
125+
String resultRawJson = (String) httpResult;
126+
127+
PlayFabJsonSuccess<UpdatePolicyResponse> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<UpdatePolicyResponse>>(){}.getType());
128+
UpdatePolicyResponse result = resultData.data;
129+
130+
PlayFabResult<UpdatePolicyResponse> pfResult = new PlayFabResult<UpdatePolicyResponse>();
131+
pfResult.Result = result;
132+
return pfResult;
133+
}
134+
19135
/**
20136
* Bans users by PlayFab ID with optional IP address, or MAC address for the provided game.
21137
*/

PlayFabSDK/src/com/playfab/PlayFabAdminModels.java

Lines changed: 79 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
393393
*/
394394
public Boolean IsLimitedEdition;
395395
/**
396-
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
396+
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
397397
*/
398398
public Integer InitialLimitedEditionCount;
399399

@@ -428,7 +428,7 @@ public static class CatalogItemConsumableInfo {
428428
*/
429429
public Long UsageCount;
430430
/**
431-
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
431+
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
432432
*/
433433
public Long UsagePeriod;
434434
/**
@@ -1114,6 +1114,10 @@ public static class DeleteUsersResult {
11141114

11151115
}
11161116

1117+
public static enum EffectType {
1118+
Allow
1119+
}
1120+
11171121
public static class EmptyResult {
11181122

11191123
}
@@ -1554,6 +1558,26 @@ public static class GetPlayerTagsResult {
15541558

15551559
}
15561560

1561+
public static class GetPolicyRequest {
1562+
/**
1563+
* The name of the policy to read. Only supported name is 'ApiPolicy'.
1564+
*/
1565+
public String PolicyName;
1566+
1567+
}
1568+
1569+
public static class GetPolicyResponse {
1570+
/**
1571+
* The name of the policy read.
1572+
*/
1573+
public String PolicyName;
1574+
/**
1575+
* The statements in the requested policy.
1576+
*/
1577+
public ArrayList<PermissionStatement> Statements;
1578+
1579+
}
1580+
15571581
public static class GetPublisherDataRequest {
15581582
/**
15591583
* array of keys to get back data from the Publisher data blob, set by the admin tools
@@ -2286,6 +2310,30 @@ public static class NameIdentifier {
22862310

22872311
}
22882312

2313+
public static class PermissionStatement {
2314+
/**
2315+
* The resource this statements effects. The only supported resources look like 'pfrn:api--*' for all apis, or 'pfrn:api--/Client/ConfirmPurchase' for specific apis.
2316+
*/
2317+
public String Resource;
2318+
/**
2319+
* The action this statement effects. The only supported action is 'Execute'.
2320+
*/
2321+
public String Action;
2322+
/**
2323+
* The effect this statement will have. The only supported effect is 'Allow'.
2324+
*/
2325+
public EffectType Effect;
2326+
/**
2327+
* The principal this statement will effect. The only supported principal is '*'.
2328+
*/
2329+
public String Principal;
2330+
/**
2331+
* A comment about the statement. Intended solely for bookeeping and debugging.
2332+
*/
2333+
public String Comment;
2334+
2335+
}
2336+
22892337
public static class PlayerLinkedAccount {
22902338
/**
22912339
* Authentication platform
@@ -3187,6 +3235,34 @@ public static class UpdatePlayerStatisticDefinitionResult {
31873235

31883236
}
31893237

3238+
public static class UpdatePolicyRequest {
3239+
/**
3240+
* The name of the policy being updated. Only supported name is 'ApiPolicy'
3241+
*/
3242+
public String PolicyName;
3243+
/**
3244+
* The new statements to include in the policy.
3245+
*/
3246+
public ArrayList<PermissionStatement> Statements;
3247+
/**
3248+
* Whether to overwrite or append to the existing policy.
3249+
*/
3250+
public Boolean OverwritePolicy;
3251+
3252+
}
3253+
3254+
public static class UpdatePolicyResponse {
3255+
/**
3256+
* The name of the policy that was updated.
3257+
*/
3258+
public String PolicyName;
3259+
/**
3260+
* The statements included in the new version of the policy.
3261+
*/
3262+
public ArrayList<PermissionStatement> Statements;
3263+
3264+
}
3265+
31903266
public static class UpdateRandomResultTablesRequest {
31913267
/**
31923268
* which catalog is being updated. If null, update the current default catalog version
@@ -3404,11 +3480,6 @@ public static class UserCredentials {
34043480
* Username of user to reset
34053481
*/
34063482
public String Username;
3407-
/**
3408-
* @deprecated Do not use
3409-
*/
3410-
@Deprecated
3411-
public String Password;
34123483

34133484
}
34143485

@@ -3614,7 +3685,7 @@ public static class UserXboxInfo {
36143685

36153686
public static class VirtualCurrencyData {
36163687
/**
3617-
* unique one- or two-character identifier for this currency type (e.g.: "CC", "G")
3688+
* unique two-character identifier for this currency type (e.g.: "CC")
36183689
*/
36193690
public String CurrencyCode;
36203691
/**

PlayFabSDK/src/com/playfab/PlayFabClientModels.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
288288
*/
289289
public Boolean IsLimitedEdition;
290290
/**
291-
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
291+
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
292292
*/
293293
public Integer InitialLimitedEditionCount;
294294

@@ -323,7 +323,7 @@ public static class CatalogItemConsumableInfo {
323323
*/
324324
public Long UsageCount;
325325
/**
326-
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
326+
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
327327
*/
328328
public Long UsagePeriod;
329329
/**

PlayFabSDK/src/com/playfab/PlayFabServerModels.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ public static class CatalogItem implements Comparable<CatalogItem> {
369369
*/
370370
public Boolean IsLimitedEdition;
371371
/**
372-
* If IsLImitedEdition is true, then this determines amount of the item initially available. Note that this fieldis ignored if the catalog item already existed in this catalog, or the field is less than 1.
372+
* If the item has IsLImitedEdition set to true, and this is the first time this ItemId has been defined as a limited edition item, this value determines the total number of instances to allocate for the title. Once this limit has been reached, no more instances of this ItemId can be created, and attempts to purchase or grant it will return a Result of false for that ItemId. If the item has already been defined to have a limited edition count, or if this value is less than zero, it will be ignored.
373373
*/
374374
public Integer InitialLimitedEditionCount;
375375

@@ -404,7 +404,7 @@ public static class CatalogItemConsumableInfo {
404404
*/
405405
public Long UsageCount;
406406
/**
407-
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed
407+
* duration in seconds for how long the item will remain in the player inventory - once elapsed, the item will be removed (recommended minimum value is 5 seconds, as lower values can cause the item to expire before operations depending on this item's details have completed)
408408
*/
409409
public Long UsagePeriod;
410410
/**

PlayFabSDK/src/com/playfab/PlayFabSettings.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import com.playfab.PlayFabErrors.ErrorCallback;
44

55
public class PlayFabSettings {
6-
public static String SdkVersion = "0.40.161107";
6+
public static String SdkVersion = "0.41.161121";
77
public static String BuildIdentifier = "jbuild_javasdk_1";
8-
public static String SdkVersionString = "JavaSDK-0.40.161107";
8+
public static String SdkVersionString = "JavaSDK-0.41.161121";
99

1010
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)
1111
public static ErrorCallback GlobalErrorHandler;

0 commit comments

Comments
 (0)