This commit is contained in:
liwei1dao 2023-05-24 17:45:27 +08:00
commit 8bc2b5ed00
6 changed files with 69 additions and 393 deletions

View File

@ -639,7 +639,12 @@ const (
Rtype159 TaskType = 159 //主线第X章关卡全部达到三星 Rtype159 TaskType = 159 //主线第X章关卡全部达到三星
Rtype160 TaskType = 160 //主线总星数达到X星 Rtype160 TaskType = 160 //主线总星数达到X星
Rtype161 TaskType = 161 //在自动战斗过程中完成另一场战斗 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分
Rtype168 TaskType = 168 //完成功夫大师挑战塔第X层 Rtype168 TaskType = 168 //完成功夫大师挑战塔第X层
Rtype169 TaskType = 169 //触发指定套装的套装效果 Rtype169 TaskType = 169 //触发指定套装的套装效果
Rtype170 TaskType = 170 //获得指定材料X个 Rtype170 TaskType = 170 //获得指定材料X个

View File

@ -584,7 +584,7 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex
if curLv-preLv > 0 { // 升级了 统计任务 if curLv-preLv > 0 { // 升级了 统计任务
var szTask []*comm.TaskParam var szTask []*comm.TaskParam
szTask = append(szTask, comm.GettaskParam(comm.Rtype147, utils.ToInt32(hero.HeroID), curLv-preLv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype147, utils.ToInt32(hero.HeroID), curLv-preLv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype113, utils.ToInt32(hero.HeroID), curLv-preLv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype113, curLv-preLv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype4, hero.Lv, utils.ToInt32(hero.HeroID))) szTask = append(szTask, comm.GettaskParam(comm.Rtype4, hero.Lv, utils.ToInt32(hero.HeroID)))
szTask = append(szTask, comm.GettaskParam(comm.Rtype23, 1, hero.Star, hero.Lv)) szTask = append(szTask, comm.GettaskParam(comm.Rtype23, 1, hero.Star, hero.Lv))
szTask = append(szTask, comm.GettaskParam(comm.Rtype24, 1)) szTask = append(szTask, comm.GettaskParam(comm.Rtype24, 1))

View File

@ -17,7 +17,6 @@ func (this *apiComp) Rtest(session comm.IUserSession, req *pb.RtaskTestReq) (cod
if req.CondiId != 0 { if req.CondiId != 0 {
if code = this.moduleRtask.CheckCondi(session.GetUserId(), req.CondiId); code != pb.ErrorCode_Success { if code = this.moduleRtask.CheckCondi(session.GetUserId(), req.CondiId); code != pb.ErrorCode_Success {
rsp.Flag = false rsp.Flag = false
return
} }
} else if req.GroupId != 0 { } else if req.GroupId != 0 {
// 获取当前玩家 // 获取当前玩家

View File

@ -1,286 +0,0 @@
package rtask
import (
cfg "go_dreamfactory/sys/configure/structs"
"github.com/pkg/errors"
)
func (this *ModelRtaskRecord) equalFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) {
//只查询参数于配置相等的情况下设置condiId否则返回0
if ok, err1 := soEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
condiId = cfg.Id
return
}
func (this *ModelRtaskRecord) greatEqualFirstParam(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) {
if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
condiId = cfg.Id
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)
return
}
condiId = cfg.Id
return
}
// 与每个参数比较
func (this *ModelRtaskRecord) equalParams(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) {
var (
paramLen int
)
if paramLen, err = lenParam(cfg, vals...); err != nil {
return
}
switch paramLen {
case 1:
if ok, err1 := soEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 2:
if ok, err1 := soEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 3:
if ok, err1 := soEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 4:
if ok, err1 := soEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[3], cfg.Data4); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 5:
if ok, err1 := soEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[3], cfg.Data4); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soEqual(vals[4], cfg.Data5); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
default:
return
}
condiId = cfg.Id
return
}
func (this *ModelRtaskRecord) greatThanParams(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) {
var (
paramLen int
)
if paramLen, err = lenParam(cfg, vals...); err != nil {
return
}
switch paramLen {
case 1:
if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 2:
if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 3:
if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 4:
if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[3], cfg.Data4); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 5:
if ok, err1 := soGreatEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[3], cfg.Data4); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[4], cfg.Data5); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
default:
return
}
condiId = cfg.Id
return
}
// 需要累加更新的查询
func (this *ModelRtaskRecord) lessThanParams(cfg *cfg.GameRdtaskCondiData, vals ...int32) (condiId int32, err error) {
var (
paramLen int
)
if paramLen, err = lenParam(cfg, vals...); err != nil {
return
}
switch paramLen {
case 1:
if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 2:
if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 3:
if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 4:
if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[3], cfg.Data4); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
case 5:
if ok, err1 := soLessEqual(vals[0], cfg.Data1); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[1], cfg.Data2); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[2], cfg.Data3); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[3], cfg.Data4); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
if ok, err1 := soGreatEqual(vals[4], cfg.Data5); !ok {
err = errors.WithMessagef(err1, "id: %v type:%v vals:%v", cfg.Id, cfg.Type, vals)
return
}
default:
return
}
condiId = cfg.Id
return
}

