优化
This commit is contained in:
parent
39fa612612
commit
7ee714a4db
@ -250,10 +250,11 @@ func (this *apiComp) DrawCard(session comm.IUserSession, req *pb.HeroDrawCardReq
|
|||||||
if int32(len(v)) > randomIndex {
|
if int32(len(v)) > randomIndex {
|
||||||
if star == 5 { // 抽出5星英雄后A次抽奖内不会再抽到5星英雄(普通卡池+阵营卡池)
|
if star == 5 { // 抽出5星英雄后A次抽奖内不会再抽到5星英雄(普通卡池+阵营卡池)
|
||||||
curDrawCount := drawCount - req.DrawCount
|
curDrawCount := drawCount - req.DrawCount
|
||||||
if curDrawCount <= 10 { // 首次十连不计算
|
if drawCount <= 10 { // 前10次不计算(连续抽卡最多连续出A个相同阵营的英雄)
|
||||||
|
szCards = append(szCards, v[randomIndex].Id)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
newID := this.module.ContinuousRestriction(session.GetUserId(), v[randomIndex].Id, curDrawCount+int32(index), strPool[index])
|
newID := this.module.ContinuousRestriction(session.GetUserId(), v[randomIndex].Id, curDrawCount+int32(index+1), strPool[index])
|
||||||
szCards = append(szCards, newID)
|
szCards = append(szCards, newID)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -53,10 +53,10 @@ func (this *apiComp) BuyGift(session comm.IUserSession, req *pb.PrivilegeBuyGift
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
vip.Reward[req.VipLv] = true
|
vip.Reward[req.VipLv] = true
|
||||||
update := map[string]interface{}{
|
|
||||||
|
this.module.modelVip.modifyVipData(session.GetUserId(), map[string]interface{}{
|
||||||
"reward": vip.Reward,
|
"reward": vip.Reward,
|
||||||
}
|
})
|
||||||
this.module.modelVip.modifyVipData(session.GetUserId(), update)
|
|
||||||
// 推送
|
// 推送
|
||||||
session.SendMsg(string(this.module.GetType()), PrivilegeBuyGiftResp, &pb.PrivilegeBuyGiftResp{Data: vip})
|
session.SendMsg(string(this.module.GetType()), PrivilegeBuyGiftResp, &pb.PrivilegeBuyGiftResp{Data: vip})
|
||||||
return
|
return
|
||||||
|
@ -353,7 +353,7 @@ func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int3
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update := map[string]interface{}{}
|
|
||||||
for i := oldVip + 1; i <= newVip; i++ {
|
for i := oldVip + 1; i <= newVip; i++ {
|
||||||
conf := this.configure.GetVipConfigureData(i)
|
conf := this.configure.GetVipConfigureData(i)
|
||||||
if conf != nil {
|
if conf != nil {
|
||||||
@ -381,11 +381,12 @@ func (this *Privilege) AddVipData(session comm.IUserSession, oldVip, newVip int3
|
|||||||
this.mail.SendMailByCid(session, comm.VipDaily, res)
|
this.mail.SendMailByCid(session, comm.VipDaily, res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
update["privilege"] = vip.Privilege
|
|
||||||
this.modelVip.modifyVipData(session.GetUserId(), update)
|
this.modelVip.modifyVipData(session.GetUserId(), map[string]interface{}{
|
||||||
|
"privilege": vip.Privilege,
|
||||||
|
})
|
||||||
|
|
||||||
session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeVipListResp{Data: vip})
|
session.SendMsg(string(this.GetType()), PrivilegeGetListResp, &pb.PrivilegeVipListResp{Data: vip})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 发送特权每日奖励
|
// 发送特权每日奖励
|
||||||
|
@ -40,7 +40,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
|
|||||||
}
|
}
|
||||||
|
|
||||||
if code = this.module.CheckRes(session, []*cfg.Gameatn{costRes}); code != pb.ErrorCode_Success {
|
if code = this.module.CheckRes(session, []*cfg.Gameatn{costRes}); code != pb.ErrorCode_Success {
|
||||||
//
|
|
||||||
if req.AutoBuy { // 不够的时候看是否能自动购买
|
if req.AutoBuy { // 不够的时候看是否能自动购买
|
||||||
if code = this.module.AutoBuyTicket(session); code != pb.ErrorCode_Success {
|
if code = this.module.AutoBuyTicket(session); code != pb.ErrorCode_Success {
|
||||||
return
|
return
|
||||||
@ -49,7 +48,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.VikingChalleng
|
|||||||
code = pb.ErrorCode_VikingMaxChallengeCount
|
code = pb.ErrorCode_VikingMaxChallengeCount
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
cfgData := this.module.configure.GetVikingBossConfigData(req.BossId, req.Difficulty)
|
cfgData := this.module.configure.GetVikingBossConfigData(req.BossId, req.Difficulty)
|
||||||
|
Loading…
Reference in New Issue
Block a user