融合 美食馆 铁匠铺埋点
This commit is contained in:
parent
f94cf46f2a
commit
a7f82085d3
@ -29,5 +29,7 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.GourmetGetListRe
|
||||
// 计算订单信息
|
||||
this.module.modelGourmet.CalculationGourmet(session.GetUserId(), _gourmet)
|
||||
session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet})
|
||||
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype136, _gourmet.TotalTime)
|
||||
return
|
||||
}
|
||||
|
@ -97,6 +97,9 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet)
|
||||
for _, order := range gourmet.Foods {
|
||||
_gourmetcfg := this.module.configure.GetGourmetConfigData(order.FoodType, gourmet.Skill[order.FoodType]) // 美食家配置表
|
||||
if order.FoodCount > 0 {
|
||||
if gourmet.CookingFood.ETime > configure.Now().Unix() {
|
||||
break
|
||||
}
|
||||
order.FoodCount--
|
||||
if order.FoodCount == 0 {
|
||||
order.CookTime = 0
|
||||
@ -127,7 +130,8 @@ func (this *modelGourmet) CalculationGourmet(uid string, gourmet *pb.DBGourmet)
|
||||
gourmet.Ctime = gourmet.CookingFood.ETime
|
||||
mapData["ctime"] = gourmet.Ctime
|
||||
bRet = true
|
||||
break
|
||||
gourmet.TotalTime += szTime[order.FoodType]
|
||||
mapData["totalTime"] = gourmet.TotalTime
|
||||
}
|
||||
}
|
||||
if !bRet { // 没有订单可以做
|
||||
|
@ -3,6 +3,7 @@ package hero
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/pb"
|
||||
"go_dreamfactory/utils"
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
@ -80,5 +81,7 @@ func (this *apiComp) Fusion(session comm.IUserSession, req *pb.HeroFusionReq) (c
|
||||
code = pb.ErrorCode_HeroCreate // 创建新英雄失败
|
||||
}
|
||||
session.SendMsg(string(this.module.GetType()), HeroFusionResp, &pb.HeroFusionResp{Heroid: conf.Hero})
|
||||
// 通过融合获得指定英雄
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype139, utils.ToInt32(conf.Hero))
|
||||
return
|
||||
}
|
||||
|
@ -20,14 +20,15 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.SmithyGetListReq
|
||||
if code != pb.ErrorCode_Success {
|
||||
return // 参数校验失败直接返回
|
||||
}
|
||||
_gourmet, err := this.module.modelSmithy.getSmithyList(session.GetUserId())
|
||||
_smithy, err := this.module.modelSmithy.getSmithyList(session.GetUserId())
|
||||
if err != nil {
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
// 计算订单信息
|
||||
this.module.modelSmithy.CalculationSmithy(session.GetUserId(), _gourmet)
|
||||
session.SendMsg(string(this.module.GetType()), SmithyGetListResp, &pb.SmithyGetListResp{Data: _gourmet})
|
||||
this.module.modelSmithy.CalculationSmithy(session.GetUserId(), _smithy)
|
||||
session.SendMsg(string(this.module.GetType()), SmithyGetListResp, &pb.SmithyGetListResp{Data: _smithy})
|
||||
|
||||
this.module.ModuleRtask.SendToRtask(session, comm.Rtype137, _smithy.TotalTime)
|
||||
return
|
||||
}
|
||||
|
@ -87,7 +87,11 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) {
|
||||
bRet := false
|
||||
for _, order := range smithy.Orders {
|
||||
_gourmetcfg := this.module.configure.GetSmithyConfigData(order.DeskType, smithy.Skill[order.DeskType]) // 美食家配置表
|
||||
|
||||
if order.Count > 0 {
|
||||
if smithy.Clang.ETime > configure.Now().Unix() {
|
||||
break
|
||||
}
|
||||
order.Count--
|
||||
if order.Count == 0 {
|
||||
order.NeedTime = 0
|
||||
@ -118,7 +122,8 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) {
|
||||
smithy.Ctime = smithy.Clang.ETime
|
||||
mapData["ctime"] = smithy.Ctime
|
||||
bRet = true
|
||||
break
|
||||
smithy.TotalTime += szTime[order.DeskType]
|
||||
mapData["totalTime"] = smithy.TotalTime
|
||||
}
|
||||
}
|
||||
if !bRet { // 没有订单可以做
|
||||
@ -147,6 +152,7 @@ func (this *modelSmithy) CalculationSmithy(uid string, smithy *pb.DBSmithy) {
|
||||
mapData["clang"] = smithy.Clang // 正在做的
|
||||
|
||||
this.module.ModifySmithyData(uid, mapData) // 同步数据
|
||||
|
||||
}
|
||||
|
||||
func (this *modelSmithy) CalculationDeskSkillLv(uid string, Smithy *pb.DBSmithy) {
|
||||
|
Loading…
Reference in New Issue
Block a user