ShopGetLotteryOdds

From BetgamesTV
Jump to navigation Jump to search

Method returns game odds information.

Method should be called only once, on authentication. Because this information changes very rarely. Except for poker game, odds are being updated when round changes.

Inputs:

  • token (string) - betshop token.
  • lottery_id (int) - id of the game.

Outputs (array of odds):

  • OddId (int) - id of the odd, which should be passed with bet information when calling ShopPlaceBets method.
  • OddCode (string) - short code for odd. Needed only for UI quick search. These code are also printed in odds pricelist.
  • OddName (string) - odd name in betshop language.
  • OddValue (int) - odd value in "cents". For example, if real odd value = 1.85, then this value would be 185. Needed to exclude float approximation errors.
  • OddItemsCount (int) - number of items needed to be selected for this odd.

Refresh lottery and odds algorithm.

1. Get and save in memory lottery list via soap method client.ShopGetLotteries(settingManager.Token);

2. Show information about the ottery in UI.

3. Get every lottery odds via ShopGetLotteryOdds (settingManager.Token, lottery.ID); and show in UI if needed.

4. Wait until next draw or next round will start.

5. Get lottery JSON from LotteriesCacheUrl (was saved after ShopGetSettings) and show lottery information in UI.

6. Get odds JSON from lottery.LotteryOddsCacheUrl (was saved after ShopGetLotteries) and show in UI if needed.

7. Steps from forth to six repeats all the time.