Game Launch
When a game definition is created via the backoffice the location of a frontend index document has to be defined.
When a game launch is requested, the player's web browser will be redirected to the given URL and a temporary (short-life) token will be passed as parameter together with a URL which should be used by the game to connect to the back office and check correctness of the token passed.
A typical URL will look like this
https://test.gamestudio/index.html?token=3869af18-7e8b-415f-b9d7-dd8f2fb61162&login=http%3A%2F%2Fgamestudio%3A4577%2Fgameapi%2Fv2%2Fconnect| Parameter (GET) | |
| token | Short life token to be used in login call |
| login | URL to be used to connect to hizi.io RGS and get a long life token in return |
The frontend should now call the URL passed in the login parameter with the short life token passed as a parameter. (GET request)
This call will return basic game information and token data which contains a new token ID which is now a long life token and should be used for any further calls. Endpoints for calls to the game engine are also passed as responses. Data is returned as a JSON object.
Note that the short life token can only be used once, if the call fails the operator has to request a new game launch URL.
Data returned by the login call - lines in bold are mandatory to be used by the game frontend
| token | Long life token ID; this token has to be used for any subsequent call to backendUrl / refreshUrl |
| backendUrl | Location of game engine endpoint |
| webSocketUrl | Optional URL of an available websocket communication which can be used as an alternative to POST requests to backendUrl - for further information request sample code from hizi.io customer support |
| logoutUrl | Optional URL which can be called to log out of the game, in effect this will invalidate the long life token and a new game launch request has to be sent by operator |
| refreshUrl | Optional URL to reconnect to a session, this call is equivalent to the login URL passed in the launch command but needs a long life token instead of the short life token |
| balance | Contains information about the players balance |
| gameSettings | gameSettings to be used by the game |
| operatorProtocol | Defines the operator protocol used - this is an informational parameter to enable the game to support operator specific requirement - for further information request sample code from hizi.io customer support |
| tokenData | Contents of the long life token - this contains information about playerid, operatorid, gameid, gamemode (REAL or DEMO) and currency information |
NOTE: This call will send information about apotential open game round in tokenData to allow game resuming.