Skip to content

Commit

Permalink
https://api.playfab.com/releaseNotes/#170710
Browse files Browse the repository at this point in the history
  • Loading branch information
PlayFabJenkinsBot committed Jul 10, 2017
1 parent c138c7e commit f1207e5
Show file tree
Hide file tree
Showing 35 changed files with 1,572 additions and 113 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,67 @@ private static PlayFabResult<GetPhotonAuthenticationTokenResult> privateGetPhoto
return pfResult;
}

/**
* Returns the title's base 64 encoded RSA CSP blob.
* @param request GetTitlePublicKeyRequest
* @return Async Task will return GetTitlePublicKeyResult
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetTitlePublicKeyResult>> GetTitlePublicKeyAsync(final GetTitlePublicKeyRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetTitlePublicKeyResult>>() {
public PlayFabResult<GetTitlePublicKeyResult> call() throws Exception {
return privateGetTitlePublicKeyAsync(request);
}
});
}

/**
* Returns the title's base 64 encoded RSA CSP blob.
* @param request GetTitlePublicKeyRequest
* @return GetTitlePublicKeyResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetTitlePublicKeyResult> GetTitlePublicKey(final GetTitlePublicKeyRequest request) {
FutureTask<PlayFabResult<GetTitlePublicKeyResult>> task = new FutureTask(new Callable<PlayFabResult<GetTitlePublicKeyResult>>() {
public PlayFabResult<GetTitlePublicKeyResult> call() throws Exception {
return privateGetTitlePublicKeyAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* Returns the title's base 64 encoded RSA CSP blob.
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<GetTitlePublicKeyResult> privateGetTitlePublicKeyAsync(final GetTitlePublicKeyRequest request) throws Exception {

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/GetTitlePublicKey", request, null, null);
task.run();
Object httpResult = task.get();
if(httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult<GetTitlePublicKeyResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

PlayFabJsonSuccess<GetTitlePublicKeyResult> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<GetTitlePublicKeyResult>>(){}.getType());
GetTitlePublicKeyResult result = resultData.data;

PlayFabResult<GetTitlePublicKeyResult> pfResult = new PlayFabResult<GetTitlePublicKeyResult>();
pfResult.Result = result;
return pfResult;
}

/**
* Requests a challenge from the server to be signed by Windows Hello Passport service to authenticate.
* @param request GetWindowsHelloChallengeRequest
Expand Down Expand Up @@ -1050,6 +1111,68 @@ private static PlayFabResult<LoginResult> privateRegisterWithWindowsHelloAsync(f
return pfResult;
}

/**
* 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.
* @param request SetPlayerSecretRequest
* @return Async Task will return SetPlayerSecretResult
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<SetPlayerSecretResult>> SetPlayerSecretAsync(final SetPlayerSecretRequest request) {
return new FutureTask(new Callable<PlayFabResult<SetPlayerSecretResult>>() {
public PlayFabResult<SetPlayerSecretResult> call() throws Exception {
return privateSetPlayerSecretAsync(request);
}
});
}

/**
* 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.
* @param request SetPlayerSecretRequest
* @return SetPlayerSecretResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<SetPlayerSecretResult> SetPlayerSecret(final SetPlayerSecretRequest request) {
FutureTask<PlayFabResult<SetPlayerSecretResult>> task = new FutureTask(new Callable<PlayFabResult<SetPlayerSecretResult>>() {
public PlayFabResult<SetPlayerSecretResult> call() throws Exception {
return privateSetPlayerSecretAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
return null;
}
}

/**
* 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.
*/
@SuppressWarnings("unchecked")
private static PlayFabResult<SetPlayerSecretResult> privateSetPlayerSecretAsync(final SetPlayerSecretRequest request) throws Exception {
if (_authKey == null) throw new Exception ("Must be logged in to call this method");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL() + "/Client/SetPlayerSecret", request, "X-Authorization", _authKey);
task.run();
Object httpResult = task.get();
if(httpResult instanceof PlayFabError) {
PlayFabError error = (PlayFabError)httpResult;
if (PlayFabSettings.GlobalErrorHandler != null)
PlayFabSettings.GlobalErrorHandler.callback(error);
PlayFabResult result = new PlayFabResult<SetPlayerSecretResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

PlayFabJsonSuccess<SetPlayerSecretResult> resultData = gson.fromJson(resultRawJson, new TypeToken<PlayFabJsonSuccess<SetPlayerSecretResult>>(){}.getType());
SetPlayerSecretResult result = resultData.data;

PlayFabResult<SetPlayerSecretResult> pfResult = new PlayFabResult<SetPlayerSecretResult>();
pfResult.Result = result;
return pfResult;
}

