From 8ab33ef3c5fd2dada9aceeb3f50ceba08a899aea Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Wed, 23 Nov 2022 13:33:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=BB=E5=8A=A1=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E8=AE=A1=E7=AE=97=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/rtask/condiFindHandle.go | 1 + modules/rtask/module.go | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/modules/rtask/condiFindHandle.go b/modules/rtask/condiFindHandle.go index 8e2c784e8..839b41426 100644 --- a/modules/rtask/condiFindHandle.go +++ b/modules/rtask/condiFindHandle.go @@ -25,6 +25,7 @@ func (this *ModelRtaskRecord) greatEqualFirstParam(cfg *cfg.GameRdtaskCondiData, return } +// 传递参数小于等于配置参数 func (this *ModelRtaskRecord) lessEqualFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) { if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok { err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals) diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 05d9ec5e0..d6559ad5e 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -162,8 +162,15 @@ func (this *ModuleRtask) initRtaskVerifyHandle() { verify: this.modelRtaskRecord.verifyFirstGreatEqualParam, update: this.modelRtaskRecord.overrideUpdate, }) + case comm.Rtype18: + this.registerVerifyHandle(v.Id, &rtaskCondi{ + cfg: typeCfg, + find: this.modelRtaskRecord.greatEqualFirstParam, + verify: this.modelRtaskRecord.verifyFirstGreatEqualParam, + update: this.modelRtaskRecord.addUpdate, + }) case comm.Rtype7, comm.Rtype12, comm.Rtype13, comm.Rtype14, comm.Rtype15, - comm.Rtype18, comm.Rtype19, comm.Rtype21, comm.Rtype24, + comm.Rtype19, comm.Rtype21, comm.Rtype24, comm.Rtype26, comm.Rtype27, comm.Rtype28, comm.Rtype38, comm.Rtype39, comm.Rtype50, comm.Rtype51, comm.Rtype53, comm.Rtype54, comm.Rtype57, comm.Rtype58, comm.Rtype60, @@ -317,7 +324,16 @@ func (this *ModuleRtask) CheckCondi(uid string, condiId int32) (code pb.ErrorCod return } +func (this *ModuleRtask) RemoveCondi(uid string, condiId int32) (err error) { + dr := this.modelRtaskRecord.getRecord(uid) + if dr != nil && dr.Vals != nil { + delete(dr.Vals, condiId) + } + return +} + // 初始化任务条件数据 +// Deprecated func (this *ModuleRtask) InitCondiData(uid string) error { return this.modelRtaskRecord.initCondiData(uid) }