Skip to content

Commit

Permalink
https://docs.microsoft.com/en-us/gaming/playfab/release-notes/#240426
Browse files Browse the repository at this point in the history
  • Loading branch information
PlayFab SDK Team authored and PlayFab SDK Team committed Apr 30, 2024
2 parents 1568b01 + 90c5a06 commit 9d577b9
Show file tree
Hide file tree
Showing 46 changed files with 2,215 additions and 183 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.215.240412.jar -Destination ../../builds/client-sdk-0.215.240412.jar
Copy-Item client-sdk-0.216.240426.jar -Destination ../../builds/client-sdk-0.216.240426.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.215.240412.jar ../../builds/client-sdk-0.215.240412.jar
cp client-sdk-0.216.240426.jar ../../builds/client-sdk-0.216.240426.jar
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,68 @@ private static PlayFabResult<GetFunctionResult> privateGetFunctionAsync(final Ge
return pfResult;
}

/**
* Lists all currently registered Event Hub triggered Azure Functions for a given title.
* @param request ListFunctionsRequest
* @return Async Task will return ListEventHubFunctionsResult
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<ListEventHubFunctionsResult>> ListEventHubFunctionsAsync(final ListFunctionsRequest request) {
return new FutureTask(new Callable<PlayFabResult<ListEventHubFunctionsResult>>() {
public PlayFabResult<ListEventHubFunctionsResult> call() throws Exception {
return privateListEventHubFunctionsAsync(request);
}
});
}

/**
* Lists all currently registered Event Hub triggered Azure Functions for a given title.
* @param request ListFunctionsRequest
* @return ListEventHubFunctionsResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<ListEventHubFunctionsResult> ListEventHubFunctions(final ListFunctionsRequest request) {
FutureTask<PlayFabResult<ListEventHubFunctionsResult>> task = new FutureTask(new Callable<PlayFabResult<ListEventHubFunctionsResult>>() {
public PlayFabResult<ListEventHubFunctionsResult> call() throws Exception {
return privateListEventHubFunctionsAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult<ListEventHubFunctionsResult> exceptionResult = new PlayFabResult<ListEventHubFunctionsResult>();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null);
return exceptionResult;
}
}

/** Lists all currently registered Event Hub triggered Azure Functions for a given title. */
@SuppressWarnings("unchecked")
private static PlayFabResult<ListEventHubFunctionsResult> privateListEventHubFunctionsAsync(final ListFunctionsRequest 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("/CloudScript/ListEventHubFunctions"), 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<ListEventHubFunctionsResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Lists all currently registered Azure Functions for a given title.
* @param request ListFunctionsRequest
Expand Down Expand Up @@ -643,6 +705,68 @@ private static PlayFabResult<EmptyResult> privatePostFunctionResultForScheduledT
return pfResult;
}

/**
* Registers an event hub triggered Azure Function with a title.
* @param request RegisterEventHubFunctionRequest
* @return Async Task will return EmptyResult
*/
@SuppressWarnings("unchecked")
public static FutureTask<PlayFabResult<EmptyResult>> RegisterEventHubFunctionAsync(final RegisterEventHubFunctionRequest request) {
return new FutureTask(new Callable<PlayFabResult<EmptyResult>>() {
public PlayFabResult<EmptyResult> call() throws Exception {
return privateRegisterEventHubFunctionAsync(request);
}
});
}

/**
* Registers an event hub triggered Azure Function with a title.
* @param request RegisterEventHubFunctionRequest
* @return EmptyResult
*/
@SuppressWarnings("unchecked")
public static PlayFabResult<EmptyResult> RegisterEventHubFunction(final RegisterEventHubFunctionRequest request) {
FutureTask<PlayFabResult<EmptyResult>> task = new FutureTask(new Callable<PlayFabResult<EmptyResult>>() {
public PlayFabResult<EmptyResult> call() throws Exception {
return privateRegisterEventHubFunctionAsync(request);
}
});
try {
task.run();
return task.get();
} catch(Exception e) {
PlayFabResult<EmptyResult> exceptionResult = new PlayFabResult<EmptyResult>();
exceptionResult.Error = PlayFabHTTP.GeneratePfError(-1, PlayFabErrorCode.Unknown, e.getMessage(), null, null);
return exceptionResult;
}
}

/** Registers an event hub triggered Azure Function with a title. */
@SuppressWarnings("unchecked")
private static PlayFabResult<EmptyResult> privateRegisterEventHubFunctionAsync(final RegisterEventHubFunctionRequest 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("/CloudScript/RegisterEventHubFunction"), 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<EmptyResult>();
result.Error = error;
return result;
}
String resultRawJson = (String) httpResult;

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

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

