API Methods
The OperatorInterface class provides static methods to communicate with the operator.
Setup
setup
Initializes the OperatorInterface.
static setup(
operatorProtocol: OperatorProtocol,
gameCode: string,
currencyCode: string,
languageCode: string,
playerID: string,
mode: string,
lobbyURL: string,
isMobile?: boolean
): Promise<void>Parameters:
operatorProtocol: The operator protocol to use.gameCode: The game code.currencyCode: The 3-digit ISO currency code.languageCode: The 2-digit ISO language code.playerID: The player ID.mode: The game mode (e.g., "REAL", "DEMO").lobbyURL: The URL to the lobby.isMobile: (Optional) Whether the game is in mobile mode. Defaults tofalse.
Event Handling
addEventListener
Adds a listener to a given incoming event.
static addEventListener(event: OperatorInterfaceToGameMessage, callback: Callback): CallbackParameters:
event: The incoming event to listen for.callback: The callback function to call.
Returns:
- The callback function.
on
Adds a listener to a given incoming event. on is an alias for addEventListener.
static on(event: OperatorInterfaceToGameMessage, callback: Callback): CallbackParameters:
event: The incoming event to listen for.callback: The callback function to call.
Returns:
- The callback function.
once
Adds a listener to a given incoming event and removes it once it's been called.
static once(event: OperatorInterfaceToGameMessage, callback: Callback): CallbackParameters:
event: The incoming event to listen for.callback: The callback function to call.
Returns:
- The callback function.
removeEventListener
Removes a listener for a given event.
static removeEventListener(event: OperatorInterfaceToGameMessage, callback: Callback): voidParameters:
event: The incoming event.callback: The callback function to remove.
Game State
gameReady
The game should call this method when it is loaded and initialized.
static gameReady(): voidloadProgress
The game should call this so that the casino can be updated with loading progress and display progress in a loading screen.
static loadProgress(progress: number): voidParameters:
progress: A number between 0 and 1 representing the loading progress (1 = 100%).
loadComplete
The game should call this when loading is completed.
static loadComplete(): voidgameDataLoaded
The game should call this method when the loadConfig call is received.
static gameDataLoaded(): voidinitialGameState
The game should call this method before loading starts to notify operators if the game will be muted or not.
static initialGameState(muted: boolean): voidParameters:
muted: Whether the game is muted.
retrievedStoredSettings
The game should call this method when the game has retrieved stored user settings such as mute state.
static retrievedStoredSettings(): voidgameUIUpdated
The game should call this method when the buy feature menu is opened/closed, the splash screen is shown/hidden, or the game is waiting for user confirmation.
static gameUIUpdated(buyFeatureMenuOpen: boolean, splashScreenVisible: boolean, waitingForUserConfirmation: boolean): voidParameters:
buyFeatureMenuOpen: Whether the buy feature menu is open.splashScreenVisible: Whether the splash screen is visible.waitingForUserConfirmation: Whether the game is waiting for user confirmation.
Gameplay
autoPlayStarted
The game should call this method when the game starts autoplays.
static autoPlayStarted(): voidautoPlayFinished
The game should call this method when the game ends autoplays.
static autoPlayFinished(): voidspinAnimationStarted
The game should call this method when the spin animation starts.
static spinAnimationStarted(): voidspinAnimationStopped
The game should call this method when the spin animation ends.
static spinAnimationStopped(): voidroundStarted
The game should call this method when a new game round is started.
static roundStarted(balance: number, stake: number): voidParameters:
balance: The player's balance in minor units.stake: The player's stake in minor units.
roundEnded
The game should call this method when a game round is ended.
static roundEnded(balance: number, stake: number, winAmount?: number, ticketsLeftAfter?: number): voidParameters:
balance: The player's balance in minor units.stake: The player's stake in minor units.winAmount: (Optional) The player's win amount in minor units. Defaults to 0.ticketsLeftAfter: (Optional) The number of tickets left after the game round. Defaults to 0.
balanceUpdated
The game should call this method whenever the displayed balance is changed.
static balanceUpdated(realBalance: number, demoBalance?: number, bonusBalance?: number, fudgeAmount?: number): voidParameters:
realBalance: The real balance of the player.demoBalance: (Optional) The demo balance of the player. Defaults to 0.bonusBalance: (Optional) The bonus balance of the player. Defaults to 0.fudgeAmount: (Optional) How much to fudge the displayed balance (if win animations have not yet finished). Defaults to 0.
stakeUpdated
The game should call this method to update the stake displayed by the casino.
static stakeUpdated(stake: number): voidParameters:
stake: The player's stake in minor units.
cashWin
The game should call this method to update the win amount displayed by the casino.
static cashWin(
winAmount: number,
stake: number,
winType?: 'normal' | 'big' | 'mega' | 'monster' | 'legendary',
isFreePlayWin?: boolean,
totalFreePlayWin?: number
): voidParameters:
winAmount: The player's win amount in minor units.stake: The player's bet amount in minor units.winType: (Optional) The type of win. Defaults to 'normal'.isFreePlayWin: (Optional) Was the win awarded in freeplays? Defaults tofalse.totalFreePlayWin: (Optional) What is the total win in the freeplays? Defaults to 0.
collected
The game should call this method when the player collects a win.
static collected(collectedAmount: number): voidParameters:
collectedAmount: The amount the player collected in minor units.
cashier
The game should call this method when the user runs out of funds or attempts to spin with insufficient funds.
static cashier(): voidhelp
The game should call this method when the user requests help.
static help(): voidhistory
The game should call this method to navigate to game history.
static history(): voidquit
The game should call this method when the quit button is pressed.
static quit(): voidresume
The game should call this method when the game is brought back into focus.
static resume(): voidvisibleSymbols
The game should call this method to notify operators of the symbols visible in the reels.
static visibleSymbols(visibleSymbols: number[][], stake: number): voidParameters:
visibleSymbols: The visible symbols.stake: The stake amount.
winningSymbols
The game should call this method to notify operators of the symbols included in all winlines.
static winningSymbols(symbols: number[], stake: number): voidParameters:
symbols: The winning symbols.stake: The stake amount.
lineCountUpdated
The game should call this method when the number of winlines changes.
static lineCountUpdated(lineCount: number): voidParameters:
lineCount: The number of winlines.
cardGamble
The game should call this method when a card gamble bet is placed.
static cardGamble(): voidladderGamble
The game should call this method when a ladder gamble bet is placed.
static ladderGamble(): voidgambleWin
The game should call this method when a win is awarded after gambling (bonus).
static gambleWin(winAmount: number, stake: number): voidParameters:
winAmount: The player's win amount in minor units.stake: The player's bet amount in minor units.
fullRow
The game should call this method when a full row winline is awarded.
static fullRow(rowCount: number, includesWilds: boolean, winlineSymbols: number[]): voidParameters:
rowCount: The number of symbols in the winline.includesWilds: Whether the winline includes a wild.winlineSymbols: The symbols in the winline.
scatterWin
The game should call this method when scatters award cash.
static scatterWin(winAmount: number, scatterSymbolID: number, positions: number[][]): voidParameters:
winAmount: The amount of cash the scatters awards.scatterSymbolID: The ID of the symbol which awarded the scatter win.positions: The position of the scatters on the reels.
Features
freeSpinsAwarded
The game should call this method when the freespins feature is awarded.
static freeSpinsAwarded(awarded: number, stake: number, inFreeSpins: boolean): voidParameters:
awarded: How many freespins were awarded.stake: The player's bet amount in minor units.inFreeSpins: Were the freespins awarded in freespins?
featuredStarted
The game should call this method when the game enters a feature like freespins.
static featuredStarted(): voidfeaturedFinished
The game should call this method when the game finishes a feature like freespins.
static featuredFinished(): voidfreeplaysAwarded
The game should call this method when entering freeplays.
static freeplaysAwarded(awarded: number, stake: number): voidParameters:
awarded: The number of freeplays awarded.stake: The stake of the freeplays in minor units.
freeplaysSummary
The game should call this method when freeplays have ended.
static freeplaysSummary(used: number, stake: number, totalWin: number): voidParameters:
used: The number of freeplays used.stake: The stake of the freeplays in minor units.totalWin: The total win of the freeplays in minor units.
getPromoInfo
The game should call this method when the game is in freeplays.
static getPromoInfo(): voidsetPromoInfo
The game should call this method when response.ticketInfo.promotions.data is present in the response.
static setPromoInfo(promoInfo: string): voidParameters:
promoInfo: The promo info passed by the game engine.
registerOption
The game can call this method to notify the operator that particular game options can be displayed by the commonUI.
static registerOption(option: RegisterOption): voidParameters:
option: The game option to register.
realityCheck
The game should call this method to display the reality check dialog.
static realityCheck(elapsedMS: number, intervalMS: number, exitURL: string, historyURL: string): voidParameters:
elapsedMS: The elapsed time in milliseconds.intervalMS: The interval between reality checks in milliseconds.exitURL: The URL to redirect to when the player exits the game.historyURL: The URL to redirect to when the player wants to see their history.
sendRealityCheckResponse
The game should call this method when the player responds to the reality check dialog.
static sendRealityCheckResponse(backendURL: string, token: string, continued: boolean): Promise<GameAPIReply | ErrorResponse>Parameters:
backendURL: The backend URL received in login call.token: The token received in the last successful call.continued: Whether the player chose to continue.
Returns:
- A promise that resolves to a
GameAPIReplyobject on success, or anErrorResponseon failure.
Audio & Turbo
muted
The game should call this method to notify the operator that the sound was muted.
static muted(): voidunmuted
The game should call this method to notify the operator that the sound was unmuted.
static unmuted(): voidsupport
The game should call this method when the user requests support.
static support(): voidturboEnabled
The game should call this method to notify the operator that turbo was enabled.
static turboEnabled(): voidturboDisabled
The game should call this method to notify the operator that turbo was disabled.
static turboDisabled(): voidOther
error
The game should call this method when an error is shown.
static error(category: ErrorCategory, severity: ErrorSeverity, message: string, code?: string): voidParameters:
category: The error category.severity: The severity of the error.message: The message to display.code: (Optional) Mandatory for Light and Wonder (LNW).
orientationUpdated
The game should call this method when orientation is updated.
static orientationUpdated(): voidpassThroughMessage
The game should call this method with any messages that are passed to the frontend.
static passThroughMessage(message: string): voidParameters:
message: The message to forward to the operator.
playerActivity
The game should call this method when the player performs an action in the game. This allows the lobby to control session inactivity requirements for specific jurisdictions.
Examples of actions that should trigger this method:
- Clicking the spin button
- Changing the bet/stake amount
- Interacting with game menus or settings
- Clicking collect/gamble buttons
- Any touch or click input during gameplay
static playerActivity(): void