上传竞技场战斗数据不同步问题
This commit is contained in:
parent
695b055556
commit
f93bebeeea
@ -35,7 +35,7 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
|
||||
bule *pb.ArenaPlayer
|
||||
heros []*pb.DBHero
|
||||
record *pb.DBBattleRecord
|
||||
change bool
|
||||
// change bool
|
||||
isopen bool
|
||||
ok bool
|
||||
err error
|
||||
@ -65,17 +65,8 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
|
||||
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResDelType, "ArenaChallengeReq", this.module.ModuleTools.GetGlobalConf().ArenaTicketCos) // 消耗资源
|
||||
})
|
||||
if red.Attack != nil {
|
||||
for i, v := range req.Battle.Format {
|
||||
if (red.Attack.Formt[i] != nil && red.Attack.Formt[i].Id != v) || (red.Attack.Formt[i] == nil && v != "") {
|
||||
change = true
|
||||
}
|
||||
}
|
||||
} else {
|
||||
change = true
|
||||
}
|
||||
|
||||
if red.Defend == nil || change {
|
||||
// if red.Defend == nil || change {
|
||||
if heros, err = this.module.modelArena.queryUserHeros(session.GetUserId(), req.Battle.Format); err != nil {
|
||||
errdata = &pb.ErrorData{
|
||||
Code: pb.ErrorCode_DBError,
|
||||
@ -107,13 +98,13 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.ArenaChallenge
|
||||
}
|
||||
red.Isdef = true
|
||||
}
|
||||
if change {
|
||||
// if change {
|
||||
red.Attack = &pb.DBPlayerBattleFormt{
|
||||
Leadpos: req.Battle.Leadpos,
|
||||
Formt: heros,
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
|
||||
if !req.Isai {
|
||||
if bule, err = this.module.modelArena.queryArenaPlayer(req.Playerid); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user