Skip to content

SimpleJSON Structure Reference

Optional fields that are not included in a message may be omitted or set to null. Compliant implementations must support both forms. Client implementations must be prepared to receive messages with additional fields that are not documented here, and should ignore any fields they do not recognize.

Effect Requests (Crowd Control-Initiated)

When a viewer purchases an effect on Crowd Control, an effect request is sent over the channel as a UTF-8 string containing a JSON payload.

NameTypeValueNotes
iduintThe request ID, all responses to this request should contain the same ID value.These are not guaranteed to be sequential or increasing.
codestring?The identifier of the requested effect.Only present on request types 0 (Test), 1(Start) and 2 (Stop).
messagestring?A secondary text value associated with the request.Contains flavortext on effect requests but may also be used for login information.
parametersobject?[]?This field contains any non-quantity parameters that the user has selected, if applicable.
quantityuint?This field contains the quantity that the user has selected, if applicable.
targetsTarget?[]?For packs on multiplayer servers, contains Target structures indicating which player should be targeted by an effect request.
durationlong?The requested duration of the effect, in milliseconds.An option to report this value as decimal seconds (double?) will be available in a future release.
viewerstring?The displayable name of the viewer who requested the effect.Returns “the crowd” if multiple viewers are present.
viewers[]Target?[]?Contains Target structures indicating which viewer(s) requested the effect.
costint?The price that the viewer(s) paid for the effect, in coins.
typeRequestType (int)The type of message. See RequestType enum below.This is EffectStart and appears as an integer value.

Effect Responses (Game-Initiated)

NameTypeValueNotes
iduintThe request ID, all responses to a request should contain the same ID value.This should be 0 for game-initiated messages.
codestring?The identifier of the requested effect.
statusEffectStatusIndicates the status of the effect request or class.
messagestring?A secondary text value associated with the request.Used for login information, omitted otherwise.
messageIDStandardErrors?A standard error code associated with the message, if applicable.This field is encoded as a camel-case string value and is only present when an error occurs. In future releases, the error message corresponding to this value will take precidence over the message field when displaying errors to non-English-language users.
timeRemaininglong?The requested duration of the effect, in milliseconds.An option to report this value as decimal seconds (double?) will be available in a future release.
typeResponseType (int)Indicates the type of message. See ResponseType enum below.This is EffectStart and appears as an integer value.

Data Requests (Crowd Control-Initiated)

NameTypeValueNotes
iduintThe request ID, all responses to this request should contain the same ID value.These are not guaranteed to be sequential or increasing.
keystringThe key of the data to request.This should be a string that identifies the data you want to retrieve.
typeRequestType (int)The type of message. See RequestType enum below.This is DataRequest and appears as an integer value.

Data Responses (Game-Initiated)

NameTypeValueNotes
iduintThe request ID, all responses to a request should contain the same ID value.This should be 0 for game-initiated messages.
keystringThe key corresponding to the requested value.This matches the key from the data request.
valueobject?The value returned by the client.This can be any JSON value, including null.
statusEffectStatusThe status of the request.Uses the same status values as effect responses.
timeRemaininglong?The due time of the request, if applicable, in milliseconds.This is milliseconds, not seconds.
messagestring?The message from the client, if any.Omitted when not needed.
typeResponseType (int)Indicates the type of message. See ResponseType enum below.This is DataRequest and appears as an integer value.

Generic Event Requests (Crowd Control-Initiated)

NameTypeValueNotes
iduintThe request ID.These are not guaranteed to be sequential or increasing.
eventTypestringThe type of event.
dataobject?The data associated with the event.This is a JSON object containing event-specific fields.
internalboolIndicates that this event is locally-generated.
typeRequestType (int)The type of message. See RequestType enum below.This is GenericEvent and appears as an integer value.

Generic Event Responses (Game-Initiated)

NameTypeValueNotes
iduintThe request ID associated with the message, if any.For game-initiated messages this is typically 0 or omitted.
eventTypestringThe type of event.
dataobject?The data associated with the event.This is a JSON object containing event-specific fields.
internalboolIndicates that this event is locally-generated.Serialized using the JSON property name internal.
typeResponseType (int)Indicates the type of message. See ResponseType enum below.This is GenericEvent and appears as an integer value.

Game State Requests (Crowd Control-Initiated)

