diff --git a/README.md b/README.md index 5b08225..5a6af5d 100644 --- a/README.md +++ b/README.md @@ -22,14 +22,13 @@ pkill -f ./texas TODO List -### 离线后 -- 牌局结束后,清理离线玩家 -- 下注页面倒计时、超时自动操作 -- 前端lobby页面显示内容优化 -- lobby界面用户创建新桌面时通知消息,前端拉取新大厅界面, -- header头部编辑、退出、账户金额,流水 -- 日志 -- 验证码 -- 性能测试、系统调优 - - 大厅桌面变化日志版本记录? - - 注册同时生成大厅tiny头像 +- [x] 牌局结束后,清理离线玩家 +- [x] 下注页面倒计时、超时自动操作 +- [ ] 前端lobby页面显示内容优化 +- [x] lobby界面用户创建新桌面时通知消息,前端拉取新大厅牌桌列表 +- [ ] header头部编辑、退出、账户金额,流水查询 +- [ ] 日志优化 +- [ ] 验证码 +- [ ] 性能测试、系统调优 + - [ ] 大厅桌面变化日志版本记录 + - [ ] 注册同时生成大厅tiny头像 diff --git a/api/poker.pb.go b/api/poker.pb.go index 982102d..aae3e6c 100644 --- a/api/poker.pb.go +++ b/api/poker.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.28.1 -// protoc v3.21.12 +// protoc v3.17.3 // source: poker.proto package api @@ -574,10 +574,15 @@ type LobbyTable struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - TableNo int32 `protobuf:"varint,1,opt,name=tableNo,proto3" json:"tableNo,omitempty"` // 游戏编号 - PlayerNum int32 `protobuf:"varint,2,opt,name=playerNum,proto3" json:"playerNum,omitempty"` // 限定玩家数量 - RobotNum int32 `protobuf:"varint,3,opt,name=robotNum,proto3" json:"robotNum,omitempty"` // 限定机器人数量 - Players []*LobbyPlayer `protobuf:"bytes,4,rep,name=players,proto3" json:"players,omitempty"` // 当前玩家机器人列表 + TableNo int32 `protobuf:"varint,1,opt,name=tableNo,proto3" json:"tableNo,omitempty"` // 游戏编号 + PlayerNum int32 `protobuf:"varint,2,opt,name=playerNum,proto3" json:"playerNum,omitempty"` + // int32 robotNum = 3; // 限定机器人数量 + Players []*LobbyPlayer `protobuf:"bytes,4,rep,name=players,proto3" json:"players,omitempty"` // 当前玩家机器人列表 + PlayerLimit int32 `protobuf:"varint,5,opt,name=playerLimit,proto3" json:"playerLimit,omitempty"` // 限定玩家数量 + TexasType int32 `protobuf:"varint,6,opt,name=texasType,proto3" json:"texasType,omitempty"` + BigBland int32 `protobuf:"varint,7,opt,name=bigBland,proto3" json:"bigBland,omitempty"` + LimitInAmount int32 `protobuf:"varint,8,opt,name=limitInAmount,proto3" json:"limitInAmount,omitempty"` + Stage int32 `protobuf:"varint,9,opt,name=stage,proto3" json:"stage,omitempty"` } func (x *LobbyTable) Reset() { @@ -626,18 +631,46 @@ func (x *LobbyTable) GetPlayerNum() int32 { return 0 } -func (x *LobbyTable) GetRobotNum() int32 { +func (x *LobbyTable) GetPlayers() []*LobbyPlayer { + if x != nil { + return x.Players + } + return nil +} + +func (x *LobbyTable) GetPlayerLimit() int32 { if x != nil { - return x.RobotNum + return x.PlayerLimit } return 0 } -func (x *LobbyTable) GetPlayers() []*LobbyPlayer { +func (x *LobbyTable) GetTexasType() int32 { if x != nil { - return x.Players + return x.TexasType } - return nil + return 0 +} + +func (x *LobbyTable) GetBigBland() int32 { + if x != nil { + return x.BigBland + } + return 0 +} + +func (x *LobbyTable) GetLimitInAmount() int32 { + if x != nil { + return x.LimitInAmount + } + return 0 +} + +func (x *LobbyTable) GetStage() int32 { + if x != nil { + return x.Stage + } + return 0 } type LobbyPlayer struct { @@ -2178,149 +2211,157 @@ var file_poker_proto_rawDesc = []byte{ 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x06, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x73, 0x22, 0x29, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x4c, 0x6f, 0x62, 0x62, 0x79, 0x46, 0x72, 0x65, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x22, 0x8c, 0x01, 0x0a, 0x0a, 0x4c, 0x6f, + 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x22, 0x88, 0x02, 0x0a, 0x0a, 0x4c, 0x6f, 0x62, 0x62, 0x79, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4e, 0x75, 0x6d, - 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x08, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x4e, 0x75, 0x6d, 0x12, 0x2a, 0x0a, 0x07, - 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, - 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x62, 0x62, 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, - 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x22, 0x67, 0x0a, 0x0b, 0x4c, 0x6f, 0x62, 0x62, - 0x79, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x62, 0x6f, 0x74, + 0x12, 0x2a, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x4c, 0x6f, 0x62, 0x62, 0x79, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x20, 0x0a, 0x0b, + 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0b, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x65, 0x78, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x09, 0x74, 0x65, 0x78, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x62, 0x69, 0x67, 0x42, 0x6c, 0x61, 0x6e, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, + 0x62, 0x69, 0x67, 0x42, 0x6c, 0x61, 0x6e, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x69, 0x6d, 0x69, + 0x74, 0x49, 0x6e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0d, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x49, 0x6e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x73, 0x74, 0x61, 0x67, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, + 0x74, 0x61, 0x67, 0x65, 0x22, 0x67, 0x0a, 0x0b, 0x4c, 0x6f, 0x62, 0x62, 0x79, 0x50, 0x6c, 0x61, + 0x79, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x05, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, + 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x7c, 0x0a, + 0x0e, 0x52, 0x65, 0x71, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f, 0x62, + 0x6f, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, 0x6f, 0x62, 0x6f, 0x74, + 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x65, 0x78, 0x61, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x67, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x08, 0x62, 0x69, 0x67, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x22, 0x2a, 0x0a, 0x0e, 0x52, + 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x22, 0x28, 0x0a, 0x0c, 0x52, 0x65, 0x71, 0x4a, 0x6f, + 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, + 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, + 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x4c, 0x65, 0x61, 0x76, 0x65, 0x54, 0x61, 0x62, + 0x6c, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x52, 0x65, 0x61, 0x64, 0x79, 0x53, 0x74, + 0x61, 0x72, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, + 0x52, 0x65, 0x61, 0x64, 0x79, 0x22, 0x2d, 0x0a, 0x0f, 0x52, 0x65, 0x71, 0x4b, 0x69, 0x63, 0x6b, + 0x4f, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x4b, 0x69, 0x63, 0x6b, 0x4f, + 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x3b, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x47, 0x61, + 0x6d, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x12, 0x0a, 0x04, 0x63, 0x68, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x63, 0x68, 0x69, 0x70, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x41, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x47, 0x61, 0x6d, 0x65, + 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x9a, 0x02, 0x0a, 0x11, 0x52, + 0x65, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x67, 0x61, + 0x6d, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x67, + 0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x68, 0x69, 0x70, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x68, 0x69, 0x70, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x62, 0x69, 0x67, 0x42, + 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x62, + 0x69, 0x67, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x73, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x6d, + 0x61, 0x6c, 0x6c, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x0d, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x73, + 0x12, 0x29, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x61, 0x72, 0x64, 0x18, 0x0e, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x72, 0x64, 0x52, + 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x61, 0x72, 0x64, 0x12, 0x2a, 0x0a, 0x07, 0x70, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x61, + 0x70, 0x69, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x07, + 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x22, 0x95, 0x03, 0x0a, 0x0b, 0x54, 0x61, 0x62, 0x6c, + 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, - 0x72, 0x22, 0x7c, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, - 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x72, - 0x6f, 0x62, 0x6f, 0x74, 0x73, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x65, 0x78, 0x61, 0x73, 0x54, 0x79, - 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x74, 0x65, 0x78, 0x61, 0x73, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x62, 0x69, 0x67, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x62, 0x69, 0x67, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x22, - 0x2a, 0x0a, 0x0e, 0x52, 0x65, 0x73, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x61, 0x62, 0x6c, - 0x65, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x22, 0x28, 0x0a, 0x0c, 0x52, - 0x65, 0x71, 0x4a, 0x6f, 0x69, 0x6e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x74, - 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, - 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x4c, 0x65, 0x61, 0x76, - 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x71, 0x52, 0x65, 0x61, - 0x64, 0x79, 0x53, 0x74, 0x61, 0x72, 0x74, 0x22, 0x10, 0x0a, 0x0e, 0x52, 0x65, 0x71, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x65, 0x61, 0x64, 0x79, 0x22, 0x2d, 0x0a, 0x0f, 0x52, 0x65, 0x71, - 0x4b, 0x69, 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, - 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x22, 0x11, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x4b, - 0x69, 0x63, 0x6b, 0x4f, 0x75, 0x74, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x3b, 0x0a, 0x0d, 0x52, - 0x65, 0x71, 0x47, 0x61, 0x6d, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x68, 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x04, 0x63, 0x68, 0x69, 0x70, 0x22, 0x0f, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x47, - 0x61, 0x6d, 0x65, 0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x65, 0x71, - 0x47, 0x61, 0x6d, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x9a, - 0x02, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4e, 0x6f, 0x12, 0x1c, - 0x0a, 0x09, 0x67, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x09, 0x67, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x63, 0x68, 0x69, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x68, 0x69, 0x70, - 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, - 0x62, 0x69, 0x67, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x05, 0x52, 0x0b, 0x62, 0x69, 0x67, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x73, 0x12, 0x24, - 0x0a, 0x0d, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x6f, 0x73, 0x18, - 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x73, 0x6d, 0x61, 0x6c, 0x6c, 0x42, 0x6c, 0x69, 0x6e, - 0x64, 0x50, 0x6f, 0x73, 0x12, 0x29, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x61, - 0x72, 0x64, 0x18, 0x0e, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, - 0x61, 0x72, 0x64, 0x52, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x43, 0x61, 0x72, 0x64, 0x12, - 0x2a, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x10, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x22, 0x95, 0x03, 0x0a, 0x0b, - 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x72, - 0x6f, 0x62, 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x6f, 0x62, 0x6f, - 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, - 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x68, 0x69, 0x70, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x68, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x06, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x6f, 0x75, - 0x6e, 0x64, 0x42, 0x65, 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, - 0x52, 0x0d, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x42, 0x65, 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, - 0x24, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x42, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x42, 0x65, 0x74, - 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x65, - 0x74, 0x43, 0x68, 0x69, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x74, 0x6f, 0x74, - 0x61, 0x6c, 0x42, 0x65, 0x74, 0x43, 0x68, 0x69, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x68, 0x61, 0x6e, - 0x64, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, - 0x69, 0x2e, 0x48, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x68, 0x61, 0x6e, 0x64, - 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x62, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x65, 0x74, 0x52, - 0x6f, 0x6c, 0x65, 0x52, 0x07, 0x62, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x08, - 0x68, 0x61, 0x6e, 0x64, 0x43, 0x61, 0x72, 0x64, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, - 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x43, 0x61, 0x72, 0x64, 0x52, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x43, - 0x61, 0x72, 0x64, 0x22, 0x2c, 0x0a, 0x04, 0x43, 0x61, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, - 0x6f, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x6f, 0x74, 0x12, 0x12, 0x0a, - 0x04, 0x73, 0x75, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x75, 0x69, - 0x74, 0x22, 0x9f, 0x01, 0x0a, 0x07, 0x42, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, - 0x06, 0x62, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, - 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x12, 0x22, 0x0a, - 0x0c, 0x62, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x0c, 0x62, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x12, 0x26, 0x0a, 0x0e, 0x62, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x4c, 0x69, - 0x6d, 0x69, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x62, 0x65, 0x74, 0x53, 0x65, - 0x63, 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x65, 0x74, - 0x4f, 0x70, 0x74, 0x73, 0x18, 0x0d, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x62, 0x65, 0x74, 0x4f, - 0x70, 0x74, 0x73, 0x22, 0x4c, 0x0a, 0x08, 0x48, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x68, 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, - 0x61, 0x6e, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x5a, 0x68, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x5a, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x70, - 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x71, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, - 0x74, 0x22, 0x15, 0x0a, 0x13, 0x52, 0x65, 0x71, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x47, - 0x61, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x44, - 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, - 0x5c, 0x0a, 0x0a, 0x52, 0x65, 0x71, 0x42, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, - 0x07, 0x62, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, - 0x62, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x65, 0x74, 0x43, 0x68, - 0x69, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x65, 0x74, 0x43, 0x68, 0x69, - 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x05, 0x52, 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x73, 0x0a, - 0x13, 0x52, 0x65, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, - 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x65, 0x31, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x6c, 0x69, 0x6e, 0x65, 0x31, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x65, 0x32, 0x18, - 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x65, 0x32, 0x12, 0x14, 0x0a, 0x05, - 0x6c, 0x69, 0x6e, 0x65, 0x33, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x69, 0x6e, - 0x65, 0x33, 0x22, 0x3e, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x64, - 0x53, 0x65, 0x74, 0x74, 0x6c, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x67, 0x61, 0x6d, 0x65, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x47, 0x61, - 0x6d, 0x65, 0x46, 0x75, 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x04, 0x67, 0x61, - 0x6d, 0x65, 0x22, 0x92, 0x01, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x43, 0x61, 0x6c, 0x63, 0x57, 0x69, - 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x68, 0x69, 0x70, 0x12, 0x40, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x73, - 0x43, 0x68, 0x69, 0x70, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, - 0x2e, 0x52, 0x65, 0x73, 0x43, 0x61, 0x6c, 0x63, 0x57, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x68, - 0x69, 0x70, 0x2e, 0x57, 0x69, 0x6e, 0x73, 0x43, 0x68, 0x69, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, - 0x52, 0x08, 0x77, 0x69, 0x6e, 0x73, 0x43, 0x68, 0x69, 0x70, 0x1a, 0x3b, 0x0a, 0x0d, 0x57, 0x69, - 0x6e, 0x73, 0x43, 0x68, 0x69, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x28, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x47, 0x61, - 0x6d, 0x65, 0x4e, 0x65, 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x72, - 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, - 0x64, 0x22, 0x13, 0x0a, 0x11, 0x52, 0x65, 0x71, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x2d, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x61, - 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x61, - 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x68, 0x69, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x04, 0x63, 0x68, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, + 0x06, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x6d, + 0x61, 0x73, 0x74, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x42, 0x65, + 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x72, 0x6f, + 0x75, 0x6e, 0x64, 0x42, 0x65, 0x74, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x24, 0x0a, 0x0d, 0x72, + 0x6f, 0x75, 0x6e, 0x64, 0x42, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x0b, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x0d, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x42, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, + 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x65, 0x74, 0x43, 0x68, 0x69, + 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x65, + 0x74, 0x43, 0x68, 0x69, 0x70, 0x12, 0x29, 0x0a, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, + 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x48, 0x61, + 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x26, 0x0a, 0x07, 0x62, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x42, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, + 0x07, 0x62, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x08, 0x68, 0x61, 0x6e, 0x64, + 0x43, 0x61, 0x72, 0x64, 0x18, 0x0f, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x61, 0x70, 0x69, + 0x2e, 0x43, 0x61, 0x72, 0x64, 0x52, 0x08, 0x68, 0x61, 0x6e, 0x64, 0x43, 0x61, 0x72, 0x64, 0x22, + 0x2c, 0x0a, 0x04, 0x43, 0x61, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x64, 0x6f, 0x74, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x64, 0x6f, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x75, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x75, 0x69, 0x74, 0x22, 0x9f, 0x01, + 0x0a, 0x07, 0x42, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x74, + 0x4d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x62, 0x65, 0x74, 0x4d, 0x69, + 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x62, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x05, 0x52, 0x06, 0x62, 0x65, 0x74, 0x4d, 0x61, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x65, 0x74, + 0x54, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0c, 0x62, 0x65, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x26, 0x0a, + 0x0e, 0x62, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x62, 0x65, 0x74, 0x53, 0x65, 0x63, 0x6f, 0x6e, 0x64, + 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x73, + 0x18, 0x0d, 0x20, 0x03, 0x28, 0x05, 0x52, 0x07, 0x62, 0x65, 0x74, 0x4f, 0x70, 0x74, 0x73, 0x22, + 0x4c, 0x0a, 0x08, 0x48, 0x61, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x68, + 0x61, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x61, 0x6e, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x5a, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x68, 0x61, 0x6e, 0x64, 0x5a, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x69, 0x6e, 0x74, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x22, 0x0e, 0x0a, + 0x0c, 0x52, 0x65, 0x71, 0x47, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x22, 0x15, 0x0a, + 0x13, 0x52, 0x65, 0x71, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x54, + 0x61, 0x62, 0x6c, 0x65, 0x22, 0x15, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x44, 0x69, 0x73, 0x6d, 0x69, + 0x73, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x5c, 0x0a, 0x0a, 0x52, + 0x65, 0x71, 0x42, 0x65, 0x74, 0x74, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x65, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x65, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x65, 0x74, 0x43, 0x68, 0x69, 0x70, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x65, 0x74, 0x43, 0x68, 0x69, 0x70, 0x12, 0x1a, 0x0a, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x08, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x22, 0x73, 0x0a, 0x13, 0x52, 0x65, 0x73, + 0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x6c, 0x69, 0x6e, 0x65, 0x31, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x69, 0x6e, + 0x65, 0x31, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x65, 0x32, 0x18, 0x0c, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x65, 0x32, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6e, 0x65, + 0x33, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x69, 0x6e, 0x65, 0x33, 0x22, 0x3e, + 0x0a, 0x10, 0x52, 0x65, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x45, 0x6e, 0x64, 0x53, 0x65, 0x74, 0x74, + 0x6c, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x67, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x46, 0x75, + 0x6c, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x04, 0x67, 0x61, 0x6d, 0x65, 0x22, 0x92, + 0x01, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x43, 0x61, 0x6c, 0x63, 0x57, 0x69, 0x6e, 0x6e, 0x65, 0x72, + 0x43, 0x68, 0x69, 0x70, 0x12, 0x40, 0x0a, 0x08, 0x77, 0x69, 0x6e, 0x73, 0x43, 0x68, 0x69, 0x70, + 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x52, 0x65, 0x73, + 0x43, 0x61, 0x6c, 0x63, 0x57, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x43, 0x68, 0x69, 0x70, 0x2e, 0x57, + 0x69, 0x6e, 0x73, 0x43, 0x68, 0x69, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x08, 0x77, 0x69, + 0x6e, 0x73, 0x43, 0x68, 0x69, 0x70, 0x1a, 0x3b, 0x0a, 0x0d, 0x57, 0x69, 0x6e, 0x73, 0x43, 0x68, + 0x69, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, + 0x02, 0x38, 0x01, 0x22, 0x28, 0x0a, 0x10, 0x52, 0x65, 0x73, 0x47, 0x61, 0x6d, 0x65, 0x4e, 0x65, + 0x78, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x13, 0x0a, + 0x11, 0x52, 0x65, 0x71, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x22, 0x2d, 0x0a, 0x11, 0x52, 0x65, 0x73, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, + 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/poker.proto b/api/poker.proto index d6ca435..05fa5d8 100644 --- a/api/poker.proto +++ b/api/poker.proto @@ -66,9 +66,15 @@ message ResLobbyFresh { message LobbyTable { int32 tableNo = 1; // 游戏编号 - int32 playerNum = 2; // 限定玩家数量 - int32 robotNum = 3; // 限定机器人数量 + int32 playerNum = 2; +// int32 robotNum = 3; // 限定机器人数量 repeated LobbyPlayer players = 4; // 当前玩家机器人列表 + + int32 playerLimit = 5; // 限定玩家数量 + int32 texasType = 6; + int32 bigBland = 7; + int32 limitInAmount = 8; + int32 stage = 9; } message LobbyPlayer { diff --git a/api/proto.js b/api/proto.js index 3003196..e0fba61 100644 --- a/api/proto.js +++ b/api/proto.js @@ -2346,8 +2346,12 @@ export const api = $root.api = (() => { * @interface ILobbyTable * @property {number|null} [tableNo] LobbyTable tableNo * @property {number|null} [playerNum] LobbyTable playerNum - * @property {number|null} [robotNum] LobbyTable robotNum * @property {Array.|null} [players] LobbyTable players + * @property {number|null} [playerLimit] LobbyTable playerLimit + * @property {number|null} [texasType] LobbyTable texasType + * @property {number|null} [bigBland] LobbyTable bigBland + * @property {number|null} [limitInAmount] LobbyTable limitInAmount + * @property {number|null} [stage] LobbyTable stage */ /** @@ -2383,20 +2387,52 @@ export const api = $root.api = (() => { LobbyTable.prototype.playerNum = 0; /** - * LobbyTable robotNum. - * @member {number} robotNum + * LobbyTable players. + * @member {Array.} players * @memberof api.LobbyTable * @instance */ - LobbyTable.prototype.robotNum = 0; + LobbyTable.prototype.players = $util.emptyArray; /** - * LobbyTable players. - * @member {Array.} players + * LobbyTable playerLimit. + * @member {number} playerLimit * @memberof api.LobbyTable * @instance */ - LobbyTable.prototype.players = $util.emptyArray; + LobbyTable.prototype.playerLimit = 0; + + /** + * LobbyTable texasType. + * @member {number} texasType + * @memberof api.LobbyTable + * @instance + */ + LobbyTable.prototype.texasType = 0; + + /** + * LobbyTable bigBland. + * @member {number} bigBland + * @memberof api.LobbyTable + * @instance + */ + LobbyTable.prototype.bigBland = 0; + + /** + * LobbyTable limitInAmount. + * @member {number} limitInAmount + * @memberof api.LobbyTable + * @instance + */ + LobbyTable.prototype.limitInAmount = 0; + + /** + * LobbyTable stage. + * @member {number} stage + * @memberof api.LobbyTable + * @instance + */ + LobbyTable.prototype.stage = 0; /** * Creates a new LobbyTable instance using the specified properties. @@ -2426,11 +2462,19 @@ export const api = $root.api = (() => { writer.uint32(/* id 1, wireType 0 =*/8).int32(message.tableNo); if (message.playerNum != null && Object.hasOwnProperty.call(message, "playerNum")) writer.uint32(/* id 2, wireType 0 =*/16).int32(message.playerNum); - if (message.robotNum != null && Object.hasOwnProperty.call(message, "robotNum")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.robotNum); if (message.players != null && message.players.length) for (let i = 0; i < message.players.length; ++i) $root.api.LobbyPlayer.encode(message.players[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.playerLimit != null && Object.hasOwnProperty.call(message, "playerLimit")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.playerLimit); + if (message.texasType != null && Object.hasOwnProperty.call(message, "texasType")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.texasType); + if (message.bigBland != null && Object.hasOwnProperty.call(message, "bigBland")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.bigBland); + if (message.limitInAmount != null && Object.hasOwnProperty.call(message, "limitInAmount")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.limitInAmount); + if (message.stage != null && Object.hasOwnProperty.call(message, "stage")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.stage); return writer; }; @@ -2473,16 +2517,32 @@ export const api = $root.api = (() => { message.playerNum = reader.int32(); break; } - case 3: { - message.robotNum = reader.int32(); - break; - } case 4: { if (!(message.players && message.players.length)) message.players = []; message.players.push($root.api.LobbyPlayer.decode(reader, reader.uint32())); break; } + case 5: { + message.playerLimit = reader.int32(); + break; + } + case 6: { + message.texasType = reader.int32(); + break; + } + case 7: { + message.bigBland = reader.int32(); + break; + } + case 8: { + message.limitInAmount = reader.int32(); + break; + } + case 9: { + message.stage = reader.int32(); + break; + } default: reader.skipType(tag & 7); break; @@ -2524,9 +2584,6 @@ export const api = $root.api = (() => { if (message.playerNum != null && message.hasOwnProperty("playerNum")) if (!$util.isInteger(message.playerNum)) return "playerNum: integer expected"; - if (message.robotNum != null && message.hasOwnProperty("robotNum")) - if (!$util.isInteger(message.robotNum)) - return "robotNum: integer expected"; if (message.players != null && message.hasOwnProperty("players")) { if (!Array.isArray(message.players)) return "players: array expected"; @@ -2536,6 +2593,21 @@ export const api = $root.api = (() => { return "players." + error; } } + if (message.playerLimit != null && message.hasOwnProperty("playerLimit")) + if (!$util.isInteger(message.playerLimit)) + return "playerLimit: integer expected"; + if (message.texasType != null && message.hasOwnProperty("texasType")) + if (!$util.isInteger(message.texasType)) + return "texasType: integer expected"; + if (message.bigBland != null && message.hasOwnProperty("bigBland")) + if (!$util.isInteger(message.bigBland)) + return "bigBland: integer expected"; + if (message.limitInAmount != null && message.hasOwnProperty("limitInAmount")) + if (!$util.isInteger(message.limitInAmount)) + return "limitInAmount: integer expected"; + if (message.stage != null && message.hasOwnProperty("stage")) + if (!$util.isInteger(message.stage)) + return "stage: integer expected"; return null; }; @@ -2555,8 +2627,6 @@ export const api = $root.api = (() => { message.tableNo = object.tableNo | 0; if (object.playerNum != null) message.playerNum = object.playerNum | 0; - if (object.robotNum != null) - message.robotNum = object.robotNum | 0; if (object.players) { if (!Array.isArray(object.players)) throw TypeError(".api.LobbyTable.players: array expected"); @@ -2567,6 +2637,16 @@ export const api = $root.api = (() => { message.players[i] = $root.api.LobbyPlayer.fromObject(object.players[i]); } } + if (object.playerLimit != null) + message.playerLimit = object.playerLimit | 0; + if (object.texasType != null) + message.texasType = object.texasType | 0; + if (object.bigBland != null) + message.bigBland = object.bigBland | 0; + if (object.limitInAmount != null) + message.limitInAmount = object.limitInAmount | 0; + if (object.stage != null) + message.stage = object.stage | 0; return message; }; @@ -2588,19 +2668,31 @@ export const api = $root.api = (() => { if (options.defaults) { object.tableNo = 0; object.playerNum = 0; - object.robotNum = 0; + object.playerLimit = 0; + object.texasType = 0; + object.bigBland = 0; + object.limitInAmount = 0; + object.stage = 0; } if (message.tableNo != null && message.hasOwnProperty("tableNo")) object.tableNo = message.tableNo; if (message.playerNum != null && message.hasOwnProperty("playerNum")) object.playerNum = message.playerNum; - if (message.robotNum != null && message.hasOwnProperty("robotNum")) - object.robotNum = message.robotNum; if (message.players && message.players.length) { object.players = []; for (let j = 0; j < message.players.length; ++j) object.players[j] = $root.api.LobbyPlayer.toObject(message.players[j], options); } + if (message.playerLimit != null && message.hasOwnProperty("playerLimit")) + object.playerLimit = message.playerLimit; + if (message.texasType != null && message.hasOwnProperty("texasType")) + object.texasType = message.texasType; + if (message.bigBland != null && message.hasOwnProperty("bigBland")) + object.bigBland = message.bigBland; + if (message.limitInAmount != null && message.hasOwnProperty("limitInAmount")) + object.limitInAmount = message.limitInAmount; + if (message.stage != null && message.hasOwnProperty("stage")) + object.stage = message.stage; return object; }; diff --git a/data/config.toml b/data/config.toml index c1599e3..b557f79 100644 --- a/data/config.toml +++ b/data/config.toml @@ -1,8 +1,8 @@ [http] #host = "" -host = "192.168.110.53" -#host = "192.168.3.102" +#host = "192.168.110.53" +host = "192.168.3.102" port = 3999 [auth] diff --git a/internal/game/store.go b/internal/game/store.go index d9a40d4..dcd6db9 100644 --- a/internal/game/store.go +++ b/internal/game/store.go @@ -14,7 +14,8 @@ var ( func init() { TableNo = &atomic.Int32{} // 牌桌编号计数器 - + TableNo.Store(10000) + var tableZeroValue *Table = nil LobbyTables = cache.NewKVCache(tableZeroValue, func(k int32) string { return strconv.Itoa(int(k)) diff --git a/internal/game/table.go b/internal/game/table.go index aec66a1..26bc3bc 100644 --- a/internal/game/table.go +++ b/internal/game/table.go @@ -35,8 +35,8 @@ type Table struct { Dealer *Dealer // 发牌员 PublicCards [5]*Card // 公共牌 - PlayerNum int32 // 玩家数 - RobotNum int32 // 机器人数 + PlayerLimit int32 // 玩家数 + RobotLimit int32 // 机器人数 Players []*Player // 玩家 Robots []*Robot BigBlindPos int // 大盲注位 diff --git a/internal/logic/table.go b/internal/logic/table.go index e3875bc..6d3b30e 100644 --- a/internal/logic/table.go +++ b/internal/logic/table.go @@ -46,8 +46,8 @@ func HandleReqCreateTable(account *session.NetAccount, msg *api.ReqCreateTable) TableNo: game.TableNo.Add(1), MasterId: account.Id, - PlayerNum: playerNum + 1, - RobotNum: robotNum, + PlayerLimit: playerNum + 1, + RobotLimit: robotNum, Players: make([]*game.Player, playerNum+1), Robots: make([]*game.Robot, robotNum), BigBlindChip: msg.BigBlind, @@ -115,6 +115,7 @@ func HandleReqLobbyView(account *session.NetAccount, _ *api.ReqLobbyView) (proto } tables := make([]*api.LobbyTable, game.LobbyTables.Count()) if account.Player != nil { + // 若玩家已进入牌桌 res.CurTableNo = account.Player.GameTable.TableNo } res.Tables = tables @@ -122,8 +123,16 @@ func HandleReqLobbyView(account *session.NetAccount, _ *api.ReqLobbyView) (proto // 遍历 store tables 转换为视图层结构体 idx := 0 game.LobbyTables.ForEach(func(k string, t *game.Table) { - table := &api.LobbyTable{TableNo: t.TableNo, PlayerNum: t.PlayerNum, RobotNum: t.RobotNum} - table.Players = make([]*api.LobbyPlayer, t.PlayerNum+t.RobotNum) + table := &api.LobbyTable{ + TableNo: t.TableNo, + PlayerNum: t.PlayerCount(), + PlayerLimit: t.PlayerLimit, + TexasType: t.TexasType, + BigBland: t.BigBlindChip, + LimitInAmount: t.LimitInAmount, + Stage: t.Stage, + } + table.Players = make([]*api.LobbyPlayer, t.PlayerLimit+t.RobotLimit) playerIdx := 0 if collect.IsNotEmptySlice(t.Players) { @@ -172,7 +181,7 @@ func HandleReqJoinTable(account *session.NetAccount, msg *api.ReqJoinTable) (pro if collect.NotIn(table.Stage, 1, 7) { return &api.ResFail{Msg: "牌桌正在进行中"}, nil } - if table.PlayerCount() == table.PlayerNum { + if table.PlayerCount() == table.PlayerLimit { return &api.ResFail{Msg: "牌桌人数已满"}, nil } @@ -249,7 +258,8 @@ func HandleReqLeaveTable(player *game.Player, _ *api.ReqLeaveTable) (proto.Messa return &api.ResFail{Msg: "您已准备不能退出"}, nil } if player.GameTable.MasterId == player.Id { - return &api.ResFail{Msg: "房主不能退出,请解散房间"}, nil + return handleReqDismissGameTable0(player, &api.ReqDismissGameTable{}) + // return &api.ResFail{Msg: "房主不能退出,请解散房间"}, nil } // 从牌桌移除 found, p := player.GameTable.RemovePlayer(player.Id) @@ -323,9 +333,13 @@ func HandleReqCancelReady(player *game.Player, _ *api.ReqCancelReady) (proto.Mes } // HandleReqDismissGameTable 解散牌桌 -func HandleReqDismissGameTable(player *game.Player, _ *api.ReqDismissGameTable) (proto.Message, error) { +func HandleReqDismissGameTable(player *game.Player, req *api.ReqDismissGameTable) (proto.Message, error) { player.GameTable.Lock.Lock() defer player.GameTable.Lock.Unlock() + return handleReqDismissGameTable0(player, req) +} + +func handleReqDismissGameTable0(player *game.Player, _ *api.ReqDismissGameTable) (proto.Message, error) { if collect.NotIn(player.GameTable.Stage, 1, 7) { return &api.ResFail{Msg: fmt.Sprintf("#%d,牌局进行中", player.GameTable.Stage)}, nil }