From 05d2d6de8411756158ac8617aa3a8d4afeed76c5 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 31 Jan 2023 12:01:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=B8=BB=E7=BA=BF=E8=BF=9B?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/mline/api_challengeover.go | 15 +++++ pb/userexpand.pb.go | 97 ++++++++++++++++++------------ 2 files changed, 72 insertions(+), 40 deletions(-) diff --git a/modules/mline/api_challengeover.go b/modules/mline/api_challengeover.go index 73ec47152..0c0f0c022 100644 --- a/modules/mline/api_challengeover.go +++ b/modules/mline/api_challengeover.go @@ -132,6 +132,21 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall update["stageId"] = curChapter.StageId if first { // 发奖 + if rst, err := this.module.ModuleUser.GetUserExpand(session.GetUserId()); err == nil { // 统计主线进度 + _mp := rst.Mline + if v, ok := _mp[curChapter.CType]; ok { + if v <= req.StageId { + _mp[curChapter.CType] = req.StageId + } + } else { + _mp = make(map[int32]int32, 0) + _mp[curChapter.CType] = req.StageId + } + this.module.ModuleUser.ChangeUserExpand(session.GetUserId(), map[string]interface{}{ + "mline": _mp, + }) + } + if code = this.module.DispenseRes(session, stageConf.Firstaward, true); code != pb.ErrorCode_Success { this.module.Debugf("Mline first DispenseRes err:+%v", stageConf.Firstaward) } diff --git a/pb/userexpand.pb.go b/pb/userexpand.pb.go index aa6c73daf..9203c6dac 100644 --- a/pb/userexpand.pb.go +++ b/pb/userexpand.pb.go @@ -26,35 +26,36 @@ type DBUserExpand struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //主键id - Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` //用户id - Lastreadnotiftime int64 `protobuf:"varint,3,opt,name=lastreadnotiftime,proto3" json:"lastreadnotiftime"` //最后阅读公告时间 - LastInitdataTime int64 `protobuf:"varint,4,opt,name=lastInitdataTime,proto3" json:"lastInitdataTime"` //上次初始数据时间 - InitdataCount uint32 `protobuf:"varint,5,opt,name=initdataCount,proto3" json:"initdataCount"` //今日初始累计次数 - Chatchannel int32 `protobuf:"varint,6,opt,name=chatchannel,proto3" json:"chatchannel"` //跨服聊天频道 - ModifynameCount int32 `protobuf:"varint,7,opt,name=modifynameCount,proto3" json:"modifynameCount"` //修改昵称次数 - Tujian map[string]int32 `protobuf:"bytes,8,rep,name=tujian,proto3" json:"tujian" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //图鉴 - Activeday int32 `protobuf:"varint,11,opt,name=activeday,proto3" json:"activeday"` //日活跃度 - Activeweek int32 `protobuf:"varint,12,opt,name=activeweek,proto3" json:"activeweek"` //周活跃度 - Sign string `protobuf:"bytes,13,opt,name=sign,proto3" json:"sign"` //用户签名 - FriendPoint int32 `protobuf:"varint,14,opt,name=friendPoint,proto3" json:"friendPoint" bson:"friendPoint"` //友情点 - FriendPointID int32 `protobuf:"varint,15,opt,name=friendPointID,proto3" json:"friendPointID" bson:"friendPointID"` //每日获赠友情点 - FriendPointOD int32 `protobuf:"varint,16,opt,name=friendPointOD,proto3" json:"friendPointOD" bson:"friendPointOD"` //每日送出友情点 - LoginAddCount int32 `protobuf:"varint,19,opt,name=loginAddCount,proto3" json:"loginAddCount"` //@go_tasgs(`bson:"loginAddCount"`) 累计登录天数 - LoginContinueCount int32 `protobuf:"varint,20,opt,name=loginContinueCount,proto3" json:"loginContinueCount"` //@go_tasgs(`bson:"loginContinueCount"`) 连续登录天数 - RtaskId int32 `protobuf:"varint,21,opt,name=rtaskId,proto3" json:"rtaskId" bson:"rtaskId"` // 当前完成的随机任务ID - TeamHeroIds []string `protobuf:"bytes,22,rep,name=teamHeroIds,proto3" json:"teamHeroIds" bson:"teamHeroIds"` //阵容英雄IDs - SociatyId string `protobuf:"bytes,23,opt,name=sociatyId,proto3" json:"sociatyId" bson:"sociatyId"` //公会ID - SociatyCd int64 `protobuf:"varint,24,opt,name=sociatyCd,proto3" json:"sociatyCd" bson:"sociatyCd"` //主动退出CD - Guildcoin int32 `protobuf:"varint,25,opt,name=guildcoin,proto3" json:"guildcoin" bson:"guildcoin"` //公会币 - Arenacoin int32 `protobuf:"varint,26,opt,name=arenacoin,proto3" json:"arenacoin" bson:"arenacoin"` //竞技场币 - Physicalbuynum int32 `protobuf:"varint,27,opt,name=physicalbuynum,proto3" json:"physicalbuynum"` //@go_tags(`bson:"physicalbuynum"`)体力购买次数 - PhysicalbuyLasttime int64 `protobuf:"varint,28,opt,name=physicalbuyLasttime,proto3" json:"physicalbuyLasttime"` //@go_tags(`bson:"physicalbuyLasttime"`)最后购买体力事件 - Buyunifiedticket int32 `protobuf:"varint,29,opt,name=buyunifiedticket,proto3" json:"buyunifiedticket"` //@go_tags(`bson:"buyunifiedticket"`)购买统一入场门票次数 - Lasttimeunifiedticket int64 `protobuf:"varint,30,opt,name=lasttimeunifiedticket,proto3" json:"lasttimeunifiedticket"` //@go_tags(`bson:"lasttimeunifiedticket"`)最后购买统一入场门票时间 - Recovertimeunifiedticket int64 `protobuf:"varint,31,opt,name=recovertimeunifiedticket,proto3" json:"recovertimeunifiedticket"` //@go_tags(`bson:"recovertimeunifiedticket"`)同意门票恢复时间 - SociatyTicketBuyNum int32 `protobuf:"varint,32,opt,name=sociatyTicketBuyNum,proto3" json:"sociatyTicketBuyNum" bson:"sociatyTicketBuyNum"` //公会boss挑战券购买次数 - SociatyTicket int32 `protobuf:"varint,33,opt,name=sociatyTicket,proto3" json:"sociatyTicket" bson:"sociatyTicket"` //公会boss挑战券数量 + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //主键id + Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid"` //用户id + Lastreadnotiftime int64 `protobuf:"varint,3,opt,name=lastreadnotiftime,proto3" json:"lastreadnotiftime"` //最后阅读公告时间 + LastInitdataTime int64 `protobuf:"varint,4,opt,name=lastInitdataTime,proto3" json:"lastInitdataTime"` //上次初始数据时间 + InitdataCount uint32 `protobuf:"varint,5,opt,name=initdataCount,proto3" json:"initdataCount"` //今日初始累计次数 + Chatchannel int32 `protobuf:"varint,6,opt,name=chatchannel,proto3" json:"chatchannel"` //跨服聊天频道 + ModifynameCount int32 `protobuf:"varint,7,opt,name=modifynameCount,proto3" json:"modifynameCount"` //修改昵称次数 + Tujian map[string]int32 `protobuf:"bytes,8,rep,name=tujian,proto3" json:"tujian" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` //图鉴 + Activeday int32 `protobuf:"varint,11,opt,name=activeday,proto3" json:"activeday"` //日活跃度 + Activeweek int32 `protobuf:"varint,12,opt,name=activeweek,proto3" json:"activeweek"` //周活跃度 + Sign string `protobuf:"bytes,13,opt,name=sign,proto3" json:"sign"` //用户签名 + FriendPoint int32 `protobuf:"varint,14,opt,name=friendPoint,proto3" json:"friendPoint" bson:"friendPoint"` //友情点 + FriendPointID int32 `protobuf:"varint,15,opt,name=friendPointID,proto3" json:"friendPointID" bson:"friendPointID"` //每日获赠友情点 + FriendPointOD int32 `protobuf:"varint,16,opt,name=friendPointOD,proto3" json:"friendPointOD" bson:"friendPointOD"` //每日送出友情点 + LoginAddCount int32 `protobuf:"varint,19,opt,name=loginAddCount,proto3" json:"loginAddCount"` //@go_tasgs(`bson:"loginAddCount"`) 累计登录天数 + LoginContinueCount int32 `protobuf:"varint,20,opt,name=loginContinueCount,proto3" json:"loginContinueCount"` //@go_tasgs(`bson:"loginContinueCount"`) 连续登录天数 + RtaskId int32 `protobuf:"varint,21,opt,name=rtaskId,proto3" json:"rtaskId" bson:"rtaskId"` // 当前完成的随机任务ID + TeamHeroIds []string `protobuf:"bytes,22,rep,name=teamHeroIds,proto3" json:"teamHeroIds" bson:"teamHeroIds"` //阵容英雄IDs + SociatyId string `protobuf:"bytes,23,opt,name=sociatyId,proto3" json:"sociatyId" bson:"sociatyId"` //公会ID + SociatyCd int64 `protobuf:"varint,24,opt,name=sociatyCd,proto3" json:"sociatyCd" bson:"sociatyCd"` //主动退出CD + Guildcoin int32 `protobuf:"varint,25,opt,name=guildcoin,proto3" json:"guildcoin" bson:"guildcoin"` //公会币 + Arenacoin int32 `protobuf:"varint,26,opt,name=arenacoin,proto3" json:"arenacoin" bson:"arenacoin"` //竞技场币 + Physicalbuynum int32 `protobuf:"varint,27,opt,name=physicalbuynum,proto3" json:"physicalbuynum"` //@go_tags(`bson:"physicalbuynum"`)体力购买次数 + PhysicalbuyLasttime int64 `protobuf:"varint,28,opt,name=physicalbuyLasttime,proto3" json:"physicalbuyLasttime"` //@go_tags(`bson:"physicalbuyLasttime"`)最后购买体力事件 + Buyunifiedticket int32 `protobuf:"varint,29,opt,name=buyunifiedticket,proto3" json:"buyunifiedticket"` //@go_tags(`bson:"buyunifiedticket"`)购买统一入场门票次数 + Lasttimeunifiedticket int64 `protobuf:"varint,30,opt,name=lasttimeunifiedticket,proto3" json:"lasttimeunifiedticket"` //@go_tags(`bson:"lasttimeunifiedticket"`)最后购买统一入场门票时间 + Recovertimeunifiedticket int64 `protobuf:"varint,31,opt,name=recovertimeunifiedticket,proto3" json:"recovertimeunifiedticket"` //@go_tags(`bson:"recovertimeunifiedticket"`)同意门票恢复时间 + SociatyTicketBuyNum int32 `protobuf:"varint,32,opt,name=sociatyTicketBuyNum,proto3" json:"sociatyTicketBuyNum" bson:"sociatyTicketBuyNum"` //公会boss挑战券购买次数 + SociatyTicket int32 `protobuf:"varint,33,opt,name=sociatyTicket,proto3" json:"sociatyTicket" bson:"sociatyTicket"` //公会boss挑战券数量 + Mline map[int32]int32 `protobuf:"bytes,34,rep,name=mline,proto3" json:"mline" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"mline"` //主线关卡最大进度 } func (x *DBUserExpand) Reset() { @@ -292,11 +293,18 @@ func (x *DBUserExpand) GetSociatyTicket() int32 { return 0 } +func (x *DBUserExpand) GetMline() map[int32]int32 { + if x != nil { + return x.Mline + } + return nil +} + var File_userexpand_proto protoreflect.FileDescriptor var file_userexpand_proto_rawDesc = []byte{ 0x0a, 0x10, 0x75, 0x73, 0x65, 0x72, 0x65, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x84, 0x09, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, + 0x74, 0x6f, 0x22, 0xee, 0x09, 0x0a, 0x0c, 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 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, 0x2c, 0x0a, 0x11, 0x6c, 0x61, 0x73, 0x74, 0x72, 0x65, 0x61, @@ -364,12 +372,19 @@ var file_userexpand_proto_rawDesc = []byte{ 0x01, 0x28, 0x05, 0x52, 0x13, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x42, 0x75, 0x79, 0x4e, 0x75, 0x6d, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x18, 0x21, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0d, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x1a, 0x39, + 0x0d, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x74, 0x79, 0x54, 0x69, 0x63, 0x6b, 0x65, 0x74, 0x12, 0x2e, + 0x0a, 0x05, 0x6d, 0x6c, 0x69, 0x6e, 0x65, 0x18, 0x22, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, + 0x44, 0x42, 0x55, 0x73, 0x65, 0x72, 0x45, 0x78, 0x70, 0x61, 0x6e, 0x64, 0x2e, 0x4d, 0x6c, 0x69, + 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x6d, 0x6c, 0x69, 0x6e, 0x65, 0x1a, 0x39, 0x0a, 0x0b, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, - 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x4d, 0x6c, 0x69, + 0x6e, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x05, 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, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -384,18 +399,20 @@ func file_userexpand_proto_rawDescGZIP() []byte { return file_userexpand_proto_rawDescData } -var file_userexpand_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_userexpand_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_userexpand_proto_goTypes = []interface{}{ (*DBUserExpand)(nil), // 0: DBUserExpand nil, // 1: DBUserExpand.TujianEntry + nil, // 2: DBUserExpand.MlineEntry } var file_userexpand_proto_depIdxs = []int32{ 1, // 0: DBUserExpand.tujian:type_name -> DBUserExpand.TujianEntry - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name + 2, // 1: DBUserExpand.mline:type_name -> DBUserExpand.MlineEntry + 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 + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_userexpand_proto_init() } @@ -423,7 +440,7 @@ func file_userexpand_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_userexpand_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, },