Skip to content

CrowdControl

Inherits MonoBehaviour

Public Member Functions

void

ClearSavedTokens()

Clears all saved tokens from a previous session.

bool

IsRunning(string effectID)

Returns true if the timed effect is currently running.

string

GetJSONManifest()

Gets the JSON Manifest of your effect pack.

void

Connect()

Connects to the Crowd Control server.

void

Disconnect()

Disconnects from the Crowd Control server.

bool

EffectIsBidWar(string effectID)

Returns true if the effect is a bid war.

bool

EffectIsTimedEffect(string effectID)

Returns true if the effect is a timed effect.

bool

EffectIsParameterEffect(string effectID)

Returns true if the effect is a parameter effect.

bool

EffectIsRegistered(CCEffectBase effectBase)

Check if the effect is registered already or not.

void

RegisterGeneric(CCGeneric generic)

Register a Generic (Not Implemented Yet).

void

LoginTwitch()

Attempt to login with Twitch.

void

LoginYoutube()

Attempt to login with Youtube.

void

LoginDiscord()

Attempt to login with Discord.

void

StartGameSession()

Begins the game session.

void

StopGameSession()

Ends the game session.

void

SendGenericTest(CCGeneric generic)

Test a generic being sent to the server. (Not Implemented Yet)

void

GetGenericTest(CCGeneric generic)

Test a generic locally. (Not Implemented Yet)

void

TestEffect(CCEffectBase effect)

Test an effect locally. Its events won't be sent to the server.

void

TestEffectRemotely(CCEffectBase effect)

Test an effect remotely.

void

StopAllEffects()

Forcefully terminates all pending and running effects.

bool

HasRunningEffects()

Returns true if at least one timed effect is currently running.

bool

IsRunning(CCEffectTimed type)

Returns true if timed effect is running.

bool

StopTimedEffect(CCEffectTimed type)

Stops a timer effect.

bool

IsPaused(CCEffectTimed type)

Returns true if timed effect is paused.

Public Static Functions

void

ResumeEffect(CCEffectTimed effect, bool fromMenu, = false)

Resume a timed effect.

void

PauseEffect(CCEffectTimed effect, bool fromMenu, = false)

Pause a timed effect.

Private Functions

void

CancelEffect(CCEffectInstance effectInstance)

Cancels a received effect

Internal Functions

void

RegisterEffect(CCEffectBase effectBase, bool silent, = false)

Registers this effect during runtime.

Public Attributes

bool

isConnected

Are you connected or not

Private Attributes

string

_gameSessionID

ID of the current game session.

Properties

static

CrowdControl

instance

[get, set]

Singleton instance. Will be null if the behaviour isn't in the scene.

static

StreamUser

testUser

[get, set]

Reference to the test user object. Used to dispatch local effects.

static

StreamUser

crowdUser

[get, set]

Reference to the crowd user object. Used to dispatch pooled effects.

static

StreamUser

anonymousUser

[get, set]

Reference to the crowd user object. Used to dispatch effects with an unknown contributor.

static

StreamUser

basicUser

[get, set]

Reference to the streamer user object.

static

string

GameID

[get, ]

Unique ID Identifier for this game.

static

bool

StartSessionAutomatically

[get, set]

Start the game session as soon as your login is verified.

bool

isConnecting

[get, set]

Whether the connection to the server is currently initializing.

bool

disconnectedFromError

[get, set]

The latest disconnect occured due to an error.

static

void

ResetEffect

[, ]

Reset a timed effect.

Events

Action

OnConnecting

Invoked when attempting a connection to the Crowd Control server.

Action

(Exception)

OnConnectionError

Invoked when the connection to the Crowd Control server has failed.

Action

OnConnected

Invoked when successfully connected to the Crowd Control server.

Action

OnDisconnected

Invoked when disconnected from the Crowd Control server.

Action

(CCEffectInstance)

OnEffectQueue

Invoked when an effect is scheduled for execution.

Action

(string, EffectResult)

OnEffectDequeue

Invoked when an effect leaves the scheduling queue.

Action

(string, float, Sprite)

OnDisplayMessage

Invoked when an important message needs to be displayed.

Action

OnLoginFailure

Invoked when you fail to login.

Action

(CCEffectInstance)

OnEffectTrigger

Invoked when an CCEffectBase is successfully triggered.

Action

(CCEffectInstanceTimed)

OnEffectStart

Invoked when a CCEffectTimed is successfully started.

Action

(CCEffectInstanceTimed)

OnEffectStop

Invoked when a CCEffectTimed is successfully stopped.

Action

(CCEffectInstanceTimed)

OnEffectPause

Invoked on effect instances when the associated CCEffectTimed is disabled.

Action

(CCEffectInstanceTimed)

OnEffectResume

Invoked on effect instances when the associated CCEffectTimed is enabled.

Action

(CCEffectInstanceTimed)

OnEffectReset

Invoked on effect instances when the associated CCEffectTimed is reset.

Action

OnLoggedOut

Invoked when you log out.

Action

OnLoggedIn

Invoked when you log in.

Action

OnSubscribed

Invoked when you subscribe to the server.

Action

OnSubscribeFail

Invoked when you fail to subscribe to the server.

Action

OnGameSessionStart

Invoked when the session starts.

Action

OnGameSessionStop

Invoked when the session stops.

Action

(CCEffectBase)

OnEffectRequest

Invoked when an effect is requested.