随机任务埋点

This commit is contained in:
liwei1dao 2022-08-30 18:56:14 +08:00
parent df08889bb8
commit 54e737fafe
5 changed files with 20 additions and 2 deletions

View File

@ -60,6 +60,8 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code
code = pb.ErrorCode_DBError
return
}
//随机任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype62, 1)
break
case pb.ChatChannel_Union:
msg.UnionId = req.TargetId

View File

@ -142,7 +142,12 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade
}
code = this.module.ModuleHero.UpdateEquipment(session, hero, equipments)
}
//随机任务触发
this.module.ModuleRtask.SendToRtask(session, comm.Rtype43, 1, equipment.Lv)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype44, equipment.Lv)
this.module.ModuleRtask.SendToRtask(session, comm.Rtype47, 1)
}
session.SendMsg(string(this.module.GetType()), "upgrade", &pb.EquipmentUpgradeResp{IsSucc: issucc, Equipment: modifyequipments})
return
}

View File

@ -75,13 +75,14 @@ func (this *modelEquipmentComp) QueryEquipmentAmount(uid string, equipmentId str
}
//添加装备
func (this *modelEquipmentComp) AddEquipments(uId string, cIds map[string]uint32) (change []*pb.DB_Equipment, err error) {
func (this *modelEquipmentComp) AddEquipments(session comm.IUserSession, cIds map[string]uint32) (change []*pb.DB_Equipment, err error) {
var (
configure *cfg.GameEquip
equipments []*pb.DB_Equipment
iskeep bool
add map[string]*pb.DB_Equipment
update map[string]*pb.DB_Equipment
uId string = session.GetUserId()
)
if configure, err = this.module.configure.GetEquipmentConfigure(); err != nil {
return
@ -108,6 +109,8 @@ func (this *modelEquipmentComp) AddEquipments(uId string, cIds map[string]uint32
if equipment, err := this.newEquipment(uId, c, v); err != nil {
return nil, err
} else {
//随机任务
this.module.ModuleRtask.SendToRtask(session, comm.Rtype50, 1, c.Star)
add[equipment.Id] = equipment
change = append(change, equipment)
}

View File

@ -93,7 +93,7 @@ func (this *Equipment) AddNewEquipments(source *comm.ModuleCallSource, session c
err error
change []*pb.DB_Equipment
)
if change, err = this.modelEquipment.AddEquipments(session.GetUserId(), cIds); err != nil {
if change, err = this.modelEquipment.AddEquipments(session, cIds); err != nil {
this.Errorf("err%v", err)
code = pb.ErrorCode_SystemError
return

View File

@ -4,6 +4,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"go_dreamfactory/utils"
"math"
"time"
@ -85,6 +86,13 @@ func (this *apiComp) Buy(session comm.IUserSession, req *pb.ShopBuyReq) (code pb
"lastBuyTime": shopitem.LastBuyTime,
})
}
//随机任务
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))
}
}
session.SendMsg(string(this.module.GetType()), "buy", &pb.ShopBuyResp{IsSucc: true})
return
}