Beamable SDK
Public Member Functions | List of all members
Beamable.Common.Api.Tournaments.TournamentApi Class Reference
Inheritance diagram for Beamable.Common.Api.Tournaments.TournamentApi:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Common.Api.Tournaments.TournamentApi:
Collaboration graph
[legend]

Public Member Functions

 TournamentApi (IStatsApi stats, IBeamableRequester requester, IUserContext ctx)
 
Promise< TournamentInfoGetTournamentInfo (string tournamentContentId)
 Find the first TournamentInfo that matches the given tournament content id. More...
 
Promise< TournamentInfoResponseGetAllTournaments (string contentId=null, int? cycle=null, bool? isRunning=null)
 Find all the tournaments that match given criteria. More...
 
Promise< TournamentChampionsResponseGetChampions (string tournamentId, int cycleLimit=30)
 Tournament champions are players who came in first across all stages and tiers for a given cycle. This method will fetch the latest cycle winners. Use the GetStandings method to get the standings for the current player's stage and tier. More...
 
Promise< TournamentStandingsResponseGetGlobalStandings (string tournamentId, int cycle=-1, int from=-1, int max=-1, int focus=-1)
 Players participating in a tournament are segmented into different leaderboard partitions to limit the size of the leaderboard any given player sees. Global standings are the scores across all stages, tiers, and partitions. Use the GetStandings method to get the standings for the current player's stage and tier. More...
 
Promise< TournamentStandingsResponseGetStandings (string tournamentId, int cycle=-1, int from=-1, int max=-1, int focus=-1)
 Retrieve the scores for the current player's stage and tier in the tournament. More...
 
Promise< TournamentRewardsResponseGetUnclaimedRewards (string tournamentId)
 Retrieve a list of unclaimed rewards that the current player has earned from previous cycles of a tournament. This method can be used to show a player what rewards they will acquire before they are claimed. Use the ClaimAllRewards method to actually claim the rewards. Use the GetPlayerStatus method to identify tournaments that the player is participating in. More...
 
Promise< TournamentRewardsResponseClaimAllRewards (string tournamentId)
 Claim all rewards that the current player has earned for previous cycles of a tournament. If you need to show the rewards before claiming them, use the GetUnclaimedRewards method. Use the GetPlayerStatus method to identify tournaments that the player is participating in. More...
 
Promise< TournamentPlayerStatusJoinTournament (string tournamentId, double startScore=0)
 A player must join a tournament before they can submit scores with the SetScore method. Once a player has joined a tournament, they will be given scores for all future cycles of the tournament. There is no way to leave a tournament. More...
 
Promise< UnitSetScore (string tournamentId, long dbid, double score, bool incrementScore=false)
 Set the tournament score for the given dbid. The player must have joined the tournament using the JoinTournament method before they can submit scores. More...
 
Promise< TournamentPlayerStatusResponseGetPlayerStatus (string tournamentId=null, string contentId=null, bool? hasUnclaimedRewards=null)
 Retrieve a set of TournamentPlayerStatuss for all matching tournaments. The TournamentPlayerStatus is a view of a tournament for the current player. More...
 
Promise< TournamentGroupStatusResponseGetGroupStatus (string tournamentId=null, string contentId=null)
 Retrieve a set of TournamentGroupStatuss for all matching tournaments. The TournamentGroupStatus is a view of a tournament for the current player, for the player's group. More...
 
Promise< TournamentGroupStatusResponseGetGroupStatuses (List< long > groupIds, string contentId)
 Retrieve a set of TournamentGroupStatuss for some set of groups for all tournaments that were spawned from the given content id. More...
 
Promise< string > GetPlayerAlias (long playerId, string statName="alias")
 A utility function to get the alias for a given player. The alias will be found by looking at the player's public stat values. More...
 
Promise< string > GetPlayerAvatar (long playerId, string statName="avatar")
 A utility function to get the avatar key for a given player. The avatar key will be found by looking at the player's public stat values. More...
 
Promise< TournamentStandingsResponseGetGroupPlayers (string tournamentId, int cycle=-1, int from=-1, int max=-1, int focus=-1)
 Retrieve scores for the the group members in the current player's group. More...
 
Promise< TournamentGroupsResponseGetGroups (string tournamentId, int cycle=-1, int from=-1, int max=-1, int focus=-1)
 Retrieve the tournament scores for player groups. When groups participate in leaderboards, the group's score is the sum of all participating members in the group. More...
 

Member Function Documentation

◆ ClaimAllRewards()

Promise< TournamentRewardsResponse > Beamable.Common.Api.Tournaments.TournamentApi.ClaimAllRewards ( string  tournamentId)
inline

Claim all rewards that the current player has earned for previous cycles of a tournament. If you need to show the rewards before claiming them, use the GetUnclaimedRewards method. Use the GetPlayerStatus method to identify tournaments that the player is participating in.

Parameters
tournamentIdThe runtime id of a tournament.
Returns
A Promise containing a TournamentRewardsResponse that has a list of TournamentRewardCurrencys the player claimed.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetAllTournaments()

