上传初始段位生成
This commit is contained in:
parent
c21fd71eb1
commit
6f70a0bb9d
@ -53,6 +53,10 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.ArenaInfoReq) (code
|
|||||||
Ticket: 10,
|
Ticket: 10,
|
||||||
Record: make([]*pb.DBArenaBattleRecord, 0),
|
Record: make([]*pb.DBArenaBattleRecord, 0),
|
||||||
}
|
}
|
||||||
|
if info.Dan, err = this.module.modelArena.computedan(info.Integral); err != nil {
|
||||||
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
|
return
|
||||||
|
}
|
||||||
if err = this.module.modelArena.Add(session.GetUserId(), info); err != nil {
|
if err = this.module.modelArena.Add(session.GetUserId(), info); err != nil {
|
||||||
this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
}
|
}
|
||||||
|
@ -85,17 +85,14 @@ func (this *modelArena) queryUserHeros(uid string, heroids []string) (results []
|
|||||||
///保存用户竞技场信息
|
///保存用户竞技场信息
|
||||||
func (this *modelArena) updateArenaUserInfo(info *pb.DBArenaUser) (err error) {
|
func (this *modelArena) updateArenaUserInfo(info *pb.DBArenaUser) (err error) {
|
||||||
var (
|
var (
|
||||||
active *cfg.GameArenaActiveRewardData
|
dan int32
|
||||||
)
|
)
|
||||||
|
if dan, err = this.computedan(info.Integral); err != nil {
|
||||||
if active, err = this.module.configure.getActiveReward(info.Integral); err != nil {
|
|
||||||
this.module.Errorln(err)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.Change(info.Uid, map[string]interface{}{
|
this.Change(info.Uid, map[string]interface{}{
|
||||||
"integral": info.Integral,
|
"integral": info.Integral,
|
||||||
"dan": active.LvId,
|
"dan": dan,
|
||||||
"attack": info.Attack,
|
"attack": info.Attack,
|
||||||
"defend": info.Defend,
|
"defend": info.Defend,
|
||||||
"streak": info.Streak,
|
"streak": info.Streak,
|
||||||
@ -103,6 +100,19 @@ func (this *modelArena) updateArenaUserInfo(info *pb.DBArenaUser) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *modelArena) computedan(integral int32) (dan int32, err error) {
|
||||||
|
var (
|
||||||
|
active *cfg.GameArenaActiveRewardData
|
||||||
|
)
|
||||||
|
|
||||||
|
if active, err = this.module.configure.getActiveReward(integral); err != nil {
|
||||||
|
this.module.Errorln(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
dan = active.LvId
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
//获取目标去陪数据
|
//获取目标去陪数据
|
||||||
// func (this *modelArena) matchePlayer(integral int32) (results []*pb.DBArenaUser, err error) {
|
// func (this *modelArena) matchePlayer(integral int32) (results []*pb.DBArenaUser, err error) {
|
||||||
// var (
|
// var (
|
||||||
|
Loading…
Reference in New Issue
Block a user