Network Messages

Table of contents

  1. Description
  2. Format
  3. Example

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: FrameData
    • 1: RecordingOptions
    • 2: RecordingOptionChanged
    • 3: SyncOptionsChanged
    • 4: SyncVisibleShapesData
    • 5: 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;
    }
}