CoinRoster / slotmachine

fruitgame
0 stars 0 forks source link

Jackpot Value #30

Closed RiskingTime closed 6 years ago

RiskingTime commented 6 years ago

@Patrick-Bay at the time of writing, the jackpot value showing on the game page is 12 digits long, this must be a bug/error since the max number of digits should be 8 and also since 1% of the value of each bet is added to the jackpot and the bet size max is 0.0005, each bet should add (0.0005 * 0.01) = 0.000005 to the jackpot

the value of the slotjackpot1 showing on the stats page is also incorrect (and also doesn't match the game page) at the time of writing the stats page is showing a jackpot value of 1.88771692

Can you let me know how long it might take you to determine what is causing these errors and outline a way to fix these bugs/errors?

Patrick-Bay commented 6 years ago

I think that this may be a two-part problem:

First appears to be a problem with the affiliate calculation. For this I would investigate the "node/affiliate_plugin.js" file, focusing on the RPC_jackpot_gen and RPC_dividend_gen functions.

The second part will begin by looing into the buildStatsTables function in the "html/stats.js" file to determine if the calculations beiong there are the cause of the problem or if the data being returned via the getInvestmentStats RPC function (the next to investigate).

Patrick-Bay commented 6 years ago
  1. Ensure that Progressive value in game is showing btc_total column value from database (from jackpot table)
  2. Ensure that Stats page is showing the same value as #1 (current progressive amount (btc))
  3. Continue investigation using above steps and continue with game_server.js in the RPC_getGameResults function to see how jackpot is being calculated.
  4. Remove extraneous total column from "jackpots" table -- all values and calculations should be done in BTC (update affected 'game_server' code as well)
Patrick-Bay commented 6 years ago

Add additional base_btc column to jackpots and add section to game_server code to reset jackpot amount to this value when jackpot is won.

Ensure that the amount is also being subtracted from the bankroll on a win.

Patrick-Bay commented 6 years ago

I'll take an additional hour to investigate this issue further and follow up with a revised estimate.

Patrick-Bay commented 6 years ago

After additional investigation I would estimate that this task will take approximately 4 hours and involve changes to a number of both client-side (browser), and server-side (Node.js) files, as described above.

RiskingTime commented 6 years ago

ok, please proceed. let me know when its complete

Patrick-Bay commented 6 years ago

Changes have been pulled to the dev server (http://myfruitgame.com) and may be tested immediately.

Complete list of code-level fixes and updates is listed in the associated commit (https://github.com/CoinRoster/slotmachine/commit/13f63738d3ed95b4efe9d42550e689b0c5d1fa62).

RiskingTime commented 6 years ago

ok, I'll start testing

RiskingTime commented 6 years ago

looks like the decimal is in the wrong place, jackpot should start at 0.05 (100x the max bet)

Patrick-Bay commented 6 years ago

I've updated the base BTC value in the database and changed the starting jackpot value to reflect this. Please refresh your browser to see the changes.

RiskingTime commented 6 years ago

the liability on http://myfruitgame.com/stats.php should be the difference between the current jackpot and its base level, so as an example = 0.055 - 0.05 = 0.005

at the moment, it looks like the current jackpot amount and the bankroll liability are the same number

RiskingTime commented 6 years ago

I'm gonna start running it till we hit the jackpot a few times to see what happens when it resets

Patrick-Bay commented 6 years ago

Regarding your earlier comment (liability calculation), a fix has been made live on the development server. The commit for it is: https://github.com/CoinRoster/slotmachine/commit/b767db08cc8a1d45b4b70324de22af492d79a42c

RiskingTime commented 6 years ago

I'm re-opening this issue because I found another bug, the jackpot isn't paying out properly, looks like its paying out double (maybe the progressive amount and also the fixed amount are both paying out?) attached are images showing the numbers,

jackpot win 1 jackpot win 2 jackpot win 3

Patrick-Bay commented 6 years ago

Understood. I'll investigate and follow up with findings and an estimate if the fix appears to be extensive (my initial impression based on the information above suggests that it's not an extensive fix).

Patrick-Bay commented 6 years ago

Update for jackpot calculation issue has been committed (https://github.com/CoinRoster/slotmachine/commit/96b8e6b1ca5e8e341f2c4876f7363b747225e12b) and can be reviewed on the dev server now.

RiskingTime commented 6 years ago

looks like the jackpots are calculating, displaying, and paying out accurately right now. I'm closing this issue