Promise< TournamentInfoResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetAllTournaments ( string  contentId = null,
int?  cycle = null,
bool?  isRunning = null 
)
inline

Find all the tournaments that match given criteria.

Parameters
contentIdIf included, only tournaments that were created from the given tournament content id will be included.
cycleIf included, only tournaments with a matching TournamentInfo.cycle will be included.
isRunningIf included, only tournaments that are running will be included.
Returns
A Promise containing the TournamentInfoResponse will all the matching TournamentInfo objects.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetChampions()

Promise< TournamentChampionsResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetChampions ( string  tournamentId,
int  cycleLimit = 30 
)
inline

Tournament champions are players who came in first across all stages and tiers for a given cycle. This method will fetch the latest cycle winners. Use the GetStandings method to get the standings for the current player's stage and tier.

Parameters
tournamentIdThe runtime id of a tournament.
cycleLimitThe number of cycles in history to look back to see champions for.
Returns
A Promise containing a TournamentChampionsResponse which contains the champions for the number cycles requested.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetGlobalStandings()

Promise< TournamentStandingsResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetGlobalStandings ( string  tournamentId,
int  cycle = -1,
int  from = -1,
int  max = -1,
int  focus = -1 
)
inline

Players participating in a tournament are segmented into different leaderboard partitions to limit the size of the leaderboard any given player sees. Global standings are the scores across all stages, tiers, and partitions. Use the GetStandings method to get the standings for the current player's stage and tier.

Parameters
tournamentIdThe runtime id of a tournament.
cycleThe relative of number cycles in the past to look for the global standings. Leaving this blank, or passing 0, will get the global standings for the current cycle. For example, if the value is 2, the resulting global standings will be from 2 cycles ago.
fromHow many entries from the top of the list to skip before returning data. Used with max, this can be used to page the global standings.
maxLimit the number of entries that will be returned. used with from, this can be used to page the global standings.
focusThe gamertag of a player to focus the results for. A focused response will include the given player, and surrounding scores.
Returns
A Promise<T> containing a TournamentStandingsResponse where the inner standings are global.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetGroupPlayers()

Promise< TournamentStandingsResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetGroupPlayers ( string  tournamentId,
int  cycle = -1,
int  from = -1,
int  max = -1,
int  focus = -1 
)
inline

Retrieve scores for the the group members in the current player's group.

Parameters
tournamentIdThe runtime id of a tournament.
cycleThe relative of number cycles in the past to look for the standings. Leaving this blank, or passing 0, will get the standings for the current cycle. For example, if the value is 2, the resulting standings will be from 2 cycles ago.
fromHow many entries from the top of the list to skip before returning data. Used with max, this can be used to page the standings.
maxLimit the number of entries that will be returned. used with from, this can be used to page the standings.
focusThe gamertag of a player to focus the results for. A focused response will include the given player, and surrounding scores.
Returns
A Promise<T> containing a TournamentStandingsResponse where the inner standings are for the player's group members.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetGroups()

Promise< TournamentGroupsResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetGroups ( string  tournamentId,
int  cycle = -1,
int  from = -1,
int  max = -1,
int  focus = -1 
)
inline

Retrieve the tournament scores for player groups. When groups participate in leaderboards, the group's score is the sum of all participating members in the group.

Parameters
tournamentIdThe runtime id of a tournament.
cycleThe relative of number cycles in the past to look for the group standings. Leaving this blank, or passing 0, will get the standings for the current cycle. For example, if the value is 2, the resulting standings will be from 2 cycles ago.
fromHow many entries from the top of the list to skip before returning data. Used with max, this can be used to page the group standings.
maxLimit the number of entries that will be returned. used with from, this can be used to page the group standings.
focusThe id of a group to focus the results for. A focused response will include the given group, and surrounding scores.
Returns
A Promise<T> containing a TournamentGroupsResponse where the inner standings are relative the current player's tier and stage.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetGroupStatus()

Promise< TournamentGroupStatusResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetGroupStatus ( string  tournamentId = null,
string  contentId = null 
)
inline

Retrieve a set of TournamentGroupStatuss for all matching tournaments. The TournamentGroupStatus is a view of a tournament for the current player, for the player's group.

Parameters
tournamentIdA tournament runtime id. If this is argument is provided, then the resulting list may only contain up to one TournamentGroupStatus, which represents the current player's group status on the given tournament id.
contentIdA tournament content id. If this argument is provided, then the resulting list may contain all TournamentGroupStatuss for each tournament that was spawned from the given content id.
Returns

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetGroupStatuses()

Promise< TournamentGroupStatusResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetGroupStatuses ( List< long >  groupIds,
string  contentId 
)
inline

Retrieve a set of TournamentGroupStatuss for some set of groups for all tournaments that were spawned from the given content id.

Parameters
groupIdsA list of group ids to get TournamentGroupStatus for. There should be a TournamentGroupStatus instance per group id, per tournament.
contentIdA tournament content id.
Returns

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetPlayerAlias()

Promise< string > Beamable.Common.Api.Tournaments.TournamentApi.GetPlayerAlias ( long  playerId,
string  statName = "alias" 
)
inline

