From 935423bf0bdf028ca02f6f02810b8428bbe06c47 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 30 May 2023 13:49:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E4=BB=BB=E5=8A=A1=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/buried/configure.go | 41 ++++++++++++++++++++++++++++++++ modules/buried/core.go | 2 +- modules/buried/module.go | 2 ++ modules/equipment/api_upgrade.go | 12 ++++++---- 4 files changed, 51 insertions(+), 6 deletions(-) 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)