From 4a86e8523f81360ecf3de149f5a64c8a39849609 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 24 May 2023 17:48:45 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=9D=9E=E5=9F=8B=E7=82=B9=E7=9A=84?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 6 ++---- modules/rtask/module.go | 14 +++++++++----- modules/rtask/verifyHandle.go | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/comm/const.go b/comm/const.go index 9fb93aa43..604d2d4b0 100644 --- a/comm/const.go +++ b/comm/const.go @@ -628,16 +628,14 @@ const ( Rtype152 TaskType = 152 //熊猫武馆解锁柱子 Rtype153 TaskType = 153 //商队交易x次 Rtype154 TaskType = 154 //狩猎副本掉落x个觉醒材料 - Rtype155 TaskType = 155 //调整助战英雄n次 + Rtype156 TaskType = 156 //完成工会任务n次 Rtype157 TaskType = 157 //战斗在xx系统中完成xx事件 Rtype158 TaskType = 158 //主线第X章关卡总星数达到N星 Rtype159 TaskType = 159 //主线第X章关卡全部达到三星 Rtype160 TaskType = 160 //主线总星数达到X星 Rtype161 TaskType = 161 //在自动战斗过程中完成另一场战斗 - Rtype162 TaskType = 162 //收藏X件攻击套装部件(激活一个套装部位+1) - Rtype163 TaskType = 163 //收藏X件防御套装部件(激活一个套装部位+1) - Rtype164 TaskType = 164 //收藏X件辅助套装部件(激活一个套装部位+1) + Rtype165 TaskType = 165 //铁匠铺收藏X件收藏品 Rtype166 TaskType = 166 //铁匠铺图鉴收藏总计达到X个 Rtype167 TaskType = 167 //铁匠铺收藏积分达到X分 diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 7ea72fb49..d1f0a9ef7 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -91,7 +91,6 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle handle := &rtaskCondHandle{ condId: v.Id, verify: this.modelRtask.verifyRtype3, - update: this.modelRtaskRecord.overrideUpdate, } handles = append(handles, handle) this.registerVerifyHandle(v.Id, handle) @@ -107,7 +106,6 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle handle := &rtaskCondHandle{ condId: v.Id, verify: this.modelRtask.verfiyRtype9, - update: this.modelRtaskRecord.overrideUpdate, } handles = append(handles, handle) this.registerVerifyHandle(v.Id, handle) @@ -125,8 +123,7 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle comm.Rtype128, comm.Rtype130, comm.Rtype131, comm.Rtype132, comm.Rtype135, comm.Rtype141, comm.Rtype142, comm.Rtype143, comm.Rtype144, comm.Rtype145, comm.Rtype146, comm.Rtype147, comm.Rtype148, comm.Rtype149, comm.Rtype152, comm.Rtype153, comm.Rtype154, - comm.Rtype155, comm.Rtype156, comm.Rtype161, comm.Rtype162, comm.Rtype163, comm.Rtype164, - comm.Rtype165, comm.Rtype166, comm.Rtype167, + comm.Rtype156, comm.Rtype161, comm.Rtype165, comm.Rtype166, comm.Rtype167, comm.Rtype171, comm.Rtype172, comm.Rtype173, comm.Rtype175, comm.Rtype177, comm.Rtype181, comm.Rtype182, comm.Rtype183, comm.Rtype184, comm.Rtype185, comm.Rtype186, comm.Rtype187: handle := &rtaskCondHandle{ @@ -148,7 +145,6 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle handle := &rtaskCondHandle{ condId: v.Id, verify: this.modelRtask.verifyRtype20, - update: this.modelRtaskRecord.overrideUpdate, } handles = append(handles, handle) @@ -162,6 +158,14 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle update: this.modelRtaskRecord.overrideUpdate, } + handles = append(handles, handle) + this.registerVerifyHandle(v.Id, handle) + case comm.Rtype138: + handle := &rtaskCondHandle{ + condId: v.Id, + verify: this.modelRtask.verifyRtype138, + } + handles = append(handles, handle) this.registerVerifyHandle(v.Id, handle) case comm.Rtype16, comm.Rtype17, diff --git a/modules/rtask/verifyHandle.go b/modules/rtask/verifyHandle.go index 70dd5a5b7..d10d64e3c 100644 --- a/modules/rtask/verifyHandle.go +++ b/modules/rtask/verifyHandle.go @@ -4,6 +4,7 @@ package rtask import ( "go_dreamfactory/comm" "go_dreamfactory/pb" + "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" "go_dreamfactory/utils" @@ -345,3 +346,20 @@ func (this *ModelRtask) verifyRtype63(uid string, record *pb.DBRtaskRecord, cfg return } + +// 记录玩家在线时间并记入进度 +func (this *ModelRtask) verifyRtype138(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { + userModule, err := this.service.GetModule(comm.ModuleUser) + if err != nil { + return + } + + if um, y := userModule.(comm.IUser); y { + if user := um.GetUser(uid); user != nil { + now := configure.Now().Unix() + l := (now - user.Logintime) / 60 + return soGreatEqual(int32(l), cfg.Data1) + } + } + return +} From 48c68c04fdc79e132c9c3214756eca43b8e568fa Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 24 May 2023 18:39:24 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=B8=96=E7=95=8C=E4=BB=BB=E5=8A=A1GM?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/worldtask/module.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/worldtask/module.go b/modules/worldtask/module.go index b374d3deb..038504d2c 100644 --- a/modules/worldtask/module.go +++ b/modules/worldtask/module.go @@ -160,6 +160,14 @@ func (this *Worldtask) BingoJumpTask(session comm.IUserSession, groupId, taskId this.Error("添加世界任务失败", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err}) return err } + } else if mytask.Uid == "" { + update := map[string]interface{}{ + "uid": uid, + } + if err := this.modelWorldtask.Change(uid, update); err != nil { + this.Error("更新世界任务失败", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err}) + return err + } } if _, ok := utils.Findx(mytask.TaskList, taskId); ok { From 1202958027207bd96bef70fbebc7fd475436812a Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 24 May 2023 18:46:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=9F=8B=E7=82=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/const.go | 4 ++++ comm/imodule.go | 7 ++---- modules/hero/api_awaken.go | 6 +++-- modules/hero/api_strengthenUpSkill.go | 2 ++ modules/hero/api_strengthenUpStar.go | 3 ++- modules/hero/api_talentlearn.go | 15 +++++++++++++ modules/hero/model_hero.go | 4 ++++ modules/hero/module.go | 7 +++--- modules/library/api_usegift.go | 7 +++++- modules/library/module.go | 32 --------------------------- modules/smithy/api_atlasactivate.go | 5 ++++- modules/smithy/api_rise.go | 2 +- 12 files changed, 47 insertions(+), 47 deletions(-) diff --git a/comm/const.go b/comm/const.go index 6fc628b87..93334f7bb 100644 --- a/comm/const.go +++ b/comm/const.go @@ -636,6 +636,10 @@ const ( Rtype160 TaskType = 160 //主线总星数达到X星 Rtype161 TaskType = 161 //在自动战斗过程中完成另一场战斗 + Rtype165 TaskType = 165 //铁匠铺收藏X件收藏品 + Rtype166 TaskType = 166 //铁匠铺图鉴收藏总计达到X个 + Rtype167 TaskType = 167 //铁匠铺收藏积分达到X分 + Rtype168 TaskType = 168 //完成功夫大师挑战塔第X层 Rtype169 TaskType = 169 //触发指定套装的套装效果 Rtype170 TaskType = 170 //获得指定材料X个 diff --git a/comm/imodule.go b/comm/imodule.go index e13c8592f..4450fd571 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -65,7 +65,7 @@ type ( //英雄 IHero interface { //查询用户卡片数量 - QueryHeroAmount(uId string, heroCfgId string) (amount uint32) + QueryHeroByConfId(uId string, heroCfgId string) (hero *pb.DBHero) // 批量创建英雄 CreateRepeatHeros(session IUserSession, heros map[string]int32, bPush bool) (hero *pb.DBHero, atno []*pb.UserAtno, code pb.ErrorCode) @@ -422,10 +422,7 @@ type ( IReddot } ILibrary interface { - //与N个英雄好感度等级达到A - CheckRtype132(uid string, num int32, lv int32) bool - //与指定英雄好感度等级达到N - CheckRtype133(uid string, heroId string, lv int32) bool + // 任务完成通知 TaskFinishNotify(uid string, taskId, fetterId int32) error } diff --git a/modules/hero/api_awaken.go b/modules/hero/api_awaken.go index 5cacfaa04..65d776515 100644 --- a/modules/hero/api_awaken.go +++ b/modules/hero/api_awaken.go @@ -101,9 +101,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c } var szTask []*comm.TaskParam szTask = append(szTask, comm.GettaskParam(comm.Rtype34, 1, _hero.JuexingLv)) - szTask = append(szTask, comm.GettaskParam(comm.Rtype119, _hero.JuexingLv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype119, _hero.JuexingLv, utils.ToInt32(_hero.HeroID))) szTask = append(szTask, comm.GettaskParam(comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID))) - + szTask = append(szTask, comm.GettaskParam(comm.Rtype118, _hero.Lv, _hero.JuexingLv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype120, _hero.JuexingLv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype122, _hero.JuexingLv, _hero.Star)) cfg := this.module.configure.GetHeroConfig(_hero.HeroID) if cfg != nil { szTask = append(szTask, comm.GettaskParam(comm.Rtype121, cfg.Race, utils.ToInt32(_hero.HeroID), _hero.JuexingLv)) diff --git a/modules/hero/api_strengthenUpSkill.go b/modules/hero/api_strengthenUpSkill.go index 79a4a89eb..1f433159a 100644 --- a/modules/hero/api_strengthenUpSkill.go +++ b/modules/hero/api_strengthenUpSkill.go @@ -137,7 +137,9 @@ func (this *apiComp) StrengthenUpSkill(session comm.IUserSession, req *pb.HeroSt if cfg := this.module.configure.GetHeroConfig(_hero.HeroID); cfg != nil { szTask = append(szTask, comm.GettaskParam(comm.Rtype55, 1, cfg.Color)) szTask = append(szTask, comm.GettaskParam(comm.Rtype56, 1, 1, cfg.Job)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype116, lvUpCount, cfg.Race)) } + szTask = append(szTask, comm.GettaskParam(comm.Rtype117, lvUpCount, utils.ToInt32(_hero.HeroID))) go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) return } diff --git a/modules/hero/api_strengthenUpStar.go b/modules/hero/api_strengthenUpStar.go index 6e80cb690..3ba68a930 100644 --- a/modules/hero/api_strengthenUpStar.go +++ b/modules/hero/api_strengthenUpStar.go @@ -95,7 +95,8 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr } else if _hero.Star == 6 { szTask = append(szTask, comm.GettaskParam(comm.Rtype28, 1)) } - szTask = append(szTask, comm.GettaskParam(comm.Rtype115, utils.ToInt32(_hero.HeroID), _hero.Star)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype114, _hero.Star, utils.ToInt32(_hero.HeroID))) + szTask = append(szTask, comm.GettaskParam(comm.Rtype115, 1, _hero.Star)) go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) return } diff --git a/modules/hero/api_talentlearn.go b/modules/hero/api_talentlearn.go index 343a97b22..15288fcc1 100644 --- a/modules/hero/api_talentlearn.go +++ b/modules/hero/api_talentlearn.go @@ -4,6 +4,7 @@ import ( "go_dreamfactory/comm" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/utils" ) //参数校验 @@ -134,5 +135,19 @@ func (this *apiComp) TalentLearn(session comm.IUserSession, req *pb.HeroTalentLe Telnet: talent, TalentID: req.TalentID, // 返回刚学习过的天赋ID }) + var szTask []*comm.TaskParam + // 查询英雄相关信息 + if heroObj := this.module.QueryHeroByConfId(session.GetUserId(), talent.HeroId); heroObj != nil { + szTask = append(szTask, comm.GettaskParam(comm.Rtype123, 1, heroObj.Lv, heroObj.Star)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype124, 1)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype125, 1, utils.ToInt32(heroObj.HeroID))) + if cfg := this.module.configure.GetHeroConfig(heroObj.HeroID); cfg != nil { + szTask = append(szTask, comm.GettaskParam(comm.Rtype126, 1, cfg.Race)) + } + szTask = append(szTask, comm.GettaskParam(comm.Rtype127, 1, heroObj.Star)) + + go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) + } + return } diff --git a/modules/hero/model_hero.go b/modules/hero/model_hero.go index 2bf92171d..5bd6350f1 100644 --- a/modules/hero/model_hero.go +++ b/modules/hero/model_hero.go @@ -603,7 +603,11 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex } } } + szTask = append(szTask, comm.GettaskParam(comm.Rtype111, 1, hero.Lv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype112, 1, hero.Lv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype113, hero.Lv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype33, 1, 1, hero.Lv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype118, hero.Lv, hero.JuexingLv)) go this.moduleHero.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) //this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype33, 1, 1, hero.Lv) } diff --git a/modules/hero/module.go b/modules/hero/module.go index f1db05e35..b0aabd167 100644 --- a/modules/hero/module.go +++ b/modules/hero/module.go @@ -182,15 +182,14 @@ func (this *Hero) GetHeroList(uid string) []*pb.DBHero { return this.modelHero.getHeroList(uid) } -// 查询英雄数量 -func (this *Hero) QueryHeroAmount(uId string, heroCfgId string) (amount uint32) { +func (this *Hero) QueryHeroByConfId(uId string, heroCfgId string) (hero *pb.DBHero) { heroes := this.GetHeroList(uId) for _, v := range heroes { if v.HeroID == heroCfgId { - amount++ + return v } } - return amount + return nil } // 删除指定卡牌 diff --git a/modules/library/api_usegift.go b/modules/library/api_usegift.go index b2fa46fbe..821deecb6 100644 --- a/modules/library/api_usegift.go +++ b/modules/library/api_usegift.go @@ -157,8 +157,13 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe }) } } + var szTask []*comm.TaskParam + szTask = append(szTask, comm.GettaskParam(comm.Rtype132, 1, _heroObj.Favorlv)) + szTask = append(szTask, comm.GettaskParam(comm.Rtype133, _heroObj.Favorlv, utils.ToInt32(_heroObj.Heroid))) + szTask = append(szTask, comm.GettaskParam(comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv)) + go this.module.ModuleRtask.TriggerTask(session.GetUserId(), szTask...) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv) - go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv)) + //go this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype134, utils.ToInt32(_heroObj.Heroid), upLv)) } return diff --git a/modules/library/module.go b/modules/library/module.go index 7dfee587f..cfced6ed8 100644 --- a/modules/library/module.go +++ b/modules/library/module.go @@ -252,38 +252,6 @@ func (this *Library) Rpc_ModuleFetter(ctx context.Context, args *pb.RPCGeneralRe return } -//与N个英雄好感度等级达到A -func (this *Library) CheckRtype132(uid string, num int32, lv int32) bool { - fetter := this.GetHeroFetterList(uid) - if len(fetter) == 0 { - return false - } - for _, v := range fetter { - if v.Favorlv >= lv { - num-- - } - } - if num >= 0 { - return true - } - return false -} - -//与指定英雄好感度等级达到N -func (this *Library) CheckRtype133(uid string, heroId string, lv int32) bool { - fetter := this.GetHeroFetterList(uid) - if len(fetter) == 0 { - return false - } - for _, v := range fetter { - if v.Heroid == heroId && v.Favorlv >= lv { - return true - } - } - - return false -} - func (this *Library) TaskFinishNotify(uid string, taskId, fetterId int32) error { ft := this.modelFetterstory.getFetterTasks(uid, fetterId) if ft == nil { diff --git a/modules/smithy/api_atlasactivate.go b/modules/smithy/api_atlasactivate.go index e53d2d3e6..2d5b58747 100644 --- a/modules/smithy/api_atlasactivate.go +++ b/modules/smithy/api_atlasactivate.go @@ -59,6 +59,7 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla code = pb.ErrorCode_SmithyNoFoundAtlas return } + this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype166, 1)) } else if conf.TypeId == 2 { if v, ok := atlas.Collect[req.Id]; ok { if !v.Activate { // 激活 @@ -74,8 +75,10 @@ func (this *apiComp) AtlasActivate(session comm.IUserSession, req *pb.SmithyAtla code = pb.ErrorCode_SmithyNoFoundAtlas return } - } + this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype165, 1)) + } + this.module.ModuleRtask.TriggerTask(session.GetUserId(), comm.GettaskParam(comm.Rtype167, atlas.Score)) session.SendMsg(string(this.module.GetType()), "atlasactivate", &pb.SmithyAtlasActivateResp{Data: atlas}) return } diff --git a/modules/smithy/api_rise.go b/modules/smithy/api_rise.go index ced8cf39c..e54ad591e 100644 --- a/modules/smithy/api_rise.go +++ b/modules/smithy/api_rise.go @@ -61,7 +61,7 @@ func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (cod this.module.modelStove.updateSmithyStove(session.GetUserId(), update) session.SendMsg(string(this.module.GetType()), "rise", &pb.SmithyRiseResp{Data: stove}) tasks := make([]*comm.TaskParam, 0) - tasks = append(tasks, comm.GettaskParam(comm.Rtype171, stove.Temperature)) + tasks = append(tasks, comm.GettaskParam(comm.Rtype175, stove.Temperature)) this.module.ModuleRtask.TriggerTask(session.GetUserId(), tasks...) }