diff --git a/modules/practice/api_receive.go b/modules/practice/api_receive.go index 950edb73e..baea789ba 100644 --- a/modules/practice/api_receive.go +++ b/modules/practice/api_receive.go @@ -206,7 +206,7 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.PracticeReceiveR } } - if _, code = this.module.ModuleHero.AddHeroExp(session, pillar.Hero, exp); code != pb.ErrorCode_Success { + if _, code = this.module.ModuleHero.AddHeroExp(session, pillar.Hero, exp1); code != pb.ErrorCode_Success { return } if code = this.module.DispenseRes(session, append(ants1, ants2...), true); code != pb.ErrorCode_Success { diff --git a/modules/user/api_puzzleaward.go b/modules/user/api_puzzleaward.go new file mode 100644 index 000000000..22637d85e --- /dev/null +++ b/modules/user/api_puzzleaward.go @@ -0,0 +1,20 @@ +package user + +import ( + "go_dreamfactory/comm" + "go_dreamfactory/pb" + + "google.golang.org/protobuf/proto" +) + +//参数校验 +func (this *apiComp) PuzzleAwardCheck(session comm.IUserSession, req *pb.UserPuzzleAwardReq) (code pb.ErrorCode) { + + return +} + +//拼图领奖 +func (this *apiComp) PuzzleAward(session comm.IUserSession, req *pb.UserPuzzleAwardReq) (code pb.ErrorCode, data proto.Message) { + + return +} diff --git a/pb/user_db.pb.go b/pb/user_db.pb.go index 0f29b8494..06d8b9fab 100644 --- a/pb/user_db.pb.go +++ b/pb/user_db.pb.go @@ -503,13 +503,14 @@ type DBSign struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID - SignTime int64 `protobuf:"varint,3,opt,name=signTime,proto3" json:"signTime" bson:"signTime"` //玩家登录时间 - SignCount int32 `protobuf:"varint,4,opt,name=signCount,proto3" json:"signCount" bson:"signCount"` //玩家累计签到次数 - Group int32 `protobuf:"varint,5,opt,name=group,proto3" json:"group"` // 签到组id - Cid int32 `protobuf:"varint,6,opt,name=cid,proto3" json:"cid"` //记录循环签到值,客户端忽略这个字段 - RTime int64 `protobuf:"varint,7,opt,name=rTime,proto3" json:"rTime" bson:"rTime"` //刷新时间 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID + SignTime int64 `protobuf:"varint,3,opt,name=signTime,proto3" json:"signTime" bson:"signTime"` //玩家登录时间 + SignCount int32 `protobuf:"varint,4,opt,name=signCount,proto3" json:"signCount" bson:"signCount"` //玩家累计签到次数 + Group int32 `protobuf:"varint,5,opt,name=group,proto3" json:"group"` //签到组id + Cid int32 `protobuf:"varint,6,opt,name=cid,proto3" json:"cid"` //记录循环签到值,客户端忽略这个字段 + RTime int64 `protobuf:"varint,7,opt,name=rTime,proto3" json:"rTime" bson:"rTime"` //刷新时间 + Puzzle []int32 `protobuf:"varint,8,rep,packed,name=puzzle,proto3" json:"puzzle" bson:"puzzle"` //拼图游戏完成情况 } func (x *DBSign) Reset() { @@ -593,6 +594,13 @@ func (x *DBSign) GetRTime() int64 { return 0 } +func (x *DBSign) GetPuzzle() []int32 { + if x != nil { + return x.Puzzle + } + return nil +} + var File_user_user_db_proto protoreflect.FileDescriptor var file_user_user_db_proto_rawDesc = []byte{ @@ -668,7 +676,7 @@ var file_user_user_db_proto_rawDesc = []byte{ 0x67, 0x12, 0x1c, 0x0a, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x78, 0x75, 0x61, 0x6e, 0x73, 0x68, 0x61, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x61, 0x69, 0x6a, 0x69, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, - 0x73, 0x61, 0x69, 0x6a, 0x69, 0x22, 0xa2, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, + 0x73, 0x61, 0x69, 0x6a, 0x69, 0x22, 0xba, 0x01, 0x0a, 0x06, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03, @@ -678,8 +686,10 @@ var file_user_user_db_proto_rawDesc = []byte{ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x63, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x03, 0x52, 0x05, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x75, + 0x7a, 0x7a, 0x6c, 0x65, 0x18, 0x08, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x70, 0x75, 0x7a, 0x7a, + 0x6c, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( diff --git a/pb/user_msg.pb.go b/pb/user_msg.pb.go index f6e23a9d5..d999e8d8a 100644 --- a/pb/user_msg.pb.go +++ b/pb/user_msg.pb.go @@ -2468,6 +2468,102 @@ func (x *UserSignResp) GetReward() bool { return false } +//拼图领奖 +type UserPuzzleAwardReq struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index int32 `protobuf:"varint,1,opt,name=index,proto3" json:"index"` +} + +func (x *UserPuzzleAwardReq) Reset() { + *x = UserPuzzleAwardReq{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_msg_proto_msgTypes[48] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserPuzzleAwardReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserPuzzleAwardReq) ProtoMessage() {} + +func (x *UserPuzzleAwardReq) ProtoReflect() protoreflect.Message { + mi := &file_user_user_msg_proto_msgTypes[48] + 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 UserPuzzleAwardReq.ProtoReflect.Descriptor instead. +func (*UserPuzzleAwardReq) Descriptor() ([]byte, []int) { + return file_user_user_msg_proto_rawDescGZIP(), []int{48} +} + +func (x *UserPuzzleAwardReq) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + +//拼图领奖 回应 +type UserPuzzleAwardResp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index"` +} + +func (x *UserPuzzleAwardResp) Reset() { + *x = UserPuzzleAwardResp{} + if protoimpl.UnsafeEnabled { + mi := &file_user_user_msg_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserPuzzleAwardResp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserPuzzleAwardResp) ProtoMessage() {} + +func (x *UserPuzzleAwardResp) ProtoReflect() protoreflect.Message { + mi := &file_user_user_msg_proto_msgTypes[49] + 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 UserPuzzleAwardResp.ProtoReflect.Descriptor instead. +func (*UserPuzzleAwardResp) Descriptor() ([]byte, []int) { + return file_user_user_msg_proto_rawDescGZIP(), []int{49} +} + +func (x *UserPuzzleAwardResp) GetIndex() int32 { + if x != nil { + return x.Index + } + return 0 +} + var File_user_user_msg_proto protoreflect.FileDescriptor var file_user_user_msg_proto_rawDesc = []byte{ @@ -2655,8 +2751,14 @@ var file_user_user_msg_proto_rawDesc = []byte{ 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1b, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, - 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x01, 0x28, 0x08, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x22, 0x2a, 0x0a, 0x12, 0x55, + 0x73, 0x65, 0x72, 0x50, 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x41, 0x77, 0x61, 0x72, 0x64, 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, 0x22, 0x2b, 0x0a, 0x13, 0x55, 0x73, 0x65, 0x72, 0x50, + 0x75, 0x7a, 0x7a, 0x6c, 0x65, 0x41, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, + 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x69, + 0x6e, 0x64, 0x65, 0x78, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2671,7 +2773,7 @@ func file_user_user_msg_proto_rawDescGZIP() []byte { return file_user_user_msg_proto_rawDescData } -var file_user_user_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 48) +var file_user_user_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 50) var file_user_user_msg_proto_goTypes = []interface{}{ (*UserLoginReq)(nil), // 0: UserLoginReq (*UserLoginResp)(nil), // 1: UserLoginResp @@ -2721,35 +2823,37 @@ var file_user_user_msg_proto_goTypes = []interface{}{ (*UserGetServerDataResp)(nil), // 45: UserGetServerDataResp (*UserSignReq)(nil), // 46: UserSignReq (*UserSignResp)(nil), // 47: UserSignResp - (*DBUser)(nil), // 48: DBUser - (*DBUserExpand)(nil), // 49: DBUserExpand - (ErrorCode)(0), // 50: ErrorCode - (*CacheUser)(nil), // 51: CacheUser - (*DBUserSetting)(nil), // 52: DBUserSetting - (*DBPagodaRecord)(nil), // 53: DBPagodaRecord - (*DBHuntingRank)(nil), // 54: DBHuntingRank - (*DBVikingRank)(nil), // 55: DBVikingRank - (*DBServerData)(nil), // 56: DBServerData - (*DBSign)(nil), // 57: DBSign + (*UserPuzzleAwardReq)(nil), // 48: UserPuzzleAwardReq + (*UserPuzzleAwardResp)(nil), // 49: UserPuzzleAwardResp + (*DBUser)(nil), // 50: DBUser + (*DBUserExpand)(nil), // 51: DBUserExpand + (ErrorCode)(0), // 52: ErrorCode + (*CacheUser)(nil), // 53: CacheUser + (*DBUserSetting)(nil), // 54: DBUserSetting + (*DBPagodaRecord)(nil), // 55: DBPagodaRecord + (*DBHuntingRank)(nil), // 56: DBHuntingRank + (*DBVikingRank)(nil), // 57: DBVikingRank + (*DBServerData)(nil), // 58: DBServerData + (*DBSign)(nil), // 59: DBSign } var file_user_user_msg_proto_depIdxs = []int32{ - 48, // 0: UserLoginResp.data:type_name -> DBUser - 49, // 1: UserLoginResp.ex:type_name -> DBUserExpand - 48, // 2: UserInfoResp.data:type_name -> DBUser - 49, // 3: UserInfoResp.ex:type_name -> DBUserExpand - 50, // 4: UserRegisterResp.Code:type_name -> ErrorCode - 51, // 5: UserLoadResp.data:type_name -> CacheUser - 52, // 6: UserGetSettingResp.setting:type_name -> DBUserSetting - 52, // 7: UserUpdateSettingReq.setting:type_name -> DBUserSetting - 48, // 8: UserBattlerecordResp.data:type_name -> DBUser - 49, // 9: UserBattlerecordResp.ex:type_name -> DBUserExpand - 53, // 10: UserBattlerecordResp.pagodaRecord:type_name -> DBPagodaRecord - 54, // 11: UserBattlerecordResp.huntingRecord:type_name -> DBHuntingRank - 55, // 12: UserBattlerecordResp.vikingRecord:type_name -> DBVikingRank - 51, // 13: UserOnlineResp.users:type_name -> CacheUser - 48, // 14: UserDataListResp.users:type_name -> DBUser - 56, // 15: UserGetServerDataResp.data:type_name -> DBServerData - 57, // 16: UserSignResp.data:type_name -> DBSign + 50, // 0: UserLoginResp.data:type_name -> DBUser + 51, // 1: UserLoginResp.ex:type_name -> DBUserExpand + 50, // 2: UserInfoResp.data:type_name -> DBUser + 51, // 3: UserInfoResp.ex:type_name -> DBUserExpand + 52, // 4: UserRegisterResp.Code:type_name -> ErrorCode + 53, // 5: UserLoadResp.data:type_name -> CacheUser + 54, // 6: UserGetSettingResp.setting:type_name -> DBUserSetting + 54, // 7: UserUpdateSettingReq.setting:type_name -> DBUserSetting + 50, // 8: UserBattlerecordResp.data:type_name -> DBUser + 51, // 9: UserBattlerecordResp.ex:type_name -> DBUserExpand + 55, // 10: UserBattlerecordResp.pagodaRecord:type_name -> DBPagodaRecord + 56, // 11: UserBattlerecordResp.huntingRecord:type_name -> DBHuntingRank + 57, // 12: UserBattlerecordResp.vikingRecord:type_name -> DBVikingRank + 53, // 13: UserOnlineResp.users:type_name -> CacheUser + 50, // 14: UserDataListResp.users:type_name -> DBUser + 58, // 15: UserGetServerDataResp.data:type_name -> DBServerData + 59, // 16: UserSignResp.data:type_name -> DBSign 17, // [17:17] is the sub-list for method output_type 17, // [17:17] is the sub-list for method input_type 17, // [17:17] is the sub-list for extension type_name @@ -3346,6 +3450,30 @@ func file_user_user_msg_proto_init() { return nil } } + file_user_user_msg_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserPuzzleAwardReq); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_user_msg_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserPuzzleAwardResp); 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{ @@ -3353,7 +3481,7 @@ func file_user_user_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_user_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 48, + NumMessages: 50, NumExtensions: 0, NumServices: 0, },