上传猜颜色

This commit is contained in:
liwei1dao 2023-10-19 15:52:30 +08:00
parent 5d667c74b4
commit 59843155f6
6 changed files with 536 additions and 79 deletions

View File

@ -17,7 +17,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.DailytaskReceive
var (
dtask *pb.DBDailytask
conf *cfg.GameAnnulartaskAllData
award []*pb.UserAssets
atno []*pb.UserAtno
err error
)
if errdata = this.ReceiveCheck(session, req); errdata != nil {
@ -52,17 +52,9 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.DailytaskReceive
return
}
}
award = make([]*pb.UserAssets, 0)
for _, v := range conf.Reward {
award = append(award, &pb.UserAssets{
A: v.A,
T: v.T,
N: v.N,
})
}
if errdata = this.module.DispenseRes(session, conf.Reward, true); errdata != nil {
if errdata, atno = this.module.DispenseAtno(session, conf.Reward, true); errdata != nil {
return
}
session.SendMsg(string(this.module.GetType()), "receive", &pb.DailytaskReceiveResp{Award: award})
session.SendMsg(string(this.module.GetType()), "receive", &pb.DailytaskReceiveResp{Award: atno})
return
}

View File

@ -12,6 +12,8 @@ type Room struct {
module *DColor
data *pb.DBDColorRoom
sessions []comm.IUserSession
currside int32
currindex int32
}
func (this *Room) GameStart() (err error) {
@ -33,6 +35,7 @@ func (this *Room) PlayerLoadEnd(uid string) (err error) {
}
if this.data.Red.Ready && this.data.Blue.Ready { //两个人都准备了
this.currside = 1
if err = this.Broadcast("loadcompletenotice", &pb.DColorGameStartPush{
Side: 1,
}); err != nil {
@ -42,6 +45,69 @@ func (this *Room) PlayerLoadEnd(uid string) (err error) {
return
}
//玩家操作
func (this *Room) PlayerHandle(uid string, handle *pb.DColorHandleReq) (err error) {
this.currindex++
allright, halfpair := this.comparison(handle.Results)
handleopt := &pb.DBDColorResult{
Index: handle.Index,
Uid: uid,
Results: handle.Results,
Allright: allright,
Halfpair: halfpair,
}
this.data.Handles = append(this.data.Handles, handleopt)
if allright == int32(len(this.data.Results)) { //结束
if err = this.Broadcast("gameover", &pb.DColorGameOverPush{
Winside: this.currside,
}); err != nil {
this.module.Errorln(err)
}
} else {
if err = this.Broadcast("gamehandle", &pb.DColorGameHandlePush{
Uid: uid,
Handle: handleopt,
}); err != nil {
this.module.Errorln(err)
}
if this.currside == 1 {
this.currside = 2
} else {
this.currside = 1
}
}
return
}
func (this *Room) comparison(results []pb.DBDColorColor) (allright, halfpair int32) {
var (
resultscolor []pb.DBDColorColor
tempcolor []pb.DBDColorColor
)
for i, v := range this.data.Results {
if results[i] == v {
allright++
} else {
tempcolor = append(tempcolor, results[i])
resultscolor = append(resultscolor, v)
}
}
for _, v1 := range tempcolor {
for i, v2 := range resultscolor {
if v1 == v2 {
halfpair++
resultscolor = append(resultscolor[0:i], resultscolor[i+1:]...)
break
}
}
}
return
}
func (this *Room) Broadcast(stype string, msg proto.Message) (err error) {
if err = this.module.SendMsgToSession(string(this.module.GetType()), stype, msg, this.sessions...); err != nil {
this.module.Errorln(err)

View File

@ -1256,6 +1256,9 @@ func (this *User) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (red
Progress: progress,
Total: 1,
}
if progress == 1 {
reddot[comm.Reddot27101].Activated = false
}
break
case comm.Reddot30100: // 体力恢复
user, err = this.GetUser(session.GetUserId())

View File

@ -152,7 +152,7 @@ type DailytaskReceiveResp struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Award []*UserAssets `protobuf:"bytes,1,rep,name=award,proto3" json:"award"` //奖励
Award []*UserAtno `protobuf:"bytes,1,rep,name=award,proto3" json:"award"` //奖励
}
func (x *DailytaskReceiveResp) Reset() {
@ -187,7 +187,7 @@ func (*DailytaskReceiveResp) Descriptor() ([]byte, []int) {
return file_dailytask_dailytask_msg_proto_rawDescGZIP(), []int{3}
}
func (x *DailytaskReceiveResp) GetAward() []*UserAssets {
func (x *DailytaskReceiveResp) GetAward() []*UserAtno {
if x != nil {
return x.Award
}
@ -208,12 +208,12 @@ var file_dailytask_dailytask_msg_proto_rawDesc = []byte{
0x32, 0x19, 0x2e, 0x44, 0x42, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x47, 0x72,
0x6f, 0x75, 0x70, 0x50, 0x72, 0x6f, 0x67, 0x72, 0x65, 0x73, 0x73, 0x52, 0x04, 0x74, 0x61, 0x73,
0x6b, 0x22, 0x15, 0x0a, 0x13, 0x44, 0x61, 0x69, 0x6c, 0x79, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65,
0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x22, 0x39, 0x0a, 0x14, 0x44, 0x61, 0x69, 0x6c,
0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x71, 0x22, 0x37, 0x0a, 0x14, 0x44, 0x61, 0x69, 0x6c,
0x79, 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x52, 0x65, 0x73, 0x70,
0x12, 0x21, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x0b, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x05, 0x61, 0x77,
0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72,
0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@ -235,11 +235,11 @@ var file_dailytask_dailytask_msg_proto_goTypes = []interface{}{
(*DailytaskReceiveReq)(nil), // 2: DailytaskReceiveReq
(*DailytaskReceiveResp)(nil), // 3: DailytaskReceiveResp
(*DBDailytaskGroupProgress)(nil), // 4: DBDailytaskGroupProgress
(*UserAssets)(nil), // 5: UserAssets
(*UserAtno)(nil), // 5: UserAtno
}
var file_dailytask_dailytask_msg_proto_depIdxs = []int32{
4, // 0: DailytaskInfoResp.task:type_name -> DBDailytaskGroupProgress
5, // 1: DailytaskReceiveResp.award:type_name -> UserAssets
5, // 1: DailytaskReceiveResp.award:type_name -> UserAtno
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name

View File

@ -364,6 +364,85 @@ func (x *DBDColorRoomPlayer) GetScore() int32 {
return 0
}
type DBDColorResult struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index"`
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"`
Results []DBDColorColor `protobuf:"varint,3,rep,packed,name=results,proto3,enum=DBDColorColor" json:"results"`
Allright int32 `protobuf:"varint,4,opt,name=allright,proto3" json:"allright"`
Halfpair int32 `protobuf:"varint,5,opt,name=halfpair,proto3" json:"halfpair"`
}
func (x *DBDColorResult) Reset() {
*x = DBDColorResult{}
if protoimpl.UnsafeEnabled {
mi := &file_dcolor_dcolor_db_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DBDColorResult) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DBDColorResult) ProtoMessage() {}
func (x *DBDColorResult) ProtoReflect() protoreflect.Message {
mi := &file_dcolor_dcolor_db_proto_msgTypes[3]
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 DBDColorResult.ProtoReflect.Descriptor instead.
func (*DBDColorResult) Descriptor() ([]byte, []int) {
return file_dcolor_dcolor_db_proto_rawDescGZIP(), []int{3}
}
func (x *DBDColorResult) GetIndex() int32 {
if x != nil {
return x.Index
}
return 0
}
func (x *DBDColorResult) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DBDColorResult) GetResults() []DBDColorColor {
if x != nil {
return x.Results
}
return nil
}
func (x *DBDColorResult) GetAllright() int32 {
if x != nil {
return x.Allright
}
return 0
}
func (x *DBDColorResult) GetHalfpair() int32 {
if x != nil {
return x.Halfpair
}
return 0
}
//猜颜色 房间
type DBDColorRoom struct {
state protoimpl.MessageState
@ -374,12 +453,13 @@ type DBDColorRoom struct {
Results []DBDColorColor `protobuf:"varint,2,rep,packed,name=results,proto3,enum=DBDColorColor" json:"results"`
Red *DBDColorRoomPlayer `protobuf:"bytes,3,opt,name=red,proto3" json:"red"`
Blue *DBDColorRoomPlayer `protobuf:"bytes,4,opt,name=blue,proto3" json:"blue"`
Handles []*DBDColorResult `protobuf:"bytes,5,rep,name=handles,proto3" json:"handles"`
}
func (x *DBDColorRoom) Reset() {
*x = DBDColorRoom{}
if protoimpl.UnsafeEnabled {
mi := &file_dcolor_dcolor_db_proto_msgTypes[3]
mi := &file_dcolor_dcolor_db_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@ -392,7 +472,7 @@ func (x *DBDColorRoom) String() string {
func (*DBDColorRoom) ProtoMessage() {}
func (x *DBDColorRoom) ProtoReflect() protoreflect.Message {
mi := &file_dcolor_dcolor_db_proto_msgTypes[3]
mi := &file_dcolor_dcolor_db_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@ -405,7 +485,7 @@ func (x *DBDColorRoom) ProtoReflect() protoreflect.Message {
// Deprecated: Use DBDColorRoom.ProtoReflect.Descriptor instead.
func (*DBDColorRoom) Descriptor() ([]byte, []int) {
return file_dcolor_dcolor_db_proto_rawDescGZIP(), []int{3}
return file_dcolor_dcolor_db_proto_rawDescGZIP(), []int{4}
}
func (x *DBDColorRoom) GetRid() string {
@ -436,6 +516,13 @@ func (x *DBDColorRoom) GetBlue() *DBDColorRoomPlayer {
return nil
}
func (x *DBDColorRoom) GetHandles() []*DBDColorResult {
if x != nil {
return x.Handles
}
return nil
}
var File_dcolor_dcolor_db_proto protoreflect.FileDescriptor
var file_dcolor_dcolor_db_proto_rawDesc = []byte{
@ -469,29 +556,41 @@ var file_dcolor_dcolor_db_proto_rawDesc = []byte{
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x61, 0x69, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x65,
0x61, 0x64, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x72, 0x65, 0x61, 0x64, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x44, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x65, 0x73,
0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x44,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x73, 0x12, 0x25, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x13, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x6f, 0x6f, 0x6d, 0x50,
0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x04, 0x62, 0x6c,
0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x52, 0x6f, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x04, 0x62,
0x6c, 0x75, 0x65, 0x2a, 0x3a, 0x0a, 0x12, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x44,
0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x69, 0x6d,
0x70, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75,
0x6c, 0x74, 0x79, 0x10, 0x01, 0x12, 0x08, 0x0a, 0x04, 0x48, 0x65, 0x6c, 0x6c, 0x10, 0x02, 0x2a,
0x77, 0x0a, 0x0d, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x30, 0x10, 0x00, 0x12, 0x0b, 0x0a,
0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x5f, 0x33, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x10,
0x04, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x35, 0x10, 0x05, 0x12, 0x0b,
0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x36, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x43,
0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x37, 0x10, 0x07, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x05, 0x73, 0x63, 0x6f, 0x72, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x44, 0x42, 0x44, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64,
0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12,
0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69,
0x64, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03,
0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x61,
0x6c, 0x6c, 0x72, 0x69, 0x67, 0x68, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61,
0x6c, 0x6c, 0x72, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x61, 0x6c, 0x66, 0x70,
0x61, 0x69, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x68, 0x61, 0x6c, 0x66, 0x70,
0x61, 0x69, 0x72, 0x22, 0xc5, 0x01, 0x0a, 0x0c, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x72, 0x69, 0x64, 0x12, 0x28, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74,
0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73,
0x12, 0x25, 0x0a, 0x03, 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e,
0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x6f, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x79,
0x65, 0x72, 0x52, 0x03, 0x72, 0x65, 0x64, 0x12, 0x27, 0x0a, 0x04, 0x62, 0x6c, 0x75, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x52, 0x6f, 0x6f, 0x6d, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x04, 0x62, 0x6c, 0x75, 0x65,
0x12, 0x29, 0x0a, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x52, 0x07, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x73, 0x2a, 0x3a, 0x0a, 0x12, 0x44,
0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74,
0x79, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x10, 0x00, 0x12, 0x0e, 0x0a,
0x0a, 0x44, 0x69, 0x66, 0x66, 0x69, 0x63, 0x75, 0x6c, 0x74, 0x79, 0x10, 0x01, 0x12, 0x08, 0x0a,
0x04, 0x48, 0x65, 0x6c, 0x6c, 0x10, 0x02, 0x2a, 0x77, 0x0a, 0x0d, 0x44, 0x42, 0x44, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f,
0x72, 0x5f, 0x30, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x31,
0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x32, 0x10, 0x02, 0x12,
0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x33, 0x10, 0x03, 0x12, 0x0b, 0x0a, 0x07,
0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x34, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x5f, 0x35, 0x10, 0x05, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f,
0x36, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x37, 0x10, 0x07,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -507,28 +606,31 @@ func file_dcolor_dcolor_db_proto_rawDescGZIP() []byte {
}
var file_dcolor_dcolor_db_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_dcolor_dcolor_db_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_dcolor_dcolor_db_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_dcolor_dcolor_db_proto_goTypes = []interface{}{
(DBDColorDifficulty)(0), // 0: DBDColorDifficulty
(DBDColorColor)(0), // 1: DBDColorColor
(*DBDColorQiecuoInvite)(nil), // 2: DBDColorQiecuoInvite
(*DBDColorQiecuoRecord)(nil), // 3: DBDColorQiecuoRecord
(*DBDColorRoomPlayer)(nil), // 4: DBDColorRoomPlayer
(*DBDColorRoom)(nil), // 5: DBDColorRoom
(*BaseUserInfo)(nil), // 6: BaseUserInfo
(*DBDColorResult)(nil), // 5: DBDColorResult
(*DBDColorRoom)(nil), // 6: DBDColorRoom
(*BaseUserInfo)(nil), // 7: BaseUserInfo
}
var file_dcolor_dcolor_db_proto_depIdxs = []int32{
2, // 0: DBDColorQiecuoRecord.targets:type_name -> DBDColorQiecuoInvite
0, // 1: DBDColorQiecuoRecord.difficulty:type_name -> DBDColorDifficulty
6, // 2: DBDColorRoomPlayer.info:type_name -> BaseUserInfo
1, // 3: DBDColorRoom.results:type_name -> DBDColorColor
4, // 4: DBDColorRoom.red:type_name -> DBDColorRoomPlayer
4, // 5: DBDColorRoom.blue:type_name -> DBDColorRoomPlayer
6, // [6:6] is the sub-list for method output_type
6, // [6:6] is the sub-list for method input_type
6, // [6:6] is the sub-list for extension type_name
6, // [6:6] is the sub-list for extension extendee
0, // [0:6] is the sub-list for field type_name
7, // 2: DBDColorRoomPlayer.info:type_name -> BaseUserInfo
1, // 3: DBDColorResult.results:type_name -> DBDColorColor
1, // 4: DBDColorRoom.results:type_name -> DBDColorColor
4, // 5: DBDColorRoom.red:type_name -> DBDColorRoomPlayer
4, // 6: DBDColorRoom.blue:type_name -> DBDColorRoomPlayer
5, // 7: DBDColorRoom.handles:type_name -> DBDColorResult
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
}
func init() { file_dcolor_dcolor_db_proto_init() }
@ -575,6 +677,18 @@ func file_dcolor_dcolor_db_proto_init() {
}
}
file_dcolor_dcolor_db_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBDColorResult); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dcolor_dcolor_db_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DBDColorRoom); i {
case 0:
return &v.state
@ -593,7 +707,7 @@ func file_dcolor_dcolor_db_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_dcolor_dcolor_db_proto_rawDesc,
NumEnums: 2,
NumMessages: 4,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},

View File

@ -568,7 +568,7 @@ func (x *DColorLoadCompleteResp) GetIssucc() bool {
return false
}
//加载完毕 通知
//游戏开始 通知
type DColorGameStartPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@ -624,6 +624,213 @@ func (x *DColorGameStartPush) GetSide() int32 {
return 0
}
//发送操作信息
type DColorHandleReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index"`
Results []DBDColorColor `protobuf:"varint,2,rep,packed,name=results,proto3,enum=DBDColorColor" json:"results"`
}
func (x *DColorHandleReq) Reset() {
*x = DColorHandleReq{}
if protoimpl.UnsafeEnabled {
mi := &file_dcolor_dcolor_msg_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DColorHandleReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DColorHandleReq) ProtoMessage() {}
func (x *DColorHandleReq) ProtoReflect() protoreflect.Message {
mi := &file_dcolor_dcolor_msg_proto_msgTypes[11]
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 DColorHandleReq.ProtoReflect.Descriptor instead.
func (*DColorHandleReq) Descriptor() ([]byte, []int) {
return file_dcolor_dcolor_msg_proto_rawDescGZIP(), []int{11}
}
func (x *DColorHandleReq) GetIndex() int32 {
if x != nil {
return x.Index
}
return 0
}
func (x *DColorHandleReq) GetResults() []DBDColorColor {
if x != nil {
return x.Results
}
return nil
}
//发送操作信息
type DColorHandleResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *DColorHandleResp) Reset() {
*x = DColorHandleResp{}
if protoimpl.UnsafeEnabled {
mi := &file_dcolor_dcolor_msg_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DColorHandleResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DColorHandleResp) ProtoMessage() {}
func (x *DColorHandleResp) ProtoReflect() protoreflect.Message {
mi := &file_dcolor_dcolor_msg_proto_msgTypes[12]
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 DColorHandleResp.ProtoReflect.Descriptor instead.
func (*DColorHandleResp) Descriptor() ([]byte, []int) {
return file_dcolor_dcolor_msg_proto_rawDescGZIP(), []int{12}
}
//游戏结果推送
type DColorGameHandlePush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
Handle *DBDColorResult `protobuf:"bytes,2,opt,name=handle,proto3" json:"handle"`
}
func (x *DColorGameHandlePush) Reset() {
*x = DColorGameHandlePush{}
if protoimpl.UnsafeEnabled {
mi := &file_dcolor_dcolor_msg_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DColorGameHandlePush) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DColorGameHandlePush) ProtoMessage() {}
func (x *DColorGameHandlePush) ProtoReflect() protoreflect.Message {
mi := &file_dcolor_dcolor_msg_proto_msgTypes[13]
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 DColorGameHandlePush.ProtoReflect.Descriptor instead.
func (*DColorGameHandlePush) Descriptor() ([]byte, []int) {
return file_dcolor_dcolor_msg_proto_rawDescGZIP(), []int{13}
}
func (x *DColorGameHandlePush) GetUid() string {
if x != nil {
return x.Uid
}
return ""
}
func (x *DColorGameHandlePush) GetHandle() *DBDColorResult {
if x != nil {
return x.Handle
}
return nil
}
//游戏结束推送
type DColorGameOverPush struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Winside int32 `protobuf:"varint,1,opt,name=winside,proto3" json:"winside"`
Award []*UserAtno `protobuf:"bytes,2,rep,name=award,proto3" json:"award"` //奖励
}
func (x *DColorGameOverPush) Reset() {
*x = DColorGameOverPush{}
if protoimpl.UnsafeEnabled {
mi := &file_dcolor_dcolor_msg_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DColorGameOverPush) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DColorGameOverPush) ProtoMessage() {}
func (x *DColorGameOverPush) ProtoReflect() protoreflect.Message {
mi := &file_dcolor_dcolor_msg_proto_msgTypes[14]
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 DColorGameOverPush.ProtoReflect.Descriptor instead.
func (*DColorGameOverPush) Descriptor() ([]byte, []int) {
return file_dcolor_dcolor_msg_proto_rawDescGZIP(), []int{14}
}
func (x *DColorGameOverPush) GetWinside() int32 {
if x != nil {
return x.Winside
}
return 0
}
func (x *DColorGameOverPush) GetAward() []*UserAtno {
if x != nil {
return x.Award
}
return nil
}
var File_dcolor_dcolor_msg_proto protoreflect.FileDescriptor
var file_dcolor_dcolor_msg_proto_rawDesc = []byte{
@ -682,8 +889,25 @@ var file_dcolor_dcolor_msg_proto_rawDesc = []byte{
0x65, 0x53, 0x74, 0x61, 0x72, 0x74, 0x50, 0x75, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x6f,
0x6f, 0x6d, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, 0x6f, 0x6d,
0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x52, 0x04, 0x73, 0x69, 0x64, 0x65, 0x22, 0x51, 0x0a, 0x0f, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64,
0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12,
0x28, 0x0a, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e,
0x32, 0x0e, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x43, 0x6f, 0x6c, 0x6f, 0x72,
0x52, 0x07, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x22, 0x12, 0x0a, 0x10, 0x44, 0x43, 0x6f,
0x6c, 0x6f, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x22, 0x51, 0x0a,
0x14, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x48, 0x61, 0x6e, 0x64, 0x6c,
0x65, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x27, 0x0a, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x44, 0x42, 0x44, 0x43, 0x6f, 0x6c,
0x6f, 0x72, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x06, 0x68, 0x61, 0x6e, 0x64, 0x6c, 0x65,
0x22, 0x4f, 0x0a, 0x12, 0x44, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x47, 0x61, 0x6d, 0x65, 0x4f, 0x76,
0x65, 0x72, 0x50, 0x75, 0x73, 0x68, 0x12, 0x18, 0x0a, 0x07, 0x77, 0x69, 0x6e, 0x73, 0x69, 0x64,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x77, 0x69, 0x6e, 0x73, 0x69, 0x64, 0x65,
0x12, 0x1f, 0x0a, 0x05, 0x61, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x41, 0x74, 0x6e, 0x6f, 0x52, 0x05, 0x61, 0x77, 0x61, 0x72,
0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (
@ -698,7 +922,7 @@ func file_dcolor_dcolor_msg_proto_rawDescGZIP() []byte {
return file_dcolor_dcolor_msg_proto_rawDescData
}
var file_dcolor_dcolor_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_dcolor_dcolor_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 15)
var file_dcolor_dcolor_msg_proto_goTypes = []interface{}{
(*DColorQiecuoReq)(nil), // 0: DColorQiecuoReq
(*DColorQiecuoResp)(nil), // 1: DColorQiecuoResp
@ -711,20 +935,30 @@ var file_dcolor_dcolor_msg_proto_goTypes = []interface{}{
(*DColorLoadCompleteReq)(nil), // 8: DColorLoadCompleteReq
(*DColorLoadCompleteResp)(nil), // 9: DColorLoadCompleteResp
(*DColorGameStartPush)(nil), // 10: DColorGameStartPush
(DBDColorDifficulty)(0), // 11: DBDColorDifficulty
(*BaseUserInfo)(nil), // 12: BaseUserInfo
(*DBDColorRoom)(nil), // 13: DBDColorRoom
(*DColorHandleReq)(nil), // 11: DColorHandleReq
(*DColorHandleResp)(nil), // 12: DColorHandleResp
(*DColorGameHandlePush)(nil), // 13: DColorGameHandlePush
(*DColorGameOverPush)(nil), // 14: DColorGameOverPush
(DBDColorDifficulty)(0), // 15: DBDColorDifficulty
(*BaseUserInfo)(nil), // 16: BaseUserInfo
(*DBDColorRoom)(nil), // 17: DBDColorRoom
(DBDColorColor)(0), // 18: DBDColorColor
(*DBDColorResult)(nil), // 19: DBDColorResult
(*UserAtno)(nil), // 20: UserAtno
}
var file_dcolor_dcolor_msg_proto_depIdxs = []int32{
11, // 0: DColorQiecuoReq.difficulty:type_name -> DBDColorDifficulty
12, // 1: DColorQiecuonotifyPush.user:type_name -> BaseUserInfo
11, // 2: DColorQiecuonotifyPush.difficulty:type_name -> DBDColorDifficulty
13, // 3: DColorGameReadyPush.room:type_name -> DBDColorRoom
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
15, // 0: DColorQiecuoReq.difficulty:type_name -> DBDColorDifficulty
16, // 1: DColorQiecuonotifyPush.user:type_name -> BaseUserInfo
15, // 2: DColorQiecuonotifyPush.difficulty:type_name -> DBDColorDifficulty
17, // 3: DColorGameReadyPush.room:type_name -> DBDColorRoom
18, // 4: DColorHandleReq.results:type_name -> DBDColorColor
19, // 5: DColorGameHandlePush.handle:type_name -> DBDColorResult
20, // 6: DColorGameOverPush.award:type_name -> UserAtno
7, // [7:7] is the sub-list for method output_type
7, // [7:7] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_dcolor_dcolor_msg_proto_init() }
@ -867,6 +1101,54 @@ func file_dcolor_dcolor_msg_proto_init() {
return nil
}
}
file_dcolor_dcolor_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DColorHandleReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dcolor_dcolor_msg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DColorHandleResp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dcolor_dcolor_msg_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DColorGameHandlePush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_dcolor_dcolor_msg_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DColorGameOverPush); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@ -874,7 +1156,7 @@ func file_dcolor_dcolor_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_dcolor_dcolor_msg_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumMessages: 15,
NumExtensions: 0,
NumServices: 0,
},