处理战斗无完成任务ID情况
This commit is contained in:
parent
ba29beb85f
commit
43d7003d7e
@ -31,9 +31,8 @@ func (this *ModelRtaskRecord) overrideUpdate(uid string, cfg *cfg.GameRdtaskCond
|
|||||||
}
|
}
|
||||||
|
|
||||||
if v, ok := record.Vals[cfg.Id]; ok {
|
if v, ok := record.Vals[cfg.Id]; ok {
|
||||||
m := hasUpdateData(paramLen, v, vals...)
|
v.Data = hasUpdateData(paramLen, v, vals...)
|
||||||
v.Data = m
|
if len(v.Data) > 0 {
|
||||||
if len(m) > 0 {
|
|
||||||
update := map[string]interface{}{
|
update := map[string]interface{}{
|
||||||
"vals": v,
|
"vals": v,
|
||||||
}
|
}
|
||||||
|
@ -22,16 +22,47 @@ func (this *apiComp) Battlefinish(session comm.IUserSession, req *pb.WorldtaskBa
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uid := session.GetUserId()
|
||||||
taskConf, err := this.module.configure.getWorldtaskById(req.TaskId)
|
taskConf, err := this.module.configure.getWorldtaskById(req.TaskId)
|
||||||
if err != nil || taskConf == nil {
|
if err != nil || taskConf == nil {
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 当前玩家世界任务
|
||||||
|
userTask, err := this.module.modelWorldtask.getWorldtask(uid)
|
||||||
|
if err != nil {
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
rsp := &pb.WorldtaskBattleFinishResp{
|
rsp := &pb.WorldtaskBattleFinishResp{
|
||||||
TaskId: req.TaskId,
|
TaskId: req.TaskId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if taskConf.Completetask == 0 {
|
||||||
|
if err := this.module.modelWorldtask.finishTask(taskConf.Group, req.TaskId, userTask); err != nil {
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
this.module.Error("世界任务战斗结果", log.Fields{"uid": uid, "err": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := session.SendMsg(string(this.module.GetType()), WorldtaskBattleFinish, rsp); err != nil {
|
||||||
|
code = pb.ErrorCode_SystemError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if taskConf.IdAfter != 0 {
|
||||||
|
if err := session.SendMsg(string(this.module.GetType()), "nexttask", &pb.WorldtaskNexttaskPush{
|
||||||
|
NextTaskId: taskConf.IdAfter,
|
||||||
|
}); err != nil {
|
||||||
|
log.Error("任务条件达成推送", log.Fields{"uid": uid, "err": err})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
battleModule, err := this.module.service.GetModule(comm.ModuleBattle)
|
battleModule, err := this.module.service.GetModule(comm.ModuleBattle)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_SystemError
|
code = pb.ErrorCode_SystemError
|
||||||
|
Loading…
Reference in New Issue
Block a user