Skip to content

UCrowdControlSubsystem

Inherits UGameInstanceSubsystem

The game-instance subsystem that loads the Crowd Control DLL and owns authentication, connection state, effect registration and dispatch, effect responses, menu state, metadata, and game sessions.

In Blueprint, get it from the Game Instance with Get Subsystem (Crowd Control Subsystem). In C++, use UGameInstance::GetSubsystem<UCrowdControlSubsystem>() or UCrowdControlSubsystem::Get.

Public Member Functions

override

void

Initialize(FSubsystemCollectionBase& Collection)

Initializes the game-instance subsystem and loads the Crowd Control DLL.

override

void

Deinitialize()

Stops Crowd Control and releases the subsystem's resources.

void

LoadDLL()

Loads CrowdControl.dll, resolves its exported API, and applies the configured game pack, application ID, and session-start behavior. Normally called during subsystem initialization.

void

StartThread()

C++ only. Starts the runnable that services the loaded Crowd Control runtime. Connect normally starts it for you.

int32

GetCommandID()

Returns the raw connection state: 0 connecting, 1 disconnected, 2 waiting for login, or 3 connected.

void

Connect()

Starts the Crowd Control connection thread.

void

Disconnect()

Disconnects from Crowd Control.

void

ResetConnection()

Clears the current login and resets the connection.

void

LoginTwitch()

Deprecated. Requests legacy Twitch login. Use RequestAuthCode for application authentication.

void

LoginYoutube()

Deprecated. Requests legacy YouTube login. Use RequestAuthCode for application authentication.

void

LoginDiscord()

Deprecated. Requests legacy Discord login. Use RequestAuthCode for application authentication.

void

RequestAuthCode()

Requests a new application authorization code. ApplicationID must be configured; the result is broadcast by OnAuthCodeReceived.

void

StartGameSession()

Starts a game session explicitly. Use this when automatic session start is disabled.

void

StopGameSession()

Stops the active game session.

void

SetupEffect(const FCrowdControlEffectInfo& Info)

Registers an instant effect with the loaded Crowd Control runtime.

void

SetupTimedEffect(const FCrowdControlTimedEffectInfo& Info)

Registers a timed effect with the loaded Crowd Control runtime.

void

SetupParameterEffect(const FCrowdControlParameterEffectInfo& Info)

Registers an effect with quantity and/or viewer-selectable parameters.

bool

CloneEffect(const FString& SourceEffectID, const FString& DestinationEffectID)

Clones a registered effect definition to one new destination ID. The Blueprint return value reports whether the clone was created.

bool

CloneEffectToIDs(const FString& SourceEffectID, const TArray& DestinationEffectIDs)

Atomically clones a registered effect definition to multiple new destination IDs. The Blueprint return value reports whether every clone was created.

void

EffectSuccess(FString id)

Reports that a request completed successfully.

void

EffectSuccessWithMessage(FString id, FString Message)

Reports success with a message for the purchasing user.

void

EffectFailure(FString id)

Reports a temporary failure without a message.

void

EffectFailureWithMessage(FString id, FString Message)

Reports a temporary failure with a message for the purchasing user.

void

EffectFailureTemporary(FString id, FString Message)

Reports that a request cannot run now and may be retried or refunded.

void

EffectFailurePermanent(FString id, FString Message)

Reports that a request can never run and must not be retried.

bool

ReportEffectStatus(FString EffectID, ECrowdControlEffectReport Status)

Reports one visibility or availability state for an effect. Visibility and availability are independent.

bool

SetEffectVisibility(FString EffectID, bool bVisible)

Shows or hides one effect in the Crowd Control menu.

bool

SetEffectAvailability(FString EffectID, bool bAvailable)

Enables or disables purchases for one effect without changing its visibility.

void

EffectMetadata(const FString& Key, const FString& Value)

Sends one key/value pair of pack metadata through the compatibility export.

void

SendPackMetadataJson(const FString& MetadataJson)

Sends a JSON object in a packMetadataChanged RPC.

void

SendPackMetadata(const FString& Key, const FString& Value)

Sends one key/value pair of game-state metadata.

bool

IsEffectRunning(FString name)

Returns whether the named timed effect is running.

void

PauseEffect(FString id)

Pauses a running timed effect and reports the pause.

void

ResumeEffect(FString id)

Resumes a paused timed effect and reports the resume.

void

ResetEffect(FString id)

Resets a running timed effect.

void

StopEffect(FString id)

Stops a running timed effect.

bool

IsConnected()

