ThrillConnect: Event Subscription
Subscribing for events
Once you have a connection established, you will usually want to subscribe for events. The ThrillTech event system allows you to specify which systems, and which events from those systems, you wish to subscribe to.
To subscribe for events from the ThrillPots system, you must send a SubscribeRequest
message via the websocket connection. For example, to subscribe to all events from the thrillpots
system, you can send the following message:
{
"SubscribeRequest": {
"events": [{
"source": "thrillpots",
"event_type": "*"
}]
}
}
If you want to subscribe to specific events only, for example if you only want to subscribe to JackpotUpdateEvents, you could send the following request:
{
"SubscribeRequest": {
"events": [{
"source": "thrillpots",
"event_type": "JackpotUpdate"
}]
}
}
Event Types
The following events are available to be subscribe to for ThrillPots:
Event | Description |
---|---|
JackpotUpdate | These events provide periodic updates for all active jackpots |
OptInEvent | These events provide updates on the connected player's opt-in status |
WinEvent | These events provide win notifications (not specifically for the connected player) |
RaffleWinEvent | These events provide win notifications for raffle jackpot wins |
JackpotUpdate
JackpotUpdate
events are sent periodically to keep your application informed of the latest jackpot values.
An example JackpotUpdate
event could look like this:
{
"msg_type": "Event",
"source": "thrillpots",
"msg_name": "JackpotUpdate",
"operator_id": "thrilltech",
"brand_id": "brand1",
"player_id": null,
"data": {
"id": "f689317d-81c8-4395-b689-10ce6f88089e",
"currency": "EUR",
"pots": [
{
"id": "minor",
"is_progressive": true,
"current_value": 10.0
},
{
"id": "major",
"is_progressive": true,
"current_value": 100.21749999999994
},
{
"id": "mega",
"is_progressive": true,
"current_value": 1000.045
}
],
"allowed_brands": [
"thrilltech:brand1",
"thrilltech:brand2",
],
"allowed_sources": [],
"status": "Active",
"last_updated": 1715154276442
},
"timestamp": 1715191298453
}
OptInEvent
When a player opts-in or opts-out of a jackpot, an event will be sent to that player's WebSocket connection. An structure of the data
for an OptInEvent looks like this:
{
"instance_id": String,
"player_id": String,
"player_brand_id": String,
"preferred_contribution_value": Number,
"opted_in": Boolean,
"last_updated": Number,
}
WinEvent
When a Jackpot is won, the ThrillPots system publishes a WinEvent
which contains the details of the win. This message is sent to all connections that are subscribed to the receive the event. The structure of the data
portion of the Event message looks like this:
{
"brand_id": String,
"player_id": String,
"source_id": Option<String>,
"instance_id": String,
"jackpot_name": String,
"jackpot_currency": String,
"timestamp": u64,
"win_pot_id": String,
"win_amount": Number,
"currency_multipliers": {
"brand_id": String,
"base_currency": String,
"multipliers": {
"EUR": Number,
"GBP": Number,
"ZAR": Number,
...
"NZD": Number,
"SEK": Number
}
}
"win_withheld": bool,
"community_winners": null | [
{
"player_id": String,
"brand_id": String,
"currency": String,
"win_amount": Number
}
],
"games_in_jackpot": Vec<String>,
"seed": Decimal
}
RaffleWinEvent
When a Raffle Jackpot resolves and winners are determines, a RaffleWinEvent
which contains the details of the wins will be sent. The message is sent to all connections that are subscribed to receive the event. The structure of the data
portion of the Event message looks like this:
{
"brand_id": String,
"instance_id": String,
"jackpot_name": String,
"jackpot_currency": String,
"currency_multipliers": {
"brand_id": String,
"base_currency": String,
"multipliers": {
"EUR": Number,
"GBP": Number,
"ZAR": Number,
...
"NZD": Number,
"SEK": Number
}
}
"timestamp": Number,
"winners": [
{
"player_id": String,
"brand_id": String,
"currency": String,
"win_amount": Number
}
],
"win_withheld": bool
}