Class TournamentService

java.lang.Object
com.bitheads.braincloud.services.TournamentService

public class TournamentService
extends Object
Created by bradleyh on 1/9/2017.
  • Constructor Details

  • Method Details

    • claimTournamentReward

      public void claimTournamentReward​(String leaderboardId, int versionId, IServerCallback callback)
      Processes any outstanding rewards for the given player Service Name - tournament Service Operation - CLAIM_TOURNAMENT_REWARD
      Parameters:
      leaderboardId - The leaderboard for the tournament
      versionId - Version of the tournament. Use -1 for the latest version.
      callback - The method to be invoked when the server response is received
    • getDivisionInfo

      public void getDivisionInfo​(String divSetId, IServerCallback callback)
      Get my divisions Service Name - tournament Service Operation - GET_DIVISIONS_INFO
      Parameters:
      divSetId - The leaderboard for the tournament
      callback - The method to be invoked when the server response is received
    • getMyDivisions

      public void getMyDivisions​(IServerCallback callback)
      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

      public void getTournamentStatus​(String leaderboardId, int versionId, IServerCallback callback)
      Get tournament status associated with a leaderboard Service Name - tournament Service Operation - GET_TOURNAMENT_STATUS
      Parameters:
      leaderboardId - The leaderboard for the tournament
      versionId - 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 tournament
      tournamentCode - Tournament to join
      initialScore - The initial score for players first joining a division Usually 0, unless leaderboard is LOW_VALUE
      callback - 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 tournament
      tournamentCode - Tournament to join
      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
    • leaveDivisionInstance

      public void leaveDivisionInstance​(String leaderboardId, IServerCallback callback)
      Leave the specified division. Removes player score from tournament leaderboard Service Name - tournament Service Operation - LEAVE_DIVISION_INSTANCE
      Parameters:
      leaderboardId - The leaderboard for the division
      callback - The method to be invoked when the server response is received
    • leaveTournament

      public void leaveTournament​(String leaderboardId, IServerCallback callback)
      Removes player's score from tournament leaderboard Service Name - tournament Service Operation - LEAVE_TOURNAMENT
      Parameters:
      leaderboardId - The leaderboard for the tournament
      callback - 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, 2021
      Post the users score to the tournament leaderboard.
      Parameters:
      leaderboardId - The leaderboard for the tournament
      score - The score to post
      jsonData - Optional data attached to the leaderboard entry
      roundStartedTime - 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 tournament
      score - The score to post
      jsonData - Optional data attached to the leaderboard entry
      roundStartedTimeUTC - 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, 2021
      Post the users score to the tournament leaderboard, and returns updated standings.
      Parameters:
      leaderboardId - The leaderboard for the tournament
      score - The score to post
      jsonData - Optional data attached to the leaderboard entry
      roundStartedTime - Time the user started the match resulting in the score being posted
      sort - 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 tournament
      score - The score to post
      jsonData - Optional data attached to the leaderboard entry
      roundStartedTimeUTC - 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_VALUE
      callback - The method to be invoked when the server response is received
    • viewCurrentReward

      public void viewCurrentReward​(String leaderboardId, IServerCallback callback)
      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 tournament
      callback - The method to be invoked when the server response is received
    • viewReward

      public void viewReward​(String leaderboardId, int versionId, IServerCallback callback)
      Returns the user's reward from a finished tournament Service Name - tournament Service Operation - VIEW_REWARD
      Parameters:
      leaderboardId - The leaderboard for the tournament
      versionId - Version of the tournament. Use -1 for the latest version.
      callback - The method to be invoked when the server response is received