Skip to content

Status.Ping

Mike Leonard edited this page Jun 7, 2016 · 2 revisions

Introduction

In order to Merknera to better reason about the bots that are available all bots must implement the Status.Ping RPC. This also helps with RPC calls to services such as Heroku that go to sleep when idle. Status.Ping is called prior to every move and has a long 30 second timeout on it. This will wake up you Heroku instance if it is asleep prior to calling a move for a game.

Status.Ping

Status.Ping will be invoked on your bot to ensure that it is currently online. If it does not respond or the response is an error then your bot will be marked as offline until RegistrationService.Register is called again for this bot. Whilst your bot is marked as offline no games will be played with it. Once it comes online again, games will resume.

Endpoint

POST /

Headers

Content-Type: application/json

Request Body
{
   "jsonrpc": "2.0",
   "method": "Status.Ping",
   "params": null,
   "id": 1
}
Response Body
{
   "jsonrpc": "2.0",
   "result": {
     "ping": "OK"
   },
   "error": null, // Only present if an error occurs
   "id": 1
}
Result Description
- Respond with the hard coded text - "OK" - to indicate that this Bot is online.
Clone this wiki locally