From 608b99672844529622ac1972d8e084e30ea86229 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Tue, 6 Dec 2022 17:15:50 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E4=BA=AC=E8=BF=9C=E5=BE=81=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEboss=20=E9=9A=BE=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 ++ modules/gm/api_cmd.go | 2 ++ modules/gm/module.go | 16 ++++++++++++++++ modules/hunting/module.go | 26 ++++++++++++++++++++++++++ modules/viking/module.go | 26 ++++++++++++++++++++++++++ 5 files changed, 72 insertions(+) diff --git a/comm/imodule.go b/comm/imodule.go index 2f65dde9a..18a3be5c5 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -242,10 +242,12 @@ type ( TriggerMF(session IUserSession, Boosid string) (err error) } IViking interface { + CompleteAllLevel(session IUserSession) (code pb.ErrorCode) CheckUserBaseVikingInfo(uid string) (data []*pb.DBVikingRank) // 查询玩家最佳通关记录 IReddot } IHunting interface { + CompleteAllLevel(session IUserSession) (code pb.ErrorCode) CheckUserBaseHuntingInfo(uid string) (data []*pb.DBHuntingRank) // 查询玩家最佳通关记录 IReddot } diff --git a/modules/gm/api_cmd.go b/modules/gm/api_cmd.go index 5c1f0b263..72492e0b3 100644 --- a/modules/gm/api_cmd.go +++ b/modules/gm/api_cmd.go @@ -22,6 +22,8 @@ import ( 7、bingo:vip,yueka_1,1 // 月卡类型 8、bingo:manhero // 获取所有满星满级满觉醒的英雄 9、bingo:season,10 赛季塔层数 +10、bingo:viking // 解锁维京所有难度 +11、bingo:hunting // 解锁狩猎所有难度 */ //参数校验 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 1af7bf860..0cc01d1a7 100644 --- a/modules/gm/module.go +++ b/modules/gm/module.go @@ -166,6 +166,22 @@ 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") { // 解锁远征所有难度 + 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") { // 解锁狩猎所有难度 + module1, err := this.service.GetModule(comm.ModuleHunting) + if err != nil { + return + } + + code = module1.(comm.IHunting).CompleteAllLevel(session) + this.Debug("使用bingo命令:uid = %s ", log.Fields{"uid": session.GetUserId(), "0": datas[1]}) } } diff --git a/modules/hunting/module.go b/modules/hunting/module.go index 2b3949b31..782718506 100644 --- a/modules/hunting/module.go +++ b/modules/hunting/module.go @@ -153,3 +153,29 @@ func (this *Hunting) Reddot(session comm.IUserSession, rid ...comm.ReddotType) ( } return } + +// 解锁远征所有难度 +func (this *Hunting) CompleteAllLevel(session comm.IUserSession) (code pb.ErrorCode) { + list, err := this.modelHunting.getHuntingList(session.GetUserId()) + if err != nil { + code = pb.ErrorCode_DBError + return + } + mapData := make(map[string]interface{}, 0) + // 查配置获取每个Boss的最大难度 + for k := range list.Boss { + for i := 1; ; i++ { + conf := this.configure.GetHuntingBossConfigData(k, int32(i)) + if conf == nil { + list.Boss[k] = int32(i - 1) + } + } + } + mapData["boss"] = list.Boss + code = this.ModifyHuntingData(session.GetUserId(), mapData) + for k := range list.Boss { + list.Boss[k] += 1 + } + session.SendMsg(string(this.GetType()), HuntingGetListResp, &pb.HuntingGetListResp{Data: list}) + return +} diff --git a/modules/viking/module.go b/modules/viking/module.go index 89b2b0418..5b106895b 100644 --- a/modules/viking/module.go +++ b/modules/viking/module.go @@ -158,3 +158,29 @@ func (this *Viking) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (r } return } + +// 解锁远征所有难度 +func (this *Viking) CompleteAllLevel(session comm.IUserSession) (code pb.ErrorCode) { + list, err := this.modelViking.getVikingList(session.GetUserId()) + if err != nil { + code = pb.ErrorCode_DBError + return + } + mapData := make(map[string]interface{}, 0) + // 查配置获取每个Boss的最大难度 + for k := range list.Boss { + for i := 1; ; i++ { + conf := this.configure.GetVikingBossConfigData(k, int32(i)) + if conf == nil { + list.Boss[k] = int32(i - 1) + } + } + } + mapData["boss"] = list.Boss + code = this.ModifyVikingData(session.GetUserId(), mapData) + for k := range list.Boss { + list.Boss[k] += 1 + } + session.SendMsg(string(this.GetType()), VikingGetListResp, &pb.VikingGetListResp{Data: list}) + return +}