Skip to content

UCrowdControlSubsystem

Inherits UGameInstanceSubsystem

The core of the plugin: a game instance subsystem that owns the connection to Crowd Control, effect registration, trigger dispatch, responses, menu reports, pack metadata, and session control. Access it in Blueprint with Get CrowdControlSubsystem (from the Game Instance) or in C++ via UGameInstance::GetSubsystem<UCrowdControlSubsystem>().

Connection

MemberDescription
Connect()Starts the connection thread.
Disconnect()Stops the connection.
ResetConnection()Resets login state and connection.
IsConnected()True once connected to the Crowd Control service.
IsInitialized()True once authenticated, subscribed, and ready for effects.
GetCommandID()Raw connection state: 0 in progress, 1 disconnected, 2 waiting for login/authorization, 3 connected & ready.
OnCommandIDChangedEvent fired whenever the connection state changes (raw integer).
OnConnectionStateChangedSame as above but typed: ECrowdControlConnectionState (Connecting, Disconnected, WaitingForLogin, Connected).
OnSessionReadyFired once each time the connection becomes fully ready for effects.

Authentication

MemberDescription
OnAuthCodeReceivedEvent (Code, URL) fired when an application auth code is generated. Show the code and/or open the URL so the user can authorize the game. Requires ApplicationID in settings.
RequestAuthCode()Requests a fresh auth code.
LoginTwitch() / LoginYoutube() / LoginDiscord()Legacy platform login (used when no ApplicationID is configured).
GetIsJWTTokenValid()Whether a valid (non-expired) login token is held.
GetStreamerName() / GetProfileType() / GetOriginID() / GetInteractionURL()Information about the logged-in user.

Effect Registration

MemberDescription
SetupEffect(Info)Registers an instant effect (FCrowdControlEffectInfo).
SetupTimedEffect(Info)Registers a timed effect (FCrowdControlTimedEffectInfo).
SetupParameterEffect(Info)Registers a parameter effect (FCrowdControlParameterEffectInfo).
PrintEffectsToJsonFile()Writes the registered effect menu to Saved/CCMenu.json for pack submission.

Effects can also be registered automatically by adding a CrowdControlEffectComponent to an actor.

Effect Triggers & Notifications

MemberDescription
OnEffectRequestReceivedEvent (RequestID, EffectID, DisplayName, ViewerName, Duration, Quantity) fired for every incoming effect, before routing. Bind notification/HUD widgets here ("Viewer sent Effect!"). Purely informational: it does not replace responding to the effect.
OnEffectTriggerEvent (ID, DisplayName, EffectID, ViewerName) for instant effects.
OnTimedEffectTriggerEvent (ID, DisplayName, Duration, EffectID, ViewerName) for timed effects.
OnParameterEffectTriggerEvent (ID, DisplayName, Quantity, Params, EffectID, ViewerName) for parameter effects.

Effects whose EffectID matches a registered effect component are dispatched to that component instead of these global trigger events. OnEffectRequestReceived always fires either way.

Effect Responses

Every trigger must eventually be answered with one of these (using the request ID from the trigger). Responses may be sent asynchronously.

MemberDescription
EffectSuccess(ID)The effect was applied.
EffectFailure(ID)Temporary failure (refund, may retry).
EffectFailureTemporary(ID, Message)Temporary failure with a viewer-facing message.
EffectFailurePermanent(ID, Message)Permanent failure - will not be retried.

Timed Effect Control

MemberDescription
PauseEffect(EffectID) / ResumeEffect(EffectID)Pause/resume a running timed effect (sends timedPause/timedResume).
StopEffect(EffectID)Ends a running timed effect.
ResetEffect(EffectID)Restarts a running timed effect.
IsEffectRunning(EffectID)Whether a timed effect is currently running.
MemberDescription
ReportEffectStatus(EffectID, Status)Reports MenuVisible, MenuHidden, MenuAvailable, or MenuUnavailable.
SetEffectVisibility(EffectID, bVisible)Convenience wrapper for visibility.
SetEffectAvailability(EffectID, bAvailable)Convenience wrapper for availability. Visibility and availability are independent states.
SendPackMetadata(Key, Value)Reports a single game-state value.
SendPackMetadataJson(MetadataJson)Reports a JSON object of game-state values.

Sessions

MemberDescription
StartGameSession() / StopGameSession()Manual session control (only needed when bStartSessionAutomatically is off).

Custom Effects

MemberDescription
UploadCustomEffect(Info) / UploadCustomTimedEffect(Info) / UploadCustomParameterEffect(Info)Upload a single custom effect.
UploadCustomEffectsArray(Effects) / UploadCustomTimedEffectsArray(Effects) / UploadCustomParameterEffectsArray(Effects)Upload multiple custom effects in one request.
GetCustomEffects()Returns the current custom effects as JSON.
DeleteCustomEffectsByIDs(EffectIDs) / DeleteCustomEffects()Delete specific or all custom effects.
ClearCustomEffects()Replaces all custom effects with an empty set.