-
Notifications
You must be signed in to change notification settings - Fork 0
API
The FireClient API is a protocol that allows for programs to interact with FireClient.
Currently the API is only available as a websocket, on port 39870.
When using the FireClient API, all packets between your application and FireClient follow a specific pattern, outlined below. However, when connecting to the API it will always send a welcome message, including a link to this page, and the connection id (attribute id), which is used in the game log when referencing the connection.
Packets sent to FireClient should always follow the below format
{
"type": "packet_type_name_here",
"data": {
"key1": "value1",
...
}
}If the packet you are sending does not require any data, simple leave the object empty, do not omit it.
When receiving a packet from FireClient, it always will have a success attribute. After sending a packet to FireClient, you will always receive one back.
If the packet you sent has a response, the response data will be in the response attribute, otherwise the packet will only contain the success value.
If the API call was unsuccessful, it will provide an error. See an example below.
{
"success": false,
"error": {
"type": "java.lang.InvalidStateException",
"message": "The error message, if applicable, otherwise null."
}
}Sending an identify packet allows FireClient to display your program's name instead of the connection ID, in certain scenarios. It expects a name argument, where you should supply your program's name. It does not have any response data.
Shows a toast (popup) in the game. It expects a message argument, where you should supply the message to be shown. It does not have any response data.
Starts the FireClient Authentication process. See the Authentication page for more information. It accepts a publicKey argument, and responds with the secretKey and username attributes. See Authentication for more info.