Interface

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.


Method

IsConnectedToGameServerNetwork()

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

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

IsConnectedToGameServerNetwork()

public abstract virtual bool IsConnectedToGameServerNetwork()

Method

IsGameSessionInProgress()

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

Returns True if game session is in progress.

IsGameSessionInProgress()

public abstract virtual bool IsGameSessionInProgress()

Method

IsUserConnectedToMatch(userId)

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.

Parameters

  • Name
    userId
    Type
    long
    Description

    Backbone user id.

Returns True if user is connected.

IsUserConnectedToMatch(long)

public abstract virtual bool IsUserConnectedToMatch(long userId)

Method

IsUserReadyForMatch(userId)

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

Parameters

  • Name
    userId
    Type
    long
    Description

    Backbone user id.

Returns True if user is ready to start.

IsUserReadyForMatch(userId)

public abstract virtual bool IsUserReadyForMatch(long userId)

Method

OnJoinTournamentMatch(Tournament, TournamentMatch, ITournamentMatchController)

Callback from tournament hub passing tournament, match, and match controller object. Use match data to join the 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.).

Parameters

  • Name
    Tournament
    Type
    tournament
    Description

    Tournament which initiated this match.

  • Name
    TournamentMatch
    Type
    match
    Description

    Tournament match requested to be joined.

  • Name
    ITournamentMatchController
    Type
    controller
    Description

    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.

OnJoinTournamentMatch(Tournament, TournamentMatch, ITournamentMatchController)

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

Method

OnLeaveTournamentMatch()

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

Remarks

This method will be called when the user needs to leave the lobby or room they have joined.

OnLeaveTournamentMatch()

public abstract virtual void OnLeaveTournamentMatch()

Method

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.

Parameters

  • Name
    checkedInUsers
    Type
    IEnumerable<TournamentMatch.User>
    Description

    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.

StartGameSession(IEnumerable<TournamentMatch.User>)

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