铁匠铺bug
This commit is contained in:
parent
d8477d7ce7
commit
1315707ce4
@ -17,7 +17,6 @@ const (
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service core.IService
|
||||
configure *configureComp
|
||||
module *Smithy
|
||||
}
|
||||
|
||||
|
@ -43,12 +43,13 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
|
||||
}
|
||||
costTime += needTime * order.Count
|
||||
}
|
||||
_smithy.Orders = append(_smithy.Orders, req.Order...) // 直接追加订单数据
|
||||
|
||||
if _smithy.Clang == nil || (_smithy.Clang != nil && _smithy.Clang.ETime == 0) {
|
||||
if _smithy.Ctime == 0 {
|
||||
_smithy.Ctime = time.Now().Unix()
|
||||
}
|
||||
_smithy.Orders = append(_smithy.Orders, req.Order...) // 直接追加订单数据
|
||||
_smithy.OrderCostTime += costTime
|
||||
if _smithy.Clang == nil || (_smithy.Clang != nil && _smithy.Clang.ETime == 0) {
|
||||
|
||||
if !utils.IsToday(_smithy.Ctime) {
|
||||
_smithy.Ctime = time.Now().Unix()
|
||||
_smithy.OrderCostTime = 0
|
||||
@ -91,6 +92,13 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
|
||||
|
||||
// 校验通过 写数据
|
||||
mapData := make(map[string]interface{}, 0)
|
||||
sz := make([]*pb.OrderClang, 0)
|
||||
for _, v := range _smithy.Orders {
|
||||
if v.Count != 0 {
|
||||
sz = append(sz, v)
|
||||
}
|
||||
}
|
||||
_smithy.Orders = sz
|
||||
mapData["orders"] = _smithy.Orders
|
||||
mapData["orderCostTime"] = _smithy.OrderCostTime
|
||||
mapData["clang"] = _smithy.Clang // 正在做的
|
||||
|
@ -37,10 +37,10 @@ func (this *apiComp) DeskSkillLv(session comm.IUserSession, req *pb.SmithyDeskSk
|
||||
if k == req.DeskType {
|
||||
bFindSkill = true
|
||||
// 查询配置文件
|
||||
curSkillCfg = this.configure.GetSmithyConfigData(k, v)
|
||||
curSkillCfg = this.module.configure.GetSmithyConfigData(k, v)
|
||||
if curSkillCfg != nil && curSkillCfg.Starupneed != nil {
|
||||
//获取下一级
|
||||
NextSkillCfg := this.configure.GetSmithyConfigData(k, v+1)
|
||||
NextSkillCfg := this.module.configure.GetSmithyConfigData(k, v+1)
|
||||
if NextSkillCfg == nil {
|
||||
code = pb.ErrorCode_GourmetSkillMaxLv
|
||||
return
|
||||
|
@ -26,12 +26,12 @@ func (this *apiComp) StoveSkillLv(session comm.IUserSession, req *pb.SmithyStove
|
||||
code = pb.ErrorCode_DBError
|
||||
return
|
||||
}
|
||||
curLvData := this.configure.GetSmithyStoveConfigData(_smithy.StoveLv)
|
||||
curLvData := this.module.configure.GetSmithyStoveConfigData(_smithy.StoveLv)
|
||||
if curLvData == nil {
|
||||
code = pb.ErrorCode_GourmetSkillMaxLv
|
||||
return
|
||||
}
|
||||
nextLvData := this.configure.GetSmithyStoveConfigData(_smithy.StoveLv + 1)
|
||||
nextLvData := this.module.configure.GetSmithyStoveConfigData(_smithy.StoveLv + 1)
|
||||
if nextLvData == nil {
|
||||
code = pb.ErrorCode_GourmetSkillMaxLv
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user