arrow_back
logo
search
SupportlaunchAPI
menulaunchSign In
close
OverviewConceptsAdmin PanelCloudAPICompliance
Overview
Get StartedAuthorizationMessagingJackpotsMultiplayerGame Client InterfaceErrors Handle
Get StartedAuthorizationGame SessionMessagingBettings and WinningsRandom Numbers GeneratorJackpotsMultiplayerTesting
Overview
Overview
Using the client libraryImplementing an integrationDeploying an integration
Replying to a gamePending Winnings
.NET CoreGoJavaNodeJsPHPPythonRuby
OverviewOverwriting jackpots
launchAPISupport
launchSign In

Jackpots

Before you begin

Before you can contribute or get outcome from any jackpots, you need to:

  1. Create a Game inside the Fireball Admin panel
  2. Create a Jackpot inside the Fireball Admin panel
  3. Authorize in operator integration

Subscribe on Jackpots updates

After successful authorization, you can connect Player to receive jackpots updates on game client:

        // setup constants for game
        public static class MyGameConstants
        {
            public static string JACKPOT_TEMPLATE_ID = "00000000-0000-0000-0000-000000000000";
            public static float CONTRIBUTION_PERCENT = 0.5f;
        }

        public async Task<MessageResult> OnAuthSuccess(SessionMessage message)
        {
            // create list of jackpots template ids
            var jackpots = new List<string>()
            {
                MyGameConstants.JACKPOT_TEMPLATE_ID,
            };

            // connect jackpots list to game client for receiving jackpots updates
            return await _fireball.SendSessionToClient(message, jackpots);
        }

Contribute to Jackpots

Every time Player place a bet, the game can contribute some part of the bet amount or full amount into the jackpot for later next try to win the jackpot:

        public async Task<MessageResult> BetPlace(long betAmount, BaseMessage message)
        {
            // calculate jackpot contribution amount
            var contributionAmount = (long)(betAmount * MyGameConstants.CONTRIBUTION_PERCENT);

            // create jackpot contributions list
            var contributionsList = new List<JackpotContribution>()
            {
                new JackpotContribution(MyGameConstants.JACKPOT_TEMPLATE_ID, contributionAmount),
            };

            // place bet with notifing what part of bet will go for jackpot contributions
            return await _fireball.PlaceBet(FireballConstants.BetType.SPIN, betAmount, message, contributionsList);
        }

        public async Task<MessageResult> OnBetPlaced(IntegrationBetPlaced message)
        {
            // calculate jackpot contribution amount
            var contributionAmount = (long)(message.Amount * MyGameConstants.CONTRIBUTION_PERCENT);

            // make contribution into jackpot from succesfully placed bet
            var result = await _fireball.Jackpots.Contribute(MyGameConstants.JACKPOT_TEMPLATE_ID, contributionAmount, message);

            // do next game logic
            ...

        }

if game want to get immediate outcome, use next method:

        public async Task<MessageResult> OnBetPlaced(IntegrationBetPlaced message)
        {
            // calculate jackpot contribution amount
            var contributionAmount = (long)(message.Amount * MyGameConstants.CONTRIBUTION_PERCENT);

            // make contribution into jackpot from succesfully placed bet
            var result = await _fireball.Jackpots.ContributeAndGetOutcome(MyGameConstants.JACKPOT_TEMPLATE_ID, contributionAmount, message);

            if (result.Won)
            {
                // congratulation! jackpot has been won!
            }

            // do next game logic
            ...

        }

Get Jackpots Outcome

After successful contributions, Player can try to win jackpot by use some part of contributions or full contributed amount:

        public async Task<MessageResult> OnBetPlaced(IntegrationBetPlaced message)
        {
            // calculate jackpot contribution amount
            var contributionAmount = (long)(message.Amount * MyGameConstants.CONTRIBUTION_PERCENT);

            // make contribution into jackpot from succesfully placed bet
            await _fireball.Jackpots.Contribute(MyGameConstants.JACKPOT_TEMPLATE_ID, contributionAmount, message);

            // do next game logic
            ...

            var result = await _fireball.Jackpots.GetOutcome(MyGameConstants.JACKPOT_TEMPLATE_ID, contributionAmount, message);
            if (result.Won)
            {
                // congratulation! jackpot has been won!
            }
        }

Pay Jackpots

After Player successfully won jackpot, this jackpot must be paid into Players balance:

        public async Task<MessageResult> OnBetPlaced(IntegrationBetPlaced message)
        {
            // calculate jackpot contribution amount
            var contributionAmount = (long)(message.Amount * MyGameConstants.CONTRIBUTION_PERCENT);

            // make contribution into jackpot from succesfully placed bet
            var result = await _fireball.Jackpots.ContributeAndGetOutcome(MyGameConstants.JACKPOT_TEMPLATE_ID, contributionAmount, message);

            if (result.Won)
            {
                // create a list of won jackpots
                var jackpotsWon = new List<JackpotEntry>()
                {
                    new JackpotEntry(result)
                };

                // paying won jackpot amount
                await _fireball.PayJackpot(jackpotsWon, message.OperatorBetId, message);
            }

            // do next game logic
            ...

        }
Copyright © 2020-. All rights reserved.v1.0.8