修炼塔增加战斗回放

This commit is contained in:
meixiongfeng 2024-02-20 15:05:23 +08:00
parent 6a244fe4f5
commit e38812d13c
3 changed files with 12 additions and 2 deletions

View File

@ -4,6 +4,7 @@ import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
cfg "go_dreamfactory/sys/configure/structs"
"time"
)
// 参数校验
@ -131,12 +132,15 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
record.Data[conf.Key].Line = &pb.LineData{
Leadpos: Leadpos,
Line: szLine,
Bid: req.Report.Info.Id, // 记录战报数据
}
mapData["data"] = record.Data
if user, err := this.module.ModuleUser.GetUser(session.GetUserId()); err == nil {
mapData["uinfo"] = comm.GetUserBaseInfo(user)
}
go this.module.battlerecord.WrietBattleRecord(session.GetUserId(), req.Report, time.Now().Add(time.Hour*24*8))
this.module.modulerank.ModifyCrossPagodaCycleData(session.GetUserId(), mapData)
// 加经验

View File

@ -100,7 +100,7 @@ func (this *ModelRank) queryRankUser(key int32) (ranks []string, err error) {
tableName := fmt.Sprintf("%s-%s-%d", db.CrossTag(), this.TableName, key)
if result, err = model.Redis.ZRevRange(tableName, 0, comm.MaxRankNum).Result(); err != nil {
//this.module.Errorln(err)
this.module.Errorln(err)
return
}
ranks = make([]string, 0)
@ -119,7 +119,7 @@ func (this *ModelRank) queryPlayers(uIds []string) (result []*pb.DBPagodaRecord,
}
result = make([]*pb.DBPagodaRecord, 0)
if _, err = model.GetByUids(uIds, &result); err != nil && err != mgo.MongodbNil {
//this.module.Errorln(err)
this.module.Errorln(err)
return
}
return

View File

@ -31,6 +31,7 @@ type Pagoda struct {
friend comm.IFriend
modelRacePagoda *ModelRace
modelCyclePagoda *ModelCycle
battlerecord comm.IBattleRecord // 战报模块
}
func NewModule() core.IModule {
@ -92,6 +93,11 @@ func (this *Pagoda) Start() (err error) {
return
}
this.friend = module.(comm.IFriend)
if module, err = this.service.GetModule(comm.ModuleBattleRecord); err != nil {
return
}
this.battlerecord = module.(comm.IBattleRecord)
//this.service.RegisterFunctionName(string(comm.Rpc_ModuleSeasonPagodaReward), this.Rpc_ModuleSeasonPagodaReward)
return
}