From ba4b108a6dd9155427d4633021306a8a9d865320 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 7 Dec 2022 10:03:25 +0800 Subject: [PATCH] =?UTF-8?q?bingo=20=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/gm/api_cmd.go | 4 ++++ modules/gm/module.go | 52 +++++++++++++++++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/modules/gm/api_cmd.go b/modules/gm/api_cmd.go index 7a01a225a..5ccdc4077 100644 --- a/modules/gm/api_cmd.go +++ b/modules/gm/api_cmd.go @@ -25,6 +25,10 @@ import ( 10、bingo:viking // 解锁维京所有难度 11、bingo:hunting // 解锁狩猎所有难度 12、bingo:mainline,1,101 // 难度 id +13、bingo:moon,1 // 触发月之秘境 +14、bingo:arena,100 // 设置竞技场用户积分 +15、bingo:sociatyexp,100 // 设置工会经验 +15、bingo:sociatyactivity,100 // 设置工会活跃 */ //参数校验 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 003535a5f..df5e3c05c 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -166,15 +166,15 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC } code = module1.(comm.IPagoda).ModifySeasonPagodaFloor(session, int32(num)) this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[0], "N": int32(num)}) - } else if len(datas) == 2 && (datas[0] == "viking") { // 解锁远征所有难度 + } else if len(datas) == 1 && (datas[0] == "viking") { // 解锁远征所有难度 module1, err := this.service.GetModule(comm.ModuleViking) if err != nil { return } code = module1.(comm.IViking).CompleteAllLevel(session) - this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]}) - } else if len(datas) == 2 && (datas[0] == "hunting") { // 解锁狩猎所有难度 + this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId()}) + } else if len(datas) == 1 && (datas[0] == "hunting") { // 解锁狩猎所有难度 module1, err := this.service.GetModule(comm.ModuleHunting) if err != nil { return @@ -192,7 +192,7 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC code = pb.ErrorCode_ReqParameterError return } - num2, err := strconv.Atoi(datas[1]) + num2, err := strconv.Atoi(datas[2]) if err != nil { code = pb.ErrorCode_ReqParameterError return @@ -200,6 +200,50 @@ func (this *GM) CreateCmd(session comm.IUserSession, cmd string) (code pb.ErrorC code = module1.(comm.IMainline).ModifyMainlineDataByNanduID(session.GetUserId(), int32(num1), int32(num2)) this.Debug("使用bingo命令", log.Fields{"uid": session.GetUserId(), "key:": keys[1]}) + } else if len(datas) == 2 && (datas[0] == "moon") { // 触发月之秘境 + module1, err := this.service.GetModule(comm.ModuleMoonfantasy) + if err != nil { + return + } + + module1.(comm.IMoonFantasy).TriggerMF(session, datas[1]) + this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]}) + } else if len(datas) == 2 && (datas[0] == "arena") { // 设置竞技场用户积分 + module1, err := this.service.GetModule(comm.ModuleArena) + if err != nil { + return + } + num, err := strconv.Atoi(datas[1]) + if err != nil { + code = pb.ErrorCode_ReqParameterError + return + } + module1.(comm.IArena).SetUserIntegral(session, int32(num)) + this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]}) + } else if len(datas) == 2 && (datas[0] == "sociatyexp") { // 设置工会经验 + module1, err := this.service.GetModule(comm.ModuleSociaty) + if err != nil { + return + } + num, err := strconv.Atoi(datas[1]) + if err != nil { + code = pb.ErrorCode_ReqParameterError + return + } + module1.(comm.ISociaty).BingoSetExp(session, int32(num)) + this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]}) + } else if len(datas) == 2 && (datas[0] == "sociatyactivity") { // 设置工会活跃度 + module1, err := this.service.GetModule(comm.ModuleSociaty) + if err != nil { + return + } + num, err := strconv.Atoi(datas[1]) + if err != nil { + code = pb.ErrorCode_ReqParameterError + return + } + module1.(comm.ISociaty).BingoSetActivity(session, int32(num)) + this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]}) } }