Returns whether the DLL has an active Crowd Control connection.

bool

IsInitialized()

Returns whether authentication and subscription are complete and effects are ready.

void

PrintEffectsToJsonFile()

Writes the registered effect manifest to Saved/CCMenu.json.

FString

GetOriginID()

Returns the authenticated user's origin identifier from the JWT.

FString

GetProfileType()

Returns the authenticated user's profile type from the JWT.

FString

GetInteractionURL()

Returns the interaction URL from the authenticated user's JWT.

FString

GetStreamerName()

Returns the display name of the authenticated streamer.

bool

GetIsJWTTokenValid()

Returns whether the stored JWT exists and is not expired.

void

ShowEffectsByIDs(const TArray& EffectIDs)

Shows the listed effects. An empty array applies the operation to all registered effects.

void

HideEffectsByIDs(const TArray& EffectIDs)

Hides the listed effects. An empty array applies the operation to all registered effects.

void

EnableEffectsByIDs(const TArray& EffectIDs)

Makes the listed effects purchasable. An empty array applies the operation to all registered effects.

void

DisableEffectsByIDs(const TArray& EffectIDs)

Makes the listed effects unavailable for purchase. An empty array applies the operation to all registered effects.

void

UploadCustomEffectsJson(const FString& EffectsJson)

C++ only. Uploads custom-effect definitions from a JSON string.

void

UploadCustomEffect(const FCrowdControlEffectInfo& EffectInfo)

Uploads one custom instant effect.

void

UploadCustomTimedEffect(const FCrowdControlTimedEffectInfo& EffectInfo)

Uploads one custom timed effect.

void

UploadCustomParameterEffect(const FCrowdControlParameterEffectInfo& EffectInfo)

Uploads one custom parameter effect.

void

UploadCustomEffectsArray(const TArray& Effects)

Uploads multiple custom instant effects in one request.

void

UploadCustomTimedEffectsArray(const TArray& Effects)

Uploads multiple custom timed effects in one request.

void

UploadCustomParameterEffectsArray(const TArray& Effects)

Uploads multiple custom parameter effects in one request.

void

ClearCustomEffects()

Replaces the current custom-effect set with an empty set.

void

DeleteCustomEffects()

Deletes all custom effects.

void

DeleteCustomEffectsByJson(const FString& EffectIDsJson)

Deletes custom effects whose IDs are supplied as a JSON array string.

void

DeleteCustomEffectsByIDs(const TArray& EffectIDs)

Deletes custom effects by ID. An empty array deletes all custom effects.

FString

GetCustomEffects()

Returns the current custom-effect definitions as JSON.

void

RegisterEffectComponent(UCrowdControlEffectComponent* Component)

C++ only. Registers a component as the request handler for its effect ID.

void

UnregisterEffectComponent(UCrowdControlEffectComponent* Component)

C++ only. Removes a component from effect-request routing.

Public Static Functions

UCrowdControlSubsystem&

Get(const UObject* WorldContextObject)

Returns the Crowd Control subsystem for the world associated with WorldContextObject.

Events

FOnTriggerEffect

(FString, FString, FString, FString)

OnEffectTrigger

Broadcast for an instant effect that is not routed to an effect component. Parameters are request ID, display name, effect ID, and viewer name.

FOnTriggerTimedEffect

(FString, FString, float, FString, FString)

OnTimedEffectTrigger

Broadcast for a timed effect that is not routed to an effect component. Parameters are request ID, display name, duration, effect ID, and viewer name.

FOnTriggerParameterEffect

(FString, FString, FString, FJsonObjectWrapper, FString, FString)

OnParameterEffectTrigger

Broadcast for a parameter effect that is not routed to an effect component. OptionalQuantity is currently a string in this delegate.

FOnCommandIDChanged

(int32)

OnCommandIDChanged

Broadcast whenever the raw connection-state command ID changes.

FOnConnectionStateChanged

(ECrowdControlConnectionState)

OnConnectionStateChanged

Broadcast whenever the typed connection state changes.

FOnSessionReady

OnSessionReady

Broadcast once each time the connection becomes fully ready to process effects.

FOnEffectRequestReceived

(FString, FString, FString, FString, float, int32)

OnEffectRequestReceived

Broadcast for every incoming request before component or global-delegate routing. Intended for notifications and HUDs; it does not replace responding to the request.

FOnAuthCodeReceived

(FString, FString)

OnAuthCodeReceived

Broadcast with the authorization code and URL after RequestAuthCode succeeds.