日志优化
This commit is contained in:
parent
1b5d5b0a6a
commit
cc6f8c05d5
@ -4,7 +4,6 @@ import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/lego/sys/event"
|
||||
"go_dreamfactory/lego/sys/log"
|
||||
"go_dreamfactory/modules"
|
||||
"go_dreamfactory/pb"
|
||||
cfg "go_dreamfactory/sys/configure/structs"
|
||||
@ -69,10 +68,7 @@ func (this *Equipment) OnInstallComp() {
|
||||
|
||||
//Event------------------------------------------------------------------------------------------------------------
|
||||
func (this *Equipment) EventUserOffline(uid, sessionid string) {
|
||||
if err := this.modelEquipment.BatchDelLists(uid); err != nil {
|
||||
this.Error("EventUserOffline", log.Field{Key: "uid", Value: uid}, log.Field{Key: "err", Value: err.Error()})
|
||||
}
|
||||
|
||||
this.modelEquipment.BatchDelLists(uid)
|
||||
}
|
||||
|
||||
//IEquipment-------------------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -311,14 +311,14 @@ func (this *ModuleBase) CheckRes(session comm.IUserSession, res []*cfg.Gameatn)
|
||||
for k, v := range attrs {
|
||||
if this.ModuleUser.QueryAttributeValue(session.GetUserId(), k) < int64(v) {
|
||||
code = pb.ErrorCode_ResNoEnough
|
||||
this.Warnf("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||
this.Warn("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||
return
|
||||
}
|
||||
}
|
||||
for k, v := range items { //校验消费资源是否充足
|
||||
if int32(this.ModuleItems.QueryItemAmount(session.GetUserId(), k)) < v {
|
||||
code = pb.ErrorCode_ResNoEnough
|
||||
this.Warnf("道具不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||
this.Warn("道具不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||
return
|
||||
}
|
||||
}
|
||||
@ -350,14 +350,14 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn
|
||||
for k, v := range attrs {
|
||||
if this.ModuleUser.QueryAttributeValue(session.GetUserId(), k) < -int64(v) { // -v 负负得正
|
||||
code = pb.ErrorCode_ResNoEnough
|
||||
this.Warnf("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||
this.Warn("资源不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||
return
|
||||
}
|
||||
}
|
||||
for k, v := range items {
|
||||
if int32(this.ModuleItems.QueryItemAmount(session.GetUserId(), k)) < -v {
|
||||
code = pb.ErrorCode_ResNoEnough
|
||||
this.Warnf("道具不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||
this.Warn("道具不足", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "T", Value: k}, log.Field{Key: "N", Value: v})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user