From 4a86e8523f81360ecf3de149f5a64c8a39849609 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 24 May 2023 17:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=9E=E5=9F=8B=E7=82=B9=E7=9A=84=E4=BB=BB?= =?UTF-8?q?=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 +}