Compare commits
No commits in common. "e1776f09666cf43566c01a64a140c74453703abc" and "f6f77f32ffa3a2e33be9eed7945e38f3750e8e42" have entirely different histories.
e1776f0966
...
f6f77f32ff
@ -20,7 +20,7 @@ func NewCustomError(code pb.ErrorCode) error {
|
|||||||
// 初次调用得用Wrap方法,进行实例化
|
// 初次调用得用Wrap方法,进行实例化
|
||||||
return errors.Wrap(&CustomError{
|
return errors.Wrap(&CustomError{
|
||||||
Code: code,
|
Code: code,
|
||||||
Message: code.ToString(),
|
Message: code.String(),
|
||||||
}, "")
|
}, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -30,6 +30,6 @@ func NewNotFoundConfErr(moduleName string, filename string, id interface{}) erro
|
|||||||
}
|
}
|
||||||
|
|
||||||
//执行外部模块异常
|
//执行外部模块异常
|
||||||
func NewExternalModuleErr(moduleName string, methodname string, parameter ...interface{}) error {
|
func NewExternalModuleErr(moduleName string, methodname string, parameter interface{}) error {
|
||||||
return fmt.Errorf("执行外部模块错误 模块:%s ,配置文件:%s,目标数据:%v", moduleName, methodname, parameter)
|
return fmt.Errorf("执行外部模块错误 模块:%s ,配置文件:%s,错误信息:%v", moduleName, methodname, parameter)
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,6 @@ func (this *apiComp) Agree(session comm.IUserSession, req *pb.SociatyAgreeReq) (
|
|||||||
} else {
|
} else {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
}
|
}
|
||||||
data.Title = code.ToString()
|
|
||||||
data.Message = err.Error()
|
|
||||||
this.module.Error("公会审核-同意",
|
this.module.Error("公会审核-同意",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "申请人", Value: req.Uid},
|
log.Field{Key: "申请人", Value: req.Uid},
|
||||||
|
@ -40,17 +40,15 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
|
|||||||
userEx, err := this.module.ModuleUser.GetUserExpand(uid)
|
userEx, err := this.module.ModuleUser.GetUserExpand(uid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
this.module.Error("GetRemoteUserExpand", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()})
|
this.module.Error("GetRemoteUserExpand", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()})
|
||||||
code = pb.ErrorCode_UserNofound
|
code = pb.ErrorCode_UserSessionNobeing
|
||||||
data.Title = code.ToString()
|
data.Title = code.ToString()
|
||||||
data.Datastring = uid
|
|
||||||
data.Message = err.Error()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if utils.IsInCDHour(userEx.SociatyCd) {
|
if utils.IsInCDHour(userEx.SociatyCd) {
|
||||||
code = pb.ErrorCode_SociatyCDLimit
|
code = pb.ErrorCode_SociatyCDLimit
|
||||||
data.Title = code.ToString()
|
data.Title = code.ToString()
|
||||||
data.Message = fmt.Sprintf("CD内[%v]不允许申请", userEx.SociatyCd)
|
data.Message = fmt.Sprintf("CD内")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,40 +56,30 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
|
|||||||
if this.module.modelSociaty.isMember(uid, sociaty) {
|
if this.module.modelSociaty.isMember(uid, sociaty) {
|
||||||
code = pb.ErrorCode_SociatyBelongTo
|
code = pb.ErrorCode_SociatyBelongTo
|
||||||
data.Title = code.ToString()
|
data.Title = code.ToString()
|
||||||
data.Datastring = sociaty.Id
|
|
||||||
data.Message = fmt.Sprintf("[%v]已经是公会[%v]成员", uid, sociaty.Name)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
user := this.module.ModuleUser.GetUser(uid)
|
user := this.module.ModuleUser.GetUser(uid)
|
||||||
if user == nil {
|
if user == nil {
|
||||||
code = pb.ErrorCode_UserNofound
|
code = pb.ErrorCode_UserSessionNobeing
|
||||||
data.Title = code.ToString()
|
|
||||||
data.Datastring = uid
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否达到入会等级
|
// 是否达到入会等级
|
||||||
if user.Lv < sociaty.ApplyLv {
|
if user.Lv < sociaty.ApplyLv {
|
||||||
code = pb.ErrorCode_SociatyAppyLvNoEnough
|
code = pb.ErrorCode_SociatyAppyLvNoEnough
|
||||||
data.Title = code.ToString()
|
|
||||||
data.Message = fmt.Sprintf("实际等级:%v 期望等级:%v", user.Lv, sociaty.ApplyLv)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否已申请
|
// 是否已申请
|
||||||
if this.module.modelSociaty.isApplied(uid, sociaty) {
|
if this.module.modelSociaty.isApplied(uid, sociaty) {
|
||||||
code = pb.ErrorCode_SociatyApplied
|
code = pb.ErrorCode_SociatyApplied
|
||||||
data.Title = code.ToString()
|
|
||||||
data.Message = fmt.Sprintf("[%v]已申请", sociaty.Name)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//判断申请人数是否超出最大允许申请数
|
//判断申请人数是否超出最大允许申请数
|
||||||
if len(sociaty.ApplyRecord) >= int(this.module.globalConf.GuildAcceptApplyMax) {
|
if len(sociaty.ApplyRecord) >= int(this.module.globalConf.GuildAcceptApplyMax) {
|
||||||
code = pb.ErrorCode_SociatyApplyMax
|
code = pb.ErrorCode_SociatyApplyMax
|
||||||
data.Title = code.ToString()
|
|
||||||
data.Message = fmt.Sprintf("实际人数:%d 期望人数:%d", len(sociaty.ApplyRecord), int(this.module.globalConf.GuildAcceptApplyMax))
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,8 +92,6 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
|
|||||||
} else {
|
} else {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
}
|
}
|
||||||
data.Title = code.ToString()
|
|
||||||
data.Message = err.Error()
|
|
||||||
this.module.Error("公会申请",
|
this.module.Error("公会申请",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "sociatyId", Value: req.SociatyId},
|
log.Field{Key: "sociatyId", Value: req.SociatyId},
|
||||||
@ -117,6 +103,7 @@ func (this *apiComp) Apply(session comm.IUserSession, req *pb.SociatyApplyReq) (
|
|||||||
// 无需审核
|
// 无需审核
|
||||||
if !isCheck {
|
if !isCheck {
|
||||||
// 触发任务条件
|
// 触发任务条件
|
||||||
|
// this.module.ModuleRtask.SendToRtask(session, comm.Rtype109, 1)
|
||||||
go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype109, 1))
|
go this.module.ModuleBuried.TriggerBuried(session.GetUserId(), comm.GetBuriedParam(comm.Rtype109, 1))
|
||||||
}
|
}
|
||||||
rsp := &pb.SociatyApplyResp{
|
rsp := &pb.SociatyApplyResp{
|
||||||
|
@ -242,7 +242,7 @@ type TaskParams struct {
|
|||||||
|
|
||||||
// 任务条件达成通知
|
// 任务条件达成通知
|
||||||
func (this *Sociaty) TCondFinishNotify(uid string, condIds []int32) {
|
func (this *Sociaty) TCondFinishNotify(uid string, condIds []int32) {
|
||||||
log.Debug("公会任务通知",
|
log.Debug("公会任务",
|
||||||
log.Field{Key: "uid", Value: uid},
|
log.Field{Key: "uid", Value: uid},
|
||||||
log.Field{Key: "condIds", Value: condIds})
|
log.Field{Key: "condIds", Value: condIds})
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
"go_dreamfactory/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 任务接取
|
// 任务接取
|
||||||
@ -89,17 +90,9 @@ func (a *apiComp) Accept(session comm.IUserSession, req *pb.WorldtaskAcceptReq)
|
|||||||
a.module.modelWorldtask.taskFinishPush(session, req.GroupId, myWorldtask, curTaskConf)
|
a.module.modelWorldtask.taskFinishPush(session, req.GroupId, myWorldtask, curTaskConf)
|
||||||
} else {
|
} else {
|
||||||
// 已完成的任务条件
|
// 已完成的任务条件
|
||||||
conds, err := a.module.ModuleBuried.CheckCondition(uid, curTaskConf.Completetask...)
|
rsp.CondiIds, _, err = a.module.ModuleBuried.CheckCondition(uid, curTaskConf.Completetask...)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
var unfinishCondIds []int32
|
a.module.ModuleBuried.ActiveCondition(uid, utils.NoContain(rsp.CondiIds, curTaskConf.Completetask)...)
|
||||||
for _, cond := range conds {
|
|
||||||
if cond.State == pb.BuriedItemFinishState_finish {
|
|
||||||
rsp.CondiIds = append(rsp.CondiIds, cond.Conid)
|
|
||||||
} else if cond.State == pb.BuriedItemFinishState_unfinish {
|
|
||||||
unfinishCondIds = append(unfinishCondIds, cond.Conid)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
a.module.ModuleBuried.ActiveCondition(uid, unfinishCondIds...)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,16 +45,9 @@ func (this *apiComp) CompleteCondi(session comm.IUserSession, req *pb.WorldtaskC
|
|||||||
myWorldtask.Uid = uid
|
myWorldtask.Uid = uid
|
||||||
wt := myWorldtask.CurrentTask[req.GroupId]
|
wt := myWorldtask.CurrentTask[req.GroupId]
|
||||||
|
|
||||||
conds, err := this.module.ModuleBuried.CheckCondition(uid, req.CondiId)
|
condIds, _, err := this.module.ModuleBuried.CheckCondition(uid, req.CondiId)
|
||||||
if err != nil {
|
if err == nil && len(condIds) > 0 {
|
||||||
code = pb.ErrorCode_ExternalModule
|
wt.CondiIds = append(wt.CondiIds, condIds...)
|
||||||
data.Title = code.ToString()
|
|
||||||
data.Message = comm.NewExternalModuleErr("buried", "CheckCondition", uid, req.CondiId).Error()
|
|
||||||
}
|
|
||||||
for _, cond := range conds {
|
|
||||||
if cond.State == pb.BuriedItemFinishState_finish {
|
|
||||||
wt.CondiIds = append(wt.CondiIds, cond.Conid)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
myWorldtask.CurrentTask[req.GroupId] = wt
|
myWorldtask.CurrentTask[req.GroupId] = wt
|
||||||
|
@ -99,24 +99,20 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var condiFlag bool
|
var (
|
||||||
|
condiFlag bool
|
||||||
|
)
|
||||||
|
|
||||||
// 检查当前任务的完成条件
|
// 检查当前任务的完成条件
|
||||||
for _, condId := range curTaskConf.Completetask {
|
for _, condId := range curTaskConf.Completetask {
|
||||||
if v, ok := userTask.CurrentTask[req.GroupId]; ok {
|
if v, ok := userTask.CurrentTask[req.GroupId]; ok {
|
||||||
if _, ok := utils.Findx(v.CondiIds, condId); !ok {
|
if _, ok := utils.Findx(v.CondiIds, condId); !ok {
|
||||||
conds, err := this.module.ModuleBuried.CheckCondition(uid, condId)
|
//
|
||||||
if err != nil {
|
conIds, _, err := this.module.ModuleBuried.CheckCondition(uid, condId)
|
||||||
code = pb.ErrorCode_ExternalModule
|
if err == nil && len(conIds) > 0 {
|
||||||
data = &pb.ErrorData{
|
|
||||||
Title: code.ToString(),
|
|
||||||
Message: comm.NewExternalModuleErr("Buried", "CheckCondition", uid, condId).Error(),
|
|
||||||
}
|
|
||||||
return
|
|
||||||
}
|
|
||||||
for _, cond := range conds {
|
|
||||||
if cond.Conid == condId && cond.State == pb.BuriedItemFinishState_finish {
|
|
||||||
condiFlag = true
|
condiFlag = true
|
||||||
}
|
} else {
|
||||||
|
condiFlag = false
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
condiFlag = true
|
condiFlag = true
|
||||||
@ -166,16 +162,18 @@ func (this *apiComp) Finish(session comm.IUserSession, req *pb.WorldtaskFinishRe
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Deprecated
|
func (this *apiComp) updateCheckCond(uid string, userTask *pb.DBWorldtask, nextTaskId int32) *pb.DBWorldtask {
|
||||||
func (this *apiComp) updateCheckCond(uid string, userTask *pb.DBWorldtask, nextTaskId int32) (*pb.DBWorldtask, error) {
|
|
||||||
//检查下个任务的完成条件
|
//检查下个任务的完成条件
|
||||||
nextTaskConf, err := this.module.configure.getWorldtaskById(nextTaskId)
|
nextTaskConf, err := this.module.configure.getWorldtaskById(nextTaskId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
this.module.Error("config not found", log.Field{Key: "taskId", Value: nextTaskId})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
if nextTaskConf == nil {
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if nextTaskConf.Des == 1 || nextTaskConf.Des == 4 {
|
if nextTaskConf.Des == 1 || nextTaskConf.Des == 4 {
|
||||||
return nil, comm.NewCustomError(pb.ErrorCode_WorldtaskNoProcess)
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if userTask.CurrentTask == nil {
|
if userTask.CurrentTask == nil {
|
||||||
@ -193,6 +191,10 @@ func (this *apiComp) updateCheckCond(uid string, userTask *pb.DBWorldtask, nextT
|
|||||||
userTask.CurrentTask[nextTaskConf.Group] = wt
|
userTask.CurrentTask[nextTaskConf.Group] = wt
|
||||||
update["currentTask"] = userTask.CurrentTask
|
update["currentTask"] = userTask.CurrentTask
|
||||||
} else {
|
} else {
|
||||||
|
for _, condiId := range nextTaskConf.Completetask {
|
||||||
|
if condiId == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
nwt, ok := userTask.CurrentTask[nextTaskConf.Group]
|
nwt, ok := userTask.CurrentTask[nextTaskConf.Group]
|
||||||
if ok {
|
if ok {
|
||||||
nwt.TaskId = nextTaskId
|
nwt.TaskId = nextTaskId
|
||||||
@ -204,30 +206,22 @@ func (this *apiComp) updateCheckCond(uid string, userTask *pb.DBWorldtask, nextT
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
conds, err := this.module.ModuleBuried.CheckCondition(uid, nextTaskConf.Completetask...)
|
condIds, _, err := this.module.ModuleBuried.CheckCondition(uid, condiId)
|
||||||
if err != nil {
|
if err == nil && len(condIds) > 0 {
|
||||||
this.module.Errorf("buried err:%v", err.Error())
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
var condIds []int32
|
|
||||||
for _, cond := range conds {
|
|
||||||
if cond.State == pb.BuriedItemFinishState_finish {
|
|
||||||
condIds = append(condIds, cond.Conid)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nwt.CondiIds = condIds
|
nwt.CondiIds = condIds
|
||||||
userTask.CurrentTask[nextTaskConf.Group] = nwt
|
userTask.CurrentTask[nextTaskConf.Group] = nwt
|
||||||
update["currentTask"] = userTask.CurrentTask
|
update["currentTask"] = userTask.CurrentTask
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(update) > 0 {
|
|
||||||
if err := this.module.modelWorldtask.Change(uid, update); err != nil {
|
|
||||||
this.module.Error("DB err", log.Field{Key: "err", Value: err.Error()})
|
|
||||||
return nil, err
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return userTask, nil
|
if len(update) > 0 {
|
||||||
|
if err := this.module.modelWorldtask.Change(uid, update); err != nil {
|
||||||
|
this.module.Error("DB err", log.Field{Key: "err", Value: err.Error()})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return userTask
|
||||||
}
|
}
|
||||||
|
@ -161,8 +161,7 @@ func (this *ModelWorldtask) checkCondi(uid string, condiId int32) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新当前任务的完成条件
|
func (this *ModelWorldtask) updateCheckCond(uid string, userLv int32, userTask *pb.DBWorldtask, nextTaskId int32) *pb.DBWorldtask {
|
||||||
func (this *ModelWorldtask) updateCurrentTaskCond(uid string, userLv int32, userTask *pb.DBWorldtask, nextTaskId int32) *pb.DBWorldtask {
|
|
||||||
//检查下个任务的完成条件
|
//检查下个任务的完成条件
|
||||||
nextTaskConf, err := this.moduleWorldtask.configure.getWorldtaskById(nextTaskId)
|
nextTaskConf, err := this.moduleWorldtask.configure.getWorldtaskById(nextTaskId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -195,6 +194,10 @@ func (this *ModelWorldtask) updateCurrentTaskCond(uid string, userLv int32, user
|
|||||||
userTask.CurrentTask[nextTaskConf.Group] = wt
|
userTask.CurrentTask[nextTaskConf.Group] = wt
|
||||||
update["currentTask"] = userTask.CurrentTask
|
update["currentTask"] = userTask.CurrentTask
|
||||||
} else {
|
} else {
|
||||||
|
for _, condiId := range nextTaskConf.Completetask {
|
||||||
|
if condiId == 0 {
|
||||||
|
continue
|
||||||
|
}
|
||||||
nwt, ok := userTask.CurrentTask[nextTaskConf.Group]
|
nwt, ok := userTask.CurrentTask[nextTaskConf.Group]
|
||||||
if ok {
|
if ok {
|
||||||
nwt.TaskId = nextTaskId
|
nwt.TaskId = nextTaskId
|
||||||
@ -205,24 +208,36 @@ func (this *ModelWorldtask) updateCurrentTaskCond(uid string, userLv int32, user
|
|||||||
TaskType: nextTaskConf.Des,
|
TaskType: nextTaskConf.Des,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// if m, err := this.service.GetModule(comm.ModuleRtask); err == nil {
|
||||||
conds, err := this.moduleWorldtask.ModuleBuried.CheckCondition(uid, nextTaskConf.Completetask...)
|
// iwt, ok := m.(comm.IRtask)
|
||||||
if err != nil {
|
// if ok {
|
||||||
this.moduleWorldtask.Errorf("buried err:%v", err.Error())
|
// if mc := iwt.CheckCondi(uid, condiId); mc != pb.ErrorCode_Success {
|
||||||
return nil
|
// this.moduleWorldtask.Debug("任务完成条件不满足",
|
||||||
}
|
// log.Field{Key: "uid", Value: uid},
|
||||||
|
// log.Field{Key: "taskId", Value: nextTaskId},
|
||||||
var condIds []int32
|
// log.Field{Key: "condiId", Value: condiId},
|
||||||
for _, cond := range conds {
|
// )
|
||||||
if cond.State == pb.BuriedItemFinishState_finish {
|
// } else {
|
||||||
condIds = append(condIds, cond.Conid)
|
// if ok {
|
||||||
}
|
// nwt.CondiIds = append(nwt.CondiIds, condiId)
|
||||||
}
|
// } else {
|
||||||
|
// condiIds := []int32{condiId}
|
||||||
|
// nwt.CondiIds = condiIds
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
condIds, _, err := this.moduleWorldtask.ModuleBuried.CheckCondition(uid, condiId)
|
||||||
|
if err == nil && len(condIds) > 0 {
|
||||||
nwt.CondiIds = condIds
|
nwt.CondiIds = condIds
|
||||||
userTask.CurrentTask[nextTaskConf.Group] = nwt
|
userTask.CurrentTask[nextTaskConf.Group] = nwt
|
||||||
update["currentTask"] = userTask.CurrentTask
|
update["currentTask"] = userTask.CurrentTask
|
||||||
}
|
}
|
||||||
|
userTask.CurrentTask[nextTaskConf.Group] = nwt
|
||||||
|
update["currentTask"] = userTask.CurrentTask
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if len(update) > 0 {
|
if len(update) > 0 {
|
||||||
if err := this.Change(uid, update); err != nil {
|
if err := this.Change(uid, update); err != nil {
|
||||||
@ -246,7 +261,7 @@ func (this *ModelWorldtask) taskFinishPush(session comm.IUserSession, groupId in
|
|||||||
|
|
||||||
nextTask := make(map[int32]*pb.Worldtask)
|
nextTask := make(map[int32]*pb.Worldtask)
|
||||||
for _, next := range nextTaskIds {
|
for _, next := range nextTaskIds {
|
||||||
ut := this.updateCurrentTaskCond(session.GetUserId(), u.Lv, userTask, next)
|
ut := this.updateCheckCond(session.GetUserId(), u.Lv, userTask, next)
|
||||||
if ut != nil {
|
if ut != nil {
|
||||||
for k, v := range ut.CurrentTask {
|
for k, v := range ut.CurrentTask {
|
||||||
nextTask[k] = &pb.Worldtask{
|
nextTask[k] = &pb.Worldtask{
|
||||||
|
@ -58,8 +58,8 @@ func (this *Worldtask) Start() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Worldtask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) {
|
func (this *Worldtask) TCondFinishNotify(uid string, conids []int32) {
|
||||||
this.Debug("世界任务完成条件通知", log.Field{Key: "uid", Value: uid}, log.Field{Key: "condIds", Value: conds})
|
this.Debug("世界任务完成条件通知", log.Field{Key: "uid", Value: uid}, log.Field{Key: "condIds", Value: conids})
|
||||||
|
|
||||||
session, ok := this.GetUserSession(uid)
|
session, ok := this.GetUserSession(uid)
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -85,14 +85,14 @@ func (this *Worldtask) TCondFinishNotify(uid string, conds []*pb.ConIProgress) {
|
|||||||
finishedCondIds := []int32{}
|
finishedCondIds := []int32{}
|
||||||
for _, c := range this.worldtaskConf.GetDataList() {
|
for _, c := range this.worldtaskConf.GetDataList() {
|
||||||
for _, v := range c.Completetask {
|
for _, v := range c.Completetask {
|
||||||
for _, cond := range conds {
|
for _, condId := range conids {
|
||||||
if v == cond.Conid {
|
if v == condId {
|
||||||
//校验任务是否是当前任务
|
//校验任务是否是当前任务
|
||||||
if task, ok := userTask.CurrentTask[c.Group]; ok {
|
if task, ok := userTask.CurrentTask[c.Group]; ok {
|
||||||
if task.NpcStatus == 1 && c.Key == task.TaskId {
|
if task.NpcStatus == 1 && c.Key == task.TaskId {
|
||||||
groupId = c.Group
|
groupId = c.Group
|
||||||
taskId = c.Key
|
taskId = c.Key
|
||||||
finishedCondIds = append(finishedCondIds, cond.Conid)
|
finishedCondIds = append(finishedCondIds, condId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user