When the server returns an Event Leaderboard, its current state is represented by a combination of boolean properties. Check if the player can claim rewards and roll into a new cohort simultaneously by reading the CanRollWithClaim property in the response.
IsActive
CanClaim
CanRoll
Description
FALSE
FALSE
FALSE
Visible, but inactive. No actions are possible.
FALSE
TRUE
FALSE
Visible, but inactive. A reward from a previous phase can be claimed.
TRUE
FALSE
FALSE
Active, a valid cohort exists and the player can submit scores (CanUpdate is true).
TRUE
FALSE
TRUE
Active, need to roll to get a cohort.
TRUE
TRUE
FALSE
Active, a completed cohort exists with an unclaimed reward. The player has no remaining rolls after claiming, or is waiting for a roll cooldown to expire.
By default, the response doesn’t include the scores of the event leaderboards. To have the response returning with the scores, set the boolean WithScores on the request to true.
FHiroEventLeaderboardDebugFillRequestFillRequest;FillRequest.Id=TEXT("leaderboard_1");FillRequest.TargetCount=50;// Optional target cohort size to fill to, otherwise fill to the max cohort size.
FHiroEventLeaderboardDebugRandomScoresRequestScoresRequest;ScoresRequest.Id=TEXT("leaderboard_1");ScoresRequest.Min=1;ScoresRequest.Max=100;ScoresRequest.SubscoreMin=1;ScoresRequest.SubscoreMax=100;FHiroOnEventLeaderboardDebugFillOnEventLeaderboardDebugFill;OnEventLeaderboardDebugFill.AddDynamic(this,&AMyActor::OnEventLeaderboardDebugFill);FOnErrorOnFillError;FHiroOnEventLeaderboardDebugRandomScoresOnEventLeaderboardDebugRandomScores;OnEventLeaderboardDebugRandomScores.AddDynamic(this,&AMyActor::OnEventLeaderboardDebugRandomScores);FOnErrorOnScoresError;// Fills cohort with debug players
HiroClient->EventLeaderboardDebugFill(Session,FillRequest,OnEventLeaderboardDebugFill,OnFillError);// Sets randomly generated scores between a range for other players (does not change the user's score)
HiroClient->EventLeaderboardDebugRandomScores(Session,ScoresRequest,OnEventLeaderboardDebugRandomScores,OnScoresError);voidAMyActor::OnEventLeaderboardDebugFill(constFHiroEventLeaderboard&EventLeaderboard){UE_LOG(LogTemp,Log,TEXT("%s"),*EventLeaderboard.ToJson());}voidAMyActor::OnEventLeaderboardDebugRandomScores(constFHiroEventLeaderboard&EventLeaderboard){UE_LOG(LogTemp,Log,TEXT("%s"),*EventLeaderboard.ToJson());}