diff --git a/api/poker.pb.go b/api/poker.pb.go index e371100..c9e23ce 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 @@ -1257,18 +1257,19 @@ type TablePlayer struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Robot bool `protobuf:"varint,1,opt,name=robot,proto3" json:"robot,omitempty"` // 是否机器人 - Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` - Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` - Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` - Chip int32 `protobuf:"varint,5,opt,name=chip,proto3" json:"chip,omitempty"` // 筹码 - Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` // 玩家状态: 1待准备开始,2已准备开始,已开始(3等待其他玩家动作,4待大盲注,5待小盲注,6待跟注,7已弃) - LastStatus int32 `protobuf:"varint,7,opt,name=lastStatus,proto3" json:"lastStatus,omitempty"` // TODO 删, 前端通过消息监听获取下注金额信息 - Master bool `protobuf:"varint,8,opt,name=master,proto3" json:"master,omitempty"` // 是否房主 - RoundBetTimes int32 `protobuf:"varint,11,opt,name=roundBetTimes,proto3" json:"roundBetTimes,omitempty"` // 该局下注次数 - TotalBetChip int32 `protobuf:"varint,13,opt,name=totalBetChip,proto3" json:"totalBetChip,omitempty"` // 该局牌已下注筹码 - BetRole *BetRole `protobuf:"bytes,14,opt,name=betRole,proto3" json:"betRole,omitempty"` // 下注时规则限制 - HandCard []*Card `protobuf:"bytes,15,rep,name=handCard,proto3" json:"handCard,omitempty"` // 手牌 + Robot bool `protobuf:"varint,1,opt,name=robot,proto3" json:"robot,omitempty"` // 是否机器人 + Id int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,3,opt,name=username,proto3" json:"username,omitempty"` + Avatar string `protobuf:"bytes,4,opt,name=avatar,proto3" json:"avatar,omitempty"` + Chip int32 `protobuf:"varint,5,opt,name=chip,proto3" json:"chip,omitempty"` // 筹码 + Status int32 `protobuf:"varint,6,opt,name=status,proto3" json:"status,omitempty"` // 玩家状态: 1待准备开始,2已准备开始,已开始(3等待其他玩家动作,4待大盲注,5待小盲注,6待跟注,7已弃) + LastStatus int32 `protobuf:"varint,7,opt,name=lastStatus,proto3" json:"lastStatus,omitempty"` // TODO 删, 前端通过消息监听获取下注金额信息 + Master bool `protobuf:"varint,8,opt,name=master,proto3" json:"master,omitempty"` // 是否房主 + RoundBetTimes int32 `protobuf:"varint,11,opt,name=roundBetTimes,proto3" json:"roundBetTimes,omitempty"` // 该局下注次数 + TotalBetChip int32 `protobuf:"varint,13,opt,name=totalBetChip,proto3" json:"totalBetChip,omitempty"` // 该局牌已下注筹码 + HandType *HandType `protobuf:"bytes,12,opt,name=handType,proto3" json:"handType,omitempty"` // 手牌组合牌型 + BetRole *BetRole `protobuf:"bytes,14,opt,name=betRole,proto3" json:"betRole,omitempty"` // 下注时规则限制 + HandCard []*Card `protobuf:"bytes,15,rep,name=handCard,proto3" json:"handCard,omitempty"` // 手牌 } func (x *TablePlayer) Reset() { @@ -1373,6 +1374,13 @@ func (x *TablePlayer) GetTotalBetChip() int32 { return 0 } +func (x *TablePlayer) GetHandType() *HandType { + if x != nil { + return x.HandType + } + return nil +} + func (x *TablePlayer) GetBetRole() *BetRole { if x != nil { return x.BetRole @@ -1506,6 +1514,69 @@ func (x *BetRole) GetBetOpts() []int32 { return nil } +type HandType struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Hand string `protobuf:"bytes,1,opt,name=hand,proto3" json:"hand,omitempty"` + HandZh string `protobuf:"bytes,2,opt,name=handZh,proto3" json:"handZh,omitempty"` + Point int64 `protobuf:"varint,3,opt,name=point,proto3" json:"point,omitempty"` +} + +func (x *HandType) Reset() { + *x = HandType{} + if protoimpl.UnsafeEnabled { + mi := &file_poker_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *HandType) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*HandType) ProtoMessage() {} + +func (x *HandType) ProtoReflect() protoreflect.Message { + mi := &file_poker_proto_msgTypes[26] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use HandType.ProtoReflect.Descriptor instead. +func (*HandType) Descriptor() ([]byte, []int) { + return file_poker_proto_rawDescGZIP(), []int{26} +} + +func (x *HandType) GetHand() string { + if x != nil { + return x.Hand + } + return "" +} + +func (x *HandType) GetHandZh() string { + if x != nil { + return x.HandZh + } + return "" +} + +func (x *HandType) GetPoint() int64 { + if x != nil { + return x.Point + } + return 0 +} + // 开始游戏 type ReqGameStart struct { state protoimpl.MessageState @@ -1516,7 +1587,7 @@ type ReqGameStart struct { func (x *ReqGameStart) Reset() { *x = ReqGameStart{} if protoimpl.UnsafeEnabled { - mi := &file_poker_proto_msgTypes[26] + mi := &file_poker_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1529,7 +1600,7 @@ func (x *ReqGameStart) String() string { func (*ReqGameStart) ProtoMessage() {} func (x *ReqGameStart) ProtoReflect() protoreflect.Message { - mi := &file_poker_proto_msgTypes[26] + mi := &file_poker_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1542,7 +1613,7 @@ func (x *ReqGameStart) ProtoReflect() protoreflect.Message { // Deprecated: Use ReqGameStart.ProtoReflect.Descriptor instead. func (*ReqGameStart) Descriptor() ([]byte, []int) { - return file_poker_proto_rawDescGZIP(), []int{26} + return file_poker_proto_rawDescGZIP(), []int{27} } // 解散房间 @@ -1555,7 +1626,7 @@ type ReqDismissGameTable struct { func (x *ReqDismissGameTable) Reset() { *x = ReqDismissGameTable{} if protoimpl.UnsafeEnabled { - mi := &file_poker_proto_msgTypes[27] + mi := &file_poker_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1568,7 +1639,7 @@ func (x *ReqDismissGameTable) String() string { func (*ReqDismissGameTable) ProtoMessage() {} func (x *ReqDismissGameTable) ProtoReflect() protoreflect.Message { - mi := &file_poker_proto_msgTypes[27] + mi := &file_poker_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1581,7 +1652,7 @@ func (x *ReqDismissGameTable) ProtoReflect() protoreflect.Message { // Deprecated: Use ReqDismissGameTable.ProtoReflect.Descriptor instead. func (*ReqDismissGameTable) Descriptor() ([]byte, []int) { - return file_poker_proto_rawDescGZIP(), []int{27} + return file_poker_proto_rawDescGZIP(), []int{28} } type ResDismissGameTable struct { @@ -1593,7 +1664,7 @@ type ResDismissGameTable struct { func (x *ResDismissGameTable) Reset() { *x = ResDismissGameTable{} if protoimpl.UnsafeEnabled { - mi := &file_poker_proto_msgTypes[28] + mi := &file_poker_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1606,7 +1677,7 @@ func (x *ResDismissGameTable) String() string { func (*ResDismissGameTable) ProtoMessage() {} func (x *ResDismissGameTable) ProtoReflect() protoreflect.Message { - mi := &file_poker_proto_msgTypes[28] + mi := &file_poker_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1619,7 +1690,7 @@ func (x *ResDismissGameTable) ProtoReflect() protoreflect.Message { // Deprecated: Use ResDismissGameTable.ProtoReflect.Descriptor instead. func (*ResDismissGameTable) Descriptor() ([]byte, []int) { - return file_poker_proto_rawDescGZIP(), []int{28} + return file_poker_proto_rawDescGZIP(), []int{29} } // 下注 @@ -1635,7 +1706,7 @@ type ReqBetting struct { func (x *ReqBetting) Reset() { *x = ReqBetting{} if protoimpl.UnsafeEnabled { - mi := &file_poker_proto_msgTypes[29] + mi := &file_poker_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1648,7 +1719,7 @@ func (x *ReqBetting) String() string { func (*ReqBetting) ProtoMessage() {} func (x *ReqBetting) ProtoReflect() protoreflect.Message { - mi := &file_poker_proto_msgTypes[29] + mi := &file_poker_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1661,7 +1732,7 @@ func (x *ReqBetting) ProtoReflect() protoreflect.Message { // Deprecated: Use ReqBetting.ProtoReflect.Descriptor instead. func (*ReqBetting) Descriptor() ([]byte, []int) { - return file_poker_proto_rawDescGZIP(), []int{29} + return file_poker_proto_rawDescGZIP(), []int{30} } func (x *ReqBetting) GetBetType() int32 { @@ -1693,7 +1764,7 @@ type ResNoticePlayerLine struct { func (x *ResNoticePlayerLine) Reset() { *x = ResNoticePlayerLine{} if protoimpl.UnsafeEnabled { - mi := &file_poker_proto_msgTypes[30] + mi := &file_poker_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1706,7 +1777,7 @@ func (x *ResNoticePlayerLine) String() string { func (*ResNoticePlayerLine) ProtoMessage() {} func (x *ResNoticePlayerLine) ProtoReflect() protoreflect.Message { - mi := &file_poker_proto_msgTypes[30] + mi := &file_poker_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1719,7 +1790,7 @@ func (x *ResNoticePlayerLine) ProtoReflect() protoreflect.Message { // Deprecated: Use ResNoticePlayerLine.ProtoReflect.Descriptor instead. func (*ResNoticePlayerLine) Descriptor() ([]byte, []int) { - return file_poker_proto_rawDescGZIP(), []int{30} + return file_poker_proto_rawDescGZIP(), []int{31} } func (x *ResNoticePlayerLine) GetPlayerId() int64 { @@ -1761,7 +1832,7 @@ type ResGameEndSettle struct { func (x *ResGameEndSettle) Reset() { *x = ResGameEndSettle{} if protoimpl.UnsafeEnabled { - mi := &file_poker_proto_msgTypes[31] + mi := &file_poker_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1774,7 +1845,7 @@ func (x *ResGameEndSettle) String() string { func (*ResGameEndSettle) ProtoMessage() {} func (x *ResGameEndSettle) ProtoReflect() protoreflect.Message { - mi := &file_poker_proto_msgTypes[31] + mi := &file_poker_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1787,7 +1858,7 @@ func (x *ResGameEndSettle) ProtoReflect() protoreflect.Message { // Deprecated: Use ResGameEndSettle.ProtoReflect.Descriptor instead. func (*ResGameEndSettle) Descriptor() ([]byte, []int) { - return file_poker_proto_rawDescGZIP(), []int{31} + return file_poker_proto_rawDescGZIP(), []int{32} } func (x *ResGameEndSettle) GetGame() *ResGameFullStatus { @@ -1809,7 +1880,7 @@ type ResCalcWinnerChip struct { func (x *ResCalcWinnerChip) Reset() { *x = ResCalcWinnerChip{} if protoimpl.UnsafeEnabled { - mi := &file_poker_proto_msgTypes[32] + mi := &file_poker_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1822,7 +1893,7 @@ func (x *ResCalcWinnerChip) String() string { func (*ResCalcWinnerChip) ProtoMessage() {} func (x *ResCalcWinnerChip) ProtoReflect() protoreflect.Message { - mi := &file_poker_proto_msgTypes[32] + mi := &file_poker_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1835,7 +1906,7 @@ func (x *ResCalcWinnerChip) ProtoReflect() protoreflect.Message { // Deprecated: Use ResCalcWinnerChip.ProtoReflect.Descriptor instead. func (*ResCalcWinnerChip) Descriptor() ([]byte, []int) { - return file_poker_proto_rawDescGZIP(), []int{32} + return file_poker_proto_rawDescGZIP(), []int{33} } func (x *ResCalcWinnerChip) GetWinsChip() map[int64]int32 { @@ -1857,7 +1928,7 @@ type ResGameNextRound struct { func (x *ResGameNextRound) Reset() { *x = ResGameNextRound{} if protoimpl.UnsafeEnabled { - mi := &file_poker_proto_msgTypes[33] + mi := &file_poker_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1870,7 +1941,7 @@ func (x *ResGameNextRound) String() string { func (*ResGameNextRound) ProtoMessage() {} func (x *ResGameNextRound) ProtoReflect() protoreflect.Message { - mi := &file_poker_proto_msgTypes[33] + mi := &file_poker_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1883,7 +1954,7 @@ func (x *ResGameNextRound) ProtoReflect() protoreflect.Message { // Deprecated: Use ResGameNextRound.ProtoReflect.Descriptor instead. func (*ResGameNextRound) Descriptor() ([]byte, []int) { - return file_poker_proto_rawDescGZIP(), []int{33} + return file_poker_proto_rawDescGZIP(), []int{34} } func (x *ResGameNextRound) GetRound() int32 { @@ -1987,7 +2058,7 @@ var file_poker_proto_rawDesc = []byte{ 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, - 0xe4, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x12, + 0x8f, 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, @@ -2004,53 +2075,60 @@ var file_poker_proto_rawDesc = []byte{ 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, 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, 0x53, 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, - 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, 0x0e, 0x0a, 0x0c, 0x52, 0x65, 0x71, - 0x47, 0x61, 0x6d, 0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x52, 0x65, 0x71, + 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, + 0x53, 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, 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, 0x15, 0x0a, 0x13, 0x52, 0x65, 0x73, 0x44, 0x69, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x47, 0x61, - 0x6d, 0x65, 0x54, 0x61, 0x62, 0x6c, 0x65, 0x22, 0x40, 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, 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, 0x42, 0x0b, 0x5a, - 0x09, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x22, 0x40, 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, 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, 0x42, 0x0b, 0x5a, 0x09, 0x2e, 0x2f, 0x61, 0x70, 0x69, 0x3b, + 0x61, 0x70, 0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2065,7 +2143,7 @@ func file_poker_proto_rawDescGZIP() []byte { return file_poker_proto_rawDescData } -var file_poker_proto_msgTypes = make([]protoimpl.MessageInfo, 35) +var file_poker_proto_msgTypes = make([]protoimpl.MessageInfo, 36) var file_poker_proto_goTypes = []interface{}{ (*ProtoWrap)(nil), // 0: api.ProtoWrap (*Ping)(nil), // 1: api.Ping @@ -2093,30 +2171,32 @@ var file_poker_proto_goTypes = []interface{}{ (*TablePlayer)(nil), // 23: api.TablePlayer (*Card)(nil), // 24: api.Card (*BetRole)(nil), // 25: api.BetRole - (*ReqGameStart)(nil), // 26: api.ReqGameStart - (*ReqDismissGameTable)(nil), // 27: api.ReqDismissGameTable - (*ResDismissGameTable)(nil), // 28: api.ResDismissGameTable - (*ReqBetting)(nil), // 29: api.ReqBetting - (*ResNoticePlayerLine)(nil), // 30: api.ResNoticePlayerLine - (*ResGameEndSettle)(nil), // 31: api.ResGameEndSettle - (*ResCalcWinnerChip)(nil), // 32: api.ResCalcWinnerChip - (*ResGameNextRound)(nil), // 33: api.ResGameNextRound - nil, // 34: api.ResCalcWinnerChip.WinsChipEntry + (*HandType)(nil), // 26: api.HandType + (*ReqGameStart)(nil), // 27: api.ReqGameStart + (*ReqDismissGameTable)(nil), // 28: api.ReqDismissGameTable + (*ResDismissGameTable)(nil), // 29: api.ResDismissGameTable + (*ReqBetting)(nil), // 30: api.ReqBetting + (*ResNoticePlayerLine)(nil), // 31: api.ResNoticePlayerLine + (*ResGameEndSettle)(nil), // 32: api.ResGameEndSettle + (*ResCalcWinnerChip)(nil), // 33: api.ResCalcWinnerChip + (*ResGameNextRound)(nil), // 34: api.ResGameNextRound + nil, // 35: api.ResCalcWinnerChip.WinsChipEntry } var file_poker_proto_depIdxs = []int32{ 9, // 0: api.ResLobbyView.tables:type_name -> api.LobbyTable 10, // 1: api.LobbyTable.players:type_name -> api.LobbyPlayer 24, // 2: api.ResGameFullStatus.publicCard:type_name -> api.Card 23, // 3: api.ResGameFullStatus.players:type_name -> api.TablePlayer - 25, // 4: api.TablePlayer.betRole:type_name -> api.BetRole - 24, // 5: api.TablePlayer.handCard:type_name -> api.Card - 22, // 6: api.ResGameEndSettle.game:type_name -> api.ResGameFullStatus - 34, // 7: api.ResCalcWinnerChip.winsChip:type_name -> api.ResCalcWinnerChip.WinsChipEntry - 8, // [8:8] is the sub-list for method output_type - 8, // [8:8] is the sub-list for method input_type - 8, // [8:8] is the sub-list for extension type_name - 8, // [8:8] is the sub-list for extension extendee - 0, // [0:8] is the sub-list for field type_name + 26, // 4: api.TablePlayer.handType:type_name -> api.HandType + 25, // 5: api.TablePlayer.betRole:type_name -> api.BetRole + 24, // 6: api.TablePlayer.handCard:type_name -> api.Card + 22, // 7: api.ResGameEndSettle.game:type_name -> api.ResGameFullStatus + 35, // 8: api.ResCalcWinnerChip.winsChip:type_name -> api.ResCalcWinnerChip.WinsChipEntry + 9, // [9:9] is the sub-list for method output_type + 9, // [9:9] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_poker_proto_init() } @@ -2438,7 +2518,7 @@ func file_poker_proto_init() { } } file_poker_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReqGameStart); i { + switch v := v.(*HandType); i { case 0: return &v.state case 1: @@ -2450,7 +2530,7 @@ func file_poker_proto_init() { } } file_poker_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReqDismissGameTable); i { + switch v := v.(*ReqGameStart); i { case 0: return &v.state case 1: @@ -2462,7 +2542,7 @@ func file_poker_proto_init() { } } file_poker_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResDismissGameTable); i { + switch v := v.(*ReqDismissGameTable); i { case 0: return &v.state case 1: @@ -2474,7 +2554,7 @@ func file_poker_proto_init() { } } file_poker_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReqBetting); i { + switch v := v.(*ResDismissGameTable); i { case 0: return &v.state case 1: @@ -2486,7 +2566,7 @@ func file_poker_proto_init() { } } file_poker_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResNoticePlayerLine); i { + switch v := v.(*ReqBetting); i { case 0: return &v.state case 1: @@ -2498,7 +2578,7 @@ func file_poker_proto_init() { } } file_poker_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResGameEndSettle); i { + switch v := v.(*ResNoticePlayerLine); i { case 0: return &v.state case 1: @@ -2510,7 +2590,7 @@ func file_poker_proto_init() { } } file_poker_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResCalcWinnerChip); i { + switch v := v.(*ResGameEndSettle); i { case 0: return &v.state case 1: @@ -2522,6 +2602,18 @@ func file_poker_proto_init() { } } file_poker_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ResCalcWinnerChip); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_poker_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ResGameNextRound); i { case 0: return &v.state @@ -2540,7 +2632,7 @@ func file_poker_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_poker_proto_rawDesc, NumEnums: 0, - NumMessages: 35, + NumMessages: 36, NumExtensions: 0, NumServices: 0, }, diff --git a/api/poker.proto b/api/poker.proto index a624874..8764671 100644 --- a/api/poker.proto +++ b/api/poker.proto @@ -151,6 +151,7 @@ message TablePlayer { int32 roundBetTimes = 11; // 该局下注次数 int32 totalBetChip = 13; // 该局牌已下注筹码 + HandType handType = 12; // 手牌组合牌型 BetRole betRole = 14; // 下注时规则限制 repeated Card handCard = 15; // 手牌 } @@ -167,6 +168,12 @@ message BetRole { repeated int32 betOpts = 13; // status=[4,6]时下注可操作按钮: 1跟注,2加注(-[0]+),3All-In,4弃牌,5过牌 } +message HandType { + string hand = 1; + string handZh = 2; + int64 point = 3; +} + // 加入游戏 ============= end // 开始游戏 diff --git a/api/proto.js b/api/proto.js index c60d21f..8112feb 100644 --- a/api/proto.js +++ b/api/proto.js @@ -5268,6 +5268,7 @@ export const api = $root.api = (() => { * @property {boolean|null} [master] TablePlayer master * @property {number|null} [roundBetTimes] TablePlayer roundBetTimes * @property {number|null} [totalBetChip] TablePlayer totalBetChip + * @property {api.IHandType|null} [handType] TablePlayer handType * @property {api.IBetRole|null} [betRole] TablePlayer betRole * @property {Array.|null} [handCard] TablePlayer handCard */ @@ -5368,6 +5369,14 @@ export const api = $root.api = (() => { */ TablePlayer.prototype.totalBetChip = 0; + /** + * TablePlayer handType. + * @member {api.IHandType|null|undefined} handType + * @memberof api.TablePlayer + * @instance + */ + TablePlayer.prototype.handType = null; + /** * TablePlayer betRole. * @member {api.IBetRole|null|undefined} betRole @@ -5426,6 +5435,8 @@ export const api = $root.api = (() => { writer.uint32(/* id 8, wireType 0 =*/64).bool(message.master); if (message.roundBetTimes != null && Object.hasOwnProperty.call(message, "roundBetTimes")) writer.uint32(/* id 11, wireType 0 =*/88).int32(message.roundBetTimes); + if (message.handType != null && Object.hasOwnProperty.call(message, "handType")) + $root.api.HandType.encode(message.handType, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); if (message.totalBetChip != null && Object.hasOwnProperty.call(message, "totalBetChip")) writer.uint32(/* id 13, wireType 0 =*/104).int32(message.totalBetChip); if (message.betRole != null && Object.hasOwnProperty.call(message, "betRole")) @@ -5507,6 +5518,10 @@ export const api = $root.api = (() => { message.totalBetChip = reader.int32(); break; } + case 12: { + message.handType = $root.api.HandType.decode(reader, reader.uint32()); + break; + } case 14: { message.betRole = $root.api.BetRole.decode(reader, reader.uint32()); break; @@ -5582,6 +5597,11 @@ export const api = $root.api = (() => { if (message.totalBetChip != null && message.hasOwnProperty("totalBetChip")) if (!$util.isInteger(message.totalBetChip)) return "totalBetChip: integer expected"; + if (message.handType != null && message.hasOwnProperty("handType")) { + let error = $root.api.HandType.verify(message.handType); + if (error) + return "handType." + error; + } if (message.betRole != null && message.hasOwnProperty("betRole")) { let error = $root.api.BetRole.verify(message.betRole); if (error) @@ -5638,6 +5658,11 @@ export const api = $root.api = (() => { message.roundBetTimes = object.roundBetTimes | 0; if (object.totalBetChip != null) message.totalBetChip = object.totalBetChip | 0; + if (object.handType != null) { + if (typeof object.handType !== "object") + throw TypeError(".api.TablePlayer.handType: object expected"); + message.handType = $root.api.HandType.fromObject(object.handType); + } if (object.betRole != null) { if (typeof object.betRole !== "object") throw TypeError(".api.TablePlayer.betRole: object expected"); @@ -5685,6 +5710,7 @@ export const api = $root.api = (() => { object.lastStatus = 0; object.master = false; object.roundBetTimes = 0; + object.handType = null; object.totalBetChip = 0; object.betRole = null; } @@ -5709,6 +5735,8 @@ export const api = $root.api = (() => { object.master = message.master; if (message.roundBetTimes != null && message.hasOwnProperty("roundBetTimes")) object.roundBetTimes = message.roundBetTimes; + if (message.handType != null && message.hasOwnProperty("handType")) + object.handType = $root.api.HandType.toObject(message.handType, options); if (message.totalBetChip != null && message.hasOwnProperty("totalBetChip")) object.totalBetChip = message.totalBetChip; if (message.betRole != null && message.hasOwnProperty("betRole")) @@ -6252,6 +6280,270 @@ export const api = $root.api = (() => { return BetRole; })(); + api.HandType = (function() { + + /** + * Properties of a HandType. + * @memberof api + * @interface IHandType + * @property {string|null} [hand] HandType hand + * @property {string|null} [handZh] HandType handZh + * @property {number|Long|null} [point] HandType point + */ + + /** + * Constructs a new HandType. + * @memberof api + * @classdesc Represents a HandType. + * @implements IHandType + * @constructor + * @param {api.IHandType=} [properties] Properties to set + */ + function HandType(properties) { + if (properties) + for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HandType hand. + * @member {string} hand + * @memberof api.HandType + * @instance + */ + HandType.prototype.hand = ""; + + /** + * HandType handZh. + * @member {string} handZh + * @memberof api.HandType + * @instance + */ + HandType.prototype.handZh = ""; + + /** + * HandType point. + * @member {number|Long} point + * @memberof api.HandType + * @instance + */ + HandType.prototype.point = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new HandType instance using the specified properties. + * @function create + * @memberof api.HandType + * @static + * @param {api.IHandType=} [properties] Properties to set + * @returns {api.HandType} HandType instance + */ + HandType.create = function create(properties) { + return new HandType(properties); + }; + + /** + * Encodes the specified HandType message. Does not implicitly {@link api.HandType.verify|verify} messages. + * @function encode + * @memberof api.HandType + * @static + * @param {api.IHandType} message HandType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HandType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.hand != null && Object.hasOwnProperty.call(message, "hand")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.hand); + if (message.handZh != null && Object.hasOwnProperty.call(message, "handZh")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.handZh); + if (message.point != null && Object.hasOwnProperty.call(message, "point")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.point); + return writer; + }; + + /** + * Encodes the specified HandType message, length delimited. Does not implicitly {@link api.HandType.verify|verify} messages. + * @function encodeDelimited + * @memberof api.HandType + * @static + * @param {api.IHandType} message HandType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HandType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HandType message from the specified reader or buffer. + * @function decode + * @memberof api.HandType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {api.HandType} HandType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HandType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + let end = length === undefined ? reader.len : reader.pos + length, message = new $root.api.HandType(); + while (reader.pos < end) { + let tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + message.hand = reader.string(); + break; + } + case 2: { + message.handZh = reader.string(); + break; + } + case 3: { + message.point = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HandType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof api.HandType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {api.HandType} HandType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HandType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HandType message. + * @function verify + * @memberof api.HandType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HandType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.hand != null && message.hasOwnProperty("hand")) + if (!$util.isString(message.hand)) + return "hand: string expected"; + if (message.handZh != null && message.hasOwnProperty("handZh")) + if (!$util.isString(message.handZh)) + return "handZh: string expected"; + if (message.point != null && message.hasOwnProperty("point")) + if (!$util.isInteger(message.point) && !(message.point && $util.isInteger(message.point.low) && $util.isInteger(message.point.high))) + return "point: integer|Long expected"; + return null; + }; + + /** + * Creates a HandType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof api.HandType + * @static + * @param {Object.} object Plain object + * @returns {api.HandType} HandType + */ + HandType.fromObject = function fromObject(object) { + if (object instanceof $root.api.HandType) + return object; + let message = new $root.api.HandType(); + if (object.hand != null) + message.hand = String(object.hand); + if (object.handZh != null) + message.handZh = String(object.handZh); + if (object.point != null) + if ($util.Long) + (message.point = $util.Long.fromValue(object.point)).unsigned = false; + else if (typeof object.point === "string") + message.point = parseInt(object.point, 10); + else if (typeof object.point === "number") + message.point = object.point; + else if (typeof object.point === "object") + message.point = new $util.LongBits(object.point.low >>> 0, object.point.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a HandType message. Also converts values to other types if specified. + * @function toObject + * @memberof api.HandType + * @static + * @param {api.HandType} message HandType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HandType.toObject = function toObject(message, options) { + if (!options) + options = {}; + let object = {}; + if (options.defaults) { + object.hand = ""; + object.handZh = ""; + if ($util.Long) { + let long = new $util.Long(0, 0, false); + object.point = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.point = options.longs === String ? "0" : 0; + } + if (message.hand != null && message.hasOwnProperty("hand")) + object.hand = message.hand; + if (message.handZh != null && message.hasOwnProperty("handZh")) + object.handZh = message.handZh; + if (message.point != null && message.hasOwnProperty("point")) + if (typeof message.point === "number") + object.point = options.longs === String ? String(message.point) : message.point; + else + object.point = options.longs === String ? $util.Long.prototype.toString.call(message.point) : options.longs === Number ? new $util.LongBits(message.point.low >>> 0, message.point.high >>> 0).toNumber() : message.point; + return object; + }; + + /** + * Converts this HandType to JSON. + * @function toJSON + * @memberof api.HandType + * @instance + * @returns {Object.} JSON object + */ + HandType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for HandType + * @function getTypeUrl + * @memberof api.HandType + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + HandType.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/api.HandType"; + }; + + return HandType; + })(); + api.ReqGameStart = (function() { /** diff --git a/internal/game/hand.go b/internal/game/hand.go index 8d90086..02d8149 100644 --- a/internal/game/hand.go +++ b/internal/game/hand.go @@ -46,6 +46,10 @@ func (h *Hand) Init(cards [5]*Card) *Hand { return h } +func (h *Hand) GetPoint() int { + return h.point +} + type CardType int func (ct CardType) String() string { @@ -53,7 +57,17 @@ func (ct CardType) String() string { return cardTypeNames[int(math.Log2(f))] } +func (ct CardType) Name() string { + return ct.String() +} + +func (ct CardType) NameZh() string { + f, _ := strconv.ParseFloat(strconv.Itoa(int(ct)>>13), 32) + return cardTypeZhNames[int(math.Log2(f))] +} + var cardTypeNames = []string{"HighCard", "OnePair", "TwoPairs", "ThreeOfKind", "Straight", "Flush", "FullHouse", "FourOfKind", "StraightFlush", "RoyalFlush"} +var cardTypeZhNames = []string{"高牌", "对子", "两对", "三条", "顺子", "同花", "葫芦", "四条", "同花顺", "皇家同花顺"} const ( HighCard CardType = 1 << 13 << iota // 高牌 diff --git a/internal/game/table.go b/internal/game/table.go index a7bfe11..4e53875 100644 --- a/internal/game/table.go +++ b/internal/game/table.go @@ -173,6 +173,13 @@ func (t *Table) BuildResGameFullStatus() *api.ResGameFullStatus { BetOpts: p.BetOpts, }, } + if p.Hand != nil { + player.HandType = &api.HandType{ + Hand: p.Hand.CardType.Name(), + HandZh: p.Hand.CardType.NameZh(), + Point: int64(p.Hand.GetPoint()), + } + } // 玩家手牌 for j, card := range p.Cards { if card == nil {