-
Notifications
You must be signed in to change notification settings - Fork 0
Communication between the CLI and OGrEE 3D
OGrEE-3D is listening to the TCP port 5500.
All data are given with a simple json structure:
{
"type" : "keyword",
"data" : <serialized corresponding data structure>
}
The keyword will identify which type of data is given, in order to deserialize it with the corresponding structure. Data content will always be a serialized structure or the id of the concerned object.
{
"type" : "login",
"data" : <login data>
}
- login data:
{
"api_url" : "",
"api_token : ""
}
These values will override/replace the ones given in config.json.
Corresponding CLI command here.
{
"type" : "load template",
"data" : <JSON of the template>
}
JSON Template structure is described here.
Corresponding CLI command here
{
"type" : "select",
"data" : "id of the object to select"
}
Corresponding CLI command here
{
"type" : "delete",
"data" : "id of the object to delete"
}
Corresponding CLI command here
{
"type" : "focus",
"data" : "id of the object to focus"
}
Corresponding CLI commands here
{
"type" : "create",
"data" : <JSON of the created object>
}
JSON object structure is described here.
Corresponding CLI command here
{
"type" : "modify",
"data" : <JSON of the updated object>
}
JSON object structure is described here
Some keywords are used only for interacting with OGrEE 3D
{
"type" : "interact",
"data" : <interact instruction>
}
- Structure of an interact data:
{
"id" : "id of the targeted object", //eg: "rackId"
"param" : "The interaction keyword", //eg: "slots"
"value" : "The value to set" //eg: "false"
}
Corresponding CLI commands here
{
"type" : "ui",
"data" : <UI instruction>
}
Possible UI instructions:
{
"command" : "delay",
"data" : "time"
}
{
"command" : "infos",
"data" : "true|false"
}
{
"command" : "debug",
"data" : "true|false"
}
{
"command" : "highlight",
"data" : "id of the object to highlight"
}
{
"command" : "clearcache",
"data" : ""
}
Corresponding CLI commands here
{
"type" : "camera",
"data" : <camera instruction>
}
A camera instruction is:
{
"command" : "",
"position" : <Serialized Vector3>,
"rotation" : <Serialized Vector2>
}
Possible camera instructions:
{
"command" : "move",
"position" : "{"x":posX, "y":posY, "z":posZ}",
"rotation" : "{"x":rotX, "y":rotY}"
}
{
"command" : "translate",
"position" : "{"x":posX, "y":posY, "z":posZ}",
"rotation" : "{"x":rotX, "y":rotY}"
}
{
"command" : "wait",
"position" : "{"x":0, "y":0, "z":0}",
"rotation" : "{"x":999, "y":time}"
}
This one is a "hack" to keep the same data structure as the other camera commands: rotation.x = 999 is used as a keycode for rotation.y = time to wait.
{
"type" : "modify-tag",
"data" :
{
"old-slug" : ""
"tag" : <JSON of the updated tag>
}
}
{
"type" : "delete-tag",
"data" : "tag-slug"
}
"type" : "create-layer",
"data" : <JSON of the created layer>
{
"type" : "modify-layer",
"data" :
{
"old-slug" : ""
"layer" : <JSON of the updated layer>
}
}
{
"type" : "delete-layer",
"data" : "layer-slug"
}