上传用户段位错误处理
This commit is contained in:
parent
d7e5929595
commit
abf90a7592
@ -67,7 +67,7 @@ func (this *aiComp) createAi(battleid string, btype pb.RaceType, users []*pb.DBR
|
||||
}
|
||||
ais = make([]*AI, len(users))
|
||||
for i, v := range users {
|
||||
if conf, err = this.module.configure.getgameBukashiAiDataByDan(int32(btype)+1, v.Dan+1); err != nil {
|
||||
if conf, err = this.module.configure.getgameBukashiAiDataByDan(int32(btype)+1, v.Dan); err != nil {
|
||||
return
|
||||
}
|
||||
ais[i] = NewAI(battleid, v.User.Uid, conf)
|
||||
|
@ -210,6 +210,25 @@ func (this *configureComp) getActiveRewardById(lv int32) (result *cfg.GameQualif
|
||||
return
|
||||
}
|
||||
|
||||
//查询积分段位信息
|
||||
func (this *configureComp) getActiveRewardByS(score int32) (conf *cfg.GameQualifyingData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
)
|
||||
if v, err = this.GetConfigure(game_qualifying); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
for _, conf = range v.(*cfg.GameQualifying).GetDataList() {
|
||||
if score > conf.ScoreLow && score <= conf.ScoreUp {
|
||||
return
|
||||
}
|
||||
}
|
||||
err = comm.NewNotFoundConfErr(string(this.module.GetType()), game_qualifying, score)
|
||||
this.module.Errorln(err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//查询积分段位信息
|
||||
func (this *configureComp) getGameDragonWeeklyrewards() (confs []*cfg.GameDragonWeeklyrewardData, err error) {
|
||||
var (
|
||||
|
@ -420,6 +420,7 @@ func (this *Parkour) recoverhp(id string, uid string, hp int32) {
|
||||
v.Currhp = v.Property[comm.Dhp]
|
||||
}
|
||||
teamScores = battle.RedScore
|
||||
ok = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -431,6 +432,7 @@ func (this *Parkour) recoverhp(id string, uid string, hp int32) {
|
||||
v.Currhp = v.Property[comm.Dhp]
|
||||
}
|
||||
teamScores = battle.BuleScore
|
||||
ok = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@ -463,6 +465,7 @@ func (this *Parkour) overtimer(task *timewheel.Task, args ...interface{}) {
|
||||
sessions []comm.IUserSession = make([]comm.IUserSession, 0)
|
||||
conf *cfg.GameQualifyingData
|
||||
lvconf *cfg.GameBuzkashiLvData
|
||||
danconf *cfg.GameQualifyingData
|
||||
awards map[string][]*cfg.Gameatn = make(map[string][]*cfg.Gameatn)
|
||||
award map[string][]*pb.UserAtno = make(map[string][]*pb.UserAtno)
|
||||
errdata *pb.ErrorData
|
||||
@ -582,9 +585,16 @@ func (this *Parkour) overtimer(task *timewheel.Task, args ...interface{}) {
|
||||
|
||||
for _, v := range battle.RedMember {
|
||||
if !v.Isai {
|
||||
|
||||
if danconf, err = this.configure.getActiveRewardByS(v.Integral); err != nil {
|
||||
this.Errorln(err)
|
||||
continue
|
||||
}
|
||||
|
||||
if err = this.parkourComp.Change(v.User.Uid, map[string]interface{}{
|
||||
"integral": v.Integral,
|
||||
"weekintegral": v.Weekintegral,
|
||||
"dan": danconf.LvId,
|
||||
"state": 0,
|
||||
"roomid": "",
|
||||
"roompath": "",
|
||||
@ -596,9 +606,15 @@ func (this *Parkour) overtimer(task *timewheel.Task, args ...interface{}) {
|
||||
}
|
||||
for _, v := range battle.BuleMember {
|
||||
if !v.Isai {
|
||||
if danconf, err = this.configure.getActiveRewardByS(v.Integral); err != nil {
|
||||
this.Errorln(err)
|
||||
continue
|
||||
}
|
||||
|
||||
if err = this.parkourComp.Change(v.User.Uid, map[string]interface{}{
|
||||
"integral": v.Integral,
|
||||
"weekintegral": v.Weekintegral,
|
||||
"dan": danconf.LvId,
|
||||
"state": 0,
|
||||
"roomid": "",
|
||||
"roompath": "",
|
||||
|
Loading…
Reference in New Issue
Block a user