From cfc5d4f3969b51b55ccf8476f20cfed0c1f67c61 Mon Sep 17 00:00:00 2001 From: wh_zcy Date: Thu, 1 Dec 2022 14:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E8=80=97=E7=9A=84=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E6=95=B0=E6=AD=A3=E6=95=B0=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/modulebase.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/modulebase.go b/modules/modulebase.go index 2af64780c..4e2a645f7 100644 --- a/modules/modulebase.go +++ b/modules/modulebase.go @@ -284,14 +284,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.Errorf("资源不足: A: attr, T: %s, N: %d", k, v) + this.Error("资源不足", log.Fields{"uid": session.GetUserId(), "T": k, "N": v}) return } } for k, v := range items { if int32(this.ModuleItems.QueryItemAmount(session.GetUserId(), k)) < -v { code = pb.ErrorCode_ResNoEnough - this.Errorf("道具不足: A: item, T:%s, N:%d", k, v) + this.Errorf("道具不足", log.Fields{"uid": session.GetUserId(), "T": k, "N": v}) return } } @@ -301,9 +301,9 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn if code != pb.ErrorCode_Success { return } - this.Debugf("消耗玩家资源: %v", attrs) + this.Debug("消耗玩家资源", log.Fields{"uid": session.GetUserId(), "attrs": attrs}) if count, ok := attrs[comm.ResDiamond]; ok { - this.ModuleRtask.SendToRtask(session, comm.Rtype104, count) + this.ModuleRtask.SendToRtask(session, comm.Rtype104, -count) } } if len(items) > 0 { @@ -311,7 +311,7 @@ func (this *ModuleBase) ConsumeRes(session comm.IUserSession, res []*cfg.Gameatn if code != pb.ErrorCode_Success { return } - this.Debugf("消耗道具资源: %v", items) + this.Debug("消耗道具资源", log.Fields{"uid": session.GetUserId(), "items": items}) } return