From d21a7ab7162fae8e7c4ae0f0b0f47fcff99c3398 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 28 Dec 2022 18:36:59 +0800 Subject: [PATCH 1/3] =?UTF-8?q?bingo=20=E5=91=BD=E4=BB=A4=E6=89=A9?= =?UTF-8?q?=E5=B1=95=20=E6=B8=85=E7=90=86=E8=83=8C=E5=8C=85=20=E6=A8=A1?= =?UTF-8?q?=E6=8B=9F=E5=85=85=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gm/api_cmd.go | 3 +++ modules/gm/module.go | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/modules/gm/api_cmd.go b/modules/gm/api_cmd.go index 495d2838e..d99ea48b6 100644 --- a/modules/gm/api_cmd.go +++ b/modules/gm/api_cmd.go @@ -32,6 +32,9 @@ import ( 16、bingo:alltask // bingo所有任务 16、bingo:allhero // bingo所有英雄 17、bingo:allgrowtask // 完成所有成长任务 +18、bingo:lv,50 +19、bingo:recharge,10 +20、bingo:cleanitem */ //参数校验 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 6f75987b3..27bc61652 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -342,7 +342,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC log.Field{Key: "param", Value: datas[0]}, log.Field{Key: "res", Value: res}, ) - } else if len(datas) == 2 && (datas[0] == "userlv") { // 玩家等级 + } else if len(datas) == 2 && (datas[0] == "lv") { // 玩家等级 module1, err := this.service.GetModule(comm.ModuleUser) if err != nil { return @@ -360,6 +360,41 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC log.Field{Key: "0", Value: datas[0]}, log.Field{Key: "N", Value: int32(num)}, ) + } else if len(datas) == 2 && (datas[0] == "recharge") { // 充值次数 + module1, err := this.service.GetModule(comm.ModulePay) + if err != nil { + return + } + num, err := strconv.Atoi(datas[1]) + if err != nil { + code = pb.ErrorCode_ReqParameterError + return + } + for i := 0; i < num; i++ { + if code = module1.(comm.IPay).ModulePayDelivery(session, "8", 64800); code != pb.ErrorCode_Success { + return + } + } + + this.Debug("使用bingo命令:uid = %s ", + log.Field{Key: "uid", Value: session.GetUserId()}, + log.Field{Key: "0", Value: datas[0]}, + log.Field{Key: "N", Value: int32(num)}, + ) + } else if len(datas) == 1 && (datas[0] == "cleanitem") { // 充值次数 + module1, err := this.service.GetModule(comm.ModuleItems) + if err != nil { + return + } + + if code = module1.(comm.IItems).CleanItems(session); code != pb.ErrorCode_Success { + return + } + + this.Debug("使用bingo命令:uid = %s ", + log.Field{Key: "uid", Value: session.GetUserId()}, + log.Field{Key: "0", Value: datas[0]}, + ) } } From 0c60f0d2ace40b4031b7b59f7b6172ebc84ab63a Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 28 Dec 2022 18:50:49 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=89=80=E6=9C=89?= =?UTF-8?q?=E8=A3=85=E5=A4=87?= 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 | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/gm/api_cmd.go b/modules/gm/api_cmd.go index d99ea48b6..50469300e 100644 --- a/modules/gm/api_cmd.go +++ b/modules/gm/api_cmd.go @@ -35,6 +35,7 @@ import ( 18、bingo:lv,50 19、bingo:recharge,10 20、bingo:cleanitem +21、bingo:allequip */ //参数校验 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 27bc61652..a6159f31a 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -395,8 +395,21 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "0", Value: datas[0]}, ) - } + } else if len(datas) == 1 && (datas[0] == "allequip") { // 充值次数 + module1, err := this.service.GetModule(comm.ModuleEquipment) + if err != nil { + return + } + if code = module1.(comm.IEquipment).AddAllEquipments(session); code != pb.ErrorCode_Success { + return + } + + this.Debug("使用bingo命令:uid = %s ", + log.Field{Key: "uid", Value: session.GetUserId()}, + log.Field{Key: "0", Value: datas[0]}, + ) + } } } 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 3/3] =?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]},