Skip to content

Commit f15b2b0

Browse files
author
Paul Gilmore
committed
Merge pull request #23 from PlayFab/master
Pushing new version
2 parents 0c63ce6 + 2394992 commit f15b2b0

16 files changed

+259
-17
lines changed

PlayFabClientSDK/src/playfab/PlayFabClientAPI.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3221,7 +3221,7 @@ private static PlayFabResult<PurchaseItemResult> privatePurchaseItemAsync(Purcha
32213221
return pfResult;
32223222
}
32233223
/**
3224-
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
3224+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/
32253225
*/
32263226
public static FutureTask<PlayFabResult<RedeemCouponResult>> RedeemCouponAsync(RedeemCouponRequest request) {
32273227
return new FutureTask(new Callable<PlayFabResult<RedeemCouponResult>>() {
@@ -3232,7 +3232,7 @@ public PlayFabResult<RedeemCouponResult> call() throws Exception {
32323232
}
32333233

32343234
/**
3235-
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
3235+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/
32363236
*/
32373237
public static PlayFabResult<RedeemCouponResult> RedeemCoupon(RedeemCouponRequest request) {
32383238
FutureTask<PlayFabResult<RedeemCouponResult>> task = new FutureTask(new Callable<PlayFabResult<RedeemCouponResult>>() {
@@ -3249,7 +3249,7 @@ public PlayFabResult<RedeemCouponResult> call() throws Exception {
32493249
}
32503250

32513251
/**
3252-
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
3252+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/
32533253
*/
32543254
private static PlayFabResult<RedeemCouponResult> privateRedeemCouponAsync(RedeemCouponRequest request) throws Exception {
32553255
if (AuthKey == null) throw new Exception ("Must be logged in to call this method");

PlayFabClientSDK/src/playfab/PlayFabClientModels.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,6 +2912,10 @@ public static class UpdateCharacterDataRequest {
29122912
* Data to be written to the user's character's custom data. Note that keys are trimmed of whitespace, are limited to 1024 characters, and may not begin with a '!' character.
29132913
*/
29142914
public Map<String,String> Data;
2915+
/**
2916+
* Optional list of Data-keys to remove from CharacterData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
2917+
*/
2918+
public ArrayList<String> KeysToRemove;
29152919
/**
29162920
* Permission to be applied to all user data keys written in this request. Defaults to "private" if not set.
29172921
*/
@@ -2936,6 +2940,10 @@ public static class UpdateSharedGroupDataRequest {
29362940
* Key value pairs to be stored in the shared group - note that keys will be trimmed of whitespace, must not begin with a '!' character, and that null values will result in the removal of the key from the data set.
29372941
*/
29382942
public Map<String,String> Data;
2943+
/**
2944+
* Optional list of Data-keys to remove from GroupData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
2945+
*/
2946+
public ArrayList<String> KeysToRemove;
29392947
/**
29402948
* Permission to be applied to all user data keys in this request.
29412949
*/
@@ -2952,6 +2960,10 @@ public static class UpdateUserDataRequest {
29522960
* Data to be written to the user's custom data. Note that keys are trimmed of whitespace, are limited to 1024 characters, and may not begin with a '!' character.
29532961
*/
29542962
public Map<String,String> Data;
2963+
/**
2964+
* Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
2965+
*/
2966+
public ArrayList<String> KeysToRemove;
29552967
/**
29562968
* Permission to be applied to all user data keys written in this request. Defaults to "private" if not set.
29572969
*/

PlayFabClientSDK/src/playfab/PlayFabErrors.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ public static enum PlayFabErrorCode {
186186
TradeAcceptedCatalogItemIsNotTradable(1182),
187187
UsersAlreadyFriends(1183),
188188
LinkedIdentifierAlreadyClaimed(1184),
189-
CustomIdNotLinked(1185);
189+
CustomIdNotLinked(1185),
190+
TotalDataSizeExceeded(1186),
191+
DeleteKeyConflict(1187);
190192

191193
public int id;
192194

PlayFabClientSDK/src/playfab/internal/PlayFabVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package playfab.internal;
22

33
public class PlayFabVersion {
4-
public static String ApiRevision = "1.7.20151019";
5-
public static String SdkRevision = "1.0.2";
4+
public static String ApiRevision = "1.9.20151109";
5+
public static String SdkRevision = "0.7.151109";
66
public static String getVersionString() {
77
return "JavaSDK-" + SdkRevision + "-" + ApiRevision;
88
}

PlayFabSDK/src/playfab/PlayFabAdminModels.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1679,6 +1679,10 @@ public static class UpdateUserDataRequest {
16791679
* Data to be written to the user's custom data. Note that keys are trimmed of whitespace, are limited to 1024 characters, and may not begin with a '!' character.
16801680
*/
16811681
public Map<String,String> Data;
1682+
/**
1683+
* Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
1684+
*/
1685+
public ArrayList<String> KeysToRemove;
16821686
/**
16831687
* Permission to be applied to all user data keys written in this request. Defaults to "private" if not set.
16841688
*/
@@ -1703,6 +1707,10 @@ public static class UpdateUserInternalDataRequest {
17031707
* Data to be written to the user's custom data.
17041708
*/
17051709
public Map<String,String> Data;
1710+
/**
1711+
* Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
1712+
*/
1713+
public ArrayList<String> KeysToRemove;
17061714

17071715
}
17081716

PlayFabSDK/src/playfab/PlayFabClientAPI.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3221,7 +3221,7 @@ private static PlayFabResult<PurchaseItemResult> privatePurchaseItemAsync(Purcha
32213221
return pfResult;
32223222
}
32233223
/**
3224-
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
3224+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/
32253225
*/
32263226
public static FutureTask<PlayFabResult<RedeemCouponResult>> RedeemCouponAsync(RedeemCouponRequest request) {
32273227
return new FutureTask(new Callable<PlayFabResult<RedeemCouponResult>>() {
@@ -3232,7 +3232,7 @@ public PlayFabResult<RedeemCouponResult> call() throws Exception {
32323232
}
32333233

32343234
/**
3235-
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
3235+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/
32363236
*/
32373237
public static PlayFabResult<RedeemCouponResult> RedeemCoupon(RedeemCouponRequest request) {
32383238
FutureTask<PlayFabResult<RedeemCouponResult>> task = new FutureTask(new Callable<PlayFabResult<RedeemCouponResult>>() {
@@ -3249,7 +3249,7 @@ public PlayFabResult<RedeemCouponResult> call() throws Exception {
32493249
}
32503250

32513251
/**
3252-
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
3252+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/using-stores-and-coupons-game-manager/
32533253
*/
32543254
private static PlayFabResult<RedeemCouponResult> privateRedeemCouponAsync(RedeemCouponRequest request) throws Exception {
32553255
if (AuthKey == null) throw new Exception ("Must be logged in to call this method");

PlayFabSDK/src/playfab/PlayFabClientModels.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2912,6 +2912,10 @@ public static class UpdateCharacterDataRequest {
29122912
* Data to be written to the user's character's custom data. Note that keys are trimmed of whitespace, are limited to 1024 characters, and may not begin with a '!' character.
29132913
*/
29142914
public Map<String,String> Data;
2915+
/**
2916+
* Optional list of Data-keys to remove from CharacterData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
2917+
*/
2918+
public ArrayList<String> KeysToRemove;
29152919
/**
29162920
* Permission to be applied to all user data keys written in this request. Defaults to "private" if not set.
29172921
*/
@@ -2936,6 +2940,10 @@ public static class UpdateSharedGroupDataRequest {
29362940
* Key value pairs to be stored in the shared group - note that keys will be trimmed of whitespace, must not begin with a '!' character, and that null values will result in the removal of the key from the data set.
29372941
*/
29382942
public Map<String,String> Data;
2943+
/**
2944+
* Optional list of Data-keys to remove from GroupData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
2945+
*/
2946+
public ArrayList<String> KeysToRemove;
29392947
/**
29402948
* Permission to be applied to all user data keys in this request.
29412949
*/
@@ -2952,6 +2960,10 @@ public static class UpdateUserDataRequest {
29522960
* Data to be written to the user's custom data. Note that keys are trimmed of whitespace, are limited to 1024 characters, and may not begin with a '!' character.
29532961
*/
29542962
public Map<String,String> Data;
2963+
/**
2964+
* Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
2965+
*/
2966+
public ArrayList<String> KeysToRemove;
29552967
/**
29562968
* Permission to be applied to all user data keys written in this request. Defaults to "private" if not set.
29572969
*/

PlayFabSDK/src/playfab/PlayFabErrors.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,9 @@ public static enum PlayFabErrorCode {
186186
TradeAcceptedCatalogItemIsNotTradable(1182),
187187
UsersAlreadyFriends(1183),
188188
LinkedIdentifierAlreadyClaimed(1184),
189-
CustomIdNotLinked(1185);
189+
CustomIdNotLinked(1185),
190+
TotalDataSizeExceeded(1186),
191+
DeleteKeyConflict(1187);
190192

191193
public int id;
192194

PlayFabSDK/src/playfab/PlayFabServerAPI.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2013,6 +2013,60 @@ private static PlayFabResult<MoveItemToUserFromCharacterResult> privateMoveItemT
20132013
pfResult.Result = result;
20142014
return pfResult;
20152015
}
2016+
/**
2017+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
2018+
*/
2019+
public static FutureTask<PlayFabResult<RedeemCouponResult>> RedeemCouponAsync(RedeemCouponRequest request) {
2020+
return new FutureTask(new Callable<PlayFabResult<RedeemCouponResult>>() {
2021+
public PlayFabResult<RedeemCouponResult> call() throws Exception {
2022+
return privateRedeemCouponAsync(request);
2023+
}
2024+
});
2025+
}
2026+
2027+
/**
2028+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
2029+
*/
2030+
public static PlayFabResult<RedeemCouponResult> RedeemCoupon(RedeemCouponRequest request) {
2031+
FutureTask<PlayFabResult<RedeemCouponResult>> task = new FutureTask(new Callable<PlayFabResult<RedeemCouponResult>>() {
2032+
public PlayFabResult<RedeemCouponResult> call() throws Exception {
2033+
return privateRedeemCouponAsync(request);
2034+
}
2035+
});
2036+
try {
2037+
task.run();
2038+
return task.get();
2039+
} catch(Exception e) {
2040+
return null;
2041+
}
2042+
}
2043+
2044+
/**
2045+
* Adds the virtual goods associated with the coupon to the user's inventory. Coupons can be generated via the Promotions->Coupons tab in the PlayFab Game Manager. See this post for more information on coupons: https://playfab.com/blog/2015/06/18/using-stores-and-coupons-game-manager
2046+
*/
2047+
private static PlayFabResult<RedeemCouponResult> privateRedeemCouponAsync(RedeemCouponRequest request) throws Exception {
2048+
if (PlayFabSettings.DeveloperSecretKey == null) throw new Exception ("Must have PlayFabSettings.DeveloperSecretKey set to call this method");
2049+
2050+
FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Server/RedeemCoupon", request, "X-SecretKey", PlayFabSettings.DeveloperSecretKey);
2051+
task.run();
2052+
Object httpResult = task.get();
2053+
if(httpResult instanceof PlayFabError) {
2054+
PlayFabError error = (PlayFabError)httpResult;
2055+
if (PlayFabSettings.GlobalErrorHandler != null)
2056+
PlayFabSettings.GlobalErrorHandler.callback(error);
2057+
PlayFabResult result = new PlayFabResult<RedeemCouponResult>();
2058+
result.Error = error;
2059+
return result;
2060+
}
2061+
String resultRawJson = (String) httpResult;
2062+
2063+
PlayFabJsonSuccess<RedeemCouponResult> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<RedeemCouponResult>>(){}.getType());
2064+
RedeemCouponResult result = resultData.data;
2065+
2066+
PlayFabResult<RedeemCouponResult> pfResult = new PlayFabResult<RedeemCouponResult>();
2067+
pfResult.Result = result;
2068+
return pfResult;
2069+
}
20162070
/**
20172071
* Submit a report about a player (due to bad bahavior, etc.) on behalf of another player, so that customer service representatives for the title can take action concerning potentially poxic players.
20182072
*/

PlayFabSDK/src/playfab/PlayFabServerModels.java

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,6 +1587,30 @@ public static class PlayerLeaderboardEntry {
15871587

15881588
}
15891589

1590+
public static class RedeemCouponRequest {
1591+
/**
1592+
* Generated coupon code to redeem.
1593+
*/
1594+
public String CouponCode;
1595+
/**
1596+
* Unique PlayFab assigned ID of the user on whom the operation will be performed.
1597+
*/
1598+
public String PlayFabId;
1599+
/**
1600+
* Catalog version of the coupon.
1601+
*/
1602+
public String CatalogVersion;
1603+
1604+
}
1605+
1606+
public static class RedeemCouponResult {
1607+
/**
1608+
* Items granted to the player as a result of redeeming the coupon.
1609+
*/
1610+
public ArrayList<ItemInstance> GrantedItems;
1611+
1612+
}
1613+
15901614
public static class RedeemMatchmakerTicketRequest {
15911615
/**
15921616
* Server authorization ticket passed back from a call to Matchmake or StartGame.
@@ -1621,7 +1645,7 @@ public static class RemoveFriendRequest {
16211645
*/
16221646
public String FriendPlayFabId;
16231647
/**
1624-
* The PlayFab identifier of the player to lose a friend
1648+
* Unique PlayFab assigned ID of the user on whom the operation will be performed.
16251649
*/
16261650
public String PlayFabId;
16271651

@@ -1818,6 +1842,10 @@ public static class UpdateCharacterDataRequest {
18181842
* Data to be written to the user's character's custom data. Note that keys are trimmed of whitespace, are limited to 1024 characters, and may not begin with a '!' character.
18191843
*/
18201844
public Map<String,String> Data;
1845+
/**
1846+
* Optional list of Data-keys to remove from CharacterData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
1847+
*/
1848+
public ArrayList<String> KeysToRemove;
18211849
/**
18221850
* Permission to be applied to all user data keys written in this request. Defaults to "private" if not set.
18231851
*/
@@ -1862,6 +1890,10 @@ public static class UpdateSharedGroupDataRequest {
18621890
* Key value pairs to be stored in the shared group - note that keys will be trimmed of whitespace, must not begin with a '!' character, and that null values will result in the removal of the key from the data set.
18631891
*/
18641892
public Map<String,String> Data;
1893+
/**
1894+
* Optional list of Data-keys to remove from GroupData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
1895+
*/
1896+
public ArrayList<String> KeysToRemove;
18651897
/**
18661898
* Permission to be applied to all user data keys in this request.
18671899
*/
@@ -1882,6 +1914,10 @@ public static class UpdateUserDataRequest {
18821914
* Data to be written to the user's custom data. Note that keys are trimmed of whitespace, are limited to 1024 characters, and may not begin with a '!' character.
18831915
*/
18841916
public Map<String,String> Data;
1917+
/**
1918+
* Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
1919+
*/
1920+
public ArrayList<String> KeysToRemove;
18851921
/**
18861922
* Permission to be applied to all user data keys written in this request. Defaults to "private" if not set.
18871923
*/
@@ -1906,6 +1942,10 @@ public static class UpdateUserInternalDataRequest {
19061942
* Data to be written to the user's custom data.
19071943
*/
19081944
public Map<String,String> Data;
1945+
/**
1946+
* Optional list of Data-keys to remove from UserData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
1947+
*/
1948+
public ArrayList<String> KeysToRemove;
19091949

19101950
}
19111951

@@ -1926,6 +1966,10 @@ public static class UpdateUserInventoryItemDataRequest {
19261966
* Data to be written to the item's custom data. Note that keys are trimmed of whitespace.
19271967
*/
19281968
public Map<String,String> Data;
1969+
/**
1970+
* Optional list of Data-keys to remove from ItemData. Some SDKs cannot insert null-values into Data due to language constraints. Use this to delete the keys directly.
1971+
*/
1972+
public ArrayList<String> KeysToRemove;
19291973

19301974
}
19311975

0 commit comments

Comments
 (0)