diff --git a/modules/buried/configure.go b/modules/buried/configure.go index fda034191..21f2e62fb 100644 --- a/modules/buried/configure.go +++ b/modules/buried/configure.go @@ -4,6 +4,7 @@ import ( "fmt" "go_dreamfactory/comm" "go_dreamfactory/lego/core" + "go_dreamfactory/lego/sys/log" "go_dreamfactory/modules" "go_dreamfactory/sys/configure" cfg "go_dreamfactory/sys/configure/structs" @@ -33,6 +34,46 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp return } +func (this *configureComp) Start() (err error) { + err = this.MCompConfigure.Start() + err = this.checkconfig() + return +} + +//校验配置异常 +func (this *configureComp) checkconfig() (err error) { + var ( + v interface{} + ok bool + vtype *cfg.GameBuriedType + vt *cfg.GameBuriedTypeData + ) + if v, err = this.GetConfigure(game_buriedtype); err != nil { + this.module.Errorf("err:%v", err) + return + } + vtype = v.(*cfg.GameBuriedType) + for k, conids := range this.group { + if vt, ok = vtype.GetDataMap()[int32(k)]; ok { + for _, cond := range conids { + if len(vt.Filter) != len(cond.Filter) { + this.module.Error("埋点中心配置错误!", + log.Field{Key: "vtype", Value: int32(k)}, + log.Field{Key: "cond", Value: cond.Id}, + log.Field{Key: "vtype_filter", Value: vt.Filter}, + log.Field{Key: "cond_filter", Value: cond.Filter}, + ) + } + } + } else { + this.module.Error("未配置埋点类型!", + log.Field{Key: "vtype", Value: int32(k)}, + ) + } + } + return +} + //读取埋点配置数据 func (this *configureComp) getburiedtypedata(tt comm.TaskType) (result *cfg.GameBuriedTypeData, err error) { var ( diff --git a/modules/buried/core.go b/modules/buried/core.go index 1dc856c92..dbbc02fbc 100644 --- a/modules/buried/core.go +++ b/modules/buried/core.go @@ -33,7 +33,7 @@ const ( //判断埋点数据的有效性 func checkburied(buried *comm.BuriedParam, bconf *cfg.GameBuriedTypeData, conf *cfg.GameBuriedCondiData) (efficient bool) { - if len(buried.Filter) != len(conf.Filter) { + if !(len(buried.Filter) == len(conf.Filter) && len(bconf.Filter) == len(conf.Filter)) { log.Error("校验埋点错误!", log.Field{Key: "buried", Value: buried}, log.Field{Key: "conf", Value: conf}) return } diff --git a/modules/buried/module.go b/modules/buried/module.go index cdb408782..d415ef847 100644 --- a/modules/buried/module.go +++ b/modules/buried/module.go @@ -201,6 +201,8 @@ func (this *Buried) TriggerBuried(uid string, burieds ...*comm.BuriedParam) { completeConIds []int32 //完成id列表 err error ) + this.Debug("触发埋点!", log.Field{Key: "burieds", Value: burieds}) + if model, err = this.modelBuried.getburiedModel(uid); err != nil { this.Error("获取用户埋点数据模型对象失败!", log.Field{Key: "err", Value: err.Error()}) return diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index fe01250d2..512232f6e 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -167,19 +167,21 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade } } - if hero.SuiteId != 0 { + if conf.Pos < 4 && hero.SuiteId != 0 { hero.Suite1Lv = suite1Lv tasks = append(tasks, comm.GetBuriedParam(comm.Rtype49, 1, hero.Suite1Star, hero.Suite1Lv)) - // this.module.ModuleRtask.SendToRtask(session, comm.Rtype49, 1, hero.Suite1Star, hero.Suite1Lv) + tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype43, equipment.Id, equipment.Lv)) + tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype45, equipment.Id, conf.Star, hero.SuiteExtId, hero.Suite2Lv)) } - if hero.SuiteExtId != 0 { + if conf.Pos >= 4 && conf.Pos < 6 && hero.SuiteExtId != 0 { + hero.Suite2Lv = suite2Lv tasks = append(tasks, comm.GetBuriedParam(comm.Rtype48, 1, hero.Suite2Star, hero.Suite2Lv)) - // this.module.ModuleRtask.SendToRtask(session, comm.Rtype48, 1, hero.Suite2Star, hero.Suite2Lv) + tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype45, equipment.Id, conf.Star, hero.SuiteExtId, hero.Suite2Lv)) } code = this.module.ModuleHero.UpdateEquipment(session, hero, equipments) } //随机任务触发 - tasks = append(tasks, comm.GetBuriedParam(comm.Rtype43, 1, equipment.Lv)) + tasks = append(tasks, comm.GetBuriedParam2(comm.Rtype43, equipment.Id, equipment.Lv)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype44, 1, equipment.Lv)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype47, 1)) // this.module.ModuleRtask.SendToRtask(session, comm.Rtype43, 1, equipment.Lv)