diff --git a/comm/imodule.go b/comm/imodule.go index a838e4e6e..4d8258272 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -454,6 +454,7 @@ type ( // 任务完成通知 TaskFinishNotify(uid string, taskId, fetterId int32) error IGetReddot + GMCreateFavorability(uid string) } // 个人成长任务 IGrowtask interface { diff --git a/modules/gm/module.go b/modules/gm/module.go index 9f9f1b1f2..72d5084a6 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -703,6 +703,22 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er module1.(comm.IGourmet).GMCreateAltas(session.GetUserId()) + this.Debug("使用bingo命令:uid = %s ", + log.Field{Key: "uid", Value: session.GetUserId()}, + log.Field{Key: "0", Value: datas[0]}, + ) + } else if len(datas) == 1 && (datas[0] == "library") { + var ( + err error + ) + + module1, err := this.service.GetModule(comm.ModuleLibrary) + if err != nil { + return + } + + module1.(comm.ILibrary).GMCreateFavorability(session.GetUserId()) + this.Debug("使用bingo命令:uid = %s ", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "0", Value: datas[0]}, diff --git a/modules/library/module.go b/modules/library/module.go index 039fd5c33..8bc40249f 100644 --- a/modules/library/module.go +++ b/modules/library/module.go @@ -343,3 +343,24 @@ func (this *Library) AddHerosFetterData(uid string, heroConfIds []string) (errda return } + +func (this *Library) GMCreateFavorability(uid string) { + fetter := this.GetHeroFetterList(uid) + update := map[string]interface{}{} + for _, v := range fetter { + + if conf, er := this.configure.GetFavorabilityExp(v.Heroid); er == nil { + // 达到最大等级不让继续升级 + v.Favorlv = int32(len(conf)) + v.Favorexp = 0 + update["favorlv"] = v.Favorlv + update["favorexp"] = v.Favorexp + + if err := this.modelFetter.ChangeList(uid, v.Id, update); err != nil { + this.Errorf("modelFetter ChangeList error: %v", err) + } + } + } + + return +}