Hi SafeDice here me again, the super fan Elmo ~
i encountered a thing that seems the balance displaying function has some issue ?
as the image shows, after a bet i got the "negative" balance, but i can still bet,
also one things that often happens is the balance display get updated after 2, 3 bets.
I don't know if this is related to this :
saying that i have 0.04 balance now, and i withdraw some amount ( e.g. 0.02 ),
and when i back to play page, the balance showed below of the balance (e.g 0.018xxx) , and when i bet
again it shows the correct balance with the win/lose bet profit.
hope the description is clear, just want to improve the site !
Hey Elmo, thanks for the feedback!
There are 2 ways you get a balance update:
1) After betting, withdraw, invest, and other balance affecting actions
2) Periodic update
I think because your connection to the server is unstable, somehow you lost connection for the former update. I also found that you do deposit and withdrawal frequently, do you usually encounter this issue after doing deposit or withdrawal?
id like to know how he could have possibly got the balance negative...
This has to do with the way and which data gets transfered after a bet.
A lot of sites, like PD, send data regarding the bet, the player, and the site after a bet. others, like safedice, only send the bet data and rely on periodic updates for the other stats. this has the following implications.
PD always shows the correct stats after a bet, because the latest balance, player stats and site stats are sent along with the site. The server calculates all of the info and is then sent to the client, so it is guaranteed to be correct. The down side of this is if you log in at multiple locations at the same time and withdraw/bet, only the instance that placed the last withdraw/bet is up to date.
At SD, on the other hand, the server only sends info regarding the bet in response to a bet, then the client needs to calculate the new balance and stats, with the occasional request for the *correct* data from the server. every 15 seconds or so, every client should have requested the latest stats, so all clients should be pretty much up to date. This means slightly less load on the server, but could cause some inaccuracies. For example if you are betting, and receive a deposit, but the occasional pull of data fails because of a network error, and you go on a losing streak, the client might think you have a negative balance (because it doesn't know of the deposit), while the server knows that you balance is in fact positive.
I've encountered this with my bot on a few instances where the balance isn't updated after a deposit or a withdrawal from somewhere else and it ends up being higher or lower than it should.
If it is really just a display issue then it isnt a big deal at all.
It is definitely only a display issue. I've known this long ago, but since it is very very rare I think it was ok, it is technically more efficient after all. But if few people encounter this kind of issue, I'll change how things work.
I just changed the way balance is updated after placing a bet, now the balance is always correctly synchronized in real time with the server