Interface CCPlayer

All Known Implementing Classes:
ConnectedPlayer

public interface CCPlayer
  • Method Details

    • getUuid

      @NotNull @NotNull UUID getUuid()
      Gets the unique ID that represents an in-game player.
      Returns:
      unique ID
    • getAuthCode

      @Nullable @Nullable String getAuthCode()
      Gets the pending auth code of this connection.
      Returns:
      auth code
    • getToken

      @Nullable @Nullable String getToken()
      Gets the user's token used for making authenticated requests.
      Returns:
      auth token
    • getUserToken

      @Nullable @Nullable UserToken getUserToken()
      Gets the user's profile as decoded from their auth token.
      Returns:
      user profile
    • getAuthUrl

      @Nullable @Nullable String getAuthUrl()
      Gets the URL for the player to sign in with, if available.
    • getGameSessionId

      @Nullable @Nullable String getGameSessionId()
      Gets the ID of the player's active game session.
      Returns:
      gameSessionID or null
    • getEventManager

      @NotNull @NotNull EventManager getEventManager()
      Gets the manager which handles distributing events.
    • sendResponse

      CompletableFuture<Boolean> sendResponse(@NotNull @NotNull CCEffectResponse response)
      Sends an effect response to the WebSocket.
      Parameters:
      response - effect response
      Returns:
      whether the response could be sent
    • sendReport

      CompletableFuture<Boolean> sendReport(@NotNull @NotNull CCEffectReport @NotNull ... reports)
      Sends one or more effect reports to the WebSocket.
      Parameters:
      reports - effect reports
      Returns:
      whether the report could be sent
    • setCustomEffects

      @NotNull @NotNull CompletableFuture<?> setCustomEffects(@NotNull @NotNull List<CustomEffectsOperation> operations)
      Attempts to set the specified custom effects. May fail if they have not yet authenticated.
      Returns:
      future to complete when finished
    • startSession

      @NotNull @NotNull CompletableFuture<?> startSession(@NotNull @NotNull CCEffectReport @NotNull ... reports)
      Attempts to start the streamer's session. May fail if they have not yet authenticated; check getGameSessionId() for outcome.
      Returns:
      future to complete when finished
    • stopSession

      @NotNull @NotNull CompletableFuture<?> stopSession()
      Attempts to stop the streamer's session.
      Returns:
      future to complete when finished
    • regenerateAuthCode

      @NotNull @NotNull CompletableFuture<?> regenerateAuthCode()
      Regenerates the user's auth code. May fail if the user is already authenticated.
      Returns:
      future to complete when the auth code has regenerated
    • clearToken

      void clearToken()
      Clears the user's auth token if they have one. Will not automatically re-generate an auth code; see regenerateAuthCode().