/**
* Registers an HTTP triggered Azure function with a title.
* @param request RegisterHttpFunctionRequest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,16 @@ public static class EntityKey {

}

public static class EventHubFunctionModel {
/** The connection string for the event hub. */
public String ConnectionString;
/** The name of the event hub that triggers the Azure Function. */
public String EventHubName;
/** The name the function was registered under. */
public String FunctionName;

}

public static class ExecuteCloudScriptResult {
/** Number of PlayFab API requests issued by the CloudScript function */
public Integer APIRequestsIssued;
Expand Down Expand Up @@ -473,6 +483,12 @@ public static class LinkedPlatformAccountModel {

}

public static class ListEventHubFunctionsResult {
/** The list of EventHub triggered functions that are currently registered for the title. */
public ArrayList<EventHubFunctionModel> Functions;

}

/**
* A title can have many functions, ListHttpFunctions will return a list of all the currently registered HTTP triggered
* functions for a given title.
Expand Down Expand Up @@ -710,6 +726,22 @@ public static class QueuedFunctionModel {

}

/**
* A title can have many functions, RegisterEventHubFunction associates a function name with an event hub name and
* connection string.
*/
public static class RegisterEventHubFunctionRequest {
/** A connection string for the namespace of the event hub for the Azure Function. */
public String ConnectionString;
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;
/** The name of the event hub for the Azure Function. */
public String EventHubName;
/** The name of the function to register */
public String FunctionName;

}

public static class RegisterHttpFunctionRequest {
/** The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). */
public Map<String,String> CustomTags;
Expand Down Expand Up @@ -796,7 +828,8 @@ public static class TagModel {

public static enum TriggerType {
HTTP,
Queue
Queue,
EventHub
}

public static class UnregisterFunctionRequest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public static class CatalogConfig {
* to 128 platforms can be listed.
*/
public ArrayList<String> Platforms;
/** The set of configuration that only applies to Ratings and Reviews. */
public ReviewConfig Review;
/** A set of player entity keys that are allowed to review content. There is a maximum of 128 entities that can be added. */
public ArrayList<EntityKey> ReviewerEntities;
/** The set of configuration that only applies to user generated contents. */
Expand Down Expand Up @@ -268,6 +270,12 @@ public static class CatalogSpecificConfig {

}

public static class CategoryRatingConfig {
/** Name of the category. */
public String Name;

}

public static enum ConcernCategory {
None,
OffensiveContent,
Expand Down Expand Up @@ -1616,7 +1624,7 @@ public static class RedeemPlayStationStoreInventoryItemsRequest {
public Map<String,String> CustomTags;
/** The entity to perform this action on. */
public EntityKey Entity;
/** Redirect URI supplied to PlayStation :tm: Network when requesting an auth code */
/** Redirect URI supplied to PlayStation :tm: Network when requesting an auth code. */
public String RedirectUri;
/** Optional Service Label to pass into the request. */
public String ServiceLabel;
Expand Down Expand Up @@ -1720,6 +1728,8 @@ public static class ReportItemReviewResponse {
}

public static class Review {
/** The star rating associated with each selected category in this review. */
public Map<String,Integer> CategoryRatings;
/** The number of negative helpfulness votes for this review. */
public Integer HelpfulNegative;
/** The number of positive helpfulness votes for this review. */
Expand Down Expand Up @@ -1749,6 +1759,12 @@ public static class Review {

}

public static class ReviewConfig {
/** A set of categories that can be applied toward ratings and reviews. */
public ArrayList<CategoryRatingConfig> CategoryRatings;

}

public static class ReviewItemRequest {
/** An alternate ID associated with this item. */
public CatalogAlternateId AlternateId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,12 @@ public static enum PlayFabErrorCode {
NoLinkedStatisticToLeaderboard(1571),
StatDefinitionAlreadyLinkedToLeaderboard(1572),
LinkingStatsNotAllowedForEntityType(1573),
LeaderboardCountLimitExceeded(1574),
LeaderboardSizeLimitExceeded(1575),
LeaderboardDefinitionModificationNotAllowedWhileLinked(1576),
StatisticDefinitionModificationNotAllowedWhileLinked(1577),
LeaderboardUpdateNotAllowedWhileLinked(1578),
CloudScriptAzureFunctionsEventHubRequestError(1579),
MatchmakingEntityInvalid(2001),
MatchmakingPlayerAttributesInvalid(2002),
MatchmakingQueueNotFound(2016),
Expand Down Expand Up @@ -772,29 +778,52 @@ public static enum PlayFabErrorCode {
CopilotDisabled(19100),
CopilotInvalidRequest(19101),
TrueSkillUnauthorized(20000),
TrueSkillBadRequest(20001),
TrueSkillMatchResultAlreadySubmitted(20002),
TrueSkillDuplicatePlayerInMatchResult(20003),
TrueSkillInvalidRanksInMatchResult(20004),
TrueSkillNoWinnerInMatchResult(20005),
TrueSkillMissingRequiredCondition(20006),
TrueSkillMissingRequiredEvent(20007),
TrueSkillUnknownEventName(20008),
TrueSkillUnknownConditionKey(20009),
TrueSkillUnknownConditionValue(20010),
TrueSkillUnknownModelId(20011),
TrueSkillNoPlayerInMatchResultTeam(20012),
TrueSkillPlayersInMatchResultExceedingLimit(20013),
TrueSkillInvalidPreMatchPartyInMatchResult(20014),
TrueSkillInvalidTimestampInMatchResult(20015),
TrueSkillInvalidPlayerSecondsPlayedInMatchResult(20016),
TrueSkillNoTeamInMatchResult(20017),
TrueSkillNotEnoughTeamsInMatchResult(20018),
TrueSkillScenarioConfigDoesNotExist(20019),
TrueSkillNoModelInScenario(20020),
TrueSkillNotSupportedForTitle(20021),
TrueSkillModelIsNotActive(20022),
TrueSkillUnauthorizedToQueryOtherPlayerSkills(20023),
TrueSkillInvalidTitleId(20001),
TrueSkillInvalidScenarioId(20002),
TrueSkillInvalidModelId(20003),
TrueSkillInvalidModelName(20004),
TrueSkillInvalidPlayerIds(20005),
TrueSkillInvalidEntityKey(20006),
TrueSkillInvalidConditionKey(20007),
TrueSkillInvalidConditionValue(20008),
TrueSkillInvalidConditionAffinityWeight(20009),
TrueSkillInvalidEventName(20010),
TrueSkillMatchResultCreated(20011),
TrueSkillMatchResultAlreadySubmitted(20012),
TrueSkillBadPlayerIdInMatchResult(20013),
TrueSkillInvalidBotIdInMatchResult(20014),
TrueSkillDuplicatePlayerInMatchResult(20015),
TrueSkillNoPlayerInMatchResultTeam(20016),
TrueSkillPlayersInMatchResultExceedingLimit(20017),
TrueSkillInvalidPreMatchPartyInMatchResult(20018),
TrueSkillInvalidTimestampInMatchResult(20019),
TrueSkillStartTimeMissingInMatchResult(20020),
TrueSkillEndTimeMissingInMatchResult(20021),
TrueSkillInvalidPlayerSecondsPlayedInMatchResult(20022),
TrueSkillNoTeamInMatchResult(20023),
TrueSkillNotEnoughTeamsInMatchResult(20024),
TrueSkillInvalidRanksInMatchResult(20025),
TrueSkillNoWinnerInMatchResult(20026),
TrueSkillMissingRequiredCondition(20027),
TrueSkillMissingRequiredEvent(20028),
TrueSkillUnknownEventName(20029),
TrueSkillInvalidEventCount(20030),
TrueSkillUnknownConditionKey(20031),
TrueSkillUnknownConditionValue(20032),
TrueSkillScenarioConfigDoesNotExist(20033),
TrueSkillUnknownModelId(20034),
TrueSkillNoModelInScenario(20035),
TrueSkillNotSupportedForTitle(20036),
TrueSkillModelIsNotActive(20037),
TrueSkillUnauthorizedToQueryOtherPlayerSkills(20038),
TrueSkillInvalidMaxIterations(20039),
TrueSkillEndTimeBeforeStartTime(20040),
TrueSkillInvalidJobId(20041),
TrueSkillInvalidMetadataId(20042),
TrueSkillMissingBuildVerison(20043),
TrueSkillJobAlreadyExists(20044),
TrueSkillJobNotFound(20045),
TrueSkillOperationCanceled(20046),
StateShareUnauthorized(21000),
StateShareStateNotFound(21001),
StateShareLinkNotFound(21002);
Expand Down
Loading

0 comments on commit 9d577b9

Please sign in to comment.