上传随机任务埋点

This commit is contained in:
liwei1dao 2022-08-31 11:03:32 +08:00
parent 54e737fafe
commit efa4bc698b
4 changed files with 47 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import (
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"math"
"google.golang.org/protobuf/proto"
)
@ -31,6 +32,7 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
equipStr map[int32]int32 = make(map[int32]int32)
equipLv map[int32]int32 = make(map[int32]int32)
hero *pb.DBHero
minStr, minLv int32 = math.MaxInt32, math.MaxInt32
)
if code = this.EquipCheck(session, req); code != pb.ErrorCode_Success {
@ -64,6 +66,13 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
return
}
equipStr[confs[i].Star]++
if confs[i].Star < minStr {
minStr = confs[i].Star
}
if equipments[i].Lv < minLv {
minLv = equipments[i].Lv
}
} else {
equipments[i] = nil
}
@ -151,6 +160,15 @@ func (this *apiComp) Equip(session comm.IUserSession, req *pb.EquipmentEquipReq)
for k, v := range equipLv {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype42, utils.ToInt32(hero.HeroID), v, k)
}
if hero.SuiteId != 0 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype46, utils.ToInt32(hero.HeroID), minStr, minLv)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype49, 1, minStr, minLv)
}
if hero.SuiteExtId != 0 {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype46, utils.ToInt32(hero.HeroID), minStr, minLv)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype48, 1, minStr, minLv)
}
session.SendMsg(string(this.module.GetType()), "equip", &pb.EquipmentEquipResp{Equipments: updatequipment})
return
}

View File

@ -6,6 +6,7 @@ import (
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"math"
"math/big"
"go.mongodb.org/mongo-driver/bson/primitive"
@ -32,7 +33,9 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
modifyequipments []*pb.DB_Equipment
hero *pb.DBHero
equipments []*pb.DB_Equipment
confs []*cfg.GameEquipData
issucc bool
minStr, minLv int32 = math.MaxInt32, math.MaxInt32
)
if code = this.UpgradeCheck(session, req); code != pb.ErrorCode_Success {
return
@ -115,6 +118,7 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
}
}
equipments = make([]*pb.DB_Equipment, 6)
confs = make([]*cfg.GameEquipData, 6)
//已装备 重新计算属性
if equipment.HeroId != "" {
if hero, code = this.module.ModuleHero.GetHeroByObjID(session.GetUserId(), equipment.HeroId); code != pb.ErrorCode_Success {
@ -135,12 +139,26 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
code = pb.ErrorCode_EquipmentOnFoundEquipment
return
}
confs[i], _ = this.module.configure.GetEquipmentConfigureById(equipments[i].CId)
} else {
equipments[i] = equipment
confs[i] = conf
}
if confs[i].Star < minStr {
minStr = confs[i].Star
}
if equipments[i].Lv < minLv {
minLv = equipments[i].Lv
}
}
}
code = this.module.ModuleHero.UpdateEquipment(session, hero, equipments)
if hero.SuiteId != 0 && hero.SuiteExtId == conf.Suittype {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype49, 1, minStr, minLv)
}
if hero.SuiteExtId != 0 && hero.SuiteExtId == conf.Suittype {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype48, 1, minStr, minLv)
}
}
//随机任务触发
this.module.ModuleRtask.SendToRtask(session, comm.Rtype43, 1, equipment.Lv)

View File

@ -4,6 +4,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto"
)
@ -52,6 +53,9 @@ func (this *apiComp) Useitem(session comm.IUserSession, req *pb.ItemsUseItemReq)
if code = this.module.ModuleHero.GetSpecifiedHero(session, sale.Prize[0].T, sale.Star, 1, int32(req.Amount)); code != pb.ErrorCode_Success {
return
}
//随机任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype22, 1)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype22, utils.ToInt32(sale.Prize[0].T))
case 4: //自选宝箱
if prop, err = this.module.configure.GetPropsgroupConfigure(itemcf.BoxId); err != nil {
code = pb.ErrorCode_ConfigNoFound

View File

@ -90,7 +90,13 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (code pb
this.module.ModuleRtask.SendToRtask(session, comm.Rtype64, 1)
for _, v := range give {
if v.A == comm.ItemType {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype64, v.N, utils.ToInt32(v.T))
this.module.ModuleRtask.SendToRtask(session, comm.Rtype65, v.N, utils.ToInt32(v.T))
}
}
this.module.ModuleRtask.SendToRtask(session, comm.Rtype66, 1, int32(req.ShopType))
for _, v := range need {
if v.A == comm.AttrType && (v.T == comm.ResGold || v.T == comm.ResDiamond) {
this.module.ModuleRtask.SendToRtask(session, comm.Rtype67, v.N, utils.ToInt32(v.T))
}
}
session.SendMsg(string(this.module.GetType()), "buy", &pb.ShopBuyResp{IsSucc: true})