转盘校验
This commit is contained in:
parent
4cd798dca8
commit
216d131096
@ -59,7 +59,7 @@ func (this *apiComp) TurntableReward(session comm.IUserSession, req *pb.Activity
|
||||
}
|
||||
// 消耗校验
|
||||
pricekey := this.module.ModuleTools.GetGlobalConf().GiftBuy
|
||||
if res, err := this.module.ModuleTools.GetPriceGroupCost(pricekey, data.Val); len(res) > 0 {
|
||||
if res, err := this.module.ModuleTools.GetPriceGroupCost(pricekey, data.Val+1); len(res) > 0 {
|
||||
need = append(need, res...)
|
||||
} else {
|
||||
errdata = &pb.ErrorData{
|
||||
@ -84,12 +84,18 @@ func (this *apiComp) TurntableReward(session comm.IUserSession, req *pb.Activity
|
||||
reward = append(reward, k)
|
||||
}
|
||||
// 发奖
|
||||
item, drawkey, err := this.module.Turntable(data.Val, reward)
|
||||
if err != nil {
|
||||
item, drawkey, err := this.module.Turntable(data.Val+1, reward)
|
||||
if err == nil {
|
||||
this.module.DispenseRes(session, []*cfg.Gameatn{item}, true)
|
||||
// 修改进度
|
||||
data.Gotarr[data.Val] = 1
|
||||
data.Val += 1
|
||||
} else {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ActivityRepatReward,
|
||||
Title: pb.ErrorCode_ActivityRepatReward.ToString(),
|
||||
}
|
||||
return
|
||||
}
|
||||
if errdata = this.module.ConsumeRes(session, need, true); errdata != nil { // 资源不足
|
||||
return
|
||||
|
@ -201,7 +201,7 @@ func (this *Activity) Turntable(drawIndex int32, reward []int32) (item *cfg.Game
|
||||
}
|
||||
}
|
||||
}
|
||||
if c, err := this.configure.GetVenturegiftsDraw(szpool[comm.GetRandW(szW)]); err != nil {
|
||||
if c, err := this.configure.GetVenturegiftsDraw(szpool[comm.GetRandW(szW)]); err == nil {
|
||||
item = c.Id // 最终获得的道具
|
||||
drawkey = c.Drawkey
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user