Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
9ec31dee0f
@ -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 //成功通关
|
||||||
|
@ -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)
|
||||||
// 英雄练功
|
// 英雄练功
|
||||||
|
@ -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)
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user