上传消息代码
This commit is contained in:
parent
af8de5362c
commit
bdaad954b8
@ -410,15 +410,15 @@ 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)
|
module, err := this.service.GetModule(comm.ModuleWorldtask)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
go func() {
|
// go func() {
|
||||||
defer func() {
|
// defer func() {
|
||||||
if r := recover(); r != nil {
|
// if r := recover(); r != nil {
|
||||||
log.Errorf("[worldtask ] err:%v ", r)
|
// log.Errorf("[worldtask ] err:%v ", r)
|
||||||
}
|
// }
|
||||||
}()
|
// }()
|
||||||
// 世界任务
|
// 世界任务
|
||||||
if worldtask, ok := module.(comm.IWorldtask); ok {
|
if worldtask, ok := module.(comm.IWorldtask); ok {
|
||||||
if err := worldtask.TaskcondNotify(session, conf.Id); err != nil {
|
if err := worldtask.TaskcondNotify(session, conf.Id); err != nil {
|
||||||
@ -446,16 +446,16 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
// }()
|
||||||
}
|
}
|
||||||
userModule, err := this.service.GetModule(comm.ModuleUser)
|
userModule, err := this.service.GetModule(comm.ModuleUser)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
go func() {
|
// go func() {
|
||||||
defer func() { //程序异常 收集异常信息传递给前端显示
|
// defer func() { //程序异常 收集异常信息传递给前端显示
|
||||||
if r := recover(); r != nil {
|
// if r := recover(); r != nil {
|
||||||
log.Errorf("[sociatytask ] err:%v ", r)
|
// log.Errorf("[sociatytask ] err:%v ", r)
|
||||||
}
|
// }
|
||||||
}()
|
// }()
|
||||||
// 公会
|
// 公会
|
||||||
if user, ok := userModule.(comm.IUser); ok {
|
if user, ok := userModule.(comm.IUser); ok {
|
||||||
ex, err := user.GetUserExpand(session.GetUserId())
|
ex, err := user.GetUserExpand(session.GetUserId())
|
||||||
@ -481,7 +481,7 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
// }()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -99,6 +99,7 @@ func (this *Worldtask) TaskcondNotify(session comm.IUserSession, condId int32) e
|
|||||||
this.Error("world_task config not found", logFields...)
|
this.Error("world_task config not found", logFields...)
|
||||||
return err
|
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 != nil {
|
||||||
if taskConf.Des == 2 { //只有世界任务才校验前置
|
if taskConf.Des == 2 { //只有世界任务才校验前置
|
||||||
if !this.modelWorldtask.IsPreFinished(userTask, taskConf) {
|
if !this.modelWorldtask.IsPreFinished(userTask, taskConf) {
|
||||||
@ -136,6 +137,8 @@ func (this *Worldtask) TaskcondNotify(session comm.IUserSession, condId int32) e
|
|||||||
}); err != nil {
|
}); err != nil {
|
||||||
logFields = append(logFields, log.Field{Key: "err", Value: err.Error()})
|
logFields = append(logFields, log.Field{Key: "err", Value: err.Error()})
|
||||||
log.Error("任务条件达成推送", logFields...)
|
log.Error("任务条件达成推送", logFields...)
|
||||||
|
} else {
|
||||||
|
this.Debug("推送任务", log.Field{Key: "NextTaskId", Value: nextTaskId})
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.Debug("已经是最后一个任务了", logFields...)
|
this.Debug("已经是最后一个任务了", logFields...)
|
||||||
|
Loading…
Reference in New Issue
Block a user