补充日志

This commit is contained in:
wh_zcy 2022-09-29 14:57:59 +08:00
parent 58e8c2f7fd
commit 7f7b549274
2 changed files with 23 additions and 17 deletions

View File

@ -7,6 +7,7 @@ import (
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/event"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/lego/utils/codec/json"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
@ -74,8 +75,9 @@ func (this *Chat) OnInstallComp() {
//Event------------------------------------------------------------------------------------------------------------
func (this *Chat) EventUserOffline(session comm.IUserSession) {
err := this.modelChat.RemoveCrossChannelMember(session)
this.Debugf("EventUserOffline:%s err:%v", session, err)
if err := this.modelChat.RemoveCrossChannelMember(session); err != nil {
this.Debug("EventUserOffline:", log.Field{"uid", session.GetUserId()}, log.Field{"err", err})
}
}
//对外接口----------------------------------------------------------------------------------------------------------

View File

@ -195,11 +195,10 @@ func (this *ModuleRtask) initRtaskVerifyHandle() {
}
func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.TaskType, params ...int32) (code pb.ErrorCode) {
this.Debugf("receive Rtask %v params: %v", rtaskType, params)
this.Debug("任务事件触发", log.Field{"uid", session.GetUserId()}, log.Field{"taskType", rtaskType}, log.Field{"params", params})
var (
err error
condiId int32
// condi *rtaskCondi
condis []*rtaskCondi
)
@ -210,7 +209,13 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
}
for _, codi := range this.configure.getRtaskCondis(int32(rtaskType)) {
if v, ok := this.handleMap[codi.Id]; ok {
v, ok := this.handleMap[codi.Id]
if !ok {
this.Warn("未注册事件处理器", log.Field{"uid", session.GetUserId()}, log.Field{"condiId", codi.Id})
code = pb.ErrorCode_RtaskCondiNoFound
return
}
if v.find == nil {
return
}
@ -221,7 +226,7 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
} else {
condis = append(condis, v)
}
}
}
// update
@ -233,7 +238,6 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
code = pb.ErrorCode_DBError
}
}
}
}