Interface
ITournamentHubController
This interface provides a set of methods for the user to interact with tournaments via a connected tournament hub (ITournamentHubCallbackHandler
). After the tournament hub is initialized, the controller implementing this interface is provided to the tournament hub. Use the tournament hub controller to join the user's active match and receive tournament match status updates. When calling JoinTournamentMatch()
, a tournament match handler can be provided that creates an interface between the tournament hub and the game room/lobby API.
ActiveMatchFinishDeadlineCountdown
Determine the remaining time until the user's active match has to be finished.
Remarks
The finish deadline can be obtained for any match from the match property Deadline
.
ActiveMatchFinishDeadlineCountdown
public abstract virtual TimeSpan ActiveMatchFinishDeadlineCountdown
{
get;
}
ActiveMatchStartDeadlineCountdown
Determine the remaining time until the user's active match should start.
Remarks
The start deadline can be obtained for any match by calling tournament.GetMatchStartDeadline(TournamentMatch)
.
ActiveMatchStartDeadlineCountdown
public abstract virtual TimeSpan ActiveMatchStartDeadlineCountdown
{
get;
}
IsConnectedToGameServerNetwork
Determine if the tournament match handler is connected to game servers.
Remarks
This can be used to inform the UI (e.g., the tournament handler is switching to the preferred tournament server region).
IsConnectedToGameServerNetwork
public abstract virtual bool IsConnectedToGameServerNetwork
{
get;
}
IsGameSessionInProgress
public abstract virtual bool IsGameSessionInProgress
{
get;
}
IsMatchHandlerInitialized
Determine if the tournament match handler is initialized.
Remarks
This is set to true after a successful call to JoinTournamentMatch(TournamentMatch, ITournamentMatchCallbackHandler)
. It is also set back to false after calling LeaveTournamentMatch()
.
IsMatchHandlerInitialized
public abstract virtual bool IsMatchHandlerInitialized
{
get;
}
IsTournamentRunning
public abstract virtual bool IsTournamentRunning
{
get;
}
IsUserKnockedOut
public abstract virtual bool IsUserKnockedOut
{
get;
}
NextEventCountdown
Determine the remaining time until the next deciding event for the user. (e.g., remaining time until the tournament starts.)
NextEventCountdown
public abstract virtual TimeSpan NextEventCountdown
{
get;
}
PartyInvites
Get all party invites the user received for this tournament. This contains also dismissed invites.
Remarks
To refresh user invites (e.g., to get recently received ones) call LoadNotifications()
on the backbone client.
PartyInvites
public abstract virtual IEnumerable<TournamentPartyInviteNotification> PartyInvites
{
get;
}
Status
public abstract virtual TournamentHubStatus Status
{
get;
}
Tournament
public abstract virtual Tournament Tournament
{
get;
}
IsUserConnectedToMatch(long)
Determine if a specific user is connected to the tournament match room/lobby.
Parameters
- Name
userId
- Type
- long
- Description
Backbone user ID.
Returns
True if the user is connected.
Remarks
This can be used to inform the UI (e.g., the tournament user is connected in the room/lobby).
IsUserConnectedToMatch(long)
public abstract virtual bool IsUserConnectedToMatch(long userId)
IsUserReadyForMatch(long)
Determine if a specific user is ready for the tournament match.
Parameters
- Name
userId
- Type
- long
- Description
Backbone user ID.
Returns
True if the user is ready.
Remarks
This can be used to inform the UI (e.g., the user is connected in the room/lobby, is set on the desired room slot, etc.).
IsUserReadyForMatch(long)
public abstract virtual bool IsUserReadyForMatch(long userId)
JoinTournamentMatch(TournamentMatch, ITournamentMatchCallbackHandler)
Inform the tournament hub that the user wants to join a specific match and initiate a connection to the game room/lobby. It also requires passing a tournament match callback handler (ITournamentMatchCallbackHandler
) that is an interface to the game room/lobby handling API (e.g., set up a private game room with specific parameters).
Parameters
- Name
TournamentMatch
- Type
- match
- Description
Tournament match the user wants to join
- Name
ITournamentMatchCallbackHandler
- Type
- tournamentMatchHandler
- Description
Tournament match handler implementing ITournamentMatchCallbackHandler interfacing the room/lobby handling API.
Remarks
After requesting to join a match, the tournament hub will start receiving tournament match status via the callback OnHubMatchStatusChanged(TournamentHubMatchStatus)
.
JoinTournamentMatch(TournamentMatch, ITournamentMatchCallbackHandler)
public abstract virtual void JoinTournamentMatch(Gimmebreak.Backbone.Tournaments.TournamentMatch match, Gimmebreak.Backbone.Tournaments.ITournamentMatchCallbackHandler tournamentMatchHandler)
LeaveTournamentMatch()
Leave the joined tournament match.
Remarks
After requesting to leave a match, the tournament hub will stop receiving tournament match status via the callback OnHubMatchStatusChanged(TournamentHubMatchStatus)
. This will also prompt the tournament match handler to leave the joined room/lobby.
LeaveTournamentMatch()
public abstract virtual void LeaveTournamentMatch()
RefreshActiveMatch()
public abstract virtual void RefreshActiveMatch()
SetUserReady()
User informs the tournament that they are ready for the next match. This is meant to be used when the tournament hub status is set to TournamentHubStatus.WaitingForUserReadyConfirmation
.
Remarks
Almost every time a user finishes a match, the system does not immediately move users to the next round. It also depends on the specific phase format if the user will be given an autolose or moved to the next match when the round finishes. For example, in a bracket setup, winning users are moved forward when the round is finished. In an arena setup, users will be given an autolose for failing to call SetUserReady()
.
SetUserReady()
public abstract virtual void SetUserReady()