Skip to content

Commit ad517e2

Browse files
https://api.playfab.com/releaseNotes/#170710
2 parents 076ea02 + f1207e5 commit ad517e2

35 files changed

+1572
-113
lines changed

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

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,67 @@ private static PlayFabResult<GetPhotonAuthenticationTokenResult> privateGetPhoto
7979
return pfResult;
8080
}
8181

82+
/**
83+
* Returns the title's base 64 encoded RSA CSP blob.
84+
* @param request GetTitlePublicKeyRequest
85+
* @return Async Task will return GetTitlePublicKeyResult
86+
*/
87+
@SuppressWarnings("unchecked")
88+
public static FutureTask<PlayFabResult<GetTitlePublicKeyResult>> GetTitlePublicKeyAsync(final GetTitlePublicKeyRequest request) {
89+
return new FutureTask(new Callable<PlayFabResult<GetTitlePublicKeyResult>>() {
90+
public PlayFabResult<GetTitlePublicKeyResult> call() throws Exception {
91+
return privateGetTitlePublicKeyAsync(request);
92+
}
93+
});
94+
}
95+
96+
/**
97+
* Returns the title's base 64 encoded RSA CSP blob.
98+
* @param request GetTitlePublicKeyRequest
99+
* @return GetTitlePublicKeyResult
100+
*/
101+
@SuppressWarnings("unchecked")
102+
public static PlayFabResult<GetTitlePublicKeyResult> GetTitlePublicKey(final GetTitlePublicKeyRequest request) {
103+
FutureTask<PlayFabResult<GetTitlePublicKeyResult>> task = new FutureTask(new Callable<PlayFabResult<GetTitlePublicKeyResult>>() {
104+
public PlayFabResult<GetTitlePublicKeyResult> call() throws Exception {
105+
return privateGetTitlePublicKeyAsync(request);
106+
}
107+
});
108+
try {
109+
task.run();
110+
return task.get();
111+
} catch(Exception e) {
112+
return null;
113+
}
114+
}
115+
116+
/**
117+
* Returns the title's base 64 encoded RSA CSP blob.
118+
*/
119+
@SuppressWarnings("unchecked")
120+
private static PlayFabResult<GetTitlePublicKeyResult> privateGetTitlePublicKeyAsync(final GetTitlePublicKeyRequest request) throws Exception {
121+
122+
FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitlePublicKey", request, null, null);
123+
task.run();
124+
Object httpResult = task.get();
125+
if(httpResult instanceof PlayFabError) {
126+
PlayFabError error = (PlayFabError)httpResult;
127+
if (PlayFabSettings.GlobalErrorHandler != null)
128+
PlayFabSettings.GlobalErrorHandler.callback(error);
129+
PlayFabResult result = new PlayFabResult<GetTitlePublicKeyResult>();
130+
result.Error = error;
131+
return result;
132+
}
133+
String resultRawJson = (String) httpResult;
134+
135+
PlayFabJsonSuccess<GetTitlePublicKeyResult> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<GetTitlePublicKeyResult>>(){}.getType());
136+
GetTitlePublicKeyResult result = resultData.data;
137+
138+
PlayFabResult<GetTitlePublicKeyResult> pfResult = new PlayFabResult<GetTitlePublicKeyResult>();
139+
pfResult.Result = result;
140+
return pfResult;
141+
}
142+
82143
/**
83144
* Requests a challenge from the server to be signed by Windows Hello Passport service to authenticate.
84145
* @param request GetWindowsHelloChallengeRequest
@@ -1050,6 +1111,68 @@ private static PlayFabResult<LoginResult> privateRegisterWithWindowsHelloAsync(f
10501111
return pfResult;
10511112
}
10521113

1114+
/**
1115+
* Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret.
1116+
* @param request SetPlayerSecretRequest
1117+
* @return Async Task will return SetPlayerSecretResult
1118+
*/
1119+
@SuppressWarnings("unchecked")
1120+
public static FutureTask<PlayFabResult<SetPlayerSecretResult>> SetPlayerSecretAsync(final SetPlayerSecretRequest request) {
1121+
return new FutureTask(new Callable<PlayFabResult<SetPlayerSecretResult>>() {
1122+
public PlayFabResult<SetPlayerSecretResult> call() throws Exception {
1123+
return privateSetPlayerSecretAsync(request);
1124+
}
1125+
});
1126+
}
1127+
1128+
/**
1129+
* Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret.
1130+
* @param request SetPlayerSecretRequest
1131+
* @return SetPlayerSecretResult
1132+
*/
1133+
@SuppressWarnings("unchecked")
1134+
public static PlayFabResult<SetPlayerSecretResult> SetPlayerSecret(final SetPlayerSecretRequest request) {
1135+
FutureTask<PlayFabResult<SetPlayerSecretResult>> task = new FutureTask(new Callable<PlayFabResult<SetPlayerSecretResult>>() {
1136+
public PlayFabResult<SetPlayerSecretResult> call() throws Exception {
1137+
return privateSetPlayerSecretAsync(request);
1138+
}
1139+
});
1140+
try {
1141+
task.run();
1142+
return task.get();
1143+
} catch(Exception e) {
1144+
return null;
1145+
}
1146+
}
1147+
1148+
/**
1149+
* Sets the player's secret if it is not already set. Player secrets are used to sign API requests. To reset a player's secret use the Admin or Server API method SetPlayerSecret.
1150+
*/
1151+
@SuppressWarnings("unchecked")
1152+
private static PlayFabResult<SetPlayerSecretResult> privateSetPlayerSecretAsync(final SetPlayerSecretRequest request) throws Exception {
1153+
if (_authKey == null) throw new Exception ("Must be logged in to call this method");
1154+
1155+
FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SetPlayerSecret", request, "X-Authorization", _authKey);
1156+
task.run();
1157+
Object httpResult = task.get();
1158+
if(httpResult instanceof PlayFabError) {
1159+
PlayFabError error = (PlayFabError)httpResult;
1160+
if (PlayFabSettings.GlobalErrorHandler != null)
1161+
PlayFabSettings.GlobalErrorHandler.callback(error);
1162+
PlayFabResult result = new PlayFabResult<SetPlayerSecretResult>();
1163+
result.Error = error;
1164+
return result;
1165+
}
1166+
String resultRawJson = (String) httpResult;
1167+
1168+
PlayFabJsonSuccess<SetPlayerSecretResult> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<SetPlayerSecretResult>>(){}.getType());
1169+
SetPlayerSecretResult result = resultData.data;
1170+
1171+
PlayFabResult<SetPlayerSecretResult> pfResult = new PlayFabResult<SetPlayerSecretResult>();
1172+
pfResult.Result = result;
1173+
return pfResult;
1174+
}
1175+
10531176
/**
10541177
* Adds the specified generic service identifier to the player's PlayFab account. This is designed to allow for a PlayFab ID lookup of any arbitrary service identifier a title wants to add. This identifier should never be used as authentication credentials, as the intent is that it is easily accessible by other players.
10551178
* @param request AddGenericIDRequest

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

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,13 +1443,9 @@ public static class GetFriendLeaderboardAroundPlayerRequest {
14431443
*/
14441444
public Boolean IncludeFacebookFriends;
14451445
/**
1446-
* The version of the leaderboard to get, when UseSpecificVersion is true.
1446+
* The version of the leaderboard to get.
14471447
*/
14481448
public Integer Version;
1449-
/**
1450-
* If true, uses the specified version. If false, gets the most recent version.
1451-
*/
1452-
public Boolean UseSpecificVersion;
14531449
/**
14541450
* If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time.
14551451
*/
@@ -1495,13 +1491,9 @@ public static class GetFriendLeaderboardRequest {
14951491
*/
14961492
public Boolean IncludeFacebookFriends;
14971493
/**
1498-
* The version of the leaderboard to get, when UseSpecificVersion is true.
1494+
* The version of the leaderboard to get.
14991495
*/
15001496
public Integer Version;
1501-
/**
1502-
* If true, uses the specified version. If false, gets the most recent version.
1503-
*/
1504-
public Boolean UseSpecificVersion;
15051497
/**
15061498
* If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time.
15071499
*/
@@ -1571,13 +1563,9 @@ public static class GetLeaderboardAroundPlayerRequest {
15711563
*/
15721564
public Integer MaxResultsCount;
15731565
/**
1574-
* The version of the leaderboard to get, when UseSpecificVersion is true.
1566+
* The version of the leaderboard to get.
15751567
*/
15761568
public Integer Version;
1577-
/**
1578-
* If true, uses the specified version. If false, gets the most recent version.
1579-
*/
1580-
public Boolean UseSpecificVersion;
15811569
/**
15821570
* If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time.
15831571
*/
@@ -1635,13 +1623,9 @@ public static class GetLeaderboardRequest {
16351623
*/
16361624
public Integer MaxResultsCount;
16371625
/**
1638-
* The version of the leaderboard to get, when UseSpecificVersion is true.
1626+
* The version of the leaderboard to get.
16391627
*/
16401628
public Integer Version;
1641-
/**
1642-
* If true, uses the specified version. If false, gets the most recent version.
1643-
*/
1644-
public Boolean UseSpecificVersion;
16451629
/**
16461630
* If non-null, this determines which properties of the profile to return. If null, playfab will only include display names. For API calls from the client, only ShowDisplayName, ShowAvatarUrl are allowed at this time.
16471631
*/
@@ -2223,6 +2207,26 @@ public static class GetTitleNewsResult {
22232207

22242208
}
22252209

2210+
public static class GetTitlePublicKeyRequest {
2211+
/**
2212+
* Unique identifier for the title, found in the Settings &gt; Game Properties section of the PlayFab developer site when a title has been selected.
2213+
*/
2214+
public String TitleId;
2215+
/**
2216+
* The shared secret key for this title
2217+
*/
2218+
public String TitleSharedSecret;
2219+
2220+
}
2221+
2222+
public static class GetTitlePublicKeyResult {
2223+
/**
2224+
* Base64 encoded RSA CSP byte array blob containing the title's public RSA key
2225+
*/
2226+
public String RSAPublicKey;
2227+
2228+
}
2229+
22262230
public static class GetTradeStatusRequest {
22272231
/**
22282232
* Player who opened trade.
@@ -3843,6 +3847,22 @@ public static class SetFriendTagsResult {
38433847

38443848
}
38453849

3850+
public static class SetPlayerSecretRequest {
3851+
/**
3852+
* Player secret that is used to verify API request signatures (Enterprise Only).
3853+
*/
3854+
public String PlayerSecret;
3855+
/**
3856+
* Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only).
3857+
*/
3858+
public String EncryptedRequest;
3859+
3860+
}
3861+
3862+
public static class SetPlayerSecretResult {
3863+
3864+
}
3865+
38463866
public static class SharedGroupDataRecord {
38473867
/**
38483868
* Data stored for the specified group data key.

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

Lines changed: 3 additions & 3 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.51.170612";
8-
public static String BuildIdentifier = "jbuild_javasdk_1";
9-
public static String SdkVersionString = "JavaSDK-0.51.170612";
7+
public static String SdkVersion = "0.52.170710";
8+
public static String BuildIdentifier = "jbuild_javasdk_2";
9+
public static String SdkVersionString = "JavaSDK-0.52.170710";
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/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<inceptionYear>2016</inceptionYear>
55
<groupId>com.playfab</groupId>
66
<artifactId>client-sdk</artifactId>
7-
<version>0.51.170612</version>
7+
<version>0.52.170710</version>
88
<name>PlayFab Client API</name>
99
<description>PlayFab is the unified backend platform for games — everything you need to build and operate your game, all in one place, so you can focus on creating and delivering a great player experience. </description>
1010
<url>http://api.playfab.com/</url>

0 commit comments

Comments
 (0)