From 00cc47880332d91f8801bb02b9d3404652d579fa Mon Sep 17 00:00:00 2001 From: tangmingyou <234767776@qq.com> Date: Mon, 20 Feb 2023 22:17:10 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E7=89=8C=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/poker.proto | 1 - internal/game/player.go | 2 -- internal/game/table.go | 1 - internal/service/table.go | 5 ++--- 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/api/poker.proto b/api/poker.proto index 6adb754..3bc259a 100644 --- a/api/poker.proto +++ b/api/poker.proto @@ -147,7 +147,6 @@ message TablePlayer { string avatar = 4; int32 chip = 5; // 筹码 int32 status = 6; // 玩家状态: 1待准备开始,2已准备开始,已开始(3等待其他玩家动作,4待大盲注,5待小盲注,6待跟注,7已弃) - int32 lastStatus = 7; // TODO 删, 前端通过消息监听获取下注金额信息 bool master = 8; // 是否房主 int32 roundBetTimes = 11; // 该局下注次数 int32 totalBetChip = 13; // 该局牌已下注筹码 diff --git a/internal/game/player.go b/internal/game/player.go index 191de45..e6ae62d 100644 --- a/internal/game/player.go +++ b/internal/game/player.go @@ -20,7 +20,6 @@ type Player struct { Chip int32 // 玩家筹码 TotalBetChip int32 // 本次游戏已下注筹码 Status int32 // 状态: 1待准备开始,2已准备开始,3等待其他玩家动作,[4第一回合小盲注跟注,5待大盲注,5待小盲注,] 6待跟注,7已弃牌,8结算中 - LastStatus int32 // 变化前一个状态 BetOpts []int32 // status=[4,6]时下注可操作按钮: 1跟注,2加注(-[0]+),3All-In,4弃牌,5过牌 BetMin int32 // 最低下注额 BetMax int32 // 最高下注额 -1不限 @@ -81,6 +80,5 @@ func (p *Player) SetStatus(status int32) { } } - p.LastStatus = p.Status p.Status = status } diff --git a/internal/game/table.go b/internal/game/table.go index 427d064..042c75d 100644 --- a/internal/game/table.go +++ b/internal/game/table.go @@ -160,7 +160,6 @@ func (t *Table) BuildResGameFullStatus() *api.ResGameFullStatus { Avatar: p.Avatar, Chip: p.Chip, Status: p.Status, - LastStatus: p.LastStatus, Master: t.MasterId == p.Id, RoundBetTimes: p.RoundBetTimes, TotalBetChip: p.TotalBetChip, diff --git a/internal/service/table.go b/internal/service/table.go index f4bb85a..4a40be2 100644 --- a/internal/service/table.go +++ b/internal/service/table.go @@ -58,7 +58,6 @@ func HandleReqCreateTable(account *session.NetAccount, msg *api.ReqCreateTable) Username: account.UserName, Avatar: account.Avatar, Status: 1, - LastStatus: 0, Chip: table.LimitInAmount, TotalBetChip: 0, Cards: [2]*game.Card{}, @@ -156,7 +155,6 @@ func HandleReqJoinTable(account *session.NetAccount, msg *api.ReqJoinTable) (pro Username: account.UserName, Avatar: account.Avatar, Status: 1, - LastStatus: 0, Chip: 0, TotalBetChip: 0, Cards: [2]*game.Card{nil, nil}, @@ -534,7 +532,7 @@ func HandleReqBetting(player *game.Player, msg *api.ReqBetting) (proto.Message, } case 5: // 过牌 table.LastPosBetType = 5 - player.RoundBetTimes++ + // player.RoundBetTimes++ betNotice.Line2 = "过牌" default: @@ -559,6 +557,7 @@ func HandleReqBetting(player *game.Player, msg *api.ReqBetting) (proto.Message, //} if !raise { + // 当前玩家未加注, 判断是否结束本轮下注 if nextPlayer.RoundBetTimes == player.RoundBetTimes { // 开启下一轮