Available in the Gaming / Industries Circle
quantum | v2 switch to V1  

API-BackboneClient

Namespace: Gimmebreak.Backbone.Core

Inheritance: Object → BackboneClient

Backbone client is entry point how to interact with backbone backend. It encapsulates http API client and provides asynchronous methods for more conviniet implementation.

public sealed class BackboneClient

Contents

Properties

Game

Get games global data. (E.g. game id, global properties)

public GameData Game
{
    get;
}

Back To Top
 

IsInitialized

Determine if client is successfully initialized.

public bool IsInitialized
{
    get;
}

Back To Top
 

IsUserLoggedIn

Determine if user is logged in and has a valid session to do API calls.

public bool IsUserLoggedIn
{
    get;
}

Back To Top
 

Notifications

Get users notification data. (E.g. tournament party invitations)

public NotificationData Notifications
{
    get;
}

Back To Top
 

Season

Get current season data. (E.g. start date, end date, user season stats)

public SeasonData Season
{
    get;
}

Back To Top
 

Tournaments

Get users tournaments data. (E.g. list of tournaments)

public TournamentData Tournaments
{
    get;
}

Back To Top
 

User

Get users data. (E.g. nickname, platform ids, user properties)

public UserData User
{
    get;
}

Back To Top
 

Methods

AcceptPartyInvite(long, Long)

Accepts tournament party invite. User has to sign up for tournament first before he can accept any party invite.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.TournamentAcceptPartyStatus> AcceptPartyInvite(long tournamentId, long partyInviteId)

Parameters

  • tournamentId: Tournament id.
  • partyInviteId: Tournament party invite id.

Returns

Accept party invite status.

Remarks

Party invites are received as notifications (TournamentPartyInviteNotification) and they contain tournamentId as well as partyInviteId.

Back To Top
 

AcceptPartyInvite(long, String)

Accepts tournament party invite by providing shared party code. User has to sign up for tournament first before he can accept any party invite.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.TournamentAcceptPartyStatus> AcceptPartyInvite(long tournamentId, string partyCode)

Parameters

  • tournamentId: Tournament id.
  • partyCode: Tournament party code.

Returns

Accept party invite status.

Remarks

Party codes are created on demand by calling CreatePartyCodeForTournament method. Once a party code exits, it can be shared with other users (e.g. chat) who can use it to join the party.

Back To Top
 

ChangeNickname(string)

Change user nick name. Unique hash number will be given on success.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> ChangeNickname(string nickName)

Parameters

  • nickName: New nick name (max 100 characters).

Returns

True if operation was successfull.

Remarks

If you want to force specific hash number (E.g. to match your own system) use ChangeNickname(string nickName, int preferredNickHash) instead.

Back To Top
 

ChangeNickname(string, Int)

Change user nick name. Desired/preferred hash number can be provided but if combination is already taken then unique hash number will be given on success.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> ChangeNickname(string nickName, int preferredNickHash)

Parameters

  • nickName: New nick name (max 100 characters).
  • preferredNickHash: Desired/preferred hash number.

Returns

True if operation was successfull.

Back To Top
 

ConnectTournamentHub(ITournamentHubCallbackHandler, Tournament)

Connect and initialize tournament hub for specific tournament. Passed tournament hub (ITournamentHubCallbackHandler) will start receiveing callbacks until it is disconnected. This is mainly used for ongoing tournament to propagate tournament state changes via tournament hub.

public void ConnectTournamentHub(Gimmebreak.Backbone.Tournaments.ITournamentHubCallbackHandler tournamentHub, Gimmebreak.Backbone.Tournaments.Tournament tournament)

Parameters

  • tournamentHub: Tournament hub implementing ITournamentHubCallbackHandler.
  • tournament: Specific tournament to initialize tournament hub for.

Remarks

Only one tournament can be connected to tournament hub at a time. Even if different tournament hub object is passed connecting to other tournament it will stop callbacks on previousely connected tournament hub.

Back To Top
 

CreateGameSession(IEnumerable<TournamentMatch.User>, Long, Byte)

Creates game session for specific tournament match. Users passed must be a subset of users specified in tournament match.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.GameSessions.GameSession> CreateGameSession(System.Collections.Generic.IEnumerable<Gimmebreak.Backbone.Tournaments.TournamentMatch.User> users, long tournamentMatchId, byte gameSessionType = 0)

Parameters

  • users: Users participating in tournament match.
  • tournamentMatchId: Tournament match id.
  • gameSessionType: Type of game session (defined in dashboard, e.g. team match, deadmatch, capture flag, etc.)