Asks the game whether it's ready for effects and if not why.

NameTypeValueNotes
iduintThe request ID.These are not guaranteed to be sequential or increasing.
typeRequestType (int)The type of message. See RequestType enum below.This is GameUpdate and appears as an integer value.

Game State Updates (Game-Initiated)

NameTypeValueNotes
iduintThe request ID associated with the message, if any.For game-initiated messages this is typically 0 or omitted.
stateGameState (string)The current state of the game.See Game State Enumeration below.
messagestring?The message from the client, if any.Omitted when not needed.
typeResponseType (int)Indicates the type of message. See ResponseType enum below.This is GameUpdate and appears as an integer value.

Login Requests (Crowd Control-Initiated)

NameTypeValueNotes
iduintThe request ID.These are not guaranteed to be sequential or increasing.
loginstring?The login name of the user.
passwordstring?The password of the user.
typeRequestType (int)The type of message. See RequestType enum below.This is Login and appears as an integer value.

Game State Enumeration

NameDescriptionNotes
unknownThe game state is unknown.Used when the game is not running or the state cannot be determined due to effect pack or connector problems.
readyThe game is running and is ready to receive effects.This is the only game state where effects can be processed.
errorThe game is in an errored or crashed state.
unmoddedThe game does not have the required mod(s) installed.
badGameSettingsThe current game settings are not compatible with Crowd Control.
wrongVersionThe game is the wrong version.
notFocusedThe game is not focused.
loadingThe game is in a loading state.
pausedThe game is paused.
wrongModeThe game is in a state that is not compatible with Crowd Control.Used for states such as a title menu or alternate game mode.
safeAreaThe game is in a safe area.Used for areas such as a town or hub.
untimedAreaThe game is in an untimed area.Used for areas such as a cutscene or tutorial.
cutsceneThe game is in a cutscene.
badPlayerStateThe player is not in a state to receive effects.For example, the player may be dead or stunned.
menuThe game is in a menu other than the pause menu.
mapThe game is in a map state such as a world map or overworld.Use this only when the game is in a map scene and should not be; otherwise return Ready.
inCombatThe game is in a combat state such as a boss fight or enemy encounter.Use this only when the game is in a combat scene and should not be; otherwise return Ready.
notInCombatThe game is in a non-combat scene such as a cutscene or tutorial.Use this only when the game is not in a combat scene and should be; otherwise return Ready.
pipelineBusyThe game message queue is busy or full and cannot process any more messages.

RequestType Enumeration

NameValueDescriptionNotes
EffectTest0x00Respond as with a normal request but don't actually activate the effect.
EffectStart0x01A standard effect request. A response (see above) is always required.
EffectStop0x02A request to stop all instances of the requested effect code.
GenericEvent0x10Generic event callback.
DataRequest0x20Request for game metadata.
RpcResponse0xD0Response to an RPC request from the game.
PlayerInfo0xE0Information about the player.
Login0xF0Indicates that this is a login request or response.
GameUpdate0xFDRequest for updated game state information.
KeepAlive0xFFCan be used in either direction to keep connections open or test connection status. Responses are neither expected nor given.

ResponseType Enumeration

NameValueDescriptionNotes
EffectRequest0x00A response to an effect request.The response ID should match the request ID. Multiple responses with the same ID are allowed in the case of timed effects.
EffectStatus0x01A status update on a type of effect.These messages concern the specified effect in general, not a specific instance.
GenericEvent0x10Generic event callback.
LoadEvent0x18Event callback for the player loading a game save.
SaveEvent0x19Event callback for the player saving a game save.
DataResponse0x20Response to a metadata request.
RpcRequest0xD0RPC request to the Crowd Control client.
Login0xF0Indicates that this is a login request or response.Whether this represents a request or response depends on the value of AuthenticationMode (see below).
LoginSuccess0xF1Indicates the login was successful.
GameUpdate0xFDGame state information update.
Disconnect0xFEDisconnect with an optional message.
KeepAlive0xFFCan be used in either direction to keep connections open or test connection status. Responses are neither expected nor given.Request ID will be 0.

EffectStatus Enumeration

Effect Instance Messages

