Network Messages
Table of contents
Description
All messages sent via WebSockets in Frame by Frame follow the same format. The format is the same no matter the direction of the message.
There are two possible directions for the messages:
- From the game/engine to Frame by Frame
- From Frame by Frame to the game/engine
The direction of messages is documented using the following format:
Origin:
Frame by Frame
Target:
Game/Engine
Format
The format of a Frame by Frame message is a JSON with the following layout:
// Frame by Frame Message Format
{
"type": number,
"data": json | array
}
type
: Id indicating the type of message. The possible values are:0
: FrameData1
: RecordingOptions2
: RecordingOptionChanged3
: SyncOptionsChanged4
: SyncVisibleShapesData5
: SyncCameraData
data
: Content of the message. It can be any valid json field, including objects or arrays.
Example
Example of a SyncOptionsChanged
message:
{
"type": 3,
"data": {
"syncVisibleShapes": true;
"syncCamera": false;
}
}