Returns

Game session with unique Id, returns null if operation failed. Will be needed for reporting results.

Remarks

Same game session is returned for specific tournament match id until results are submitted and game session is closed.

Back To Top
 

CreateGameSession(IEnumerable<GameSession.User>, Long, Byte)

Creates game session for specific tournament match. Users passed must be a subset of users specified in tournament match.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.GameSessions.GameSession> CreateGameSession(System.Collections.Generic.IEnumerable<Gimmebreak.Backbone.GameSessions.GameSession.User> users, long tournamentMatchId, byte gameSessionType = 0)

Parameters

  • users: Users participating in tournament match.
  • tournamentMatchId: Tournament match id.
  • gameSessionType: Type of game session (defined in dashboard, e.g. team match, deadmatch, capture flag, etc.)

Returns

Game session with unique Id, returns null if operation failed. Will be needed for reporting results.

Remarks

Same game session is returned for specific tournament match id until results are submitted and game session is closed.

Back To Top
 

CreatePartyCodeForTournament(long, Bool)

Create party code for tournament that can be shared and used to join the party.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.PartyCodeResult> CreatePartyCodeForTournament(long tournamentId, bool recreate = False)

Parameters

  • tournamentId: Tournament id.
  • recreate: If set to true existing party code will be replaced with new one.

Returns

Result of party create code process.

Remarks

When party code is recreated by setting "recreate" parameter to true then old party code will be rendered invalid and can no longer be used for joining the party.

Back To Top
 

CreatePartyInviteForTournament(long, Long)

Create party invite for tournament by providing user id.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.PartyInviteResult> CreatePartyInviteForTournament(long tournamentId, long inviteUserId)

Parameters

  • tournamentId: Tournament id.
  • inviteUserId: Id of user that will receive party invite.

Returns

Result of party invite process.

Back To Top
 

CreatePartyInviteForTournament(long, LoginProvider.Platform, String)

Create party invite for tournament by providing type and user id of specific platform.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.PartyInviteResult> CreatePartyInviteForTournament(long tournamentId, Gimmebreak.Backbone.User.LoginProvider.Platform inviteUserPlatformType, string inviteUserPlatformId)

Parameters

  • tournamentId: Tournament id.
  • inviteUserPlatformType: Specific platform type.
  • inviteUserPlatformId: Specific platform id.

Returns

Result of party invite process.

Back To Top
 

CreatePartyInviteForTournament(long, String, Int)

Create party invite for tournament by providing users nick name and hash number.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.PartyInviteResult> CreatePartyInviteForTournament(long tournamentId, string inviteUserNick, int inviteUserHash)

Parameters

  • tournamentId: Tournament id.
  • inviteUserNick: Users nick name.
  • inviteUserHash: Users hash number.

Returns

Result of party invite process.

Back To Top
 

DeclinePartyInvite(long)

Decline tournament party invite.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> DeclinePartyInvite(long partyInviteId)

Parameters

  • partyInviteId: Party invite id.

Returns

True if operation was successfull.

Remarks

Declining an invite will not prevent other user to send another one again.

Back To Top
 

DisconnectTournamentHub()

Disconnects tournament hub and stops running callbacks.

public void DisconnectTournamentHub()

Back To Top
 

DismissNotification(Notification)

Dismiss users notification and remove it from active list. Notification is still available until next list refresh. Check IsDismissed property to determine if notification was already dismissed.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> DismissNotification(Gimmebreak.Backbone.Notifications.Notification notification)

Parameters

  • notification: Notification to dismiss.

Returns

Ture if notification was dismissed.

Back To Top
 

DownloadGameSessionReplay(GameSession)

Downloads game session replay if available and populates list of submissions on game session replay object (GameSessions.GameSession.Replay).

public Gimmebreak.Backbone.Core.AsyncOperation<bool> DownloadGameSessionReplay(Gimmebreak.Backbone.GameSessions.GameSession gameSession)

Parameters

  • gameSession: Valid game session.

Returns

True if operation was successful.

Back To Top
 

Initialize(IBackboneClientCallbackHandler)

Initialize Backbone client using setting from Default BackboneClientSetting asset.

public static Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Core.BackboneClient> Initialize(Gimmebreak.Backbone.Core.IBackboneClientCallbackHandler callbackHandler = null)

Parameters

  • callbackHandler: Pass handler that will listen to client callbacks.

Returns

Initialized Backbone client ready for use.

Back To Top
 

