This document is about: QUANTUM 2
SWITCH TO

API-ITournamentMatchCallbackHandler


Available in the Gaming Circle and Industries Circle
Circle

Namespace: Gimmebreak.Backbone.Tournaments

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.

C#

public interface ITournamentMatchCallbackHandler

Methods

IsConnectedToGameServerNetwork()

Callback from tournament hub to check if client is successfully connected to your networking backend.

C#

public abstract virtual bool IsConnectedToGameServerNetwork()

Returns

True if user is connected and ready to join given match.

IsGameSessionInProgress()

Callback from tournament hub to check if game session is already in progress for connected tournament match.

C#

public abstract virtual bool IsGameSessionInProgress()

Returns

True if game session is in progress.

IsUserConnectedToMatch(long)

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.

C#

public abstract virtual bool IsUserConnectedToMatch(long userId)

Parameters

  • userId: Backbone user id.

Returns

True if user is connected.

IsUserReadyForMatch(long)

Callback from tournament hub to check if specific user is ready (E.g. moved to correct slot).

C#

public abstract virtual bool IsUserReadyForMatch(long userId)

Parameters

  • userId: Backbone user id.

Returns

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.).

C#

public abstract virtual void OnJoinTournamentMatch(Gimmebreak.Backbone.Tournaments.Tournament tournament, Gimmebreak.Backbone.Tournaments.TournamentMatch match, Gimmebreak.Backbone.Tournaments.ITournamentMatchController controller)

Parameters

  • tournament: Tournament which initiate this match.
  • match: Tournament match requested to be joined.
  • controller: Tournament match controller for interaction with related tournament hub.

Remarks

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.

OnLeaveTournamentMatch()

Callback from tournament hub informing user should leave joined lobby/room.

C#

public abstract virtual void OnLeaveTournamentMatch()

StartGameSession(IEnumerable<TournamentMatch.User>)

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.

C#

public abstract virtual void StartGameSession(System.Collections.Generic.IEnumerable<Gimmebreak.Backbone.Tournaments.TournamentMatch.User> checkedInUsers)

Parameters

  • checkedInUsers: Users that checked in for match. (In case of parties, only users from fully checked in parties)

Remarks

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.

Back to top