Class GlobalStatisticsService

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

public class GlobalStatisticsService
extends Object
  • Constructor Details

    • GlobalStatisticsService

      public GlobalStatisticsService​(BrainCloudClient client)
  • Method Details

    • readAllGlobalStats

      public void readAllGlobalStats​(IServerCallback callback)
      Method returns all of the global statistics.
      Parameters:
      callback - The callback.
    • readGlobalStatsSubset

      public void readGlobalStatsSubset​(String[] globalStats, IServerCallback callback)
      Reads a subset of global statistics.
      Parameters:
      globalStats - The array of statistics to read: [ "Level01_TimesBeaten", "Level02_TimesBeaten" ]
      callback - The callback.
    • readGlobalStatsForCategory

      public void readGlobalStatsForCategory​(String category, IServerCallback callback)
      Method retrieves the global statistics for the given category. Service Name - GlobalStatistics Service Operation - READ_FOR_CATEGORY
      Parameters:
      category - The global statistics category
      callback - Callback.
    • incrementGlobalStats

      public void incrementGlobalStats​(String jsonData, IServerCallback callback)
      Atomically increment (or decrement) global statistics. Global statistics are defined through the brainCloud portal.
      Parameters:
      jsonData - The JSON encoded data to be sent to the server.For the full statistics grammer see the http://getbraincloud.com/apidocs site.
      callback - The callback.
    • processStatistics

      public void processStatistics​(String jsonData, IServerCallback callback)
      Apply statistics grammar to a partial set of statistics. Service Name - GlobalStatistics Service Operation - PROCESS_STATISTICS
      Parameters:
      jsonData - The JSON format is as follows: { "DEAD_CATS": "RESET", "LIVES_LEFT": "SET#9", "MICE_KILLED": "INC#2", "DOG_SCARE_BONUS_POINTS": "INC#10", "TREES_CLIMBED": 1 }
      callback - Method to be invoked when the server response is received.