MCN Launch Pad Web Access - SSE Event Documentation
Models
SseEvent
interface SseEvent
{
type: string;
data: string;
}
Depending on the type, data may be a Base64-encoded JSON Object.
ServerMessage
For receiving or sending messages.
interface ServerMessage
{
type: string;
message: string;
}
ConsoleVariable
interface ConsoleVariable
{
name: string;
value: string;
oldValue: string;
type: string;
flags: string;
}
Because of the type-translation limitations between Java and JavaScript, all variable values are transmitted as strings. It is the responsibility of your JavaScript logic to convert the value into the correct data type, based on the type field.
The type field can be one of the following:
- boolean
- byte
- short
- integer
- long
- float
- double
- string
If the value represents a complex data type, the type will be "json". In that case, the value string contains a Base64-encoded JSON object. This object may represent a byte array or any other structured data.
When requesting a variable from the server, consult the reference manual to determine the correct data type and decode or convert the value accordingly.
Console Output Changed
This event is fired when the console's output buffer has changed.
- Type:
CONSOLE_OUTPUT_CHANGED - Data:
Base64 Encoded Output Buffer
Because the output buffer can be very large, this event may produce an overwhelming amount of data. If your system cannot handle large buffers, you can limit the number of output lines using the console variable cv_maxlines. The default value is 255, but you may reduce it to any smaller number to decrease the amount of data sent.
Console Variable Changed
This event is fired when a console variable has been modified.
- Type:
CONSOLE_VARIABLE_CHANGED - Data:
Base64 Encoded ConsoleVariable JSON Object
Log Message
This event is fired when Logger::LogMessage is invoked.
- Type:
LOG_MESSAGE - Data:
Base64 Encoded ServerMessage JSON Object
The ServerMessage type corresponds to the log level, and the message field contains the actual log text.
Impulse
This event is fired whenever an Impulse is triggered. Impulses are enumerated signals that indicate changes in the program runtime state.
- Type:
IMPULSE - Data:
Impulse Code
At the present time, there are three codes:
OutputChanged- Indicates that the console output buffer has changed.VariableChanged- Indicates that a console variable has changed.SystemEnd- Indicates that the program runtime has ended.
Since the first two impulses already have dedicated SSE events with additional context, they are typically handled through those richer event types.