开启通知接口

This commit is contained in:
meixiongfeng 2023-09-07 18:57:53 +08:00
parent 1359923623
commit 02f60eb381
6 changed files with 30 additions and 10 deletions

View File

@ -1060,3 +1060,13 @@ const (
Caddtime string = "caddtime"
Csubtime string = "csubtime"
)
// 条件开启枚举
type OpencondType int32
const (
OpencondTypePlatlv OpencondType = 1
OpencondTypeMaxmapid OpencondType = 2
OpencondTypeWorldtaskid OpencondType = 3
OpencondTypeFriend OpencondType = 4
)

View File

@ -42,7 +42,7 @@ type (
type (
ISys interface {
ValidCond(uid string, conf *cfg.GameOpencondData) string
CheckLvUpCond(session IUserSession, lv int32)
CheckOpenCond(session IUserSession, itype OpencondType, value int32)
// 查询opencond 配置
CheckOpenCondCfgById(uid string, id string) (bOpen bool, errdata *pb.ErrorData)

View File

@ -219,7 +219,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.MlineChall
module, err2 := this.module.service.GetModule(comm.ModuleSys)
if err2 == nil {
if isys, ok := module.(comm.ISys); ok {
isys.CheckLvUpCond(session, req.StageId) // 校验新功能是否开启
isys.CheckOpenCond(session, comm.OpencondTypeMaxmapid, req.StageId) // 校验新功能是否开启
}
}
// 主线任务统计 Rtype60

View File

@ -67,18 +67,26 @@ func (this *configureComp) LoadCondConfig() {
}
func (this *configureComp) GetOpencondLv(lv int32) []string {
this.hlock.RLock()
defer this.hlock.RUnlock()
return this.maplv[lv]
}
func (this *configureComp) getOpencondMline(id int32) []string {
this.hlock.RLock()
defer this.hlock.RUnlock()
return this.mapmline[id]
}
func (this *configureComp) getOpencondTask(id int32) []string {
this.hlock.RLock()
defer this.hlock.RUnlock()
return this.maptask[id]
}
func (this *configureComp) getFriendTask(id int32) []string {
this.hlock.RLock()
defer this.hlock.RUnlock()
return this.mapfriend[id]
}
func (this *configureComp) getOpencondCfg() (data *cfg.GameOpencond, err error) {

View File

@ -19,9 +19,7 @@ type ModuleSys struct {
service base.IRPCXService
modelSys *ModelSys
mainline comm.IMainline
pagoda comm.IPagoda
sociaty comm.ISociaty
}
@ -80,9 +78,13 @@ func (this *ModuleSys) ValidCond(uid string, conf *cfg.GameOpencondData) string
return this.modelSys.validCond(uid, conf)
}
func (this *ModuleSys) CheckLvUpCond(session comm.IUserSession, lv int32) {
if cond := this.configure.GetOpencondLv(lv); len(cond) > 0 {
this.AutoActivate(session, cond)
func (this *ModuleSys) CheckOpenCond(session comm.IUserSession, itype comm.OpencondType, value int32) {
switch itype {
case comm.OpencondTypePlatlv:
case comm.OpencondTypeMaxmapid:
case comm.OpencondTypeWorldtaskid:
case comm.OpencondTypeFriend:
}
}

View File

@ -310,7 +310,7 @@ func (this *ModelUser) ChangeLevel(event interface{}, next func(event interface{
}
et.TriggerEvent(comm.EventOpenCond, ul.session.GetUserId(), funcList)
isys.CheckLvUpCond(ul.session, curLv) // 校验新功能是否开启
isys.CheckOpenCond(ul.session, comm.OpencondTypePlatlv, curLv) // 校验新功能是否开启
}
}
if err := ul.session.SendMsg(string(this.module.GetType()), UserSubTypeLvChangedPush,