commit e6590d8a203d60f5fbfe2fc5e30fcbe021d73497
parent 3a6271b90701f9f202dbb739e0e0d9edb03fb097
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Thu, 7 Dec 2023 23:43:21 -0500
unused
Diffstat:
1 file changed, 0 insertions(+), 6 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -798,14 +798,12 @@ type PlayerGain struct {
}
func processPot(winners []GameResult, nbPlayers, mainPot int) (res []PlayerGain) {
- winnersStrArr := make([]string, 0)
if len(winners) == 0 {
logrus.Error("winners has len 0")
} else if len(winners) == 1 && len(winners[0].Players) == 1 {
// Everyone fold but 1 player
player := winners[0].Players[0]
res = append(res, PlayerGain{player, mainPot, 0, "Only player alive"})
- winnersStrArr = append(winnersStrArr, player.Username)
} else {
isDone := true
for groupIdx, group := range winners {
@@ -817,14 +815,12 @@ func processPot(winners []GameResult, nbPlayers, mainPot int) (res []PlayerGain)
// Only 1 player win and is not all-in
player := group.Players[0]
res = append(res, PlayerGain{player, mainPot, groupIdx, poker.RankString(group.HandScore)})
- winnersStrArr = append(winnersStrArr, player.Username)
} else if len(group.Players) == 1 && group.Players[0].Cash == 0 {
// Only 1 player win but is all-in
player := group.Players[0]
maxGain := player.RoundTotalBet * nbPlayers
piece := utils.MinInt(maxGain, mainPot)
res = append(res, PlayerGain{player, piece, groupIdx, poker.RankString(group.HandScore)})
- winnersStrArr = append(winnersStrArr, player.Username)
mainPot -= piece
isDone = false
} else if len(group.Players) > 1 {
@@ -839,7 +835,6 @@ func processPot(winners []GameResult, nbPlayers, mainPot int) (res []PlayerGain)
piece := utils.MinInt(maxGain, expectedSplit)
res = append(res, PlayerGain{p, piece, groupIdx, poker.RankString(group.HandScore)})
mainPot -= piece
- winnersStrArr = append(winnersStrArr, p.Username)
if nbPlayersInGroup-allInCount > 0 {
expectedSplit = mainPot / (nbPlayersInGroup - allInCount)
} else {
@@ -855,7 +850,6 @@ func processPot(winners []GameResult, nbPlayers, mainPot int) (res []PlayerGain)
for _, p := range group.Players {
if p.Cash > 0 {
res = append(res, PlayerGain{p, piece, groupIdx, poker.RankString(group.HandScore)})
- winnersStrArr = append(winnersStrArr, p.Username)
}
}
}