战斗记录

This commit is contained in:
meixiongfeng 2024-01-23 17:37:58 +08:00
parent d60039220d
commit 22bcc92e0d
3 changed files with 4 additions and 4 deletions

View File

@ -238,7 +238,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PlunderCha
Cid: list.Source[req.Index],
Ctime: configure.Now().Unix() + int64(conf.Extime),
})
err = this.module.modelRecord.AddRecordData(session.GetUserId(), info)
err = this.module.modelRecord.AddRecordData(land.Id, info)
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
this.module.WriteUserLog(session.GetUserId(), req, comm.GMResAddType, "PlunderChallengeOverReq", atno)
})

View File

@ -107,7 +107,7 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder
Cid: land.Ship[req.Oid].Line.Cid,
Ctime: configure.Now().Unix(),
})
err = this.module.modelRecord.AddRecordData(session.GetUserId(), info)
err = this.module.modelRecord.AddRecordData(land.Id, info)
return
}
@ -146,6 +146,6 @@ func (this *apiComp) PvpChallengeOver(session comm.IUserSession, req *pb.Plunder
Cid: land.Ship[req.Oid].Line.Cid,
Ctime: configure.Now().Unix(),
})
err = this.module.modelRecord.AddRecordData(session.GetUserId(), info)
err = this.module.modelRecord.AddRecordData(land.Id, info)
return
}

View File

@ -37,7 +37,7 @@ func (this *modelRecord) changePlunderRecordData(id string, update map[string]in
// 新增一条记录
func (this *modelRecord) AddRecordData(id string, info []*pb.PlunderRecordData) (err error) {
if record, err := this.getPlunderRecordData(id); err != nil {
if record, err := this.getPlunderRecordData(id); err == nil {
record.Data = append(record.Data, info...)
err = this.changePlunderRecordData(id, map[string]interface{}{"data": record.Data})
}