Package live.crowdcontrol.cc4j
Interface CCPlayer
- All Known Implementing Classes:
ConnectedPlayer
public interface CCPlayer
-
Method Summary
Modifier and TypeMethodDescriptionvoidClears the user's auth token if they have one.@Nullable StringGets the pending auth code of this connection.@Nullable StringGets the URL for the player to sign in with, if available.@NotNull EventManagerGets the manager which handles distributing events.@Nullable StringGets the ID of the player's active game session.@Nullable StringgetToken()Gets the user's token used for making authenticated requests.@Nullable UserTokenGets the user's profile as decoded from their auth token.@NotNull UUIDgetUuid()Gets the unique ID that represents an in-game player.@NotNull CompletableFuture<?> Regenerates the user's auth code.sendReport(@NotNull CCEffectReport @NotNull ... reports) Sends one or more effect reports to the WebSocket.sendResponse(@NotNull CCEffectResponse response) Sends an effect response to the WebSocket.@NotNull CompletableFuture<?> setCustomEffects(@NotNull List<CustomEffectsOperation> operations) Attempts to set the specified custom effects.@NotNull CompletableFuture<?> startSession(@NotNull CCEffectReport @NotNull ... reports) Attempts to start the streamer's session.@NotNull CompletableFuture<?> Attempts to stop the streamer's session.
-
Method Details
-
getUuid
Gets the unique ID that represents an in-game player.- Returns:
- unique ID
-
getAuthCode
Gets the pending auth code of this connection.- Returns:
- auth code
-
getToken
Gets the user's token used for making authenticated requests.- Returns:
- auth token
-
getUserToken
Gets the user's profile as decoded from their auth token.- Returns:
- user profile
-
getAuthUrl
Gets the URL for the player to sign in with, if available. -
getGameSessionId
Gets the ID of the player's active game session.- Returns:
- gameSessionID or null
-
getEventManager
Gets the manager which handles distributing events. -
sendResponse
Sends an effect response to the WebSocket.- Parameters:
response- effect response- Returns:
- whether the response could be sent
-
sendReport
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; checkgetGameSessionId()for outcome.- Returns:
- future to complete when finished
-
stopSession
Attempts to stop the streamer's session.- Returns:
- future to complete when finished
-
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; seeregenerateAuthCode().
-