From 196d211fffda0fc1427c8c1ea475b980a93f6129 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Fri, 22 Nov 2024 16:08:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=81=E4=B8=89=E5=BC=A0=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=8F=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamerule/thirteen/constants.go | 25 +++++++ gamesrv/thirteen/scene.go | 14 +++- gamesrv/thirteen/scenepolicy.go | 76 ++++++++++---------- protocol/thirteen/thirteen.pb.go | 120 +++++++++++++++++-------------- protocol/thirteen/thirteen.proto | 3 +- 5 files changed, 143 insertions(+), 95 deletions(-) diff --git a/gamerule/thirteen/constants.go b/gamerule/thirteen/constants.go index 3cbdadd..64d4508 100644 --- a/gamerule/thirteen/constants.go +++ b/gamerule/thirteen/constants.go @@ -33,6 +33,7 @@ const ( ThirteenWaterPlayerOpStandup = 2 //站起标记 ThirteenWaterPlayerOpTest = 3 // test ThirteenWaterPlayerOpReset = 4 // 重新选牌 + ThirteenWaterPlayerJoin = 5 // 加入游戏 ) const ( ThirteenWaterSceneWaitTimeout = time.Second * 2 //等待倒计时 @@ -44,6 +45,30 @@ const ( ThirteenWaterBilledTimeout = time.Second * 5 //结算 ) +const ( + TimeoutStart = iota + TimeoutSendCards + TimeoutOp + TimeoutBill +) + +func GetTimeout(param []int64, index int) time.Duration { + if index >= 0 && index < len(param) { + return time.Duration(param[index]) * time.Second + } + switch index { + case TimeoutStart: + return ThirteenWaterStartTimeout + case TimeoutSendCards: + return ThirteenWaterSendCardsTimeout + case TimeoutOp: + return ThirteenWaterOptCardTimeout + case TimeoutBill: + return ThirteenWaterBilledTimeout + } + return time.Duration(-1) +} + func GetMaxCard(allGroup map[int]*Group) *Group { var ret *Group max := -1000 diff --git a/gamesrv/thirteen/scene.go b/gamesrv/thirteen/scene.go index 3395455..e08204b 100644 --- a/gamesrv/thirteen/scene.go +++ b/gamesrv/thirteen/scene.go @@ -185,6 +185,10 @@ func (this *SceneEx) ThirteenWaterCreateRoomInfoPacket(s *base.Scene, p *base.Pl LeaveDeduct: this.GetDBGameFree().GetLeaveDeduct(), LeaveCombat: this.GetDBGameFree().GetLeaveCombat(), Params: common.CopySliceInt64ToInt32(s.Params), + TimeOuts: this.GetDBGameFree().GetOtherIntParams(), + } + if len(pack.TimeOuts) > rule.TimeoutOp { + pack.TimeOuts[rule.TimeoutOp] = int64(this.GetBaiPai().Seconds()) } // 玩家信息 for _, playerEx := range this.players { @@ -386,11 +390,17 @@ func (this *SceneEx) GetBaseScore() int64 { //游戏底分 } func (this *SceneEx) GetBaiPai() time.Duration { - s := this.GetParam(rule.ParamBaiPai) + if this.IsSceneMode(common.SceneModePublic) { + second := rule.GetTimeout(this.GetDBGameFree().GetOtherIntParams(), rule.TimeoutOp) // 后台配置摆牌时间 + if second > 0 { + return second + } + } + s := this.GetParam(rule.ParamBaiPai) // 自建房,摆牌时间 if s > 0 { return time.Duration(s) * time.Second } - return rule.ThirteenWaterOptCardTimeout + return rule.ThirteenWaterOptCardTimeout // 默认摆牌时间 } func (this *SceneEx) HasLaiZi() bool { diff --git a/gamesrv/thirteen/scenepolicy.go b/gamesrv/thirteen/scenepolicy.go index 1a2f6c6..e8ac247 100644 --- a/gamesrv/thirteen/scenepolicy.go +++ b/gamesrv/thirteen/scenepolicy.go @@ -85,13 +85,7 @@ func (this *PolicyThirteen) OnPlayerEnter(s *base.Scene, p *base.Player) { p.Pos = pos p.ExtraData = playerEx playerEx.Clear() - if sceneEx.Gaming && sceneEx.GetSceneState().GetState() != rule.ThirteenWaterSceneStateSendCards && - sceneEx.GetSceneState().GetState() != rule.ThirteenWaterSceneStateOptCard { // 发牌,理牌阶段也可以加入本局游戏 - p.MarkFlag(base.PlayerState_WaitNext) - p.UnmarkFlag(base.PlayerState_Ready) - } - if sceneEx.Gaming && sceneEx.GetSceneState().GetState() == rule.ThirteenWaterSceneStateOptCard && - int(rule.ThirteenWaterOptCardTimeout.Seconds())-s.GetSceneState().GetTimeout(s) < 15 { + if sceneEx.Gaming { p.MarkFlag(base.PlayerState_WaitNext) p.UnmarkFlag(base.PlayerState_Ready) } @@ -465,6 +459,10 @@ func (this *BaseState) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, par if !ok { return false } + sceneEx, ok := s.ExtraData.(*SceneEx) + if !ok { + return false + } switch opcode { case rule.ThirteenWaterPlayerOpStandup: @@ -488,41 +486,30 @@ func (this *BaseState) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, par if !common.Config.IsDevMode { return false } - sceneEx, ok := s.ExtraData.(*SceneEx) - if !ok { - return false - } sceneEx.testPokers = make([]int64, len(params)) copy(sceneEx.testPokers, params) return true + case rule.ThirteenWaterPlayerJoin: + // 发牌和选牌阶段,给玩家发牌 + if s.GetSceneState().GetState() == rule.ThirteenWaterSceneStateSendCards || + (s.GetSceneState().GetState() == rule.ThirteenWaterSceneStateOptCard && int(sceneEx.GetBaiPai().Seconds())-sceneEx.GetSceneState().GetTimeout(s) > 15) { + if len(sceneEx.cardsArr) > 0 && playerEx.cards[0] == -1 { + playerEx.MarkFlag(base.PlayerState_Ready) + playerEx.UnmarkFlag(base.PlayerState_WaitNext) + playerEx.cards = sceneEx.cardsArr[0] + playerEx.allGroup = sceneEx.cardsGroup[0] + sceneEx.cardsArr = sceneEx.cardsArr[1:] + sceneEx.cardsGroup = sceneEx.cardsGroup[1:] + sceneEx.SendToPlayerCardsBySnid(p.SnId) + logger.Logger.Tracef("游戏开始后给玩家发牌, sceneId=%v, player=%v, cards=%v", s.GetSceneId(), p.SnId, playerEx.cards) + } + } } return false } -func (this *BaseState) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) { - if sceneEx, ok := s.ExtraData.(*SceneEx); ok { - switch evtcode { - case base.PlayerEventLeave: - case base.PlayerEventEnter: - // 发牌和选牌阶段,给玩家发牌 - if s.GetSceneState().GetState() == rule.ThirteenWaterSceneStateSendCards || - s.GetSceneState().GetState() == rule.ThirteenWaterSceneStateOptCard { - if p.IsGameing() { - playerEx, ok := p.ExtraData.(*PlayerEx) - if ok && len(sceneEx.cardsArr) > 0 && playerEx.cards[0] == -1 { - playerEx.cards = sceneEx.cardsArr[0] - playerEx.allGroup = sceneEx.cardsGroup[0] - sceneEx.cardsArr = sceneEx.cardsArr[1:] - sceneEx.cardsGroup = sceneEx.cardsGroup[1:] - sceneEx.SendToPlayerCardsBySnid(p.SnId) - logger.Logger.Tracef("游戏开始后给玩家发牌, sceneId=%v, player=%v, cards=%v", s.GetSceneId(), p.SnId, playerEx.cards) - } - } - } - } - } -} +func (this *BaseState) OnPlayerEvent(s *base.Scene, p *base.Player, evtcode int, params []int64) {} //===================================== // StateWait 匹配中 @@ -632,7 +619,12 @@ func (this *StateStart) OnEnter(s *base.Scene) { func (this *StateStart) OnTick(s *base.Scene) { this.BaseState.OnTick(s) if sceneEx, ok := s.ExtraData.(*SceneEx); ok { - if time.Now().Sub(sceneEx.StateStartTime) > rule.ThirteenWaterStartTimeout { + var second = rule.ThirteenWaterStartTimeout + sub := rule.GetTimeout(sceneEx.GetDBGameFree().GetOtherIntParams(), rule.TimeoutStart) + if sub > 0 { + second = sub + } + if time.Now().Sub(sceneEx.StateStartTime) > second { if sceneEx.Creator != 0 && sceneEx.GetRealPlayerNum() == 0 { sceneEx.Destroy(true) return @@ -765,7 +757,12 @@ func (this *StateSendCard) OnEnter(s *base.Scene) { func (this *StateSendCard) OnTick(s *base.Scene) { this.BaseState.OnTick(s) if sceneEx, ok := s.ExtraData.(*SceneEx); ok { - if time.Now().Sub(sceneEx.StateStartTime) > rule.ThirteenWaterSendCardsTimeout { + var second = rule.ThirteenWaterSendCardsTimeout + sub := rule.GetTimeout(sceneEx.GetDBGameFree().GetOtherIntParams(), rule.TimeoutSendCards) + if sub > 0 { + second = sub + } + if time.Now().Sub(sceneEx.StateStartTime) > second { if sceneEx.CheckNeedDestroy() { s.ChangeSceneState(rule.ThirteenWaterSceneStateWait) } else { @@ -1531,7 +1528,12 @@ func (this *StateBilled) OnPlayerOp(s *base.Scene, p *base.Player, opcode int, p func (this *StateBilled) OnTick(s *base.Scene) { this.BaseState.OnTick(s) if sceneEx, ok := s.ExtraData.(*SceneEx); ok { - if time.Now().Sub(sceneEx.StateStartTime) > rule.ThirteenWaterBilledTimeout { + var second = rule.ThirteenWaterBilledTimeout + sub := rule.GetTimeout(sceneEx.GetDBGameFree().GetOtherIntParams(), rule.TimeoutBill) + if sub > 0 { + second = sub + } + if time.Now().Sub(sceneEx.StateStartTime) > second { if sceneEx.CanStart() { s.ChangeSceneState(rule.ThirteenWaterSceneStateStart) } else { diff --git a/protocol/thirteen/thirteen.pb.go b/protocol/thirteen/thirteen.pb.go index 200ba6a..e3c891e 100644 --- a/protocol/thirteen/thirteen.pb.go +++ b/protocol/thirteen/thirteen.pb.go @@ -386,7 +386,7 @@ type CSThirteenPlayerOp struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` // 1:确定牌 2站起状态 3test 4重新选牌 + OpCode int32 `protobuf:"varint,1,opt,name=OpCode,proto3" json:"OpCode,omitempty"` // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏 // 确定牌时,两种参数规则,都可以 // 第一种:玩家从推荐牌型中选择一个,把Poker.IndexType发过来(减少数据传输) // 第二种:按头墩中墩尾墩顺序把牌发过来 @@ -924,6 +924,7 @@ type SCThirteenRoomInfo struct { TotalOfGames int32 `protobuf:"varint,17,opt,name=TotalOfGames,proto3" json:"TotalOfGames,omitempty"` //总局数 LeaveDeduct int32 `protobuf:"varint,18,opt,name=LeaveDeduct,proto3" json:"LeaveDeduct,omitempty"` // 离场扣分倍数;玩家在发牌,选牌状态离场扣除指定倍数的底分 LeaveCombat int32 `protobuf:"varint,19,opt,name=LeaveCombat,proto3" json:"LeaveCombat,omitempty"` // 补偿倍数;玩家在发牌,选牌状态离场其它玩家补偿底分倍数 + TimeOuts []int64 `protobuf:"varint,20,rep,packed,name=TimeOuts,proto3" json:"TimeOuts,omitempty"` // 游戏阶段超时时间,秒 0开始倒计时,1发牌,2选牌,3结算 } func (x *SCThirteenRoomInfo) Reset() { @@ -1091,6 +1092,13 @@ func (x *SCThirteenRoomInfo) GetLeaveCombat() int32 { return 0 } +func (x *SCThirteenRoomInfo) GetTimeOuts() []int64 { + if x != nil { + return x.TimeOuts + } + return nil +} + //房间状态更新 //PACKET_SCThirteenRoomState type SCThirteenRoomState struct { @@ -1475,7 +1483,7 @@ var file_protocol_thirteen_thirteen_proto_rawDesc = []byte{ 0x44, 0x61, 0x74, 0x61, 0x22, 0x29, 0x0a, 0x15, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x22, - 0xd4, 0x04, 0x0a, 0x12, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x52, 0x6f, + 0xf0, 0x04, 0x0a, 0x12, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, @@ -1512,59 +1520,61 @@ var file_protocol_thirteen_thirteen_proto_rawDesc = []byte{ 0x74, 0x18, 0x12, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x18, 0x13, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x4c, 0x65, 0x61, 0x76, 0x65, - 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x22, 0x43, 0x0a, 0x13, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, - 0x74, 0x65, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, - 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x05, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5a, 0x0a, 0x13, 0x53, - 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x53, 0x68, 0x6f, 0x77, 0x43, 0x61, 0x72, - 0x64, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x41, 0x6c, - 0x6c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, - 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x2e, 0x50, 0x6f, 0x6b, 0x65, 0x72, 0x52, 0x08, 0x41, - 0x6c, 0x6c, 0x43, 0x61, 0x72, 0x64, 0x73, 0x22, 0x68, 0x0a, 0x06, 0x42, 0x69, 0x6c, 0x6c, 0x65, - 0x64, 0x12, 0x10, 0x0a, 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x50, 0x6f, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, - 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, - 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, 0x6f, 0x69, - 0x6e, 0x22, 0x42, 0x0a, 0x10, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x42, - 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x09, 0x41, 0x6c, 0x6c, 0x42, 0x69, 0x6c, 0x6c, - 0x65, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x69, 0x72, 0x74, - 0x65, 0x65, 0x6e, 0x2e, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x09, 0x41, 0x6c, 0x6c, 0x42, - 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x22, 0x24, 0x0a, 0x0e, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, - 0x65, 0x65, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x2a, 0xee, 0x02, 0x0a, 0x0d, - 0x54, 0x57, 0x4d, 0x6d, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x18, 0x0a, - 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x48, 0x49, 0x52, 0x54, 0x45, 0x45, 0x4e, - 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, - 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, - 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xc2, 0x2b, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, - 0x54, 0x5f, 0x43, 0x53, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x4f, 0x70, 0x10, 0xc3, 0x2b, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, - 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, - 0x53, 0x74, 0x61, 0x74, 0x65, 0x10, 0xc4, 0x2b, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, - 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x50, 0x6c, 0x61, - 0x79, 0x65, 0x72, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x10, 0xc5, 0x2b, 0x12, 0x21, 0x0a, 0x1c, 0x50, - 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, - 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x10, 0xc6, 0x2b, 0x12, 0x21, - 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, - 0x65, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x61, 0x72, 0x64, 0x73, 0x10, 0xc7, - 0x2b, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, - 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xc8, - 0x2b, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, - 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x53, 0x68, 0x6f, 0x77, 0x43, 0x61, 0x72, 0x64, 0x73, 0x10, - 0xc9, 0x2b, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, - 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x10, 0xca, 0x2b, - 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, - 0x72, 0x74, 0x65, 0x65, 0x6e, 0x54, 0x65, 0x73, 0x74, 0x10, 0xcb, 0x2b, 0x2a, 0x2f, 0x0a, 0x0c, - 0x4f, 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, - 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, - 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x42, 0x28, 0x5a, - 0x26, 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x74, - 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x75, + 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x03, 0x52, 0x08, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x75, + 0x74, 0x73, 0x22, 0x43, 0x0a, 0x13, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, + 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x5a, 0x0a, 0x13, 0x53, 0x43, 0x54, 0x68, 0x69, + 0x72, 0x74, 0x65, 0x65, 0x6e, 0x53, 0x68, 0x6f, 0x77, 0x43, 0x61, 0x72, 0x64, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, + 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x41, 0x6c, 0x6c, 0x43, 0x61, 0x72, + 0x64, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x74, 0x68, 0x69, 0x72, 0x74, + 0x65, 0x65, 0x6e, 0x2e, 0x50, 0x6f, 0x6b, 0x65, 0x72, 0x52, 0x08, 0x41, 0x6c, 0x6c, 0x43, 0x61, + 0x72, 0x64, 0x73, 0x22, 0x68, 0x0a, 0x06, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x50, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x50, 0x6f, 0x73, 0x12, + 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, + 0x6f, 0x69, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x57, 0x69, 0x6e, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1e, 0x0a, + 0x0a, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x62, 0x61, 0x74, 0x43, 0x6f, 0x69, 0x6e, 0x22, 0x42, 0x0a, + 0x10, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x42, 0x69, 0x6c, 0x6c, 0x65, + 0x64, 0x12, 0x2e, 0x0a, 0x09, 0x41, 0x6c, 0x6c, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x74, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x2e, + 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x52, 0x09, 0x41, 0x6c, 0x6c, 0x42, 0x69, 0x6c, 0x6c, 0x65, + 0x64, 0x22, 0x24, 0x0a, 0x0e, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x54, + 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x44, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x44, 0x61, 0x74, 0x61, 0x2a, 0xee, 0x02, 0x0a, 0x0d, 0x54, 0x57, 0x4d, 0x6d, + 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x41, 0x43, + 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x48, 0x49, 0x52, 0x54, 0x45, 0x45, 0x4e, 0x5f, 0x5a, 0x45, 0x52, + 0x4f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, + 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, + 0x10, 0xc2, 0x2b, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, + 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, + 0x10, 0xc3, 0x2b, 0x12, 0x1f, 0x0a, 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, + 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x10, 0xc4, 0x2b, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, + 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x45, + 0x6e, 0x74, 0x65, 0x72, 0x10, 0xc5, 0x2b, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, 0x43, 0x4b, 0x45, + 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x10, 0xc6, 0x2b, 0x12, 0x21, 0x0a, 0x1c, 0x50, 0x41, + 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, 0x6e, 0x50, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x43, 0x61, 0x72, 0x64, 0x73, 0x10, 0xc7, 0x2b, 0x12, 0x1e, 0x0a, + 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, + 0x65, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xc8, 0x2b, 0x12, 0x1f, 0x0a, + 0x1a, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, + 0x65, 0x6e, 0x53, 0x68, 0x6f, 0x77, 0x43, 0x61, 0x72, 0x64, 0x73, 0x10, 0xc9, 0x2b, 0x12, 0x1c, + 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, + 0x65, 0x65, 0x6e, 0x42, 0x69, 0x6c, 0x6c, 0x65, 0x64, 0x10, 0xca, 0x2b, 0x12, 0x1a, 0x0a, 0x15, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x54, 0x68, 0x69, 0x72, 0x74, 0x65, 0x65, + 0x6e, 0x54, 0x65, 0x73, 0x74, 0x10, 0xcb, 0x2b, 0x2a, 0x2f, 0x0a, 0x0c, 0x4f, 0x70, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, + 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, + 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x42, 0x28, 0x5a, 0x26, 0x6d, 0x6f, 0x6e, + 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x61, 0x6d, + 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x74, 0x68, 0x69, 0x72, 0x74, + 0x65, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protocol/thirteen/thirteen.proto b/protocol/thirteen/thirteen.proto index 4c8badb..0ac7d2d 100644 --- a/protocol/thirteen/thirteen.proto +++ b/protocol/thirteen/thirteen.proto @@ -73,7 +73,7 @@ message SCThirteenPlayerCards { //玩家操作 //PACKET_CSThirteenPlayerOp message CSThirteenPlayerOp { - int32 OpCode = 1; // 1:确定牌 2站起状态 3test 4重新选牌 + int32 OpCode = 1; // 1:确定牌 2站起状态 3test 4重新选牌 5加入游戏 // 确定牌时,两种参数规则,都可以 // 第一种:玩家从推荐牌型中选择一个,把Poker.IndexType发过来(减少数据传输) @@ -164,6 +164,7 @@ message SCThirteenRoomInfo { int32 TotalOfGames = 17; //总局数 int32 LeaveDeduct = 18; // 离场扣分倍数;玩家在发牌,选牌状态离场扣除指定倍数的底分 int32 LeaveCombat = 19; // 补偿倍数;玩家在发牌,选牌状态离场其它玩家补偿底分倍数 + repeated int64 TimeOuts = 20; // 游戏阶段超时时间,秒 0开始倒计时,1发牌,2选牌,3结算 } //房间状态更新