diff --git a/comm/imodule.go b/comm/imodule.go index 35a2c4c48..2c873658b 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -313,7 +313,7 @@ type ( IPagoda interface { ModifyPagodaFloor(session IUserSession, d1 int32, d2 int32) (errdata *pb.ErrorData) CheckUserBasePagodaInfo(uid string) (data *pb.DBPagodaRecord) // 查询玩家最佳通关记录 - + CheckCompletePagoda(uid string) (bComplete bool) // 校验是否通关普通塔 // Check Rtype84 Rtype85 Rtype86 CheckPagodaMaxFloor(uid string, pagodaType int32) int32 // 查询塔通关难度type 1 表示普通塔 2 赛季塔 ///红点 diff --git a/modules/pagoda/api_racechallenge.go b/modules/pagoda/api_racechallenge.go index 50b5e8903..6af839c95 100644 --- a/modules/pagoda/api_racechallenge.go +++ b/modules/pagoda/api_racechallenge.go @@ -108,16 +108,6 @@ func (this *apiComp) ChallengeRace(session comm.IUserSession, req *pb.PagodaChal } } - // 校验条件 - if conf.Unlock != 1 { - if !this.mline.CheckCommpleteStage(session.GetUserId(), conf.Unlock) { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_PagodaUnlock, - Title: pb.ErrorCode_PagodaUnlock.ToString(), - } - return - } - } errdata, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{ Ptype: pb.PlayType_pagoda, Title: "", diff --git a/modules/pagoda/api_racechallengeover.go b/modules/pagoda/api_racechallengeover.go index 92cc8aff7..27213f46b 100644 --- a/modules/pagoda/api_racechallengeover.go +++ b/modules/pagoda/api_racechallengeover.go @@ -95,16 +95,7 @@ func (this *apiComp) ChallengeRaceOver(session comm.IUserSession, req *pb.Pagoda return } } - // 校验条件 - if conf.Unlock != 1 { - if !this.mline.CheckCommpleteStage(session.GetUserId(), conf.Unlock) { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_PagodaUnlock, - Title: pb.ErrorCode_PagodaUnlock.ToString(), - } - return - } - } + // 校验通过 errdata, isWin = this.module.battle.CheckBattleReport(session, req.Report) if errdata != nil { diff --git a/modules/pagoda/module.go b/modules/pagoda/module.go index 551e576ca..37305b021 100644 --- a/modules/pagoda/module.go +++ b/modules/pagoda/module.go @@ -204,3 +204,12 @@ func (this *Pagoda) GetSeasonData() (endSeasonTime int64) { return endSeasonTime } + +func (this *Pagoda) CheckCompletePagoda(uid string) (bComplete bool) { + + if list, err := this.modelPagoda.getPagodaList(uid); err != nil { + return list.Complete + } + + return false +} diff --git a/modules/sys/model_sys.go b/modules/sys/model_sys.go index eccd2582a..5b0b84040 100644 --- a/modules/sys/model_sys.go +++ b/modules/sys/model_sys.go @@ -111,6 +111,17 @@ func (this *ModelSys) validCond(uid string, condData *cfg.GameOpencondData) stri return "" } } + case 5: + module, err := this.service.GetModule(comm.ModulePagoda) + if err != nil { + this.moduleSys.Debugln(err) + return "" + } + if v, ok := module.(comm.IPagoda); ok { + if !v.CheckCompletePagoda(uid) { + return "" + } + } } } return condData.Id