新增远征狩猎红点
This commit is contained in:
parent
8b3e0b900f
commit
7f7f264c65
@ -342,6 +342,7 @@ const (
|
|||||||
Reddot29 ReddotType = 10029 //公会----申请红点
|
Reddot29 ReddotType = 10029 //公会----申请红点
|
||||||
Reddot30 ReddotType = 10030 //邮件-----未读邮件红点
|
Reddot30 ReddotType = 10030 //邮件-----未读邮件红点
|
||||||
Reddot31 ReddotType = 10031 //维京远征 有挑战次数
|
Reddot31 ReddotType = 10031 //维京远征 有挑战次数
|
||||||
|
Reddot32 ReddotType = 10032 //狩猎 有挑战次数
|
||||||
)
|
)
|
||||||
|
|
||||||
type TaskType int32
|
type TaskType int32
|
||||||
|
@ -23,6 +23,7 @@ type (
|
|||||||
Imail interface {
|
Imail interface {
|
||||||
CreateNewMail(session IUserSession, mail *pb.DBMailData) bool
|
CreateNewMail(session IUserSession, mail *pb.DBMailData) bool
|
||||||
SendNewMail(mail *pb.DBMailData, uid ...string) bool // 批量发送邮件 支持跨服
|
SendNewMail(mail *pb.DBMailData, uid ...string) bool // 批量发送邮件 支持跨服
|
||||||
|
IReddot
|
||||||
}
|
}
|
||||||
//道具背包接口
|
//道具背包接口
|
||||||
IItems interface {
|
IItems interface {
|
||||||
|
@ -59,3 +59,21 @@ func (this *modelHunting) getHuntingList(uid string) (result *pb.DBHunting, err
|
|||||||
err = nil
|
err = nil
|
||||||
return result, err
|
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
|
||||||
|
}
|
||||||
|
@ -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)
|
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
|
||||||
|
}
|
||||||
|
@ -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) {
|
for k, v := range this.module.gourmet.Reddot(session, _rid) {
|
||||||
reddot[int32(k)] = v
|
reddot[int32(k)] = v
|
||||||
}
|
}
|
||||||
case comm.Reddot26:
|
case comm.Reddot26, comm.Reddot30:
|
||||||
for k, v := range this.module.gourmet.Reddot(session, _rid) {
|
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
|
reddot[int32(k)] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,8 +27,10 @@ type Reddot struct {
|
|||||||
arena comm.IArena
|
arena comm.IArena
|
||||||
gourmet comm.IGourmet
|
gourmet comm.IGourmet
|
||||||
sociaty comm.ISociaty
|
sociaty comm.ISociaty
|
||||||
// mail comm.Imail
|
mail comm.Imail
|
||||||
api_comp *apiComp
|
viking comm.IViking
|
||||||
|
hunting comm.IHunting
|
||||||
|
api_comp *apiComp
|
||||||
}
|
}
|
||||||
|
|
||||||
//模块名
|
//模块名
|
||||||
@ -74,10 +76,21 @@ func (this *Reddot) Start() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.sociaty = module.(comm.ISociaty)
|
this.sociaty = module.(comm.ISociaty)
|
||||||
// if module, err = this.service.GetModule(comm.ModuleMail); err != nil {
|
|
||||||
// return
|
if module, err = this.service.GetModule(comm.ModuleMail); err != nil {
|
||||||
// }
|
return
|
||||||
// this.mail = module.(comm.Imail)
|
}
|
||||||
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user