diff --git a/modules/pagoda/api_challengeover.go b/modules/pagoda/api_challengeover.go index ac16b4a73..bee3111de 100644 --- a/modules/pagoda/api_challengeover.go +++ b/modules/pagoda/api_challengeover.go @@ -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) // 加经验 diff --git a/modules/pagoda/model_rank.go b/modules/pagoda/model_rank.go index d77131887..9436e9668 100644 --- a/modules/pagoda/model_rank.go +++ b/modules/pagoda/model_rank.go @@ -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 diff --git a/modules/pagoda/module.go b/modules/pagoda/module.go index 441f015d5..0eb605067 100644 --- a/modules/pagoda/module.go +++ b/modules/pagoda/module.go @@ -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 }