融合 美食馆 铁匠铺埋点

This commit is contained in:
meixiongfeng 2022-11-22 20:31:00 +08:00
parent f94cf46f2a
commit a7f82085d3
5 changed files with 21 additions and 5 deletions

View File

@ -29,5 +29,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.GourmetGetListRe
// 计算订单信息 // 计算订单信息
this.module.modelGourmet.CalculationGourmet(session.GetUserId(), _gourmet) this.module.modelGourmet.CalculationGourmet(session.GetUserId(), _gourmet)
session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet}) session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet})
this.module.ModuleRtask.SendToRtask(session, comm.Rtype136, _gourmet.TotalTime)
return return
} }

View File

@ -97,6 +97,9 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet)
for _, order := range gourmet.Foods { for _, order := range gourmet.Foods {
_gourmetcfg := this.module.configure.GetGourmetConfigData(order.FoodType, gourmet.Skill[order.FoodType]) // 美食家配置表 _gourmetcfg := this.module.configure.GetGourmetConfigData(order.FoodType, gourmet.Skill[order.FoodType]) // 美食家配置表
if order.FoodCount > 0 { if order.FoodCount > 0 {
if gourmet.CookingFood.ETime > configure.Now().Unix() {
break
}
order.FoodCount-- order.FoodCount--
if order.FoodCount == 0 { if order.FoodCount == 0 {
order.CookTime = 0 order.CookTime = 0
@ -127,7 +130,8 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet)
gourmet.Ctime = gourmet.CookingFood.ETime gourmet.Ctime = gourmet.CookingFood.ETime
mapData["ctime"] = gourmet.Ctime mapData["ctime"] = gourmet.Ctime
bRet = true bRet = true
break gourmet.TotalTime += szTime[order.FoodType]
mapData["totalTime"] = gourmet.TotalTime
} }
} }
if !bRet { // 没有订单可以做 if !bRet { // 没有订单可以做

View File

@ -3,6 +3,7 @@ package hero
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils"
"google.golang.org/protobuf/proto" "google.golang.org/protobuf/proto"
) )
@ -80,5 +81,7 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c
code = pb.ErrorCode_HeroCreate // 创建新英雄失败 code = pb.ErrorCode_HeroCreate // 创建新英雄失败
} }
session.SendMsg(string(this.module.GetType()), HeroFusionResp, &pb.HeroFusionResp{Heroid: conf.Hero}) session.SendMsg(string(this.module.GetType()), HeroFusionResp, &pb.HeroFusionResp{Heroid: conf.Hero})
// 通过融合获得指定英雄
this.module.ModuleRtask.SendToRtask(session, comm.Rtype139, utils.ToInt32(conf.Hero))
return return
} }

View File

@ -20,14 +20,15 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.SmithyGetListReq
if code != pb.ErrorCode_Success { if code != pb.ErrorCode_Success {
return // 参数校验失败直接返回 return // 参数校验失败直接返回
} }
_gourmet, err := this.module.modelSmithy.getSmithyList(session.GetUserId()) _smithy, err := this.module.modelSmithy.getSmithyList(session.GetUserId())
if err != nil { if err != nil {
code = pb.ErrorCode_DBError code = pb.ErrorCode_DBError
return return
} }
// 计算订单信息 // 计算订单信息
this.module.modelSmithy.CalculationSmithy(session.GetUserId(), _gourmet) this.module.modelSmithy.CalculationSmithy(session.GetUserId(), _smithy)
session.SendMsg(string(this.module.GetType()), SmithyGetListResp, &pb.SmithyGetListResp{Data: _gourmet}) session.SendMsg(string(this.module.GetType()), SmithyGetListResp, &pb.SmithyGetListResp{Data: _smithy})
this.module.ModuleRtask.SendToRtask(session, comm.Rtype137, _smithy.TotalTime)
return return
} }

View File

@ -87,7 +87,11 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) {
bRet := false bRet := false
for _, order := range smithy.Orders { for _, order := range smithy.Orders {
_gourmetcfg := this.module.configure.GetSmithyConfigData(order.DeskType, smithy.Skill[order.DeskType]) // 美食家配置表 _gourmetcfg := this.module.configure.GetSmithyConfigData(order.DeskType, smithy.Skill[order.DeskType]) // 美食家配置表
if order.Count > 0 { if order.Count > 0 {
if smithy.Clang.ETime > configure.Now().Unix() {
break
}
order.Count-- order.Count--
if order.Count == 0 { if order.Count == 0 {
order.NeedTime = 0 order.NeedTime = 0
@ -118,7 +122,8 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) {
smithy.Ctime = smithy.Clang.ETime smithy.Ctime = smithy.Clang.ETime
mapData["ctime"] = smithy.Ctime mapData["ctime"] = smithy.Ctime
bRet = true bRet = true
break smithy.TotalTime += szTime[order.DeskType]
mapData["totalTime"] = smithy.TotalTime
} }
} }
if !bRet { // 没有订单可以做 if !bRet { // 没有订单可以做
@ -147,6 +152,7 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) {
mapData["clang"] = smithy.Clang // 正在做的 mapData["clang"] = smithy.Clang // 正在做的
this.module.ModifySmithyData(uid, mapData) // 同步数据 this.module.ModifySmithyData(uid, mapData) // 同步数据
} }
func (this *modelSmithy) CalculationDeskSkillLv(uid string, Smithy *pb.DBSmithy) { func (this *modelSmithy) CalculationDeskSkillLv(uid string, Smithy *pb.DBSmithy) {