A utility function to get the alias for a given player. The alias will be found by looking at the player's public stat values.

Parameters
playerIdThe gamertag of the player to get the alias for.
statNameThe stat name where the alias is kept. By default, this is "alias"
Returns
A Promise<T> containing the player's alias.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetPlayerAvatar()

Promise< string > Beamable.Common.Api.Tournaments.TournamentApi.GetPlayerAvatar ( long  playerId,
string  statName = "avatar" 
)
inline

A utility function to get the avatar key for a given player. The avatar key will be found by looking at the player's public stat values.

Parameters
playerIdThe gamertag of the player to get the avatar key for.
statNameThe stat name where the avatar key is kept. By default, this is "avatar"
Returns
A Promise<T> containing the player's avatar key.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetPlayerStatus()

Promise< TournamentPlayerStatusResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetPlayerStatus ( string  tournamentId = null,
string  contentId = null,
bool?  hasUnclaimedRewards = null 
)
inline

Retrieve a set of TournamentPlayerStatuss for all matching tournaments. The TournamentPlayerStatus is a view of a tournament for the current player.

Parameters
tournamentIdA tournament runtime id. If this is argument is provided, then the resulting list may only contain up to one TournamentPlayerStatus, which represents the current player's status on the given tournament id.
contentIdA tournament content id. If this argument is provided, then the resulting list may contain all TournamentPlayerStatuss for each tournament that was spawned from the given content id.
hasUnclaimedRewardsWhen true, the resulting list will only contain TournamentPlayerStatuss for tournaments that have unclaimed rewards. This can be used in conjunction with the ClaimAllRewards to claim all pending rewards for the player.
Returns
A Promise<T> containing a TournamentPlayerStatusResponse which contains a list of TournamentPlayerStatus for each matching tournament.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetStandings()

Promise< TournamentStandingsResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetStandings ( string  tournamentId,
int  cycle = -1,
int  from = -1,
int  max = -1,
int  focus = -1 
)
inline

Retrieve the scores for the current player's stage and tier in the tournament.

Parameters
tournamentIdThe runtime id of a tournament.
cycleThe relative of number cycles in the past to look for the standings. Leaving this blank, or passing 0, will get the standings for the current cycle. For example, if the value is 2, the resulting standings will be from 2 cycles ago.
fromHow many entries from the top of the list to skip before returning data. Used with max, this can be used to page the standings.
maxLimit the number of entries that will be returned. used with from, this can be used to page the standings.
focusThe gamertag of a player to focus the results for. A focused response will include the given player, and surrounding scores.
Returns
A Promise<T> containing a TournamentStandingsResponse where the inner standings are relative the current player's tier and stage.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetTournamentInfo()

Promise< TournamentInfo > Beamable.Common.Api.Tournaments.TournamentApi.GetTournamentInfo ( string  tournamentContentId)
inline

Find the first TournamentInfo that matches the given tournament content id.

Parameters
tournamentContentIdA tournament content id.
Returns
A Promise<T> containing the first TournamentInfo whose TournamentInfo.contentId matches the tournamentContentId

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ GetUnclaimedRewards()

Promise< TournamentRewardsResponse > Beamable.Common.Api.Tournaments.TournamentApi.GetUnclaimedRewards ( string  tournamentId)
inline

Retrieve a list of unclaimed rewards that the current player has earned from previous cycles of a tournament. This method can be used to show a player what rewards they will acquire before they are claimed. Use the ClaimAllRewards method to actually claim the rewards. Use the GetPlayerStatus method to identify tournaments that the player is participating in.

Parameters
tournamentIdThe runtime id of a tournament.
Returns
A Promise containing a TournamentRewardsResponse that has a list of TournamentRewardCurrencys the player has earned.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ JoinTournament()

Promise< TournamentPlayerStatus > Beamable.Common.Api.Tournaments.TournamentApi.JoinTournament ( string  tournamentId,
double  startScore = 0 
)
inline

A player must join a tournament before they can submit scores with the SetScore method. Once a player has joined a tournament, they will be given scores for all future cycles of the tournament. There is no way to leave a tournament.

Parameters
tournamentIdThe runtime id of a tournament.
startScoreAn initial score for the player.
Returns
A Promise<T> containing a TournamentPlayerStatus for the current player's view of the tournament.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.

◆ SetScore()

Promise< Unit > Beamable.Common.Api.Tournaments.TournamentApi.SetScore ( string  tournamentId,
long  dbid,
double  score,
bool  incrementScore = false 
)
inline

Set the tournament score for the given dbid. The player must have joined the tournament using the JoinTournament method before they can submit scores.

Parameters
tournamentIdThe runtime id of a tournament.
dbidThe gamertag of the player that will have their score updated.
scoreIf the incrementScore is false (which it is by default), then the score will be the player's new score. However, if the incrementScore is true, then the score will be added to the player's existing score. Negative values would lower the player's score.
incrementScoreWhen true, the score value will be added to the player's existing score. When false, the score value will become the player's new score.
Returns
A Promise<T> representing the network call.

Implements Beamable.Common.Api.Tournaments.ITournamentApi.


The documentation for this class was generated from the following file: