update worldtask gm

This commit is contained in:
wh_zcy 2023-05-29 16:14:21 +08:00
parent 982697ea1c
commit afcbd2c766
4 changed files with 28 additions and 30 deletions

View File

@ -6261,7 +6261,7 @@
"type_sp": 1,
"tasktxt": {
"key": "taskcond_rdtask_condi_tasktxt_369",
"text": "强化武器+3引导自动强化"
"text": "强化任意装备3次"
},
"type": 92,
"valid": 0,
@ -6295,7 +6295,7 @@
"type_sp": 1,
"tasktxt": {
"key": "taskcond_rdtask_condi_tasktxt_371",
"text": "通关1次维京远征boss2难度1"
"text": "通关维京远征boss2难度1"
},
"type": 73,
"valid": 0,
@ -8119,9 +8119,9 @@
"type": 93,
"valid": 0,
"NPC": 10291,
"data1": 6,
"data2": 1,
"data3": 0,
"data1": 1,
"data2": 6,
"data3": 1,
"data4": 0,
"data5": 0
},

View File

@ -283,7 +283,10 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, record *pb.DB
if len(params) == 1 {
ok = true
} else {
ok, d, _ = handle.verify(uid, conf, params...)
ok, d, err = handle.verify(uid, conf, params...)
if err != nil {
// this.Error("参数校验失败", log.Field{Key: "err", Value: err.Error()})
}
}
if !ok {

View File

@ -2,20 +2,20 @@
package rtask
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"go_dreamfactory/sys/configure"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"github.com/pkg/errors"
"github.com/spf13/cast"
)
// n params (1-GreatEqual 2-equal 3-equal 4-equal 5-equal)
func (this *ModelRtaskRecord) verifyMultiEqual(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
if len(params) == 0 {
err = errors.New("玩家参数数据缺失")
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
return
}
var paramLen int
@ -89,17 +89,18 @@ func (this *ModelRtaskRecord) verifyFirstEqualParam(uid string, cfg *cfg.GameRdt
// firstParam (first-greatEqual)
func (this *ModelRtaskRecord) verifyFirstGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
if len(params) == 1 {
ok = true
// ok, err = soGreatEqual(params[0], cfg.Data1)
if len(params) != 1 {
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
return
}
ok = true
return
}
// three params (first-greatEqual second-equal third-lessEqual)
func (this *ModelRtaskRecord) verifyThirdLessEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
if len(params) != 3 {
err = errors.New("玩家参数数据缺失")
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
return
}
var paramLen int
@ -128,7 +129,7 @@ func (this *ModelRtaskRecord) verifyThirdLessEqualParam(uid string, cfg *cfg.Gam
// three params (first-greatEqual second-equal third-greatEqual)
func (this *ModelRtaskRecord) verifyThirdGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
if len(params) != 3 {
err = errors.New("玩家参数数据缺失")
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
return
}
var paramLen int
@ -157,20 +158,11 @@ func (this *ModelRtaskRecord) verifyThirdGreatEqualParam(uid string, cfg *cfg.Ga
// two params (first-Equal second-Equal)
func (this *ModelRtaskRecord) veriftyEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
if len(params) != 2 {
err = errors.New("玩家参数数据缺失")
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
return
}
// var paramLen int
if _, err = lenParam(cfg, params...); err == nil {
//参数比较,默认第一个参数soGreateEqual,其它soEqual
// switch paramLen {
// case 1:
// ok, err = soGreat(params[0], cfg.Data1)
// return
// case 2:
// if ok, err = soGreat(params[0], cfg.Data1); !ok {
// return
// }
if ok, err = soEqual(params[1], cfg.Data2); !ok {
return
}
@ -182,7 +174,7 @@ func (this *ModelRtaskRecord) veriftyEqualParam(uid string, cfg *cfg.GameRdtaskC
// two params (first-Equal second-GreatEqual)
func (this *ModelRtaskRecord) veriftyGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
if len(params) != 2 {
err = errors.New("玩家参数数据缺失")
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
return
}
// var paramLen int

View File

@ -268,7 +268,7 @@ func (this *Worldtask) JumpTaskByTaskId(session comm.IUserSession, taskId int32)
}
// 返回所有前置任务
mytask.TaskList = this.recursionTasks(taskId, mytask.TaskList)
mytask.TaskList = this.recursionTasks(taskId)
update := map[string]interface{}{
"taskList": mytask.TaskList,
@ -399,12 +399,15 @@ func (this *Worldtask) UpdateTaskStatus(uid string, taskId int32) {
}
}
func (this *Worldtask) recursionTasks(taskId int32, taskList []int32) []int32 {
func (this *Worldtask) recursionTasks(taskId int32) (taskIds []int32) {
if taskConf, ok := this.worldtaskConf.GetDataMap()[taskId]; ok {
if taskConf.Ontxe > 0 {
taskList = append(taskList, taskConf.Ontxe)
this.recursionTasks(taskConf.Ontxe, taskList)
preId := taskConf.Ontxe
for preId > 0 {
if tc, ok := this.worldtaskConf.GetDataMap()[preId]; ok {
taskIds = append(taskIds, preId)
preId = tc.Ontxe
}
}
}
return taskList
return taskIds
}