diff --git a/bin/json/game_rdtaskcondi.json b/bin/json/game_rdtaskcondi.json index b9c6f0e69..77e539471 100644 --- a/bin/json/game_rdtaskcondi.json +++ b/bin/json/game_rdtaskcondi.json @@ -911,7 +911,7 @@ { "id": 301, "type": 61, - "data1": 101, + "data1": 1100101, "data2": 0, "data3": 0, "data4": 0, diff --git a/bin/json/game_worldtask.json b/bin/json/game_worldtask.json index 98ec30167..74ee41ea6 100644 --- a/bin/json/game_worldtask.json +++ b/bin/json/game_worldtask.json @@ -448,15 +448,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_01", "text": "这是哪里" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "这是哪里" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -488,15 +488,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_02", "text": "和这个少年谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和这个少年谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -528,15 +528,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_03", "text": "触摸花朵" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "触摸花朵" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -568,15 +568,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_04", "text": "触摸花朵" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "触摸花朵" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -608,15 +608,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_05", "text": "和杰克谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和杰克谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -648,15 +648,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_06", "text": "这个小家伙是?" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "这个小家伙是?" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -688,15 +688,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_07", "text": "和邦尼兔谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和邦尼兔谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -734,15 +734,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_08", "text": "和波比谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和波比谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -774,15 +774,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_09", "text": "和波比谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和波比谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -814,15 +814,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_10", "text": "和豺狼人谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和豺狼人谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -860,15 +860,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_11", "text": "和豺狼人谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和豺狼人谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -900,15 +900,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_12", "text": "走入黑洞" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "走入黑洞" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -918,14 +918,14 @@ ], "receivenpc": [ "bossfight_pt_02", - "新手引导-圣树下的黑洞", + "新手引导-波比-犀牛守卫", "901" ], "getafter_event": [ - 5, - 10008 + 4, + 166 ], - "completetask": 198, + "completetask": 301, "auto_accept": 0, "overtips": 1, "reword": [ @@ -946,15 +946,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_13", "text": "和犀牛守卫谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和犀牛守卫谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -986,15 +986,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_14", "text": "和波比谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和波比谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1026,15 +1026,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_15", "text": "和波比谈谈" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和波比谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1066,15 +1066,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "task_name_16", "text": "敬请期待后续剧情" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "和杰克谈谈" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1106,15 +1106,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1146,15 +1146,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1186,15 +1186,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1232,15 +1232,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1272,15 +1272,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1312,15 +1312,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1337,7 +1337,7 @@ 2, 429 ], - "completetask": 301, + "completetask": 0, "auto_accept": 0, "overtips": 1, "reword": [], @@ -1352,15 +1352,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1392,15 +1392,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ @@ -1432,15 +1432,15 @@ "des": 2, "icon": "", "task_Tname": { - "key": "story_npc_task", + "key": "story_80", "text": "初来乍到" }, "task_name": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "task_display": { - "key": "story_npc_task", + "key": "story_80", "text": "新手引导" }, "npc": [ diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 89cc0eacc..e25aec7da 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -278,62 +278,62 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType com } //任务完成则推送 - if code := this.CheckCondi(uid, conf.Id); code == pb.ErrorCode_Success { + if code = this.CheckCondi(uid, conf.Id); code == pb.ErrorCode_Success { module, err := this.service.GetModule(comm.ModuleWorldtask) if err == nil { - go func() { - defer func() { - if r := recover(); r != nil { - log.Errorf("[worldtask ] err:%v ", r) - } - }() + // go func() { + // defer func() { + // if r := recover(); r != nil { + // log.Errorf("[worldtask ] err:%v ", r) + // } + // }() - if worldtask, ok := module.(comm.IWorldtask); ok { - if err := worldtask.TaskcondNotify(session, conf.Id); err != nil { - log.Error("任务条件达成通知", - log.Field{Key: "uid", Value: uid}, - log.Field{Key: "condId", Value: conf.Id}, - log.Field{Key: "err", Value: err.Error()}, - ) - } + if worldtask, ok := module.(comm.IWorldtask); ok { + if err := worldtask.TaskcondNotify(session, conf.Id); err != nil { + log.Error("任务条件达成通知", + log.Field{Key: "uid", Value: uid}, + log.Field{Key: "condId", Value: conf.Id}, + log.Field{Key: "err", Value: err.Error()}, + ) } - }() + } + // }() } userModule, err := this.service.GetModule(comm.ModuleUser) if err == nil { - go func() { - defer func() { //程序异常 收集异常信息传递给前端显示 - if r := recover(); r != nil { - log.Errorf("[sociatytask ] err:%v ", r) + // go func() { + // defer func() { //程序异常 收集异常信息传递给前端显示 + // if r := recover(); r != nil { + // log.Errorf("[sociatytask ] err:%v ", r) + // } + // }() + // 公会 + if user, ok := userModule.(comm.IUser); ok { + ex, err := user.GetUserExpand(uid) + if err == nil && ex.SociatyId != "" { + sociatyModule, err := this.service.GetModule(comm.ModuleSociaty) + if err != nil { + return } - }() - // 公会 - if user, ok := userModule.(comm.IUser); ok { - ex, err := user.GetUserExpand(uid) - if err == nil && ex.SociatyId != "" { - sociatyModule, err := this.service.GetModule(comm.ModuleSociaty) - if err != nil { - return - } - if sociaty, ok := sociatyModule.(comm.ISociaty); ok { - if err2 := sociaty.TaskcondNotify(uid, ex.SociatyId, conf.Id); err2 != nil { - log.Error("公会任务条件达成通知", - log.Field{Key: "uid", Value: uid}, - log.Field{Key: "sociatyId", Value: ex.SociatyId}, - log.Field{Key: "condId", Value: conf.Id}, - log.Field{Key: "err", Value: err2.Error()}, - ) - } - this.processOneTask(session, comm.Rtype156, 1) - // if module, err := this.service.GetModule(comm.ModuleRtask); err == nil { - // if iRtask, ok := module.(comm.IRtask); ok { - // iRtask.SendToRtask(session, comm.Rtype156, 1) - // } - // } + if sociaty, ok := sociatyModule.(comm.ISociaty); ok { + if err2 := sociaty.TaskcondNotify(uid, ex.SociatyId, conf.Id); err2 != nil { + log.Error("公会任务条件达成通知", + log.Field{Key: "uid", Value: uid}, + log.Field{Key: "sociatyId", Value: ex.SociatyId}, + log.Field{Key: "condId", Value: conf.Id}, + log.Field{Key: "err", Value: err2.Error()}, + ) } + this.processOneTask(session, comm.Rtype156, 1) + // if module, err := this.service.GetModule(comm.ModuleRtask); err == nil { + // if iRtask, ok := module.(comm.IRtask); ok { + // iRtask.SendToRtask(session, comm.Rtype156, 1) + // } + // } } } - }() + } + // }() } } @@ -359,11 +359,11 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T return } - // this.Debug("任务事件触发", - // log.Field{Key: "uid", Value: uid}, - // log.Field{Key: "taskType", Value: rtaskType}, - // log.Field{Key: "params", Value: params}, - // ) + this.Debug("任务事件触发", + log.Field{Key: "uid", Value: uid}, + log.Field{Key: "taskType", Value: rtaskType}, + log.Field{Key: "params", Value: params}, + ) var ( condis []*rtaskCondi ) @@ -410,78 +410,78 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T } //任务完成则推送 - if code := this.CheckCondi(uid, conf.Id); code == pb.ErrorCode_Success { + if code = this.CheckCondi(uid, conf.Id); code == pb.ErrorCode_Success { module, err := this.service.GetModule(comm.ModuleWorldtask) if err == nil { - go func() { - defer func() { - if r := recover(); r != nil { - log.Errorf("[worldtask ] err:%v ", r) - } - }() - // 世界任务 - if worldtask, ok := module.(comm.IWorldtask); ok { - if err := worldtask.TaskcondNotify(session, conf.Id); err != nil { - var customErr = new(comm.CustomError) - if errors.As(err, &customErr) { - notifyErr := &pb.NotifyErrorNotifyPush{ - ReqMainType: string(comm.ModuleWorldtask), - ReqSubType: "finish", - Message: "", - } + // go func() { + // defer func() { + // if r := recover(); r != nil { + // log.Errorf("[worldtask ] err:%v ", r) + // } + // }() + // 世界任务 + if worldtask, ok := module.(comm.IWorldtask); ok { + if err := worldtask.TaskcondNotify(session, conf.Id); err != nil { + var customErr = new(comm.CustomError) + if errors.As(err, &customErr) { + notifyErr := &pb.NotifyErrorNotifyPush{ + ReqMainType: string(comm.ModuleWorldtask), + ReqSubType: "finish", + Message: "", + } - if customErr.Code == pb.ErrorCode_WorldtaskLvNotEnough { - notifyErr.Code = pb.ErrorCode_WorldtaskLvNotEnough - session.SendMsg(string(comm.ModuleWorldtask), "finish", notifyErr) - } else if customErr.Code == pb.ErrorCode_UserSessionNobeing { - notifyErr.Code = pb.ErrorCode_UserSessionNobeing - session.SendMsg(string(comm.ModuleWorldtask), "finish", notifyErr) - } else { - log.Error("任务条件达成通知", - log.Field{Key: "uid", Value: uid}, - log.Field{Key: "condId", Value: conf.Id}, - log.Field{Key: "err", Value: err.Error()}, - ) - } + if customErr.Code == pb.ErrorCode_WorldtaskLvNotEnough { + notifyErr.Code = pb.ErrorCode_WorldtaskLvNotEnough + session.SendMsg(string(comm.ModuleWorldtask), "finish", notifyErr) + } else if customErr.Code == pb.ErrorCode_UserSessionNobeing { + notifyErr.Code = pb.ErrorCode_UserSessionNobeing + session.SendMsg(string(comm.ModuleWorldtask), "finish", notifyErr) + } else { + log.Error("任务条件达成通知", + log.Field{Key: "uid", Value: uid}, + log.Field{Key: "condId", Value: conf.Id}, + log.Field{Key: "err", Value: err.Error()}, + ) } } } - }() + } + // }() } userModule, err := this.service.GetModule(comm.ModuleUser) if err == nil { - go func() { - defer func() { //程序异常 收集异常信息传递给前端显示 - if r := recover(); r != nil { - log.Errorf("[sociatytask ] err:%v ", r) + // go func() { + // defer func() { //程序异常 收集异常信息传递给前端显示 + // if r := recover(); r != nil { + // log.Errorf("[sociatytask ] err:%v ", r) + // } + // }() + // 公会 + if user, ok := userModule.(comm.IUser); ok { + ex, err := user.GetUserExpand(session.GetUserId()) + if err == nil && ex.SociatyId != "" { + sociatyModule, err := this.service.GetModule(comm.ModuleSociaty) + if err != nil { + return } - }() - // 公会 - if user, ok := userModule.(comm.IUser); ok { - ex, err := user.GetUserExpand(session.GetUserId()) - if err == nil && ex.SociatyId != "" { - sociatyModule, err := this.service.GetModule(comm.ModuleSociaty) - if err != nil { - return + if sociaty, ok := sociatyModule.(comm.ISociaty); ok { + if err2 := sociaty.TaskcondNotify(uid, ex.SociatyId, conf.Id); err2 != nil { + log.Error("公会任务条件达成通知", + log.Field{Key: "uid", Value: uid}, + log.Field{Key: "sociatyId", Value: ex.SociatyId}, + log.Field{Key: "condId", Value: conf.Id}, + log.Field{Key: "err", Value: err2.Error()}, + ) } - if sociaty, ok := sociatyModule.(comm.ISociaty); ok { - if err2 := sociaty.TaskcondNotify(uid, ex.SociatyId, conf.Id); err2 != nil { - log.Error("公会任务条件达成通知", - log.Field{Key: "uid", Value: uid}, - log.Field{Key: "sociatyId", Value: ex.SociatyId}, - log.Field{Key: "condId", Value: conf.Id}, - log.Field{Key: "err", Value: err2.Error()}, - ) - } - if module, err := this.service.GetModule(comm.ModuleRtask); err == nil { - if iRtask, ok := module.(comm.IRtask); ok { - iRtask.SendToRtask(session, comm.Rtype156, 1) - } + if module, err := this.service.GetModule(comm.ModuleRtask); err == nil { + if iRtask, ok := module.(comm.IRtask); ok { + iRtask.SendToRtask(session, comm.Rtype156, 1) } } } } - }() + } + // }() } } } diff --git a/modules/worldtask/module.go b/modules/worldtask/module.go index 93a607e27..d825c681c 100644 --- a/modules/worldtask/module.go +++ b/modules/worldtask/module.go @@ -99,6 +99,7 @@ func (this *Worldtask) TaskcondNotify(session comm.IUserSession, condId int32) e this.Error("world_task config not found", logFields...) return err } + logFields = append(logFields, log.Field{Key: "id_after", Value: taskConf.IdAfter}, log.Field{Key: "des", Value: taskConf.Des}) if taskConf != nil { if taskConf.Des == 2 { //只有世界任务才校验前置 if !this.modelWorldtask.IsPreFinished(userTask, taskConf) { @@ -136,6 +137,8 @@ func (this *Worldtask) TaskcondNotify(session comm.IUserSession, condId int32) e }); err != nil { logFields = append(logFields, log.Field{Key: "err", Value: err.Error()}) log.Error("任务条件达成推送", logFields...) + } else { + this.Debug("推送任务", log.Field{Key: "NextTaskId", Value: nextTaskId}) } } else { this.Debug("已经是最后一个任务了", logFields...)