Inheritance: Object → ITournamentMatchCallbackHandler
This interface is meant to be implemented by tournament match handler for providing connection between tournament hub and games room/lobby handling API. (E.g. set up a private game room with specific parameters, check who is connected, start a game session, etc.) Tournament match handler implementing this interface can be then passed to JoinTournamentMatch(TournamentMatch, ITournamentMatchCallbackHandler) method in tournament hub controller. Purpose of this interface is to provide information exchange between tournament hub and games room/lobby handling API.
public interface ITournamentMatchCallbackHandler
Callback from tournament hub to check if client is successfully connected to your networking backend.
public abstract virtual bool IsConnectedToGameServerNetwork()
True if user is connected and ready to join given match.
Callback from tournament hub to check if game session is already in progress for connected tournament match.
public abstract virtual bool IsGameSessionInProgress()
True if game session is in progress.
Callback from tournament hub to check if specific user is already connected to lobby/room. This method is called for every user that is expected to be in connected tournament match.
public abstract virtual bool IsUserConnectedToMatch(long userId)
userId: Backbone user id.
True if user is connected.
Callback from tournament hub to check if specific user is ready (E.g. moved to correct slot).
public abstract virtual bool IsUserReadyForMatch(long userId)
userId: Backbone user id.
True if user is ready to start.
OnJoinTournamentMatch(Tournament, TournamentMatch, ITournamentMatchController)
Callback from tournament hub passing tournament, match and match controller object. Use match data to join correct lobby/room (E.g. using match Secret as room id). Use match controller to inform tournament hub about changes in your lobby/room (E.g. new player connected, player disconnected, etc.).
public abstract virtual void OnJoinTournamentMatch(Gimmebreak.Backbone.Tournaments.Tournament tournament, Gimmebreak.Backbone.Tournaments.TournamentMatch match, Gimmebreak.Backbone.Tournaments.ITournamentMatchController controller)
tournament: Tournament which initiate this match.
match: Tournament match requested to be joined.
controller: Tournament match controller for interaction with related tournament hub.
If you require specific parameters for room/lobby API (E.g. map, modes, allowed abilities, etc.), you can use tournament custom properties providing the info. This method is also called only once therefore any room/lobby joining procedure should repeatedly try to connect until OnLeaveTournamentMatch() is called.
Callback from tournament hub informing user should leave joined lobby/room.
public abstract virtual void OnLeaveTournamentMatch()
Callback from tournament hub requesting game session to start immediately. Also passing users that successfully checked in for current match. Create tournament game session, and start your game. This might be called multiple times until IsGameSessionInProgress() returns true.
public abstract virtual void StartGameSession(System.Collections.Generic.IEnumerable<Gimmebreak.Backbone.Tournaments.TournamentMatch.User> checkedInUsers)
checkedInUsers: Users that checked in for match. (In case of parties, only users from fully checked in parties)
When this method is called, user should initiate CreateGameSession(TournamentMatch.User, long, byte) on backbone client. After user receives a valid tournament game session it should proceed to start a game.