From 2c47ef93565bf2bcd372d4261a61c43a017b7e9c Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Mon, 22 Jan 2024 17:18:56 +0800 Subject: [PATCH] =?UTF-8?q?#44293=20=E4=BB=BB=E5=8A=A1=20=E3=80=90?= =?UTF-8?q?=E6=A2=A6=E5=B7=A5=E5=9C=BA=E7=B3=BB=E7=BB=9F=E3=80=91=20<-?= =?UTF-8?q?=E5=90=8E=E7=AB=AF->=20=E3=80=90=E4=B8=89=E6=B6=88=E3=80=91=20-?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9EGM=E6=8C=87=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 +- modules/entertainment/module.go | 19 +++++++++++++++++++ modules/gm/module.go | 13 +++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/comm/imodule.go b/comm/imodule.go index f9e44060f..d4e44aec6 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -714,7 +714,7 @@ type ( UserOffline(roomid string, uid string) (err error) //主动认输 AdmitDefeat(roomid string, uid string) (err error) - + GMAddConsumeexp(session IUserSession, score int32) (errdata *pb.ErrorData) IPayDelivery } IMoonlv interface { diff --git a/modules/entertainment/module.go b/modules/entertainment/module.go index c3ea74a94..84030bfe7 100644 --- a/modules/entertainment/module.go +++ b/modules/entertainment/module.go @@ -351,3 +351,22 @@ func (this *Entertainment) Delivery(session comm.IUserSession, pId int32) (errda }) return } + +func (this *Entertainment) GMAddConsumeexp(session comm.IUserSession, score int32) (errdata *pb.ErrorData) { + + var ( + result *pb.DBXXLData + err error + ) + + if result, err = this.model.getEntertainmList(session.GetUserId()); err != nil { + return + } + result.Consumeexp = score + + this.model.modifyEntertainmList(session.GetUserId(), map[string]interface{}{ + "consumeexp": score, + }) + + return +} diff --git a/modules/gm/module.go b/modules/gm/module.go index 64a41f79f..acca27531 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -957,6 +957,19 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (errdata *pb.Er if id, err := strconv.Atoi(datas[1]); err == nil { module1.(comm.IBuried).CompleteCondition(session, int32(id)) + this.Debug("使用bingo命令", + log.Field{Key: "uid", Value: session.GetUserId()}, + log.Field{Key: "0", Value: datas[1]}, + ) + } + } else if len(datas) == 2 && (datas[0] == "consumeexp") { // 完成埋点条件 + module1, err := this.service.GetModule(comm.ModuleEntertainment) + if err != nil { + return + } + if id, err := strconv.Atoi(datas[1]); err == nil { + module1.(comm.IEntertainment).GMAddConsumeexp(session, int32(id)) + this.Debug("使用bingo命令", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "0", Value: datas[1]},