Package com.bitheads.braincloud.services
Class TournamentService
java.lang.Object
com.bitheads.braincloud.services.TournamentService
public class TournamentService extends Object
Created by bradleyh on 1/9/2017.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTournamentService.Parameter -
Constructor Summary
Constructors Constructor Description TournamentService(BrainCloudClient client) -
Method Summary
Modifier and Type Method Description voidclaimTournamentReward(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_TOURNAMENTvoidpostTournamentScore(String leaderboardId, long score, String jsonData, Date roundStartedTime, IServerCallback callback)Deprecated.Use postTournamentScoreUTC instead - Removal September 1, 2021voidpostTournamentScoreUTC(String leaderboardId, long score, String jsonData, long roundStartedTimeUTC, IServerCallback callback)Post the users score to the leaderboard Service Name - tournament Service Operation - POST_TOURNAMENT_SCOREvoidpostTournamentScoreWithResults(String leaderboardId, long score, String jsonData, Date roundStartedTime, SocialLeaderboardService.SortOrder sort, int beforeCount, int afterCount, long initialScore, IServerCallback callback)Deprecated.Use postTournamentScoreWithResultsUTC instead - Removal September 1, 2021voidpostTournamentScoreWithResultsUTC(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
-
postTournamentScore
public void postTournamentScore(String leaderboardId, long score, String jsonData, Date roundStartedTime, IServerCallback callback)Deprecated.Use postTournamentScoreUTC instead - Removal September 1, 2021Post the users score to the tournament leaderboard.- Parameters:
leaderboardId- The leaderboard for the tournamentscore- The score to postjsonData- Optional data attached to the leaderboard entryroundStartedTime- Time the user started the match resulting in the score being posted.callback- 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
-
postTournamentScoreWithResults
public void postTournamentScoreWithResults(String leaderboardId, long score, String jsonData, Date roundStartedTime, SocialLeaderboardService.SortOrder sort, int beforeCount, int afterCount, long initialScore, IServerCallback callback)Deprecated.Use postTournamentScoreWithResultsUTC instead - Removal September 1, 2021Post the users score to the tournament leaderboard, and returns updated standings.- Parameters:
leaderboardId- The leaderboard for the tournamentscore- The score to postjsonData- Optional data attached to the leaderboard entryroundStartedTime- Time the user started the match resulting in the score being postedsort- Sort key Sort order of page. ("HIGH_TO_LOW" or "LOW_TO_HIGH")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_VALUE.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
-