英雄数据埋点

This commit is contained in:
meixiongfeng 2022-11-22 17:53:04 +08:00
parent 08afddcc38
commit 4a7ef70fea
6 changed files with 44 additions and 2 deletions

View File

@ -483,7 +483,7 @@ const (
Rtype123 TaskType = 123 //拥有共鸣至A级的B星英雄N个(打开任务时检查B星英雄中共鸣等级大于等于A级的记入进度达到任务条件则完成任务) Rtype123 TaskType = 123 //拥有共鸣至A级的B星英雄N个(打开任务时检查B星英雄中共鸣等级大于等于A级的记入进度达到任务条件则完成任务)
Rtype124 TaskType = 124 //拥有共鸣至N级的英雄(打开任务时,检查英雄中共鸣等级最高的英雄并记入进度,达到任务条件则完成任务) Rtype124 TaskType = 124 //拥有共鸣至N级的英雄(打开任务时,检查英雄中共鸣等级最高的英雄并记入进度,达到任务条件则完成任务)
Rtype125 TaskType = 125 //指定英雄共鸣至N级(打开任务时,检查指定英雄的共鸣等级并记入进度,达到任务条件则完成任务) Rtype125 TaskType = 125 //指定英雄共鸣至N级(打开任务时,检查指定英雄的共鸣等级并记入进度,达到任务条件则完成任务)
Rtype126 TaskType = 126 //A阵营英雄共鸣N级(从接到任务开始A阵营的英雄共鸣每升1级进度+1) Rtype126 TaskType = 126 //A阵营英雄共鸣N级(从接到任务开始A阵营的英雄共鸣每升1级进度1)
Rtype127 TaskType = 127 //A星英雄共鸣N级(从接到任务开始A星的英雄共鸣每升1级进度+1) Rtype127 TaskType = 127 //A星英雄共鸣N级(从接到任务开始A星的英雄共鸣每升1级进度+1)
Rtype128 TaskType = 128 //竞技场积分达到N分(历史最高记录计入进度达到N分则完成任务) Rtype128 TaskType = 128 //竞技场积分达到N分(历史最高记录计入进度达到N分则完成任务)
Rtype129 TaskType = 129 //竞技场段位达到A段位(打开任务时,检查玩家历史最高段位,如果达到任务条件则完成任务) Rtype129 TaskType = 129 //竞技场段位达到A段位(打开任务时,检查玩家历史最高段位,如果达到任务条件则完成任务)

View File

@ -106,9 +106,11 @@ func (this *apiComp) Awaken(session comm.IUserSession, req *pb.HeroAwakenReq) (c
session.SendMsg(string(this.module.GetType()), Awaken, &pb.HeroAwakenResp{Hero: _hero}) session.SendMsg(string(this.module.GetType()), Awaken, &pb.HeroAwakenResp{Hero: _hero})
//任务相关 //任务相关
this.module.ModuleRtask.SendToRtask(session, comm.Rtype34, 1, _hero.JuexingLv) this.module.ModuleRtask.SendToRtask(session, comm.Rtype34, 1, _hero.JuexingLv)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype119, _hero.JuexingLv)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID)) this.module.ModuleRtask.SendToRtask(session, comm.Rtype35, _hero.JuexingLv, utils.ToInt32(_hero.HeroID))
cfg := this.module.configure.GetHeroConfig(_hero.HeroID) cfg := this.module.configure.GetHeroConfig(_hero.HeroID)
if cfg != nil { if cfg != nil {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype121, cfg.Race, utils.ToInt32(_hero.HeroID), _hero.JuexingLv)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv) this.module.ModuleRtask.SendToRtask(session, comm.Rtype36, 1, cfg.Color, cfg.Job, cfg.Race, _hero.JuexingLv)
//xx英雄满级、共鸣、觉醒至最高状态 //xx英雄满级、共鸣、觉醒至最高状态
nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1) nextAwaken := this.module.configure.GetHeroAwakenConfig(_hero.HeroID, _hero.JuexingLv+1)

View File

@ -246,9 +246,16 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
} else { // 阵营招募 } else { // 阵营招募
this.module.ModuleRtask.SendToRtask(session, comm.Rtype15, req.DrawCount) this.module.ModuleRtask.SendToRtask(session, comm.Rtype15, req.DrawCount)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype19, req.DrawCount) this.module.ModuleRtask.SendToRtask(session, comm.Rtype19, req.DrawCount)
if drawCount == 10 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype91, 1) // 阵营10连
}
} }
for _, star := range szStar { for _, star := range szStar {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype16, star, 1) this.module.ModuleRtask.SendToRtask(session, comm.Rtype16, star, 1)
} }
if drawCount == 10 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype90, 1)
}
this.module.ModuleRtask.SendToRtask(session, comm.Rtype89, req.DrawCount)
return return
} }

View File

@ -178,6 +178,6 @@ func (this *apiComp) StrengthenUpStar(session comm.IUserSession, req *pb.HeroStr
} else if _hero.Star == 6 { } else if _hero.Star == 6 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype28, 1) this.module.ModuleRtask.SendToRtask(session, comm.Rtype28, 1)
} }
this.module.ModuleRtask.SendToRtask(session, comm.Rtype115, utils.ToInt32(_hero.HeroID), _hero.Star)
return return
} }

View File

@ -560,6 +560,8 @@ func (this *ModelHero) AddCardExp(session comm.IUserSession, hero *pb.DBHero, ex
if curLv-preLv > 0 { // 升级了 统计任务 if curLv-preLv > 0 { // 升级了 统计任务
this.ChangeHeroProperty(session, hero) // 重新计算属性值 this.ChangeHeroProperty(session, hero) // 重新计算属性值
// 推送 // 推送
this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype113, utils.ToInt32(hero.HeroID), curLv-preLv)
this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype4, utils.ToInt32(hero.HeroID), hero.Lv) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype4, utils.ToInt32(hero.HeroID), hero.Lv)
this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype23, 1, hero.Star, hero.Lv) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype23, 1, hero.Star, hero.Lv)
this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype24, 1) this.moduleHero.ModuleRtask.SendToRtask(session, comm.Rtype24, 1)

View File

@ -560,3 +560,34 @@ func (this *Hero) CheckCondition(uid string) bool {
} }
return false return false
} }
// 检查大于lv等级英雄的数量
func (this *Hero) CheckLvNum(uid string, lv int32) int32 {
tmp := make([]*pb.DBHero, 0)
for _, v := range this.modelHero.getHeroList(uid) {
if v.Lv >= lv {
tmp = append(tmp, v)
}
}
return int32(len(tmp))
}
func (this *Hero) GetTujianHeroNum(uid string) int32 {
if result, err1 := this.ModuleUser.GetUserExpand(uid); err1 == nil {
tujian := result.GetTujian()
return int32(len(tujian))
}
return 0
}
////拥有觉醒至A级的B星英雄N个
func (this *Hero) CheckJuexingHeroNum(uid string, juexingLv int32, star int32) int32 {
tmp := make([]*pb.DBHero, 0)
for _, v := range this.modelHero.getHeroList(uid) {
if v.JuexingLv >= juexingLv && v.Star >= star {
tmp = append(tmp, v)
}
}
return int32(len(tmp))
}