From a8347ef0af17341c33c096ba37d33685ff1699ff Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Thu, 10 Nov 2022 19:34:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E5=AD=A3=E5=A1=94=20=E4=B8=BB?= =?UTF-8?q?=E7=BA=BF=E7=BA=A2=E7=82=B9=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 4 ++++ modules/mainline/module.go | 39 ++++++++++++++++++++++++++++++++++++++ modules/pagoda/module.go | 30 +++++++++++++++++++++++++++++ 3 files changed, 73 insertions(+) diff --git a/comm/imodule.go b/comm/imodule.go index e647cf8b0..c2e7cdea3 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -120,6 +120,8 @@ type ( ModifyMainlineData(uid string, id int32) (code pb.ErrorCode) /// 查询章节ID GetUsermainLineData(uid string) (mainlineId int32) + + Reddot(uid string, rid ...ReddotType) map[ReddotType]bool } //任务 ITask interface { @@ -199,6 +201,8 @@ type ( IPagoda interface { ModifyPagodaFloor(session IUserSession, level int32) (code pb.ErrorCode) CheckUserBasePagodaInfo(uid string) (data *pb.DBPagodaRecord) // 查询玩家最佳通关记录 + + Reddot(uid string, rid ...ReddotType) map[ReddotType]bool } IHeroFetter interface { diff --git a/modules/mainline/module.go b/modules/mainline/module.go index 13bb24e42..d0061dbc8 100644 --- a/modules/mainline/module.go +++ b/modules/mainline/module.go @@ -98,3 +98,42 @@ func (this *Mainline) Start() (err error) { this.battle = module.(comm.IBattle) return } + +//红点查询 +func (this *Mainline) Reddot(uid string, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { + reddot = make(map[comm.ReddotType]bool) + for _, v := range rid { + if v == comm.Reddot5 { + reddot[comm.Reddot5] = this.CheckPoint(uid) + break + } + } + return +} + +// 红点检测 +func (this *Mainline) CheckPoint(uid string) bool { + list, err := this.modelMainline.getMainlineList(uid) + if err != nil { + return false + } + for _, v := range list { + conf := this.configure.GetMainlineChapter(v.ChapterId) + if conf == nil { + continue + } + bFind := false + for _, v1 := range conf.Episode { + for _, banch := range v.BranchID { + if banch == v1 { + bFind = true + break + } + } + } + if !bFind { // 没找到 显示红点 + return false + } + } + return true +} diff --git a/modules/pagoda/module.go b/modules/pagoda/module.go index bebbe16c1..629469b8a 100644 --- a/modules/pagoda/module.go +++ b/modules/pagoda/module.go @@ -139,3 +139,33 @@ func (this *Pagoda) SetPagodaRankList(tableName string, score int32, uid string) } } } + +//红点查询 +func (this *Pagoda) Reddot(uid string, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { + reddot = make(map[comm.ReddotType]bool) + + return +} + +// 红点检测 +func (this *Pagoda) CheckPoint(uid string) bool { + list, err := this.modelPagoda.getPagodaList(uid) + if err != nil { + return false + } + maxFloor := this.configure.GetPagodaFloor(list.Type) + if list.PagodaId < maxFloor { // 层数不够 显示红点 + return true + } + + // 检测赛季塔 + season, err := this.modelSeasonPagoda.getSeasonPagodaList(uid) + if err != nil { + return false + } + maxFloor = this.configure.GetPagodaFloor(list.Type) + if season.PagodaId < maxFloor { // 层数不够 显示红点 + return true + } + return true +}