From 288e899d3957811e91fd36a2bf93495ab1c7d542 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Mon, 22 Aug 2022 18:40:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=9A=8F=E6=9C=BA=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E9=99=90=E5=AE=9A=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 + modules/rtask/api.go | 1 + modules/rtask/api_choose.go | 25 +++-- modules/rtask/api_dotask.go | 40 ++++++-- modules/rtask/api_list.go | 12 ++- modules/rtask/config.go | 29 ++++++ modules/rtask/model_rtask.go | 154 +++++++++++++++++++++------ modules/rtask/module.go | 194 ++++++++++++++++++++++------------- modules/task/module.go | 16 +++ pb/chat_db.pb.go | 2 +- pb/errorcode.pb.go | 19 ++-- pb/hero_db.pb.go | 2 +- 12 files changed, 362 insertions(+), 134 deletions(-) diff --git a/comm/imodule.go b/comm/imodule.go index 4dddeeec8..350dd3784 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -106,6 +106,8 @@ type ( SendToTask(session IUserSession, taskType TaskType, param *pb.TaskParam) (code pb.ErrorCode) // 清理玩家任务数据 CleanData(uid string) + // 获取当前任务 + GetTaskById(uid string, taskId int32) *pb.DBTask } // 随机任务 diff --git a/modules/rtask/api.go b/modules/rtask/api.go index ddbbc9749..993090d31 100644 --- a/modules/rtask/api.go +++ b/modules/rtask/api.go @@ -8,6 +8,7 @@ import ( const ( RtaskSubTypeChoose = "choose" //选择 RtaskSubTypeList = "list" //随机任务列表 + RtaskSubTypeDotask = "dotask" //做任务 ) type apiComp struct { diff --git a/modules/rtask/api_choose.go b/modules/rtask/api_choose.go index c3dd29198..47afb5a6b 100644 --- a/modules/rtask/api_choose.go +++ b/modules/rtask/api_choose.go @@ -3,7 +3,6 @@ package rtask import ( "go_dreamfactory/comm" "go_dreamfactory/pb" - "go_dreamfactory/utils" "google.golang.org/protobuf/proto" ) @@ -24,10 +23,10 @@ func (this *apiComp) Choose(session comm.IUserSession, req *pb.RtaskChooseReq) ( } // 是否已完成 - if _, ok := utils.Findx(rtask.FrtaskIds, req.RtaskId); !ok { - code = pb.ErrorCode_RtaskUnFinished - return - } + // if _, ok := utils.Findx(rtask.FrtaskIds, req.RtaskId); !ok { + // code = pb.ErrorCode_RtaskUnFinished + // return + // } // 获取当前任务配置 conf := this.moduleRtask.configure.getRtaskById(req.RtaskId) @@ -36,12 +35,16 @@ func (this *apiComp) Choose(session comm.IUserSession, req *pb.RtaskChooseReq) ( return } - // var nextTaskId int32 - if req.ChooseId == 0 { - //读任务配置中的next taskId - // nextTaskId = conf.IdAfter - } else { - // nextTaskId = + //获取选项配置 + chooseCnf := this.moduleRtask.configure.getRtaskChooseCfg(req.ChooseId) + if chooseCnf == nil { + code = pb.ErrorCode_ConfigNoFound + return + } + + // 校验限定条件 + if ok := this.moduleRtask.modelRtask.checkCondi(session.GetUserId(), chooseCnf.PreTid); !ok { + return } //发奖励 diff --git a/modules/rtask/api_dotask.go b/modules/rtask/api_dotask.go index f6fc8baac..65b7b0405 100644 --- a/modules/rtask/api_dotask.go +++ b/modules/rtask/api_dotask.go @@ -27,21 +27,45 @@ func (this *apiComp) dotask(session comm.IUserSession, req *pb.RtaskApplyReq) (c return } + // 获取当前任务配置 + conf := this.moduleRtask.configure.getRtaskById(req.RtaskId) + if conf == nil { + code = pb.ErrorCode_ConfigNoFound + return + } + //验证该任务是否已完成 if _, ok := utils.Findx(rtask.FrtaskIds, req.RtaskId); ok { code = pb.ErrorCode_RtaskFinished return } - rtask.FrtaskIds = append(rtask.FrtaskIds, req.RtaskId) - - // 更新完成的任务 - update := map[string]interface{}{ - "frtaskIds": rtask.FrtaskIds, - } - if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil { - code = pb.ErrorCode_SystemError + //校验限定条件 + var ok bool + if code, ok = this.moduleRtask.modelRtask.checkHandle(session.GetUserId(), conf); !ok { + return } + // 没有设置选项,表示任务完成 + if len(conf.ChooseId) == 0 { + rtask.FrtaskIds = append(rtask.FrtaskIds, req.RtaskId) + + // 更新完成的任务 + update := map[string]interface{}{ + "frtaskIds": rtask.FrtaskIds, + } + if err := this.moduleRtask.modelRtask.Change(session.GetUserId(), update); err != nil { + code = pb.ErrorCode_SystemError + } + + // 发奖励 + code = this.moduleRtask.DispenseRes(session, conf.Reward, true) + } + + if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeDotask, &pb.RtaskApplyResp{ + RtaskId: req.RtaskId, + }); err != nil { + code = pb.ErrorCode_SystemError + } return } diff --git a/modules/rtask/api_list.go b/modules/rtask/api_list.go index 72ad5559a..6f524b051 100644 --- a/modules/rtask/api_list.go +++ b/modules/rtask/api_list.go @@ -13,10 +13,16 @@ func (this *apiComp) listCheck(session comm.IUserSession, req *pb.RtasklistReq) func (this *apiComp) list(session comm.IUserSession, req *pb.RtasklistReq) (code pb.ErrorCode, data proto.Message) { + // 获取当前玩家 + rtask := this.moduleRtask.modelRtask.GetRtask(session.GetUserId()) + if rtask == nil { + code = pb.ErrorCode_RtaskNoRtask + return + } - - - rsp := &pb.RtasklistResp{} + rsp := &pb.RtasklistResp{ + RtaskId: rtask.FrtaskIds, + } if err := session.SendMsg(string(this.moduleRtask.GetType()), RtaskSubTypeList, rsp); err != nil { code = pb.ErrorCode_SystemError return diff --git a/modules/rtask/config.go b/modules/rtask/config.go index 6ad02a0a8..a950e5a27 100644 --- a/modules/rtask/config.go +++ b/modules/rtask/config.go @@ -59,6 +59,22 @@ func (this *configureComp) getRtaskTypeCfg() (data *cfg.GameRdtaskCondi, err err return } +func (this *configureComp) getRtaskChoose() (data *cfg.GameRdtaskChoose, err error) { + var ( + v interface{} + ok bool + ) + if v, err = this.GetConfigure(gameRtaskChoose); err != nil { + return + } else { + if data, ok = v.(*cfg.GameRdtaskChoose); !ok { + err = fmt.Errorf("%T is *cfg.getRtaskChoose", v) + return + } + } + return +} + // 获取随机任务配置 func (this *configureComp) getRtaskList() (data []*cfg.GameRdtaskData, err error) { cfg, err := this.getRtaskCfg() @@ -71,6 +87,19 @@ func (this *configureComp) getRtaskList() (data []*cfg.GameRdtaskData, err error return } +// 获取选项配置 +func (this *configureComp) getRtaskChooseCfg(id int32) *cfg.GameRdtaskChooseData { + cfg, err := this.getRtaskChoose() + if err != nil { + return nil + } + + if data, ok := cfg.GetDataMap()[id]; ok { + return data + } + return nil +} + // 查询任务类型 func (this *configureComp) getRtaskTypeById(typeId int32) (data *cfg.GameRdtaskCondiData, err error) { cfg, err := this.getRtaskTypeCfg() diff --git a/modules/rtask/model_rtask.go b/modules/rtask/model_rtask.go index 35e5e867c..dd38fec6d 100644 --- a/modules/rtask/model_rtask.go +++ b/modules/rtask/model_rtask.go @@ -8,19 +8,23 @@ import ( "go_dreamfactory/modules" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/utils" + "github.com/spf13/cast" "go.mongodb.org/mongo-driver/mongo" ) type ModelRtask struct { modules.MCompModel moduleRtask *ModuleRtask + service core.IService } func (this *ModelRtask) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) { this.TableName = comm.TableRtask err = this.MCompModel.Init(service, module, comp, options) this.moduleRtask = module.(*ModuleRtask) + this.service = service return } @@ -46,63 +50,153 @@ func (this *ModelRtask) setNextTask(uid string, rtaskId int32) error { return this.Change(uid, update) } -func (this *ModelRtask) doRtaskHandle(uid string, param *pb.RtaskParam) (rtaskId int32, err error) { - log.Debugf("do rtask params: %v %v %v ", param.Param1, param.Param2, param.Param3) +// 做任务之前的校验 +func (this *ModelRtask) checkHandle(uid string, conf *cfg.GameRdtaskData) (code pb.ErrorCode, ok bool) { //查询玩家的 rtask := &pb.DBRtask{} - if err = this.Get(uid, rtask); err != nil { + if err := this.Get(uid, rtask); err != nil { + code = pb.ErrorCode_DBError return } - var taskId int32 - if len(rtask.FrtaskIds) == 0 { - conf := this.moduleRtask.configure.getFirstTask() - if conf != nil { - taskId = conf.NextTid + //判断前置任务状态 + if conf.PreTid != 0 { + if _, ok := utils.Findx(rtask.FrtaskIds, conf.PreTid); !ok { + code = pb.ErrorCode_RtaskPreNoFinish + return code, false } - } else { - //TODO } - if rtask, ok := this.moduleRtask.rtaskHandleMap[taskId]; ok { - for _, handle := range rtask.handlers { - if ok := handle.fn(handle.cfg, param); !ok { - log.Infof("uid: %v do rtask %v condition not", uid, taskId) - break - } - } - rtaskId = taskId + //验证限定条件 + for _, v := range conf.Condition { + this.checkCondi(uid, v) } return } +// 确定选项前的校验 +func (this *ModelRtask) checkCondi(uid string, condiId int32) (ok bool) { + //验证限定条件 + if condi, ok := this.moduleRtask.rtaskHandleMap[condiId]; ok { + if ok = condi.fn(uid, condi.cfg); !ok { + log.Infof("uid: %v do rtask %v condition not", uid, condiId) + } + } + return false +} + // 英雄指定 -func (this *ModelRtask) HeroTarget(cfg *cfg.GameRdtaskCondiData, tp *pb.RtaskParam) (ok bool) { - return cfg.Data1 == tp.Param1 +func (this *ModelRtask) HeroTarget(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool) { + heroModule, err := this.service.GetModule(comm.ModuleHero) + if err != nil { + return false + } + h := heroModule.(comm.IHero) + for _, v := range h.GetHeroList(uid) { + if cast.ToString(cfg.Data1) == v.HeroID { + return true + } + } + return false } // 指定英雄的等级 -func (this *ModelRtask) HeroLvTarget(cfg *cfg.GameRdtaskCondiData, tp *pb.RtaskParam) (ok bool) { - return cfg.Data1 == tp.Param1 && cfg.Data1 == tp.Param2 +func (this *ModelRtask) HeroLvTarget(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool) { + heroModule, err := this.service.GetModule(comm.ModuleHero) + if err != nil { + return false + } + h := heroModule.(comm.IHero) + var hero *pb.DBHero + for _, v := range h.GetHeroList(uid) { + if cast.ToString(cfg.Data1) == v.HeroID { + hero = v + } + } + if hero != nil { + return cast.ToString(cfg.Data1) == hero.HeroID && cfg.Data1 == hero.Lv + } + + return false } // 指定英雄的指定装备的数量 -func (this *ModelRtask) EquipNum(cfg *cfg.GameRdtaskCondiData, tp *pb.RtaskParam) (ok bool) { - return cfg.Data1 == tp.Param1 && cfg.Data2 == tp.Param2 && cfg.Data3 == tp.Param3 +func (this *ModelRtask) EquipNum(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool) { + heroModule, err := this.service.GetModule(comm.ModuleHero) + if err != nil { + return false + } + h := heroModule.(comm.IHero) + var hero *pb.DBHero + for _, v := range h.GetHeroList(uid) { + if cast.ToString(cfg.Data1) == v.HeroID { + hero = v + } + } + + var count int32 + if hero != nil { + // 验证装备 + _, ok := utils.Findx(hero.EquipID, cast.ToString(cfg.Data2)) + // 验证数量 + for _, v := range hero.EquipID { + if v != "0" { + count++ + } + } + return cast.ToString(cfg.Data1) == hero.HeroID && + ok && cfg.Data3 == count + } + + return false } // 剧情ID -func (this *ModelRtask) PoltId(cfg *cfg.GameRdtaskCondiData, tp *pb.RtaskParam) (ok bool) { - return cfg.Data1 == tp.Param1 +func (this *ModelRtask) PoltId(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool) { + //TODO + return false } // 每日任务 -func (this *ModelRtask) TaskDay(cfg *cfg.GameRdtaskCondiData, tp *pb.RtaskParam) (ok bool) { - return cfg.Data1 == tp.Param1 +func (this *ModelRtask) TaskDay(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool) { + taskModule, err := this.service.GetModule(comm.ModuleTask) + if err != nil { + return false + } + + itask := taskModule.(comm.ITask) + + if task := itask.GetTaskById(uid, cfg.Data1); task == nil { + return false + } else { + //任务完成 + if task.Status == 1 { + return true + } + } + + return false } // 指定英雄的星级 -func (this *ModelRtask) HeroStarTarget(cfg *cfg.GameRdtaskCondiData, tp *pb.RtaskParam) (ok bool) { - return cfg.Data1 == tp.Param1 && cfg.Data2 == tp.Param2 +func (this *ModelRtask) HeroStarTarget(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool) { + heroModule, err := this.service.GetModule(comm.ModuleHero) + if err != nil { + return false + } + h := heroModule.(comm.IHero) + + var hero *pb.DBHero + for _, v := range h.GetHeroList(uid) { + if cast.ToString(cfg.Data1) == v.HeroID { + hero = v + } + } + + if hero != nil { + return cast.ToString(cfg.Data1) == hero.HeroID && cfg.Data2 == hero.Star + } + + return false } diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 7a73a6dc9..f6a1f93c8 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -6,15 +6,14 @@ import ( "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" - "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" ) // 随机任务 -type rtask struct { - rtaskId int32 - handlers []*rtaskCondi -} +// type rtask struct { +// rtaskId int32 +// handlers []*rtaskCondi +// } // 限定条件 type rtaskCondi struct { @@ -23,7 +22,7 @@ type rtaskCondi struct { } // 设定返回值 -type rtaskHandle func(cfg *cfg.GameRdtaskCondiData, tp *pb.RtaskParam) (ok bool) +type rtaskHandle func(uid string, cfg *cfg.GameRdtaskCondiData) (ok bool) type ModuleRtask struct { modules.ModuleBase @@ -31,12 +30,12 @@ type ModuleRtask struct { api *apiComp configure *configureComp - rtaskHandleMap map[int32]*rtask // 任务处理器 + rtaskHandleMap map[int32]*rtaskCondi // 任务处理器 } func NewModule() core.IModule { return &ModuleRtask{ - rtaskHandleMap: make(map[int32]*rtask), + rtaskHandleMap: make(map[int32]*rtaskCondi), } } @@ -57,82 +56,131 @@ func (this *ModuleRtask) OnInstallComp() { this.configure = this.RegisterComp(new(configureComp)).(*configureComp) } -func (this *ModuleRtask) register(rtaskId int32, rtask *rtask) { - if _, ok := this.rtaskHandleMap[rtaskId]; !ok { - this.rtaskHandleMap[rtaskId] = rtask +func (this *ModuleRtask) register(condiId int32, rtask *rtaskCondi) { + if _, ok := this.rtaskHandleMap[condiId]; !ok { + this.rtaskHandleMap[condiId] = rtask } } func (this *ModuleRtask) initRtaskHandle() { - if data, err := this.configure.getRtaskList(); err == nil { - for _, v := range data { - var handlers []*rtaskCondi - rtask := &rtask{ - rtaskId: v.Id, - handlers: handlers, - } + conf, err := this.configure.getRtaskTypeCfg() + if err != nil { + return + } - //遍历任务的限定条件 - for _, rtaskTypeId := range v.Condition { - // 获取每个限定条件配置 - if typeCfg, err2 := this.configure.getRtaskTypeById(rtaskTypeId); err2 == nil { - if typeCfg != nil { - switch comm.TaskType(typeCfg.GetTypeId()) { - case comm.RtaskTypeHeroTarget: - handlers = append(handlers, &rtaskCondi{ - cfg: typeCfg, - fn: this.modelRtask.HeroTarget, - }) - case comm.RtaskTypeHeroLvTarget: - handlers = append(handlers, &rtaskCondi{ - cfg: typeCfg, - fn: this.modelRtask.HeroLvTarget, - }) - case comm.RtaskTypeHeroStarTarget: - handlers = append(handlers, &rtaskCondi{ - cfg: typeCfg, - fn: this.modelRtask.HeroStarTarget, - }) - case comm.RtaskTypeEquipNum: - handlers = append(handlers, &rtaskCondi{ - cfg: typeCfg, - fn: this.modelRtask.EquipNum, - }) - case comm.RtaskTypePoltId: - handlers = append(handlers, &rtaskCondi{ - cfg: typeCfg, - fn: this.modelRtask.PoltId, - }) - case comm.RtaskTypeTaskDay: - handlers = append(handlers, &rtaskCondi{ - cfg: typeCfg, - fn: this.modelRtask.TaskDay, - }) + for _, v := range conf.GetDataList() { + if typeCfg, err := this.configure.getRtaskTypeById(v.Id); err == nil { + if typeCfg != nil { + switch comm.TaskType(typeCfg.GetTypeId()) { + case comm.RtaskTypeHeroTarget: + this.register(v.Id, &rtaskCondi{ + cfg: typeCfg, + fn: this.modelRtask.HeroTarget, + }) + case comm.RtaskTypeHeroLvTarget: + this.register(v.Id, &rtaskCondi{ + cfg: typeCfg, + fn: this.modelRtask.HeroLvTarget, + }) + case comm.RtaskTypeHeroStarTarget: + this.register(v.Id, &rtaskCondi{ + cfg: typeCfg, + fn: this.modelRtask.HeroStarTarget, + }) - default: - log.Warnf("%v rtask type not configure", typeCfg.GetTypeId()) - } - } + case comm.RtaskTypeEquipNum: + this.register(v.Id, &rtaskCondi{ + cfg: typeCfg, + fn: this.modelRtask.EquipNum, + }) + + case comm.RtaskTypePoltId: + this.register(v.Id, &rtaskCondi{ + cfg: typeCfg, + fn: this.modelRtask.PoltId, + }) + + case comm.RtaskTypeTaskDay: + this.register(v.Id, &rtaskCondi{ + cfg: typeCfg, + fn: this.modelRtask.TaskDay, + }) + default: + log.Warnf("%v rtask type not configure", typeCfg.GetTypeId()) } } - - this.register(v.Id, rtask) - } } + + // if data, err := this.configure.getRtaskList(); err == nil { + // for _, v := range data { + // // var handlers []*rtaskCondi + // // rtask := &rtask{ + // // rtaskId: v.Id, + // // handlers: handlers, + // // } + + // //遍历任务的限定条件 + // for _, rtaskTypeId := range v.Condition { + // // 获取每个限定条件配置 + // if typeCfg, err2 := this.configure.getRtaskTypeById(rtaskTypeId); err2 == nil { + // if typeCfg != nil { + // switch comm.TaskType(typeCfg.GetTypeId()) { + // case comm.RtaskTypeHeroTarget: + // this.register(v.Id, &rtaskCondi{ + // cfg: typeCfg, + // fn: this.modelRtask.HeroTarget, + // }) + // case comm.RtaskTypeHeroLvTarget: + // handlers = append(handlers, &rtaskCondi{ + // cfg: typeCfg, + // fn: this.modelRtask.HeroLvTarget, + // }) + // case comm.RtaskTypeHeroStarTarget: + // handlers = append(handlers, &rtaskCondi{ + // cfg: typeCfg, + // fn: this.modelRtask.HeroStarTarget, + // }) + // case comm.RtaskTypeEquipNum: + // handlers = append(handlers, &rtaskCondi{ + // cfg: typeCfg, + // fn: this.modelRtask.EquipNum, + // }) + // case comm.RtaskTypePoltId: + // handlers = append(handlers, &rtaskCondi{ + // cfg: typeCfg, + // fn: this.modelRtask.PoltId, + // }) + // case comm.RtaskTypeTaskDay: + // handlers = append(handlers, &rtaskCondi{ + // cfg: typeCfg, + // fn: this.modelRtask.TaskDay, + // }) + + // default: + // log.Warnf("%v rtask type not configure", typeCfg.GetTypeId()) + // } + // } + // } + // } + + // this.register(v.Id, rtask) + + // } + // } } // 通知随机任务 -func (this *ModuleRtask) SendToRtask(session comm.IUserSession, param *pb.RtaskParam) (code pb.ErrorCode) { - if taskId, err := this.modelRtask.doRtaskHandle(session.GetUserId(), param); err != nil { - code = pb.ErrorCode_TaskHandle - } else { - if err := session.SendMsg(string(comm.ModuleRtask), "", &pb.RtaskFinishPush{ - RtaskId: taskId, - }); err != nil { - code = pb.ErrorCode_SystemError - } - } +// func (this *ModuleRtask) SendToRtask(session comm.IUserSession, param *pb.RtaskParam) (code pb.ErrorCode) { +// if taskId, err := this.modelRtask.doRtaskHandle(session.GetUserId(), param); err != nil { +// code = pb.ErrorCode_TaskHandle +// } else { +// if err := session.SendMsg(string(comm.ModuleRtask), "", &pb.RtaskFinishPush{ +// RtaskId: taskId, +// }); err != nil { +// code = pb.ErrorCode_SystemError +// } +// } - return -} +// return +// } diff --git a/modules/task/module.go b/modules/task/module.go index 9d79f922b..3c87adb7e 100644 --- a/modules/task/module.go +++ b/modules/task/module.go @@ -76,6 +76,21 @@ func (this *ModuleTask) resetActive(uid string, taskTag comm.TaskTag) { } } +// 获取玩家指定任务 +func (this *ModuleTask) GetTaskById(uid string, taskId int32) *pb.DBTask { + list := []*pb.DBTask{} + if err := this.modelTask.GetList(uid, &list); err != nil { + log.Errorf("GetTaskById err %v", err) + return nil + } + for _, v := range list { + if v.TaskId == taskId { + return v + } + } + return nil +} + //重置任务 func (this *ModuleTask) ResetTask(uid string, taskTag comm.TaskTag) { this.resetActive(uid, taskTag) @@ -123,6 +138,7 @@ func (this *ModuleTask) register(taskType comm.TaskType, fn taskHandle) { } } +// 初始任务事件处理类 func (this *ModuleTask) initTaskHandle() { if data, err := this.configure.getTaskList(); err == nil { for _, v := range data { diff --git a/pb/chat_db.pb.go b/pb/chat_db.pb.go index bbcb6d05e..615edd8c2 100644 --- a/pb/chat_db.pb.go +++ b/pb/chat_db.pb.go @@ -80,7 +80,7 @@ type DBChat struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //主键id + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID Channel ChatChannel `protobuf:"varint,2,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道 Suid string `protobuf:"bytes,3,opt,name=suid,proto3" json:"suid"` //发送用户id Slv int32 `protobuf:"varint,4,opt,name=slv,proto3" json:"slv"` //发送者等级 diff --git a/pb/errorcode.pb.go b/pb/errorcode.pb.go index 91a610d09..b2b299bab 100644 --- a/pb/errorcode.pb.go +++ b/pb/errorcode.pb.go @@ -151,10 +151,11 @@ const ( ErrorCode_GourmetMoreOrderTime ErrorCode = 2101 // 超过订单时长 ErrorCode_GourmetSkillMaxLv ErrorCode = 2102 // 技能已经达到满级 // rtask - ErrorCode_RtaskFinished ErrorCode = 2201 //任务已完成 - ErrorCode_RtaskUnFinished ErrorCode = 2202 //任务未完成 - ErrorCode_RtaskNoRtask ErrorCode = 2203 //任务未开启 - ErrorCode_RtaskRewarded ErrorCode = 2204 //已获取奖励 + ErrorCode_RtaskFinished ErrorCode = 2201 //任务已完成 + ErrorCode_RtaskUnFinished ErrorCode = 2202 //任务未完成 + ErrorCode_RtaskNoRtask ErrorCode = 2203 //任务未开启 + ErrorCode_RtaskRewarded ErrorCode = 2204 //已获取奖励 + ErrorCode_RtaskPreNoFinish ErrorCode = 2205 //前置未完成 ) // Enum value maps for ErrorCode. @@ -279,6 +280,7 @@ var ( 2202: "RtaskUnFinished", 2203: "RtaskNoRtask", 2204: "RtaskRewarded", + 2205: "RtaskPreNoFinish", } ErrorCode_value = map[string]int32{ "Success": 0, @@ -400,6 +402,7 @@ var ( "RtaskUnFinished": 2202, "RtaskNoRtask": 2203, "RtaskRewarded": 2204, + "RtaskPreNoFinish": 2205, } ) @@ -434,7 +437,7 @@ var File_errorcode_proto protoreflect.FileDescriptor var file_errorcode_proto_rawDesc = []byte{ 0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x2a, 0xfb, 0x13, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x6f, 0x2a, 0x92, 0x14, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12, 0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, @@ -593,8 +596,10 @@ var file_errorcode_proto_rawDesc = []byte{ 0x99, 0x11, 0x12, 0x14, 0x0a, 0x0f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x55, 0x6e, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0x9a, 0x11, 0x12, 0x11, 0x0a, 0x0c, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x10, 0x9b, 0x11, 0x12, 0x12, 0x0a, 0x0d, 0x52, - 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x65, 0x64, 0x10, 0x9c, 0x11, 0x42, - 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x65, 0x64, 0x10, 0x9c, 0x11, 0x12, + 0x15, 0x0a, 0x10, 0x52, 0x74, 0x61, 0x73, 0x6b, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x46, 0x69, 0x6e, + 0x69, 0x73, 0x68, 0x10, 0x9d, 0x11, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/pb/hero_db.pb.go b/pb/hero_db.pb.go index 1dd0f7d25..372b05636 100644 --- a/pb/hero_db.pb.go +++ b/pb/hero_db.pb.go @@ -151,7 +151,7 @@ type DBHero struct { IsOverlying bool `protobuf:"varint,23,opt,name=isOverlying,proto3" json:"isOverlying"` // go_tags(`bson:"isOverlying"`) 是否允许叠加 默认true EnergyProperty map[string]int32 `protobuf:"bytes,24,rep,name=energyProperty,proto3" json:"energyProperty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"energyProperty"` // JuexProperty map[string]int32 `protobuf:"bytes,25,rep,name=juexProperty,proto3" json:"juexProperty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3" bson:"juexProperty"` ////hp - Status HeroType `protobuf:"varint,26,opt,name=status,proto3,enum=HeroType" json:"status" bson:"heroType"` //状态 (1 练功) + Status HeroType `protobuf:"varint,26,opt,name=status,proto3,enum=HeroType" json:"status"` // 状态 (1 练功) } func (x *DBHero) Reset() {