This commit is contained in:
wh_zcy 2023-03-06 18:05:39 +08:00
commit 9ec31dee0f
4 changed files with 18 additions and 20 deletions

View File

@ -730,7 +730,7 @@ const (
PrivilegeType7 //巨怪商队背包容量
PrivilegeType8 //美食馆每日最大制作时间
PrivilegeType9 //武馆每日最大练功时间
PrivilegeType10 //铁匠铺每日最大锻造时间
)
const (
MainStarType1 = 1 //成功通关

View File

@ -67,7 +67,7 @@ type (
//清理玩家英雄数据
CleanData(uid string)
// 获取指定星级等级的英雄
GetSpecifiedHero(session IUserSession, heroConfId string, star, lv, amount int32) (code pb.ErrorCode)
GetSpecifiedHero(session IUserSession, heroConfId string, star, lv int32) (code pb.ErrorCode)
// 英雄加经验
AddHeroExp(session IUserSession, heroObjID string, exp int32) (curAddExp int32, code pb.ErrorCode)
// 英雄练功

View File

@ -204,8 +204,8 @@ func (this *Hero) CleanData(uid string) {
}
// 创建一些特殊的英雄
func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string, star, lv, amount int32) (code pb.ErrorCode) {
if session.GetUserId() == "" || heroConfId == "" || star == 0 || lv == 0 || amount == 0 {
func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string, star, lv int32) (code pb.ErrorCode) {
if session.GetUserId() == "" || heroConfId == "" || star == 0 || lv == 0 {
return pb.ErrorCode_ReqParameterError
}
// 等级校验
@ -235,11 +235,11 @@ func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string,
}
hero.Lv = lv
hero.Star = star
hero.SameCount = amount
hero.SameCount = 1
_heroMap := map[string]interface{}{
"lv": hero.Lv,
"star": hero.Star,
"sameCount": amount,
"sameCount": 1,
}
// 保存数据
err = this.modelHero.ChangeList(session.GetUserId(), hero.Id, _heroMap)

View File

@ -22,7 +22,6 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
var (
res []*cfg.Gameatn
costTime int32
privilegeAddItme int32 // 特权额外增加的时间
)
code = this.CreateOrderCheck(session, req)
@ -83,8 +82,7 @@ func (this *apiComp) CreateOrder(session comm.IUserSession, req *pb.SmithyCreate
return
}
_smithy.OrderCostTime += costTime
privilegeAddItme = this.module.ModulePrivilege.GetCountByPrivilegeId(session.GetUserId(), comm.PrivilegeType10)
if cfgCom.SmithyMaxtime+privilegeAddItme < _smithy.OrderCostTime { // 大于总时长是不允许的
if cfgCom.SmithyMaxtime < _smithy.OrderCostTime { // 大于总时长是不允许的
code = pb.ErrorCode_GourmetMoreOrderTime
return
}