Game Events API Documentation
This document describes the events and event handlers for a game client integrated with a window-based system.
The API allows the game to send events to a client and register callbacks for specific events.
All methods interact with a client object to send events or handle incoming events via callbacks.
Event Sending Methods
These methods allow the game to send events to the client using the client.send method. Each event is associated with a specific action or state change in the game.
- Outgoing Events:
- These are outgoing events sent by the game to the client using the
client.sendmethod. - They represent actions or state changes initiated by the game, such as loading progress, gameplay start/end, or user interactions (e.g., enabling audio or opening the help menu).
- Example:
loadStart(),playEnd(),valueStake(stakeAmount). - Purpose: To notify the client of game-driven events or updates.
- Event Handlers:
- These are event handlers that register callbacks to respond to incoming events triggered by the client.
- They use the
_addEventHandlermethod to listen for specific client-initiated events, such as game pause, balance updates, or UI changes (e.g., opening the paytable). - Example:
onGamePause(cb),onUpdateBalance(cb),onHelpOpen(cb). - Purpose: To handle client-driven events by executing the provided callback functions.
- Outgoing Events
- Event Handlers
https://stg.otkgaming.com
Example for use
window.addEventListener('message', (data) => {
console.log(data)
})
Events list
load-start
load-progress
load-end
load-fail
play-start
play-end
feature-start
feature-end
autoplay-start
autoplay-end
autoplay-remaining
game-close
game-reload
value-stake
value-win
value-balance
no-funds
audio-enable
audio-disable
quikspin-enable
quikspin-disable
quikspin-level-change
help-open
help-close
playtable-open
playtable-close
history-open
history-close
error
go-home
https://stg.otkgaming.com
Example for use
iframeRef.current.contentWindow?.postMessage(
{
"event": 'game-pause',
"target": 'choicegaming'
},
'*'
)
Events list
game-pause
game-resume
autoplay-disable
update-balance
update-game-info
sync-balance
audio-enable
audio-disable
quickspin-enable
quickspin-disable
help-open
help-close
paytable-open
paytable-close
history-open
history-close