Initialize(BackboneClientSetting, IBackboneClientCallbackHandler)

Initialize Backbone client using setting from BackboneClientSetting asset.

public static Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Core.BackboneClient> Initialize(Gimmebreak.Backbone.Core.BackboneClientSetting settings, Gimmebreak.Backbone.Core.IBackboneClientCallbackHandler callbackHandler = null)

Parameters

  • settings: BackboneClientSetting asset.
  • callbackHandler: Pass handler that will listen to client callbacks.

Returns

Initialized Backbone client ready for use.

Back To Top
 

Initialize(Uri, String, IBackboneClientCallbackHandler)

Initialize Backbone client for specific server and game.

public static Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Core.BackboneClient> Initialize(System.Uri server, string gameId, Gimmebreak.Backbone.Core.IBackboneClientCallbackHandler callbackHandler = null)

Parameters

  • server: Server url or ip.
  • gameId: Game id obtained from Backbone dashboard.
  • callbackHandler: Pass handler that will listen to client callbacks.

Returns

Initialized Backbone client ready for use.

Back To Top
 

LoadNotifications()

Load users active notifications (e.g. news, party invites, etc.)

public Gimmebreak.Backbone.Core.AsyncOperation<bool> LoadNotifications()

Returns

True if notifications were loaded

Back To Top
 

LoadTournament(Tournament)

Load all tournament data. (Party users, matches, details, etc.)

public Gimmebreak.Backbone.Core.AsyncOperation<bool> LoadTournament(Gimmebreak.Backbone.Tournaments.Tournament tournament)

Parameters

  • tournament: Tournament to load data for.

Returns

True if data were loaded.

Back To Top
 

LoadTournament(long)

Load all tournament data. (Party users, matches, details, etc.)

public Gimmebreak.Backbone.Core.AsyncOperation<bool> LoadTournament(long tournamentId)

Parameters

  • tournamentId: Tournament id to load data for.

Returns

True if data were loaded.

Back To Top
 

LoadTournamentList()

Load tournament list containing past, upcoming and current tournaments. Loaded tournaments do not contain all metadata. You can check property HasAllDataLoaded. To load all data you have to subsequently call LoadTournament().

public Gimmebreak.Backbone.Core.AsyncOperation<bool> LoadTournamentList()

Returns

True if list was refreshed successfully.

Back To Top
 

LoadTournamentMatches(long, IEnumerable<long>)

Load tournament matches for specific match ids. The return limit is 25 matches per call.

public Gimmebreak.Backbone.Core.AsyncOperation<System.Collections.Generic.List<Gimmebreak.Backbone.Tournaments.TournamentMatch>> LoadTournamentMatches(long tournamentId, System.Collections.Generic.IEnumerable<long> matchIds)

Parameters

  • tournamentId: Tournament id.
  • matchIds: Specific tournament match ids (max 25).

Returns

List of tournament matches on success, otherwise null.

Back To Top
 

LoadTournamentMatches(long, Int, Int, Int, Int, Int, Bool, Int)

Load tournament matches for specific phase. This method allows to browse all matches in tournament.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.MatchesPaginatedResult> LoadTournamentMatches(long tournamentId, int phaseId, int fromRoundId, int toRoundId, int maxResults, int page, bool onlyInProgress, int groupId = 0)

Parameters

  • tournamentId: Tournament id.
  • phaseId: Specific tournament phase to load matches for.
  • fromRoundId: Phase round id to load matches from, inclusive.
  • toRoundId: Phase round id to load matche to, inclusive.
  • maxResults: Max results to be returned per page.
  • page: Requested page number.
  • onlyInProgress: Loads only matches that are in progress.
  • groupId: Specific phase group to load matches for.

Returns

One page of tournament matches.

Back To Top
 

LoadTournamentMatchesAll(long, Int, Int)

Load all tournament matches for specific phase. If phase contains large number of matches the operation will be split into more than one call and can take same time to finish. If you wish to load/refresh only specific matches use LoadTournamentMatches() method. (E.g. to load only matches from first round.)

public Gimmebreak.Backbone.Core.AsyncOperation<System.Collections.Generic.List<Gimmebreak.Backbone.Tournaments.TournamentMatch>> LoadTournamentMatchesAll(long tournamentId, int phaseId, int groupId = 0)

Parameters

  • tournamentId: Tournament id.
  • phaseId: Specific tournament phase to load matches for.
  • groupId: Specific phase group to load matches for.

Returns

List of all phase matches, otherwise null.

Back To Top
 

