API-Tournament
Namespace: Gimmebreak.Backbone.Tournaments
Inheritance: Object → Tournament
Represents exactly one specific instance of tournament holding all necessary information.
To load tournament data call LoadTournamentList() or LoadTournament() on backbone client.
All tournament instances can be found in client.Tournaments.TournamentList.
C#
public class Tournament
Constructors
Tournament()
Create an instance of tournament.
C#
public Tournament()
Properties
AdditionalDescription
Get additional description of this tournament if any.
C#
public string AdditionalDescription
{
get;
set;
}
AllMatches
All tournament matches from all phases.
This field can be populated with LoadTournamentMatches() or LoadTournamentMatchesAll() call on backbone client.
C#
public List<TournamentMatch> AllMatches
{
get;
set;
}
CurrentInvites
Determine current active invites/registrations for tournament.
This always represents a single user even if tournament is set to have parties/teams.
C#
public int CurrentInvites
{
get;
set;
}
CurrentPhaseId
Determine current active phase Id (If id=0 then tournament was not initiated yet, first phase always starts with id=1).
C#
public int CurrentPhaseId
{
get;
set;
}
CurrentPhaseStarted
Determine when current phase started.
This is UTC datetime.
C#
public DateTime CurrentPhaseStarted
{
get;
set;
}
CustomProperties
Get tournament custom properties. (e.g. game mode, allowed abilities, allowed maps, etc.)
C#
public TournamentCustomProperties CustomProperties
{
get;
set;
}
Description
Get description of this tournament if any.
C#
public string Description
{
get;
set;
}
EntryFee
Determine entry fee of this tournament.
This will not be null even if tournament does not have any entry fees set up, however EntryFee.Items will be empty.
C#
public TournamentEntryFee EntryFee
{
get;
set;
}
HasAllDataLoaded
Determine if all tournament data were loaded.
C#
public bool HasAllDataLoaded
{
get;
set;
}
Remarks
This is set to false if tournament was loaded only with LoadTournamentList() call on backbone client.
This is set to true if tournament was loaded with LoadTournament() call on backbone client.
HighlightsUrl
Get highlights url of tournament if any.
C#
public string HighlightsUrl
{
get;
set;
}
IconUrl
Get icon url of this tournament if any.
C#
public string IconUrl
{
get;
set;
}
Id
Tournament unique id.
C#
public long Id
{
get;
set;
}
ImageUrl
Get image url of this tournament if any.
C#
public string ImageUrl
{
get;
set;
}
InvitationCloseTime
Determine when invitation closes.
After this point nobody can sign up or sign out.
This is UTC datetime.
C#
public DateTime InvitationCloseTime
{
get;
set;
}
InvitationOpenTime
Determine when invitation opens.
This is UTC datetime.
C#
public DateTime InvitationOpenTime
{
get;
set;
}
Remarks
When invitation opens then only user who has a direct invite can sign up.
Direct invites can represent winners from previous tournaments or specific users set up in dashboard.
This means you can give time priority to those users for sign up before public registration opens.
Invite
Get tournament invite/ticket.
If user was invited to the tournament, ticket is available but not confirmed.
This property is null if user was not automatically invited or signed up for the tournament.
C#
public TournamentInvite Invite
{
get;
set;
}
IsAdministrator
Determine if user is administrator of this tournament.
Administrator can access match secrets when browsing matches and therefore join as spectator.
C#
public bool IsAdministrator
{
get;
set;
}
IsInvitationOnly
Determine if tournament is only for invited users.
If set to true then RegistrationOpenTime should not be used as it does not contain valid value.
C#
public bool IsInvitationOnly
{
get;
set;
}
LastMatchRoundId
Determine last round id of match that user played.
C#
public int LastMatchRoundId
{
get;
set;
}
LastUpdate
Determine last tournament data update.
C#
public DateTime LastUpdate
{
get;
set;
}
MaxInvites
Determine max invites/registrations for tournament.
This always represents a single user even if tournament is set to have parties/teams.
C#
public int MaxInvites
{
get;
set;
}
NextPhase
Determine time when next phase will start.
This is UTC datetime.
C#
public DateTime NextPhase
{
get;
set;
}
Remarks
If all matches have been played in current phase then tournament might progress to next phase sooner to prevent unnecessary wating for users.
Party
Get user party (signup user is always in a party, even in 1v1).
This property is null until user signs up for the tournament.
C#
public TournamentParty Party
{
get;
set;
}
Remarks
Signed up user is always in a party.
If user leaves party then he is automatically assigned a new one.
PartySize
Determine requried party size for tournament (E.g. 1v1, 2v2, 3v3, etc).
C#
public int PartySize
{
get;
set;
}
PhaseCount
Determine how many phases are in tournament (always at least one).
C#
public int PhaseCount
{
get;
set;
}
Phases
List of all tournament phases.
Tournament always has at least one phase (PhaseId = 1).
C#
public List<TournamentPhase> Phases
{
get;
set;
}
PolicyURL
Get policy url of this tournament if any.
C#
public string PolicyURL
{
get;
set;
}
PrivateCode
Get private code of this tournament.
Can be shared with other users to sign up for private tournaments.
C#
public string PrivateCode
{
get;
set;
}
Remarks
Private code is generated only if this type of invite is enabled in dashboard.
Prizes
List of tournament prizes.
C#
public List<TournamentPrize> Prizes
{
get;
set;
}
RegistrationOpenTime
Determine when registration opens.
This property is set only if IsInvitationOnly is set to false.
This is UTC datetime.
C#
public DateTime RegistrationOpenTime
{
get;
set;
}
Remarks
When registration opens then any user can sign up.
ReplayExpires
Determine when replay url expires (e.g. twitch after 14 days)
This is UTC datetime.
C#
public DateTime ReplayExpires
{
get;
set;
}
ReplayUrl
Get replay url of tournament if any. (E.g. twitch VOD)
C#
public string ReplayUrl
{
get;
set;
}
Requirements
Determine tournament requiremts for signup.
This will not be null even if tournament does not have any custom requirements set up, however Requirements.CustomRequirements will be empty.
C#
public TournamentRequirements Requirements
{
get;
set;
}
RoundCount
Determine how many rounds in total are in tournament (always at least one).
C#
public int RoundCount
{
get;
set;
}
Season
Determine which season tournament is created in.
C#
public int Season
{
get;
set;
}
SeasonPart
Determine which season part tournament is created in.
C#
public int SeasonPart
{
get;
set;
}
SponsorImageUrl
Get sponsor image.
C#
public string SponsorImageUrl
{
get;
set;
}
SponsorName
Get sponsor name.
C#
public string SponsorName
{
get;
set;
}
Status
Current status of tournament. (E.g. Invitation Open, Finished, etc.)
To get more detailed statuses you have to connect tournament with tournament hub.
C#
public TournamentStatus Status
{
get;
set;
}
StreamUrl
Get tournament stream url if any.
C#
public string StreamUrl
{
get;
set;
}
ThemeColor
Get theme color of this tournament if any.
C#
public string ThemeColor
{
get;
set;
}
Time
Determine start time of tournament.
This is UTC datetime.
C#
public DateTime Time
{
get;
set;
}
TournamentName
Tournament official name.
C#
public string TournamentName
{
get;
set;
}
Type
Determine type of tournament. (E.g. public, private, testing)
Some tournament types are only visible to certain users.
C#
public TournamentType Type
{
get;
set;
}
UserActiveMatch
Currently active match for the user which he should join.
This is only applicable for users that are signed up for the tournament.
C#
public TournamentMatch UserActiveMatch
{
get;
set;
}
Remarks
This property is automatically set when user connects to tournament hub.
In some situations user will be asked by tournament hub to explicitly confirm that he is ready before tournament match is assigned.
UserMatches
All user matches from all phases.
C#
public List<TournamentMatch> UserMatches
{
get;
set;
}
Remarks
If user failed to start certain rounds on time and totally skiped some round matches (autolose) then those matches will not be present in this list.
Use UserPlayedRoundCount property on tournament phase object to determine if user actually missed a match.
Winner
Get basic tournament winner data.
This contains list of all users in all parties that finished on first position.
C#
public TournamentWinner Winner
{
get;
set;
}
Remarks
If last phase of tournament has groups then tournament can have multiple winners as final position is calculated within a group.
Methods
GetCurrentTournamentPhase()
Get current tournament phase.
C#
public Gimmebreak.Backbone.Tournaments.TournamentPhase GetCurrentTournamentPhase()
Returns
Tournament phase or null if tournament has not started yet. Finished tournament always returns last phase.
GetMatchMinGameLength(TournamentMatch)
Get minimum lenght (in minutes) required for a game to be played.
C#
public int GetMatchMinGameLength(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
Minimum lenght (in minutes).
GetMatchNextGameDeadline(TournamentMatch)
Calculate a finish deadline for next game within a match.
This deadline is calculated in a way there is still at least minimum game time for each game that has to be played.
C#
public System.DateTime GetMatchNextGameDeadline(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
Maximum possible finish deadline for a next game.
GetMatchNextGameFinishDeadline(TournamentMatch)
Calculate a finish deadline for next game within a match.
This deadline is calculated in a way there is still at least minimum game time for each game that has to be played.
C#
public System.DateTime GetMatchNextGameFinishDeadline(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
Maximum possible finish deadline for a next game.
GetMatchNextGameStartDeadline(TournamentMatch)
Calculate a start deadline for next game within a match.
This deadline is calculated in a way there is still at least minimum game time for each game that has to be played.
C#
public System.DateTime GetMatchNextGameStartDeadline(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
Maximum possible start deadline for a next game.
GetMatchStartDeadline(TournamentMatch)
Determine deadline after which match has to start in order to be able accommodate all required games each to be played with at least minimum game time.
C#
public System.DateTime GetMatchStartDeadline(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
Deadline after which match has to start.
GetThemeColor()
Get tournament theme color.
C#
public UnityEngine.Color GetThemeColor()
Returns
Unity color.
GetTournamentMatchById(long)
Get tournament match by its unique id.
C#
public Gimmebreak.Backbone.Tournaments.TournamentMatch GetTournamentMatchById(long tournamentMatchId)
Parameters
tournamentMatchId
: Tournament match id.
Returns
Tournament match or null if match cannot be found.
Remarks
This method searches for the match locally and does not access server data.
If match id is valid but method return null populate local data with LoadTournamentMatches() on backbone client.
GetTournamentMatchMaxGameCount(TournamentMatch)
Determine maximum allowed number of games to be played in specific match.
Once this value is reached then system will determine winners by scored points from all played games.
C#
public int GetTournamentMatchMaxGameCount(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
Maximum allowed number of games.
GetTournamentMatchMinCheckinsPerTeam(TournamentMatch)
Determine required win score for specific match.
Win score determines how many times user has to place on scored position in order to win the match.
C#
public int GetTournamentMatchMinCheckinsPerTeam(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
Win score for specific match.
GetTournamentMatchWinScore(TournamentMatch)
Determine required win score for specific match.
Win score determines how many times user has to place on scored position in order to win the match.
C#
public int GetTournamentMatchWinScore(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
Win score for specific match.
GetTournamentPhaseById(int)
Get specific tournament phase by its id.
C#
public Gimmebreak.Backbone.Tournaments.TournamentPhase GetTournamentPhaseById(int phaseId)
Parameters
phaseId
: Tournament phase id (first phase always starts with id=1).
Returns
Tournament phase or null if phase does not exists.
GetTournamentPhaseFinishTime(int)
Get finish timestamp of specific tournament phase.
C#
public System.DateTime GetTournamentPhaseFinishTime(int phaseId)
Parameters
phaseId
: Phase id.
Returns
Finish timestamp of requested phase.
GetTournamentPhaseMaxLength(int)
Get tournament phase maximum time lenght in minutes. This is a sum of all round MaxLength values.
C#
public int GetTournamentPhaseMaxLength(int phaseId)
Parameters
phaseId
: Phase id.
Returns
Length of tournament phase in minutes.
GetTournamentPhaseRoundFinishTime(int, int)
Get round finish timestamp in currently active tournament phase.
C#
public System.DateTime GetTournamentPhaseRoundFinishTime(int phaseId, int roundId)
Parameters
phaseId
: Phase id.roundId
: Round id.
Returns
Finish timestamp of requested round.
GetTournamentPhaseRoundStartTime(int, int)
Get round start timestamp in currently active tournament phase.
C#
public System.DateTime GetTournamentPhaseRoundStartTime(int phaseId, int roundId)
Parameters
phaseId
: Phase id.roundId
: Round id.
Returns
Start timestamp of requested round.
GetTournamentPhaseStartTime(int)
Get start timestamp of specific tournament phase.
C#
public System.DateTime GetTournamentPhaseStartTime(int phaseId)
Parameters
phaseId
: Phase id.
Returns
Start timestamp of requested phase.
IsMatchInLoserBracket(TournamentMatch)
Determine if match is in loser bracket.
This is used for double elimination braket format.
C#
public bool IsMatchInLoserBracket(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
True if match is in loser bracket.
IsMatchInWinnerBracket(TournamentMatch)
Determine if match is in winner bracket.
This is used for double elimination braket format.
C#
public bool IsMatchInWinnerBracket(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
True if match is in winners bracket.
IsMatchMergingInLoserBracket(TournamentMatch)
Determine if match is merging within loser bracket.
This is used for double elimination braket format.
C#
public bool IsMatchMergingInLoserBracket(Gimmebreak.Backbone.Tournaments.TournamentMatch match)
Parameters
match
: Tournament match.
Returns
True if match is merging in loser bracket.
Remarks
Merging in loser bracket meant that winner of loser bracket match will face another winner of loser bracket match.
In opposite case, if match is not merging then winner of loser bracket will face loser of winner bracket therefore number of loser bracket matches will be same in next round.
This method helps with UI visualisation of double elimination brackets.