dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit fb2a660612edbed9a832d0d7f0fd9231bf839ec2
parent 6cfc7b50ca4d18c97fec00570942734d1707481c
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 14 Dec 2023 14:17:48 -0500

fix

Diffstat:
Mpkg/database/tableUsers.go | 2+-
Mpkg/web/handlers/poker/poker.go | 8++++----
2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/pkg/database/tableUsers.go b/pkg/database/tableUsers.go @@ -121,7 +121,7 @@ type User struct { CaptchaRequired bool Theme int64 GeneralMessagesCount int64 - ChipsTest int + ChipsTest PokerChip XmrBalanceStagenet Piconero XmrBalance Piconero AFK bool diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -377,7 +377,7 @@ func (g *PokerGame) UnSitPlayer1(db *database.DkfDB, roomID string, player *Poke } tx := db.Begin() if g.PokerTableIsTest { - user.ChipsTest += int(account.Amount) + user.ChipsTest += account.Amount } else { user.XmrBalanceStagenet += account.Amount.ToPiconero() } @@ -1221,7 +1221,7 @@ func Refund(db *database.DkfDB) { for _, account := range accounts { if user, err := tx.GetUserByID(account.UserID); err == nil { if account.PokerTable.IsTest { - user.ChipsTest += int(account.Amount.ToPiconero() + account.AmountBet.ToPiconero()) + user.ChipsTest += account.Amount + account.AmountBet } else { user.XmrBalanceStagenet += account.Amount.ToPiconero() + account.AmountBet.ToPiconero() } @@ -1302,7 +1302,7 @@ func PokerSitHandler(c echo.Context) error { } var userChips database.PokerChip if pokerTable.IsTest { - userChips = database.PokerChip(authUser.ChipsTest) + userChips = authUser.ChipsTest } else { userChips = authUser.XmrBalanceStagenet.ToPokerChip() } @@ -1313,7 +1313,7 @@ func PokerSitHandler(c echo.Context) error { } needed := tableMinBuyIn - tableAccount.Amount if pokerTable.IsTest { - authUser.ChipsTest -= int(needed) + authUser.ChipsTest -= needed } else { authUser.XmrBalanceStagenet -= needed.ToPiconero() }