Package com.bitheads.braincloud.services
Class TournamentService
java.lang.Object
com.bitheads.braincloud.services.TournamentService
Created by bradleyh on 1/9/2017.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclaimTournamentReward(String leaderboardId, int versionId, IServerCallback callback) Processes any outstanding rewards for the given player Service Name - tournament Service Operation - CLAIM_TOURNAMENT_REWARDvoidgetDivisionInfo(String divSetId, IServerCallback callback) Get my divisions Service Name - tournament Service Operation - GET_DIVISIONS_INFOvoidgetMyDivisions(IServerCallback callback) Get my divisions Service Name - tournament Service Operation - GET_MY_DIVISIONSvoidgetTournamentStatus(String leaderboardId, int versionId, IServerCallback callback) Get tournament status associated with a leaderboard Service Name - tournament Service Operation - GET_TOURNAMENT_STATUSvoidjoinDivision(String divSetId, String tournamentCode, long initialScore, IServerCallback callback) Join the specified division.voidjoinTournament(String leaderboardId, String tournamentCode, long initialScore, IServerCallback callback) Join the specified tournament.voidleaveDivisionInstance(String leaderboardId, IServerCallback callback) Leave the specified division.voidleaveTournament(String leaderboardId, IServerCallback callback) Removes player's score from tournament leaderboard Service Name - tournament Service Operation - LEAVE_TOURNAMENTvoidpostTournamentScoreUTC(String leaderboardId, long score, String jsonData, long roundStartedTimeUTC, IServerCallback callback) Post the users score to the leaderboard Service Name - tournament Service Operation - POST_TOURNAMENT_SCOREvoidpostTournamentScoreWithResultsUTC(String leaderboardId, long score, String jsonData, long roundStartedTimeUTC, SocialLeaderboardService.SortOrder sort, int beforeCount, int afterCount, long initialScore, IServerCallback callback) Post the users score to the leaderboard Service Name - tournament Service Operation - POST_TOURNAMENT_SCORE_WITH_RESULTSvoidviewCurrentReward(String leaderboardId, IServerCallback callback) Returns the user's expected reward based on the current scores Service Name - tournament Service Operation - VIEW_CURRENT_REWARDvoidviewReward(String leaderboardId, int versionId, IServerCallback callback) Returns the user's reward from a finished tournament Service Name - tournament Service Operation - VIEW_REWARD
-
Constructor Details
-
TournamentService
-
-
Method Details
-
claimTournamentReward
Processes any outstanding rewards for the given player Service Name - tournament Service Operation - CLAIM_TOURNAMENT_REWARD- Parameters:
leaderboardId- The leaderboard for the tournamentversionId- Version of the tournament. Use -1 for the latest version.callback- The method to be invoked when the server response is received
-
getDivisionInfo
Get my divisions Service Name - tournament Service Operation - GET_DIVISIONS_INFO- Parameters:
divSetId- The leaderboard for the tournamentcallback- The method to be invoked when the server response is received
-
getMyDivisions
Get my divisions Service Name - tournament Service Operation - GET_MY_DIVISIONS- Parameters:
callback- The method to be invoked when the server response is received
-
getTournamentStatus
Get tournament status associated with a leaderboard Service Name - tournament Service Operation - GET_TOURNAMENT_STATUS- Parameters:
leaderboardId- The leaderboard for the tournamentversionId- Version of the tournament. Use -1 for the latest version.callback- The method to be invoked when the server response is received
-
joinDivision
public void joinDivision(String divSetId, String tournamentCode, long initialScore, IServerCallback callback) Join the specified division. If joining tournament requires a fee, it's possible to fail at joining the division Service Name - tournament Service Operation - JOIN_DIVISION- Parameters:
divSetId- The leaderboard for the tournamenttournamentCode- Tournament to joininitialScore- The initial score for players first joining a division Usually 0, unless leaderboard is LOW_VALUEcallback- The method to be invoked when the server response is received
-
joinTournament
public void joinTournament(String leaderboardId, String tournamentCode, long initialScore, IServerCallback callback) Join the specified tournament. Any entry fees will be automatically collected. Service Name - tournament Service Operation - JOIN_TOURNAMENT- Parameters:
leaderboardId- The leaderboard for the tournamenttournamentCode- Tournament to joininitialScore- The initial score for players first joining a tournament Usually 0, unless leaderboard is LOW_VALUEcallback- The method to be invoked when the server response is received
-
leaveDivisionInstance
Leave the specified division. Removes player score from tournament leaderboard Service Name - tournament Service Operation - LEAVE_DIVISION_INSTANCE- Parameters:
leaderboardId- The leaderboard for the divisioncallback- The method to be invoked when the server response is received
-
leaveTournament
Removes player's score from tournament leaderboard Service Name - tournament Service Operation - LEAVE_TOURNAMENT- Parameters:
leaderboardId- The leaderboard for the tournamentcallback- The method to be invoked when the server response is received
-
postTournamentScoreUTC
public void postTournamentScoreUTC(String leaderboardId, long score, String jsonData, long roundStartedTimeUTC, IServerCallback callback) Post the users score to the leaderboard Service Name - tournament Service Operation - POST_TOURNAMENT_SCORE- Parameters:
leaderboardId- The leaderboard for the tournamentscore- The score to postjsonData- Optional data attached to the leaderboard entryroundStartedTimeUTC- Time the user started the match resulting in the score being posted in UTC mmilliseconds time.callback- The method to be invoked when the server response is received
-
postTournamentScoreWithResultsUTC
public void postTournamentScoreWithResultsUTC(String leaderboardId, long score, String jsonData, long roundStartedTimeUTC, SocialLeaderboardService.SortOrder sort, int beforeCount, int afterCount, long initialScore, IServerCallback callback) Post the users score to the leaderboard Service Name - tournament Service Operation - POST_TOURNAMENT_SCORE_WITH_RESULTS- Parameters:
leaderboardId- The leaderboard for the tournamentscore- The score to postjsonData- Optional data attached to the leaderboard entryroundStartedTimeUTC- Time the user started the match resulting in the score being posted in UTC mmilliseconds time.sort- Sort key Sort order of page.beforeCount- The count of number of players before the current player to include.afterCount- The count of number of players after the current player to include.initialScore- The initial score for players first joining a tournament Usually 0, unless leaderboard is LOW_VALUEcallback- The method to be invoked when the server response is received
-
viewCurrentReward
Returns the user's expected reward based on the current scores Service Name - tournament Service Operation - VIEW_CURRENT_REWARD- Parameters:
leaderboardId- The leaderboard for the tournamentcallback- The method to be invoked when the server response is received
-
viewReward
Returns the user's reward from a finished tournament Service Name - tournament Service Operation - VIEW_REWARD- Parameters:
leaderboardId- The leaderboard for the tournamentversionId- Version of the tournament. Use -1 for the latest version.callback- The method to be invoked when the server response is received
-