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

@ -721,16 +721,16 @@ const (
) )
const ( const (
PrivilegeType1 = iota + 1 //每日获得 PrivilegeType1 = iota + 1 //每日获得
PrivilegeType2 //金币商店每日免费刷新次数 PrivilegeType2 //金币商店每日免费刷新次数
PrivilegeType3 //维京远征每日可购买挑战次数 PrivilegeType3 //维京远征每日可购买挑战次数
PrivilegeType4 //狩猎每日可购买挑战次数 PrivilegeType4 //狩猎每日可购买挑战次数
PrivilegeType5 //竞技场每日可购买挑战次数 PrivilegeType5 //竞技场每日可购买挑战次数
PrivilegeType6 //梦境每日可购买挑战次数 PrivilegeType6 //梦境每日可购买挑战次数
PrivilegeType7 //巨怪商队背包容量 PrivilegeType7 //巨怪商队背包容量
PrivilegeType8 //美食馆每日最大制作时间 PrivilegeType8 //美食馆每日最大制作时间
PrivilegeType9 //武馆每日最大练功时间 PrivilegeType9 //武馆每日最大练功时间
PrivilegeType10 //铁匠铺每日最大锻造时间
) )
const ( const (
MainStarType1 = 1 //成功通关 MainStarType1 = 1 //成功通关

View File

@ -67,7 +67,7 @@ type (
//清理玩家英雄数据 //清理玩家英雄数据
CleanData(uid string) 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) 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) { func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string, star, lv int32) (code pb.ErrorCode) {
if session.GetUserId() == "" || heroConfId == "" || star == 0 || lv == 0 || amount == 0 { if session.GetUserId() == "" || heroConfId == "" || star == 0 || lv == 0 {
return pb.ErrorCode_ReqParameterError return pb.ErrorCode_ReqParameterError
} }
// 等级校验 // 等级校验
@ -235,11 +235,11 @@ func (this *Hero) GetSpecifiedHero(session comm.IUserSession, heroConfId string,
} }
hero.Lv = lv hero.Lv = lv
hero.Star = star hero.Star = star
hero.SameCount = amount hero.SameCount = 1
_heroMap := map[string]interface{}{ _heroMap := map[string]interface{}{
"lv": hero.Lv, "lv": hero.Lv,
"star": hero.Star, "star": hero.Star,
"sameCount": amount, "sameCount": 1,
} }
// 保存数据 // 保存数据
err = this.modelHero.ChangeList(session.GetUserId(), hero.Id, _heroMap) err = this.modelHero.ChangeList(session.GetUserId(), hero.Id, _heroMap)

View File

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