补充日志

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

View File

@ -195,12 +195,11 @@ func (this *ModuleRtask) initRtaskVerifyHandle() {
} }
func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.TaskType, params ...int32) (code pb.ErrorCode) { 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 ( var (
err error err error
condiId int32 condiId int32
// condi *rtaskCondi condis []*rtaskCondi
condis []*rtaskCondi
) )
user := this.ModuleUser.GetUser(session.GetUserId()) user := this.ModuleUser.GetUser(session.GetUserId())
@ -210,18 +209,24 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
} }
for _, codi := range this.configure.getRtaskCondis(int32(rtaskType)) { for _, codi := range this.configure.getRtaskCondis(int32(rtaskType)) {
if v, ok := this.handleMap[codi.Id]; ok { v, ok := this.handleMap[codi.Id]
if v.find == nil { if !ok {
return this.Warn("未注册事件处理器", log.Field{"uid", session.GetUserId()}, log.Field{"condiId", codi.Id})
} code = pb.ErrorCode_RtaskCondiNoFound
if condiId, err = v.find(v.cfg, params...); condiId == 0 { return
if err != nil {
this.Error(err.Error())
}
} else {
condis = append(condis, v)
}
} }
if v.find == nil {
return
}
if condiId, err = v.find(v.cfg, params...); condiId == 0 {
if err != nil {
this.Error(err.Error())
}
} else {
condis = append(condis, v)
}
} }
// update // update
@ -233,7 +238,6 @@ func (this *ModuleRtask) SendToRtask(session comm.IUserSession, rtaskType comm.T
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
} }
} }
} }
} }