Merge branch 'meixiongfeng' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev

This commit is contained in:
meixiongfeng 2022-11-21 14:45:50 +08:00
commit edf63e2f0f
4 changed files with 136 additions and 2 deletions

View File

@ -323,7 +323,7 @@ const (
Reddot15 ReddotType = 10015 //装备----可附魔红点 前端处理
Reddot16 ReddotType = 10016 //装备----可洗炼红点 前端处理
Reddot17 ReddotType = 10017 //星座图----红点
Reddot18 ReddotType = 10018 //英雄招募----红点
Reddot18 ReddotType = 10018 //英雄招募----红点 // 前端处理
Reddot19 ReddotType = 10019 //竞技场----挑战红点
Reddot20 ReddotType = 10020 //丛林美食馆----可挂机红点
Reddot21 ReddotType = 10021 //丛林美食馆----可升级红点

View File

@ -282,9 +282,14 @@ type (
// 任务完成通知
TaskFinishNotify(uid string, taskId, groupId int32) error
}
//竞技场
IArena interface {
///红点
IReddot
}
IGourmet interface {
///红点
IReddot
}
)

View File

@ -48,3 +48,103 @@ func (this *Gourmet) ModifyGourmetData(uid string, data map[string]interface{})
}
return
}
//红点查询
func (this *Gourmet) 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.Reddot20:
reddot[comm.Reddot20] = this.CheckPoint20(session.GetUserId())
break
case comm.Reddot21:
reddot[comm.Reddot21] = this.CheckPoint21(session.GetUserId())
break
case comm.Reddot22:
reddot[comm.Reddot22] = this.CheckPoint22(session.GetUserId())
break
}
}
return
}
func (this *Gourmet) CheckPoint20(uid string) bool {
cfgCom := this.configure.GetGlobalConf() // 获取总的下单时长
if cfgCom == nil {
return false
}
_gourmet, err := this.modelGourmet.getGourmetList(uid)
if err != nil {
return false
}
if cfgCom.Gourmet < _gourmet.OrderCostTime { // 大于总时长是不允许的
return false
}
return true
}
func (this *Gourmet) CheckPoint21(uid string) bool {
_gourmet, err := this.modelGourmet.getGourmetList(uid)
if err != nil {
return false
}
for skillType := range _gourmet.Skill {
skilllv, _ := _gourmet.Skill[skillType]
if this.configure.GetGourmetConfigData(skillType, skillType+1) == nil { // 下一级是否存在
return false
}
_skillCfg := this.configure.GetGourmetConfigData(skillType, skilllv) // 获取技能配置
for _, v := range _skillCfg.SkillConsume {
if v.A == comm.AttrType { //用户属性资源
if amount := this.ModuleUser.QueryAttributeValue(uid, v.T); amount < int64(v.N) {
return false
}
} else if v.A == comm.ItemType { //道具资源
if amount := this.ModuleItems.QueryItemAmount(uid, v.T); amount < uint32(v.N) {
return false
}
}
}
}
// 特殊技能判断
for skillType := range _gourmet.SpecialSkill {
skilllv, _ := _gourmet.Skill[skillType]
if this.configure.GetGourmetConfigData(skillType, skillType+1) == nil { // 下一级是否存在
return false
}
_skillCfg := this.configure.GetGourmetConfigData(skillType, skilllv) // 获取技能配置
for _, v := range _skillCfg.SkillConsume {
if v.A == comm.AttrType { //用户属性资源
if amount := this.ModuleUser.QueryAttributeValue(uid, v.T); amount < int64(v.N) {
return false
}
} else if v.A == comm.ItemType { //道具资源
if amount := this.ModuleItems.QueryItemAmount(uid, v.T); amount < uint32(v.N) {
return false
}
}
}
}
return true
}
func (this *Gourmet) CheckPoint22(uid string) bool {
_gourmet, err := this.modelGourmet.getGourmetList(uid)
if err != nil {
return false
}
if len(_gourmet.Items) > 0 { // 有可领取的 直接返回
return true
}
return false
}

View File

@ -152,12 +152,22 @@ func (this *Pagoda) SetPagodaRankList(tableName string, score int32, uid string)
//红点查询
func (this *Pagoda) 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.Reddot6:
reddot[comm.Reddot6] = this.CheckPoint6(session.GetUserId())
break
case comm.Reddot7:
reddot[comm.Reddot7] = this.CheckPoint7(session.GetUserId())
break
}
}
return
}
// 红点检测
func (this *Pagoda) CheckPoint(uid string) bool {
func (this *Pagoda) CheckPoint6(uid string) bool {
list, err := this.modelPagoda.getPagodaList(uid)
if err != nil {
return false
@ -178,7 +188,26 @@ func (this *Pagoda) CheckPoint(uid string) bool {
}
return true
}
func (this *Pagoda) Rpc_ModuleSeasonPagodaReward(ctx context.Context, args *pb.EmptyReq, reply *pb.EmptyResp) {
this.Debug("Rpc_ModuleSeasonPagodaReward", log.Fields{"args": args.String()})
this.modulerank.seasonSettlement()
}
func (this *Pagoda) CheckPoint7(uid string) bool {
list, _ := this.modelPagoda.getPagodaList(uid)
if list.Id == "" { // 普通塔
return false
}
if len(list.Reward) > 0 {
return true
}
season, _ := this.modelSeasonPagoda.getSeasonPagodaList(uid)
if season.Id == "" { // 普通塔
return false
}
if len(season.Reward) > 0 {
return true
}
return true
}