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