LoadTournamentMatchGameSessions(TournamentMatch)

Loads finished game sessions of tournament match. Only tournament match that is ongoing or finished will be processed.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> LoadTournamentMatchGameSessions(Gimmebreak.Backbone.Tournaments.TournamentMatch tournamentMatch)

Parameters

  • tournamentMatch: Tournament match that is ongoing or finished.

Returns

True if operation was successfull.

Back To Top
 

LoadTournaments(DateTime, DateTime, Int, Int)

Loads tournaments between specific dates. Loaded tournaments do not contain all metadata. You can check property HasAllDataLoaded. To load all data you have to subsequently call LoadTournament().

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.TournamentsPaginatedResult> LoadTournaments(System.DateTime sinceDate, System.DateTime untilDate, int maxResults = 25, int page = 1)

Parameters

  • sinceDate: UTC date time (smaller value then until date).
  • untilDate: UTC date time (bigger value than since date).
  • maxResults: Max results to be returned per page.
  • page: Requested page number.

Returns

One page of tournament.

Back To Top
 

LoadTournamentsAll(DateTime, DateTime)

Load all tournaments between specific dates. Loaded tournaments do not contain all metadata. You can check property HasAllDataLoaded. To load all data you have to subsequently call LoadTournament(). If time frame contains large number of tournaments the operation will be split into more than one call and can take same time to finish. If you wish to load/refresh only specific tournaments use LoadTournaments() method.

public Gimmebreak.Backbone.Core.AsyncOperation<System.Collections.Generic.List<Gimmebreak.Backbone.Tournaments.Tournament>> LoadTournamentsAll(System.DateTime sinceDate, System.DateTime untilDate)

Parameters

  • sinceDate: UTC date time (smaller value then until date).
  • untilDate: UTC date time (bigger value than since date).

Returns

List of all tournaments between dates, otherwise null.

Back To Top
 

LoadTournamentScores(long, Int, Int, Int, Int)

Load tournament scores for specific phase. This method allows to browse all party scores in tournament.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.ScoresPaginatedResult> LoadTournamentScores(long tournamentId, int phaseId, int maxResults, int page, int groupId = 0)

Parameters

  • tournamentId: Tournament id.
  • phaseId: Specific tournament phase to load scores for.
  • maxResults: Max results to be returned per page.
  • page: Requested page number.
  • groupId: Specific phase group to load scores for.

Returns

One page of tournament scores.

Back To Top
 

LoadTournamentScoresAll(long, Int, Int)

Load all tournament scores for specific phase. If phase contains large number of parties the operation will be split into more than one call and can take same time to finish. If you wish to load/refresh only specific scores use LoadTournamentScores() method. (E.g. to load only scores from top 10 places.)

public Gimmebreak.Backbone.Core.AsyncOperation<System.Collections.Generic.List<Gimmebreak.Backbone.Tournaments.TournamentScore>> LoadTournamentScoresAll(long tournamentId, int phaseId, int groupId = 0)

Parameters

  • tournamentId: Tournament id.
  • phaseId: Specific tournament phase to load scores for.
  • groupId: Specific phase group to load scores for.

Returns

List of all phase scores, otherwise null.

Back To Top
 

LoadUserSeasonProfile(long, Int)

Loads user profile for specific season. This contains stats such as played games, tournaments, etc., as well as last played game sessions.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Season.UserSeasonProfile> LoadUserSeasonProfile(long userId, int season)

Parameters

  • userId: User id
  • season: Season number, starting with 1.

Returns

User season profile if operation was successfull.

Back To Top
 

LoadUserSeasonProfile(LoginProvider.Platform, String, Int)

Loads user profile for specific season. This contains stats such as played games, tournaments, etc., as well as last played game sessions.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Season.UserSeasonProfile> LoadUserSeasonProfile(Gimmebreak.Backbone.User.LoginProvider.Platform userPlatformType, string userPlatformId, int season)

Parameters

  • userPlatformType: Specific platform type.
  • userPlatformId: Specific platform id.
  • season: Season number, starting with 1.

Returns

User season profile if operation was successfull.

Back To Top
 

Login(LoginProvider)

Login user via specific login provider. If user does not exists it fails or creates a new one based on provider setting.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.User.LoginResult> Login(Gimmebreak.Backbone.User.LoginProvider loginProvider)

Parameters

  • loginProvider: Login provider used for authentication.

Returns

Access and refresh token pair.

Back To Top
 

Logout()

Logout user and remove all cached data

public Gimmebreak.Backbone.Core.AsyncOperation<bool> Logout()

