This document is about: QUANTUM 2
SWITCH TO

API-BackboneClient


Available in the Gaming Circle and Industries Circle
Circle

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.

C#

public sealed class BackboneClient

Properties

Game

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

C#

public GameData Game
{
    get;
}

IsInitialized

Determine if client is successfully initialized.

C#

public bool IsInitialized
{
    get;
}

IsUserLoggedIn

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

C#

public bool IsUserLoggedIn
{
    get;
}

Notifications

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

C#

public NotificationData Notifications
{
    get;
}

Season

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

C#

public SeasonData Season
{
    get;
}

Tournaments

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

C#

public TournamentData Tournaments
{
    get;
}

User

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

C#

public UserData User
{
    get;
}

Methods

AcceptPartyInvite(long, long)

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

C#

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.

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.

C#

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.

ChangeNickname(string)

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

C#

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.

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.

C#

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.

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.

C#

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.

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.

C#

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.

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.

C#

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.

CreatePartyCodeForTournament(long, bool)

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

C#

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.

CreatePartyInviteForTournament(long, long)

Create party invite for tournament by providing user id.

C#

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.

CreatePartyInviteForTournament(long, LoginProvider.Platform, string)

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

C#

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.

CreatePartyInviteForTournament(long, string, int)

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

C#

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.

DeclinePartyInvite(long)

Decline tournament party invite.

C#

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.

DisconnectTournamentHub()

Disconnects tournament hub and stops running callbacks.

C#

public void DisconnectTournamentHub()

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.

C#

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

Parameters

  • notification: Notification to dismiss.

Returns

Ture if notification was dismissed.

DownloadGameSessionReplay(GameSession)

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

C#

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

Parameters

  • gameSession: Valid game session.

Returns

True if operation was successful.

Initialize(IBackboneClientCallbackHandler)

Initialize Backbone client using setting from Default BackboneClientSetting asset.

C#

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.

Initialize(BackboneClientSetting, IBackboneClientCallbackHandler)

Initialize Backbone client using setting from BackboneClientSetting asset.

C#

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.

Initialize(Uri, string, IBackboneClientCallbackHandler)

Initialize Backbone client for specific server and game.

C#

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.

LoadNotifications()

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

C#

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

Returns

True if notifications were loaded

LoadTournament(Tournament)

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

C#

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.

LoadTournament(long)

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

C#

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

Parameters

  • tournamentId: Tournament id to load data for.

Returns

True if data were loaded.

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

C#

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

Returns

True if list was refreshed successfully.

LoadTournamentMatches(long, IEnumerable<long>)

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

C#

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.

LoadTournamentMatches(long, int, int, int, int, int, bool, int)

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

C#

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.

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

C#

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.

LoadTournamentMatchGameSessions(TournamentMatch)

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

C#

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.

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

C#

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.

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.

C#

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.

LoadTournamentScores(long, int, int, int, int)

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

C#

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.

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

C#

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.

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.

C#

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.

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.

C#

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.

Login(LoginProvider)

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

C#

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.

Logout()

Logout user and remove all cached data

C#

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

Returns

True if user was logged out

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.

C#

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.

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

C#

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.

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.

C#

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

Returns

True if snapshot was saved.

SignoutFromTournament(long)

Sign out from tournament if registration is open.

C#

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.

SignupForTournament(long)

Sign up user for tournament if registration is open.

C#

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.

SignupForTournament(string)

Sign up user for tournament if registration is open.

C#

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.

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.

C#

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.

SubmitGameSessionReplay(long, byte[])

Submits user game session replay to server.

C#

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.

SynchUser(bool)

Get the latest user data from server.

C#

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.

Back to top