上传竞技场连胜积分加成
This commit is contained in:
parent
7d115768a5
commit
6666868fca
@ -18,6 +18,7 @@ func (this *apiComp) ChallengeRewardCheck(session comm.IUserSession, req *pb.Are
|
||||
func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaChallengeRewardReq) (errdata *pb.ErrorData) {
|
||||
var (
|
||||
reward *cfg.GameArenaActiveRewardData
|
||||
conf *cfg.GameArenaActiveWinData
|
||||
info *pb.DBArenaUser
|
||||
rival *pb.DBArenaUser
|
||||
red *pb.ArenaPlayer
|
||||
@ -156,6 +157,17 @@ func (this *apiComp) ChallengeReward(session comm.IUserSession, req *pb.ArenaCha
|
||||
}
|
||||
}
|
||||
this.module.modelArena.integralCompute(red, bule, req.Iswin)
|
||||
if req.Iswin {
|
||||
if conf, err = this.module.configure.getGameArenaActiveWinData(info.Streak); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ConfigNoFound,
|
||||
Message: err.Error(),
|
||||
}
|
||||
return
|
||||
}
|
||||
red.Integral += conf.Txt.N
|
||||
red.Changeintegral += conf.Txt.N
|
||||
}
|
||||
if !req.Isai {
|
||||
this.module.modelRank.updateArenaRank(red, bule)
|
||||
info.Integral = red.Integral
|
||||
|
@ -45,6 +45,7 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
||||
this.LoadConfigure(game_arenachallengenpc, cfg.NewGameArenaChallengeNpc)
|
||||
this.LoadConfigure(game_arenaactiveking, cfg.NewGameArenaActiveKing)
|
||||
this.LoadConfigure(game_arenaweeklytask, cfg.NewGameArenaWeeklyTask)
|
||||
this.LoadConfigure(game_arenaactivewin, cfg.NewGameArenaActiveWin)
|
||||
configure.RegisterConfigure(game_monsterformat, cfg.NewGameMonsterFormat, func() {
|
||||
this.mformatlock.Lock()
|
||||
if v, err := this.GetConfigure(game_monsterformat); err != nil {
|
||||
@ -240,3 +241,25 @@ func (this *configureComp) getGameActiveTaskData(id int32) (result *cfg.GameAren
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
//查询剧情npc系统
|
||||
func (this *configureComp) getGameArenaActiveWinData(num int32) (conf *cfg.GameArenaActiveWinData, err error) {
|
||||
var (
|
||||
v interface{}
|
||||
confs []*cfg.GameArenaActiveWinData
|
||||
)
|
||||
if v, err = this.GetConfigure(game_arenaactivewin); err != nil {
|
||||
this.module.Errorln(err)
|
||||
} else {
|
||||
confs = v.(*cfg.GameArenaActiveWin).GetDataList()
|
||||
for i := len(confs) - 1; i >= 0; i-- {
|
||||
if num >= confs[i].Winningstreak {
|
||||
conf = confs[i]
|
||||
return
|
||||
}
|
||||
}
|
||||
err = comm.NewNotFoundConfErr(moduleName, game_arenaactivewin, num)
|
||||
this.module.Errorln(err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user