Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
f3a9c6dc61
@ -8,7 +8,7 @@ import (
|
||||
|
||||
// 参数校验
|
||||
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.ArenaChallengeReq) (errdata *pb.ErrorData) {
|
||||
if (!req.Isai && req.Playerid == "") || (req.Isai && req.MformatId == 0) || req.Battle.Format == nil || len(req.Battle.Format) != 5 {
|
||||
if (!req.Isai && req.Playerid == "") || (req.Isai && req.MformatId == 0) || req.Battle == nil || req.Battle.Format == nil || len(req.Battle.Format) != 5 {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_ReqParameterError,
|
||||
Title: pb.ErrorCode_ReqParameterError.ToString(),
|
||||
|
@ -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,12 @@ 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 {
|
||||
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