Hooks
Inject custom logic into the Core library
Introduction
Hooks are a way of adding your own code on top of Slot Engine. They allow you to execute code or update state at specific points of the program.
List of Hooks
These are the hooks you can define in your game configuration.
onHandleGameFlow
| Property | Type | Required |
|---|---|---|
onHandleGameFlow | (ctx: GameContext) => void | yes |
The complete game logic must be implemented in this hook.
onSimulationAccepted
| Property | Type | Required |
|---|---|---|
onSimulationAccepted | (ctx: GameContext) => void |
This hook is called after a simulation is accepted and the payout has been written to the book. Useful to run code after completing a simulation and before continuing with the next.
Important
No payouts or results should be altered using this hook! But adding additional data
with ctx.services.data.record() is perfectly fine.
Use of AI on this page: All texts were initially written by hand and many were later revised by AI for improved flow. All AI generated revisions were carefully reviewed and edited as needed.