From 2702982977f037ef760979c6c91f18a9ec5c2b2e Mon Sep 17 00:00:00 2001 From: tangmingyou <234767776@qq.com> Date: Sun, 5 Mar 2023 22:31:33 +0800 Subject: [PATCH] fold bugfix --- Makefile | 2 +- internal/game/actions.go | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index f279784..b87fd52 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ clean: rm -rf target/ run: - nohup target/texas -conf=target/data/config.toml -region=sh -zone=sh001 -deploy.env=dev -weight=10 2>&1 > target/data/texas.log & + nohup target/texas -conf=target/data/config.toml 2>&1 > target/data/texas.log & stop: pkill -f target/texas diff --git a/internal/game/actions.go b/internal/game/actions.go index 7f3bedd..991a0d8 100644 --- a/internal/game/actions.go +++ b/internal/game/actions.go @@ -123,20 +123,20 @@ func Fold4Limited(player *Player, betChip int32) proto.Message { player.SetStatus(7) betNotice.Line2 = "弃牌" - // 剩余玩家数为1则结束 - leftPlayers := collect.Filter(player.GameTable.Players, func(i int, p *Player) bool { - return p != nil && p.Status != 7 - }) - if len(leftPlayers) == 1 { - err := table.RoundOver() - if err != nil { - return &api.ResFail{Code: 500, Msg: err.Error()} - } - player.GameTable.NoticeAllPlayer(betNotice) - return &api.ResSuccess{} - } - player.GameTable.NoticeAllPlayer(betNotice) - return nil + // 剩余玩家数为1则结束, 在 service 中判断 + //leftPlayers := collect.Filter(player.GameTable.Players, func(i int, p *Player) bool { + // return p != nil && p.Status != 7 + //}) + //if len(leftPlayers) == 1 { + // err := table.RoundOver() + // if err != nil { + // return &api.ResFail{Code: 500, Msg: err.Error()} + // } + // // player.GameTable.NoticeAllPlayer(betNotice) + // return &api.ResSuccess{} + //} + // player.GameTable.NoticeAllPlayer(betNotice) + return &api.ResSuccess{} } func Check4Limited(player *Player, betChip int32) proto.Message {