From 003aeb881483f940dc8d1eb99bc8d4afb4deb150 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 28 Dec 2022 19:01:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gm/api_cmd.go | 1 + modules/gm/module.go | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/modules/gm/api_cmd.go b/modules/gm/api_cmd.go index 50469300e..0e430f0ba 100644 --- a/modules/gm/api_cmd.go +++ b/modules/gm/api_cmd.go @@ -36,6 +36,7 @@ import ( 19、bingo:recharge,10 20、bingo:cleanitem 21、bingo:allequip +21、bingo:chat,1 */ //参数校验 func (this *apiComp) CmdCheck(session comm.IUserSession, req *pb.GMCmdReq) (code pb.ErrorCode) { diff --git a/modules/gm/module.go b/modules/gm/module.go index a6159f31a..271dad286 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -405,6 +405,22 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC return } + this.Debug("使用bingo命令:uid = %s ", + log.Field{Key: "uid", Value: session.GetUserId()}, + log.Field{Key: "0", Value: datas[0]}, + ) + } else if len(datas) == 2 && (datas[0] == "chat") { + // num, err := strconv.Atoi(datas[1]) + // if err != nil { + // code = pb.ErrorCode_ReqParameterError + // return + // } + if module, err := this.service.GetModule(comm.ModuleChat); err == nil { + if code = module.(comm.IChat).SendSysChatToWorld(comm.ChatSystem10, nil, 5, 0, "xxx", "25001"); code != pb.ErrorCode_Success { + return + } + } + this.Debug("使用bingo命令:uid = %s ", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "0", Value: datas[0]},