Interface GameStatsSource

All Known Implementing Classes:
StaticGameStatsSource

public interface GameStatsSource
Host hook that fetches an account's public stats on one server. The library never holds an API key or knows any server's endpoint or stat format: the host implements this (reads its key, calls the server's API, formats the result into GameStats display chips). Register one source per server on AltsRuntime.Builder; the runtime caches per server, keyed by player UUID.

Game stats are an optional capability. A host may register no sources, and a registered source may return null (or throw) to signal "no stats for this player". Called off the main thread by an AsyncCache; may block on I/O.

Since:
0.3.0
  • Method Summary

    Modifier and Type
    Method
    Description
    fetch(String uuid)
    Fetches stats for one player on this source's server.
    Returns the identifier of the server this source covers.
  • Method Details

    • serverId

      String serverId()
      Returns the identifier of the server this source covers. Used as the cache key and the GameStats.serverId() stamp, and looked up by AltsRuntime.gameStats(String).
      Returns:
      the server id (stable, non-null)
      Since:
      0.3.0
    • fetch

      GameStats fetch(String uuid) throws Exception
      Fetches stats for one player on this source's server.
      Parameters:
      uuid - the dashed player UUID
      Returns:
      the player's stats, or null if unavailable
      Throws:
      Exception - if the lookup fails (treated as "no stats")
      Since:
      0.3.0