/**
* 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.
* @param request AddGenericIDRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1443,13 +1443,9 @@ public static class GetFriendLeaderboardAroundPlayerRequest {
*/
public Boolean IncludeFacebookFriends;
/**
* The version of the leaderboard to get, when UseSpecificVersion is true.
* The version of the leaderboard to get.
*/
public Integer Version;
/**
* If true, uses the specified version. If false, gets the most recent version.
*/
public Boolean UseSpecificVersion;
/**
* 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.
*/
Expand Down Expand Up @@ -1495,13 +1491,9 @@ public static class GetFriendLeaderboardRequest {
*/
public Boolean IncludeFacebookFriends;
/**
* The version of the leaderboard to get, when UseSpecificVersion is true.
* The version of the leaderboard to get.
*/
public Integer Version;
/**
* If true, uses the specified version. If false, gets the most recent version.
*/
public Boolean UseSpecificVersion;
/**
* 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.
*/
Expand Down Expand Up @@ -1571,13 +1563,9 @@ public static class GetLeaderboardAroundPlayerRequest {
*/
public Integer MaxResultsCount;
/**
* The version of the leaderboard to get, when UseSpecificVersion is true.
* The version of the leaderboard to get.
*/
public Integer Version;
/**
* If true, uses the specified version. If false, gets the most recent version.
*/
public Boolean UseSpecificVersion;
/**
* 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.
*/
Expand Down Expand Up @@ -1635,13 +1623,9 @@ public static class GetLeaderboardRequest {
*/
public Integer MaxResultsCount;
/**
* The version of the leaderboard to get, when UseSpecificVersion is true.
* The version of the leaderboard to get.
*/
public Integer Version;
/**
* If true, uses the specified version. If false, gets the most recent version.
*/
public Boolean UseSpecificVersion;
/**
* 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.
*/
Expand Down Expand Up @@ -2223,6 +2207,26 @@ public static class GetTitleNewsResult {

}

public static class GetTitlePublicKeyRequest {
/**
* Unique identifier for the title, found in the Settings &gt; Game Properties section of the PlayFab developer site when a title has been selected.
*/
public String TitleId;
/**
* The shared secret key for this title
*/
public String TitleSharedSecret;

}

public static class GetTitlePublicKeyResult {
/**
* Base64 encoded RSA CSP byte array blob containing the title's public RSA key
*/
public String RSAPublicKey;

}

public static class GetTradeStatusRequest {
/**
* Player who opened trade.
Expand Down Expand Up @@ -3843,6 +3847,22 @@ public static class SetFriendTagsResult {

}

public static class SetPlayerSecretRequest {
/**
* Player secret that is used to verify API request signatures (Enterprise Only).
*/
public String PlayerSecret;
/**
* Base64 encoded body that is encrypted with the Title's public RSA key (Enterprise Only).
*/
public String EncryptedRequest;

}

public static class SetPlayerSecretResult {

}

public static class SharedGroupDataRecord {
/**
* Data stored for the specified group data key.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.playfab.PlayFabErrors.ErrorCallback;

public class PlayFabSettings {
public static String SdkVersion = "0.51.170612";
public static String BuildIdentifier = "jbuild_javasdk_1";
public static String SdkVersionString = "JavaSDK-0.51.170612";
public static String SdkVersion = "0.52.170710";
public static String BuildIdentifier = "jbuild_javasdk_2";
public static String SdkVersionString = "JavaSDK-0.52.170710";

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)
public static ErrorCallback GlobalErrorHandler;
Expand Down
2 changes: 1 addition & 1 deletion PlayFabClientSDK/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<inceptionYear>2016</inceptionYear>
<groupId>com.playfab</groupId>
<artifactId>client-sdk</artifactId>
<version>0.51.170612</version>
<version>0.52.170710</version>
<name>PlayFab Client API</name>
<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>
<url>http://api.playfab.com/</url>
Expand Down
Loading

0 comments on commit f1207e5

Please sign in to comment.