View File

@ -26,12 +26,13 @@ var _ comm.IRtask = (*ModuleRtask)(nil)
type rtaskCondHandle struct { type rtaskCondHandle struct {
condId int32 //任务条件配置ID condId int32 //任务条件配置ID
verify verifyHandle //校验任务条件 verify verifyHandle //校验任务条件
find condiFindHandle //检索任务条件
update updateDataHandle //更新任务数据 update updateDataHandle //更新任务数据
} }
// 任务参数校验
type verifyHandle func(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (bool, error) type verifyHandle func(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (bool, error)
type condiFindHandle func(cfg *cfg.GameRdtaskCondiData, vals ...int32) (int32, error)
// 任务数据更新
type updateDataHandle func(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData, vals ...int32) error type updateDataHandle func(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData, vals ...int32) error
type ModuleRtask struct { type ModuleRtask struct {
@ -75,164 +76,120 @@ func (this *ModuleRtask) registerVerifyHandle(condiId int32, condi *rtaskCondHan
this.handleMap.Store(condiId, condi) this.handleMap.Store(condiId, condi)
} }
func (this *ModuleRtask) getHandle(tt comm.TaskType) (condis []*rtaskCondHandle) { func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle) {
for _, v := range this.configure.getRtaskCondis(int32(tt)) { for _, v := range this.configure.getRtaskCondis(int32(tt)) {
switch tt { switch tt {
case comm.Rtype1: case comm.Rtype1:
condi := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam, verify: this.modelRtaskRecord.verifyGreatEqual,
verify: this.modelRtaskRecord.verifyFromDb,
update: this.modelRtaskRecord.addUpdate, update: this.modelRtaskRecord.addUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype3: case comm.Rtype3:
condi := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype3, verify: this.modelRtask.verifyRtype3,
update: this.modelRtaskRecord.overrideUpdate, update: this.modelRtaskRecord.overrideUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype4: case comm.Rtype4, comm.Rtype5, comm.Rtype6, comm.Rtype8, comm.Rtype10:
condi := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam, verify: this.modelRtaskRecord.verifyGreatEqual,
verify: this.modelRtask.verifyRtype4,
update: this.modelRtaskRecord.overrideUpdate, update: this.modelRtaskRecord.overrideUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype5:
condi := &rtaskCondHandle{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype5,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype6:
condi := &rtaskCondHandle{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype6,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype8:
condi := &rtaskCondHandle{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verfiyRtype8,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype9: case comm.Rtype9:
condi := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verfiyRtype9, verify: this.modelRtask.verfiyRtype9,
update: this.modelRtaskRecord.overrideUpdate, update: this.modelRtaskRecord.overrideUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype10:
condi := &rtaskCondHandle{
condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verfiyRtype10,
update: this.modelRtaskRecord.overrideUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype18:
condi := &rtaskCondHandle{
condId: v.Id,
find: this.modelRtaskRecord.greatEqualFirstParam,
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
update: this.modelRtaskRecord.addUpdate,
}
condis = append(condis, condi)
this.registerVerifyHandle(v.Id, condi)
case comm.Rtype7, comm.Rtype12, comm.Rtype13, comm.Rtype14, comm.Rtype15, case comm.Rtype7, comm.Rtype12, comm.Rtype13, comm.Rtype14, comm.Rtype15,
comm.Rtype19, comm.Rtype21, comm.Rtype24, comm.Rtype18, comm.Rtype19, comm.Rtype24,
comm.Rtype26, comm.Rtype27, comm.Rtype28, comm.Rtype38, comm.Rtype26, comm.Rtype27, comm.Rtype28, comm.Rtype38,
comm.Rtype39, comm.Rtype51, comm.Rtype53, comm.Rtype39, comm.Rtype51, comm.Rtype53,
comm.Rtype54, comm.Rtype57, comm.Rtype60, comm.Rtype54, comm.Rtype57, comm.Rtype60,
comm.Rtype62, comm.Rtype64, comm.Rtype88, comm.Rtype104, comm.Rtype62, comm.Rtype64, comm.Rtype87, comm.Rtype88, comm.Rtype89, comm.Rtype90,
comm.Rtype96, comm.Rtype105, comm.Rtype128, comm.Rtype130, comm.Rtype131, comm.Rtype91, comm.Rtype92, comm.Rtype94, comm.Rtype95, comm.Rtype97, comm.Rtype104,
comm.Rtype96, comm.Rtype98, comm.Rtype99, comm.Rtype102, comm.Rtype103, comm.Rtype105,
comm.Rtype106, comm.Rtype108, comm.Rtype113, comm.Rtype114, comm.Rtype115, comm.Rtype116,
comm.Rtype117, comm.Rtype118, comm.Rtype119, comm.Rtype120, comm.Rtype121, comm.Rtype123,
comm.Rtype128, comm.Rtype130, comm.Rtype131, comm.Rtype132, comm.Rtype135,
comm.Rtype141, comm.Rtype142, comm.Rtype143, comm.Rtype144, comm.Rtype145, comm.Rtype146, comm.Rtype141, comm.Rtype142, comm.Rtype143, comm.Rtype144, comm.Rtype145, comm.Rtype146,
comm.Rtype147, comm.Rtype149, comm.Rtype153, comm.Rtype154, comm.Rtype155, comm.Rtype156, comm.Rtype147, comm.Rtype148, comm.Rtype149, comm.Rtype152, comm.Rtype153, comm.Rtype154,
comm.Rtype171, comm.Rtype186, comm.Rtype187: comm.Rtype155, comm.Rtype156, comm.Rtype161, comm.Rtype162, comm.Rtype163, comm.Rtype164,
condi := &rtaskCondHandle{ 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{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.lessEqualFirstParam,
verify: this.modelRtaskRecord.verifyFirstGreatEqualParam, verify: this.modelRtaskRecord.verifyFirstGreatEqualParam,
update: this.modelRtaskRecord.addUpdate, update: this.modelRtaskRecord.addUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype50, comm.Rtype73: case comm.Rtype50, comm.Rtype73:
condi := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.lessEqualFirstParam, verify: this.modelRtaskRecord.verifyGreatEqual,
verify: this.modelRtaskRecord.verifyFromDb,
update: this.modelRtaskRecord.addUpdate, update: this.modelRtaskRecord.addUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype20: case comm.Rtype20:
condi := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtask.verifyRtype20, verify: this.modelRtask.verifyRtype20,
update: this.modelRtaskRecord.overrideUpdate, update: this.modelRtaskRecord.overrideUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype109: case comm.Rtype109, comm.Rtype122, comm.Rtype124, comm.Rtype125, comm.Rtype126,
condi := &rtaskCondHandle{ comm.Rtype127, comm.Rtype129, comm.Rtype133, comm.Rtype134, comm.Rtype158,
comm.Rtype159, comm.Rtype160:
handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.equalFirstParam,
verify: this.modelRtaskRecord.verifyFirstEqualParam, verify: this.modelRtaskRecord.verifyFirstEqualParam,
update: this.modelRtaskRecord.overrideUpdate, update: this.modelRtaskRecord.overrideUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype16, comm.Rtype17, case comm.Rtype16, comm.Rtype17,
comm.Rtype35, comm.Rtype61: comm.Rtype35, comm.Rtype61:
condi := &rtaskCondHandle{ handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.equalParams, verify: this.modelRtaskRecord.verifyGreatEqual,
verify: this.modelRtaskRecord.verifyFromDb,
update: this.modelRtaskRecord.overrideUpdate, update: this.modelRtaskRecord.overrideUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
case comm.Rtype23, comm.Rtype25, comm.Rtype30, case comm.Rtype23, comm.Rtype25, comm.Rtype30,
comm.Rtype32, comm.Rtype33, comm.Rtype34, comm.Rtype36, comm.Rtype32, comm.Rtype33, comm.Rtype34, comm.Rtype36,
comm.Rtype37, comm.Rtype40, comm.Rtype41, comm.Rtype37, comm.Rtype40, comm.Rtype41,
comm.Rtype42, comm.Rtype43, comm.Rtype42, comm.Rtype43,
comm.Rtype46, comm.Rtype47, comm.Rtype46, comm.Rtype47,
comm.Rtype52, comm.Rtype55, comm.Rtype56, comm.Rtype52, comm.Rtype55, comm.Rtype56,
comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68, comm.Rtype70, comm.Rtype140: comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68, comm.Rtype70, comm.Rtype140,
condi := &rtaskCondHandle{ comm.Rtype168, comm.Rtype169, comm.Rtype170, comm.Rtype174, comm.Rtype179, comm.Rtype180:
handle := &rtaskCondHandle{
condId: v.Id, condId: v.Id,
find: this.modelRtaskRecord.lessThanParams, verify: this.modelRtaskRecord.verifyGreatEqual,
verify: this.modelRtaskRecord.verifyFromDb,
update: this.modelRtaskRecord.addUpdate, update: this.modelRtaskRecord.addUpdate,
} }
condis = append(condis, condi) handles = append(handles, handle)
this.registerVerifyHandle(v.Id, condi) this.registerVerifyHandle(v.Id, handle)
default: default:
log.Warnf("rtaskType[%v] not register", tt) log.Warnf("rtaskType[%v] handle not register", tt)
} }
} }
return return

View File

@ -11,7 +11,8 @@ import (
"github.com/spf13/cast" "github.com/spf13/cast"
) )
func (this *ModelRtaskRecord) verifyFromDb(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { // GreatEqual
func (this *ModelRtaskRecord) verifyGreatEqual(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
if record == nil { if record == nil {
err = errors.WithMessagef(err, "玩家数据DBRtaskRecord空") err = errors.WithMessagef(err, "玩家数据DBRtaskRecord空")
return return
@ -278,7 +279,7 @@ func (this *ModelRtask) verfiyRtype8(uid string, record *pb.DBRtaskRecord, cfg *
return return
} }
// 连续登陆xx天 // 连续登陆xx天 未埋点的处理方法
func (this *ModelRtask) verfiyRtype9(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) { func (this *ModelRtask) verfiyRtype9(uid string, record *pb.DBRtaskRecord, cfg *cfg.GameRdtaskCondiData) (ok bool, err error) {
userModule, err := this.service.GetModule(comm.ModuleUser) userModule, err := this.service.GetModule(comm.ModuleUser)
if err != nil { if err != nil {