NameValueDescriptionNotes
Success0x00The effect executed successfully.
Failure0x01The effect failed to trigger, but is still available for use. Viewer(s) will be refunded.
Unavailable0x02Same as Failure but the effect is no longer available for use for the remainder of the game.
Retry0x03The effect cannot be triggered right now, try again in a few seconds.This is the "normal" failure response.
Queue0x04The effect has been queued for execution after the current one ends.INTERNAL USE ONLY
Running0x05The effect triggered successfully and is now active until it ends.INTERNAL USE ONLY
Paused0x06The timed effect has been paused and is now waiting.
Resumed0x07The timed effect has been resumed and is counting down again.
Finished0x08The timed effect has finished.
Wait0x09The effect cannot be triggered right now. Wait for the specified time period for a followup response. Does not reschedule the request.
RemoteScheduled0x0AThe effect is being managed by a remote scheduler. Wait indefinitely.

Effect Class Messages

NameValueDescriptionNotes
Visible0x80The effect should be shown in the menu.
NotVisible0x81The effect should be hidden in the menu.
Selectable0x82The effect should be selectable in the menu.
NotSelectable0x83The effect should be unselectable in the menu.

System Status Messages

NameValueDescriptionNotes
NotReady0xFFThe processor isn't ready to start or has shut down.

Target Structure

NameTypeValueNotes
idstring?The service identifier of the player/viewer.This is always a string.
namestring?The display name of the player/viewer.
loginstring?The login name of the player/viewer.This field may not be available on all services.
avatarstring?The avatar name of the player/viewer.This field may not be available on all services.
serviceServiceType (int)RESERVEDRESERVED This field will appear in a future release.Appears as an integer value. See RequestType enum.

StandardErrors Enumeration

NameDescriptionNotes
General Errors
UnknownAn unknown error occurred.
ExceptionThrownAn exception was thrown while attempting to run the effect.
Bad Request Errors
BadRequestThe request was invalid.
EffectUnknownThe effect was not available.
EffectDisabledThe effect was disabled.
AlreadyFailedThe effect has already failed.
CannotParseNumberA supplied parameter could not be parsed.
UnknownSelectionA supplied parameter was unknown.
Connector Errors
ConnectorErrorAn unknown connector error occurred.
ConnectorReadFailureThe connector could not read from the game.
ConnectorWriteFailureThe connector could not write to the game.
ConnectorNotConnectedThe connector could not connect to the game.
ConnectorNotSupportedThe connector does not support the requested effect.
TCP Connector Errors
NoResponseThe connector received no response from the game.
Settings Errors
SettingsErrorAn error occurred while processing the pack settings.
CooldownPerEffectThe effect is on cooldown.
CooldownGlobalEffects are on cooldown.
RetryMaxTimeThe maximum retry time was exceeded.
RetryMaxAttemptsThe maximum number of retry attempts was exceeded.
Session Errors
NoSessionNo active game session.
SessionEndingThe game session ended before the effect could be run.
Game State Errors
BadGameStateThe game state was not ready.
Game State Errors - Missing Objects
GameObjectNotFoundA required game entity was not found.
PlayerNotFoundThe player was not found.
CharacterNotFoundThe character or party member was not found.
EnemyNotFoundThe enemy was not found.
ObjectNotFoundThe object was not found.
PrerequisiteNotFoundA required object was not found.
Game State Errors - Object State
ObjectStateErrorA required game entity was not in the correct state.
AlreadyInStateThe character or object was already in the target state.
AlreadyAcquiredThe item or object was already acquired.
AlreadyFinishedThe selected objective was already finished.
NoEmptyContainersThere are no empty containers or slots available.
PartyFullThe player's group or party is full.
InvalidAreaThe selected effect is not applicable or not allowed in the current area.
InvalidTargetThe selected target is not valid for the effect.
NoValidTargetsNo valid targets were found.
SpawnNotAllowedHereThe selected object or enemy cannot be spawned here.
Game State Errors - Range Limits
RangeErrorA value range error occurred.
AlreadyMinimumThe value was already at the minimum.
AlreadyMaximumThe value was already at the maximum.
Game Pack Errors
EffectNotImplementedThe effect is not implemented.
PackResourceMissingA required pack resource was missing.
Emulator Errors
EmulatorNotSupportedThe emulator does not support this effect.
EmulatorInvalidSettingThe emulator was not properly configured.
Game Pack State Errors
ConflictingEffectRunningA conflicting effect is already running.
UnqueueablePendingThis effect cannot be queued and another instance is already running.