Skip to content

Commit

Permalink
https://docs.microsoft.com/en-us/gaming/playfab/release-notes/#221207
Browse files Browse the repository at this point in the history
  • Loading branch information
PlayFab SDK Team authored and PlayFab SDK Team committed Dec 8, 2022
2 parents 20dc69e + d339d71 commit cbb8b70
Show file tree
Hide file tree
Showing 44 changed files with 971 additions and 181 deletions.
2 changes: 1 addition & 1 deletion AndroidStudioExample/app/packageMe.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ New-Item -ItemType Directory -Force ./builds
popd

cd target
Copy-Item client-sdk-0.177.221107.jar -Destination ../../builds/client-sdk-0.177.221107.jar
Copy-Item client-sdk-0.178.221207.jar -Destination ../../builds/client-sdk-0.178.221207.jar
2 changes: 1 addition & 1 deletion AndroidStudioExample/app/packageMe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ mkdir -p ./builds
popd

cd target
cp client-sdk-0.177.221107.jar ../../builds/client-sdk-0.177.221107.jar
cp client-sdk-0.178.221207.jar ../../builds/client-sdk-0.178.221207.jar
Original file line number Diff line number Diff line change
Expand Up @@ -1135,19 +1135,8 @@ public static enum ExternalFriendSources {
None,
Steam,
Facebook,
SteamOrFacebook,
Xbox,
SteamOrXbox,
FacebookOrXbox,
SteamOrFacebookOrXbox,
Psn,
SteamOrPsn,
FacebookOrPsn,
SteamOrFacebookOrPsn,
XboxOrPsn,
SteamOrXboxOrPsn,
FacebookOrXboxOrPsn,
SteamOrFacebookOrXboxOrPsn,
All
}

Expand Down Expand Up @@ -1452,7 +1441,10 @@ public static class GetContentDownloadUrlResult {
public static class GetFriendLeaderboardAroundPlayerRequest {
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;
/** Indicates which other platforms' friends should be included in the response. */
/**
* Indicates which other platforms' friends should be included in the response. In HTTP, it is represented as a
* comma-separated list of platforms.
*/
public ExternalFriendSources ExternalPlatformFriends;
/**
* Indicates whether Facebook friends should be included in the response. Default is true.
Expand Down Expand Up @@ -1504,7 +1496,10 @@ public static class GetFriendLeaderboardAroundPlayerResult {
public static class GetFriendLeaderboardRequest {
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;
/** Indicates which other platforms' friends should be included in the response. */
/**
* Indicates which other platforms' friends should be included in the response. In HTTP, it is represented as a
* comma-separated list of platforms.
*/
public ExternalFriendSources ExternalPlatformFriends;
/**
* Indicates whether Facebook friends should be included in the response. Default is true.
Expand Down Expand Up @@ -1540,7 +1535,10 @@ public static class GetFriendLeaderboardRequest {
public static class GetFriendsListRequest {
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;
/** Indicates which other platforms' friends should be included in the response. */
/**
* Indicates which other platforms' friends should be included in the response. In HTTP, it is represented as a
* comma-separated list of platforms.
*/
public ExternalFriendSources ExternalPlatformFriends;
/**
* Indicates whether Facebook friends should be included in the response. Default is true.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,11 @@ public static class PostFunctionResultForFunctionExecutionRequest {
public static class PostFunctionResultForPlayerTriggeredActionRequest {
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;
/** The optional entity to perform this action on. Defaults to the currently logged in entity. */
/**
* The optional entity to perform this action on. Defaults to the currently logged in entity.
* @deprecated Do not use
*/
@Deprecated
public EntityKey Entity;
/** The result of the function execution. */
public ExecuteFunctionResult FunctionResult;
Expand All @@ -680,7 +684,11 @@ public static class PostFunctionResultForPlayerTriggeredActionRequest {
public static class PostFunctionResultForScheduledTaskRequest {
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;
/** The entity to perform this action on. */
/**
* The entity to perform this action on.
* @deprecated Do not use
*/
@Deprecated
public EntityKey Entity;
/** The result of the function execution */
public ExecuteFunctionResult FunctionResult;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,68 @@ private static PlayFabResult<GetMicrosoftStoreAccessTokensResponse> privateGetMi
return pfResult;
}

/**
* Get transaction history.
* @param request GetTransactionHistoryRequest
* @return Async Task will return GetTransactionHistoryResponse
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<GetTransactionHistoryResponse>> GetTransactionHistoryAsync(final GetTransactionHistoryRequest request) {
return new FutureTask(new Callable<PlayFabResult<GetTransactionHistoryResponse>>() {
public PlayFabResult<GetTransactionHistoryResponse> call() throws Exception {
return privateGetTransactionHistoryAsync(request);
}
});
}

/**
* Get transaction history.
* @param request GetTransactionHistoryRequest
* @return GetTransactionHistoryResponse
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<GetTransactionHistoryResponse> GetTransactionHistory(final GetTransactionHistoryRequest request) {
FutureTask<PlayFabResult<GetTransactionHistoryResponse>> task = new FutureTask(new Callable<PlayFabResult<GetTransactionHistoryResponse>>() {
public PlayFabResult<GetTransactionHistoryResponse> call() throws Exception {
return privateGetTransactionHistoryAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult<GetTransactionHistoryResponse> exceptionResult = new PlayFabResult<GetTransactionHistoryResponse>();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null);
return exceptionResult;
}
}

/** Get transaction history. */
@SuppressWarnings("unchecked")
private static PlayFabResult<GetTransactionHistoryResponse> privateGetTransactionHistoryAsync(final GetTransactionHistoryRequest request) throws Exception {
if (PlayFabSettings.EntityToken == null) throw new Exception ("Must call GetEntityToken before you can use the Entity API");

FutureTask<Object> task = PlayFabHTTP.doPost(PlayFabSettings.GetURL("/Inventory/GetTransactionHistory"), request, "X-EntityToken", PlayFabSettings.EntityToken);
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<GetTransactionHistoryResponse>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Initiates a publish of an item from the working catalog to the public catalog.
* @param request PublishDraftItemRequest
Expand Down
Loading

0 comments on commit cbb8b70

Please sign in to comment.