上传竞技场gm 修改积分后导致排行榜异常
This commit is contained in:
parent
d99a893586
commit
020a45e6df
@ -100,12 +100,22 @@ func (this *Arena) Rpc_ModuleArenaRaceSettlement(ctx context.Context, args *pb.E
|
||||
// 修改用户积分
|
||||
func (this *Arena) Rpc_ModuleArenaModifyIntegral(ctx context.Context, args *pb.RPCModifyIntegralReq, reply *pb.EmptyResp) (err error) {
|
||||
this.Debug("Rpc_ModuleArenaModifyIntegral", log.Field{Key: "args", Value: args.String()})
|
||||
var (
|
||||
info *pb.DBArenaUser
|
||||
)
|
||||
//防止数据未初始化就修改数据
|
||||
if _, err = this.modelArena.queryPlayerInfo(args.Uid); err != nil && err != mgo.MongodbNil {
|
||||
if info, err = this.modelArena.queryPlayerInfo(args.Uid); err != nil && err != mgo.MongodbNil {
|
||||
this.Debug("Rpc_ModuleArenaModifyIntegral", log.Field{Key: "err", Value: err.Error()})
|
||||
return
|
||||
}
|
||||
err = this.modelArena.modifyIntegral(args.Uid, args.Integral)
|
||||
if err = this.modelArena.modifyIntegral(args.Uid, args.Integral); err != nil {
|
||||
this.Debug("Rpc_ModuleArenaModifyIntegral", log.Field{Key: "err", Value: err.Error()})
|
||||
return
|
||||
}
|
||||
err = this.modelRank.updateArenaRank(&pb.ArenaPlayer{
|
||||
Uinfo: info.Uinfo,
|
||||
Integral: args.Integral,
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user