update worldtask gm
This commit is contained in:
parent
982697ea1c
commit
afcbd2c766
@ -6261,7 +6261,7 @@
|
|||||||
"type_sp": 1,
|
"type_sp": 1,
|
||||||
"tasktxt": {
|
"tasktxt": {
|
||||||
"key": "taskcond_rdtask_condi_tasktxt_369",
|
"key": "taskcond_rdtask_condi_tasktxt_369",
|
||||||
"text": "强化武器+3(引导自动强化)"
|
"text": "强化任意装备3次"
|
||||||
},
|
},
|
||||||
"type": 92,
|
"type": 92,
|
||||||
"valid": 0,
|
"valid": 0,
|
||||||
@ -6295,7 +6295,7 @@
|
|||||||
"type_sp": 1,
|
"type_sp": 1,
|
||||||
"tasktxt": {
|
"tasktxt": {
|
||||||
"key": "taskcond_rdtask_condi_tasktxt_371",
|
"key": "taskcond_rdtask_condi_tasktxt_371",
|
||||||
"text": "通关1次维京远征boss2难度1"
|
"text": "通关维京远征boss2难度1"
|
||||||
},
|
},
|
||||||
"type": 73,
|
"type": 73,
|
||||||
"valid": 0,
|
"valid": 0,
|
||||||
@ -8119,9 +8119,9 @@
|
|||||||
"type": 93,
|
"type": 93,
|
||||||
"valid": 0,
|
"valid": 0,
|
||||||
"NPC": 10291,
|
"NPC": 10291,
|
||||||
"data1": 6,
|
"data1": 1,
|
||||||
"data2": 1,
|
"data2": 6,
|
||||||
"data3": 0,
|
"data3": 1,
|
||||||
"data4": 0,
|
"data4": 0,
|
||||||
"data5": 0
|
"data5": 0
|
||||||
},
|
},
|
||||||
|
@ -283,7 +283,10 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, record *pb.DB
|
|||||||
if len(params) == 1 {
|
if len(params) == 1 {
|
||||||
ok = true
|
ok = true
|
||||||
} else {
|
} 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 {
|
if !ok {
|
||||||
|
@ -2,20 +2,20 @@
|
|||||||
package rtask
|
package rtask
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"go_dreamfactory/sys/configure"
|
"go_dreamfactory/sys/configure"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
"go_dreamfactory/utils"
|
"go_dreamfactory/utils"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
|
||||||
"github.com/spf13/cast"
|
"github.com/spf13/cast"
|
||||||
)
|
)
|
||||||
|
|
||||||
// n params (1-GreatEqual 2-equal 3-equal 4-equal 5-equal)
|
// 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) {
|
func (this *ModelRtaskRecord) verifyMultiEqual(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
||||||
if len(params) == 0 {
|
if len(params) == 0 {
|
||||||
err = errors.New("玩家参数数据缺失")
|
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var paramLen int
|
var paramLen int
|
||||||
@ -89,17 +89,18 @@ func (this *ModelRtaskRecord) verifyFirstEqualParam(uid string, cfg *cfg.GameRdt
|
|||||||
|
|
||||||
// firstParam (first-greatEqual)
|
// firstParam (first-greatEqual)
|
||||||
func (this *ModelRtaskRecord) verifyFirstGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
func (this *ModelRtaskRecord) verifyFirstGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
||||||
if len(params) == 1 {
|
if len(params) != 1 {
|
||||||
ok = true
|
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
|
||||||
// ok, err = soGreatEqual(params[0], cfg.Data1)
|
return
|
||||||
}
|
}
|
||||||
|
ok = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// three params (first-greatEqual second-equal third-lessEqual)
|
// 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) {
|
func (this *ModelRtaskRecord) verifyThirdLessEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
||||||
if len(params) != 3 {
|
if len(params) != 3 {
|
||||||
err = errors.New("玩家参数数据缺失")
|
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var paramLen int
|
var paramLen int
|
||||||
@ -128,7 +129,7 @@ func (this *ModelRtaskRecord) verifyThirdLessEqualParam(uid string, cfg *cfg.Gam
|
|||||||
// three params (first-greatEqual second-equal third-greatEqual)
|
// 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) {
|
func (this *ModelRtaskRecord) verifyThirdGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
||||||
if len(params) != 3 {
|
if len(params) != 3 {
|
||||||
err = errors.New("玩家参数数据缺失")
|
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var paramLen int
|
var paramLen int
|
||||||
@ -157,20 +158,11 @@ func (this *ModelRtaskRecord) verifyThirdGreatEqualParam(uid string, cfg *cfg.Ga
|
|||||||
// two params (first-Equal second-Equal)
|
// two params (first-Equal second-Equal)
|
||||||
func (this *ModelRtaskRecord) veriftyEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
func (this *ModelRtaskRecord) veriftyEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
||||||
if len(params) != 2 {
|
if len(params) != 2 {
|
||||||
err = errors.New("玩家参数数据缺失")
|
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// var paramLen int
|
// var paramLen int
|
||||||
if _, err = lenParam(cfg, params...); err == nil {
|
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 {
|
if ok, err = soEqual(params[1], cfg.Data2); !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -182,7 +174,7 @@ func (this *ModelRtaskRecord) veriftyEqualParam(uid string, cfg *cfg.GameRdtaskC
|
|||||||
// two params (first-Equal second-GreatEqual)
|
// two params (first-Equal second-GreatEqual)
|
||||||
func (this *ModelRtaskRecord) veriftyGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
func (this *ModelRtaskRecord) veriftyGreatEqualParam(uid string, cfg *cfg.GameRdtaskCondiData, params ...int32) (ok bool, count int32, err error) {
|
||||||
if len(params) != 2 {
|
if len(params) != 2 {
|
||||||
err = errors.New("玩家参数数据缺失")
|
err = fmt.Errorf("玩家参数数据缺失,用户参数:%v", params)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// var paramLen int
|
// var paramLen int
|
||||||
|
@ -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{}{
|
update := map[string]interface{}{
|
||||||
"taskList": mytask.TaskList,
|
"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, ok := this.worldtaskConf.GetDataMap()[taskId]; ok {
|
||||||
if taskConf.Ontxe > 0 {
|
preId := taskConf.Ontxe
|
||||||
taskList = append(taskList, taskConf.Ontxe)
|
for preId > 0 {
|
||||||
this.recursionTasks(taskConf.Ontxe, taskList)
|
if tc, ok := this.worldtaskConf.GetDataMap()[preId]; ok {
|
||||||
|
taskIds = append(taskIds, preId)
|
||||||
|
preId = tc.Ontxe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return taskList
|
}
|
||||||
|
return taskIds
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user