diff --git a/comm/const.go b/comm/const.go index 2605ba0f5..0f47ce036 100644 --- a/comm/const.go +++ b/comm/const.go @@ -342,6 +342,7 @@ const ( Reddot29 ReddotType = 10029 //公会----申请红点 Reddot30 ReddotType = 10030 //邮件-----未读邮件红点 Reddot31 ReddotType = 10031 //维京远征 有挑战次数 + Reddot32 ReddotType = 10032 //狩猎 有挑战次数 ) type TaskType int32 diff --git a/comm/imodule.go b/comm/imodule.go index f135aa9bf..2d178134f 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -23,6 +23,7 @@ type ( Imail interface { CreateNewMail(session IUserSession, mail *pb.DBMailData) bool SendNewMail(mail *pb.DBMailData, uid ...string) bool // 批量发送邮件 支持跨服 + IReddot } //道具背包接口 IItems interface { diff --git a/modules/hunting/model_hunting.go b/modules/hunting/model_hunting.go index 25166eca9..e4ff20e75 100644 --- a/modules/hunting/model_hunting.go +++ b/modules/hunting/model_hunting.go @@ -59,3 +59,21 @@ func (this *modelHunting) getHuntingList(uid string) (result *pb.DBHunting, err err = nil return result, err } + +// 红点检测 +func (this *modelHunting) checkReddot32(uid string) bool { + + conf := this.module.configure.GetGlobalConf() + if conf == nil { + return false + } + costRes := conf.HuntingCos + if costRes == nil { + return false + } + amount := int32(this.module.ModuleItems.QueryItemAmount(uid, costRes.T)) // 获取当前数量 + if amount > 0 { + return true + } + return false +} diff --git a/modules/hunting/module.go b/modules/hunting/module.go index 2d6df0b74..2b3949b31 100644 --- a/modules/hunting/module.go +++ b/modules/hunting/module.go @@ -139,3 +139,17 @@ func (this *Hunting) CheckRank(uid string, boosID int32, difficulty int32, hunti this.modulerank.SetRankListData("huntingRank"+strconv.Itoa(int(boosID)), difficulty<<16+costTime, objID) } } + +//红点查询 +func (this *Hunting) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (reddot map[comm.ReddotType]bool) { + reddot = make(map[comm.ReddotType]bool) + for _, v := range rid { + switch v { + case comm.Reddot32: + reddot[comm.Reddot32] = this.modelHunting.checkReddot32(session.GetUserId()) + break + + } + } + return +} diff --git a/modules/reddot/api_get.go b/modules/reddot/api_get.go index d4c97900d..99e7c1b77 100644 --- a/modules/reddot/api_get.go +++ b/modules/reddot/api_get.go @@ -57,8 +57,17 @@ func (this *apiComp) Get(session comm.IUserSession, req *pb.ReddotGetReq) (code for k, v := range this.module.gourmet.Reddot(session, _rid) { reddot[int32(k)] = v } - case comm.Reddot26: - for k, v := range this.module.gourmet.Reddot(session, _rid) { + case comm.Reddot26, comm.Reddot30: + for k, v := range this.module.mail.Reddot(session, _rid) { + reddot[int32(k)] = v + } + case comm.Reddot31: + for k, v := range this.module.viking.Reddot(session, _rid) { + reddot[int32(k)] = v + } + + case comm.Reddot32: + for k, v := range this.module.hunting.Reddot(session, _rid) { reddot[int32(k)] = v } } diff --git a/modules/reddot/module.go b/modules/reddot/module.go index 983cfef19..7bf6c3f26 100644 --- a/modules/reddot/module.go +++ b/modules/reddot/module.go @@ -27,8 +27,10 @@ type Reddot struct { arena comm.IArena gourmet comm.IGourmet sociaty comm.ISociaty - // mail comm.Imail - api_comp *apiComp + mail comm.Imail + viking comm.IViking + hunting comm.IHunting + api_comp *apiComp } //模块名 @@ -74,10 +76,21 @@ func (this *Reddot) Start() (err error) { return } this.sociaty = module.(comm.ISociaty) - // if module, err = this.service.GetModule(comm.ModuleMail); err != nil { - // return - // } - // this.mail = module.(comm.Imail) + + if module, err = this.service.GetModule(comm.ModuleMail); err != nil { + return + } + this.mail = module.(comm.Imail) + + if module, err = this.service.GetModule(comm.ModuleViking); err != nil { + return + } + this.viking = module.(comm.IViking) + + if module, err = this.service.GetModule(comm.ModuleHunting); err != nil { + return + } + this.hunting = module.(comm.IHunting) return }