Returns

True if user was logged out

Back To Top
 

RemovePartyUser(long, Long)

Remove user from tournament party. Other users in party can be only removed by party leader. You can pass your own id to leave party.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.TournamentRemoveUserStatus> RemovePartyUser(long tournamentId, long userId)

Parameters

  • tournamentId: Tournament id of party to remove user from.
  • userId: Id of user to be removed.

Returns

Remove user status.

Remarks

If party leader leaves party (By removing himself) new party leader is automatically set from remaining party users.

Back To Top
 

ReportUser(long, ReportReason, Long, Long, Long)

Report user for suspected cheating or other reason. This action can be initiated by user or automatically by any anticheat. Use correct report reason indicating who initiated the report (User or System).

public Gimmebreak.Backbone.Core.AsyncOperation<bool> ReportUser(long userId, Gimmebreak.Backbone.User.ReportReason reportReason, long gameSessionId = 0, long tournamentMatchId = 0, long tournamentId = 0)

Parameters

  • userId: Id of user to be reported.
  • reportReason: Reason of report.
  • gameSessionId: Optional game session id (usefull to track down game session replay).
  • tournamentMatchId: Optional tournament match id.
  • tournamentId: Optional tournament id.

Returns

True if operation was successful.

Remarks

Reports are immediately visible in tournament dashboard. In case of ongoing tournament, admin can kick or ban excessively reported users.

Back To Top
 

SaveSession()

Snapshots client state and save data to disk. When client initializes it loads latest snapshot. This way game can access user data in offline mode.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> SaveSession()

Returns

True if snapshot was saved.

Back To Top
 

SignoutFromTournament(long)

Sign out from tournament if registration is open.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.InviteResult> SignoutFromTournament(long tournamentId)

Parameters

  • tournamentId: Id of tournament to sign out from.

Returns

Reuslt of signout process. Can return null if tournament id is invalid.

Back To Top
 

SignupForTournament(long)

Sign up user for tournament if registration is open.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.InviteResult> SignupForTournament(long tournamentId)

Parameters

  • tournamentId: Id of tournament to sign up for.

Returns

Result of signup process. Can return null if tournament id is invalid.

Remarks

If there are custom requirements set for tournament that can be verified locally check them before proceeding to user signup that would fail. Use server requirement verification as sanity check rather than directing user experience flow. The same applies for any entry fees for tournament. Check if user has all entry fees (E.g. currency, items, points) before proceeding to user signup that would fail.

Back To Top
 

SignupForTournament(string)

Sign up user for tournament if registration is open.

public Gimmebreak.Backbone.Core.AsyncOperation<Gimmebreak.Backbone.Tournaments.InviteResult> SignupForTournament(string privateCode)

Parameters

  • privateCode: Private code of tournament to sign up for.

Returns

Result of signup process.

Remarks

If there are custom requirements set for tournament that can be verified locally check them before proceeding to user signup that would fail. Use server requirement verification as sanity check rather than directing user experience flow. The same applies for any entry fees for tournament. Check if user has all entry fees (E.g. currency, items, points) before proceeding to user signup that would fail.

Back To Top
 

SubmitGameSession(GameSession, Byte[])

Submits game session result to server. All users have to have final place set in order to assign points. You can provide game stats set up in dahboard (e.g. number of shots fired, kills, picked abilities, etc.). All match participants have to submit results and they have to be same. If someone reports different outcome such match will be marked and users will receive warning report to further investigate potential cheating.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> SubmitGameSession(Gimmebreak.Backbone.GameSessions.GameSession gameSession, byte[] replayData = null)

Parameters

  • gameSession: Game session with final results and stats.
  • replayData: Optional replay data of game session.

Returns

True if submission was succesfull.

Back To Top
 

SubmitGameSessionReplay(long, Byte[])

Submits user game session replay to server.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> SubmitGameSessionReplay(long gameSessionId, byte[] replayData = null)

Parameters

  • gameSessionId: Valid game session id.
  • replayData: Uncompressed raw replay data. (Data will be compressed before sending)

Returns

True if operation is successful.

Remarks

All users have to submit game session replay successfully otherwise it will not indicate that replay is available.

Back To Top
 

SynchUser(bool)

Get the latest user data from server.

public Gimmebreak.Backbone.Core.AsyncOperation<bool> SynchUser(bool fullSynch = False)

Parameters

  • fullSynch: Some parts are updated incrementally, set true if full sych should be done.

Returns

True if operation was successfull.


To Document Top