修炼塔增加战斗回放
This commit is contained in:
parent
6a244fe4f5
commit
e38812d13c
@ -4,6 +4,7 @@ import (
|
|||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
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{
|
record.Data[conf.Key].Line = &pb.LineData{
|
||||||
Leadpos: Leadpos,
|
Leadpos: Leadpos,
|
||||||
Line: szLine,
|
Line: szLine,
|
||||||
|
Bid: req.Report.Info.Id, // 记录战报数据
|
||||||
}
|
}
|
||||||
mapData["data"] = record.Data
|
mapData["data"] = record.Data
|
||||||
if user, err := this.module.ModuleUser.GetUser(session.GetUserId()); err == nil {
|
if user, err := this.module.ModuleUser.GetUser(session.GetUserId()); err == nil {
|
||||||
mapData["uinfo"] = comm.GetUserBaseInfo(user)
|
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)
|
this.module.modulerank.ModifyCrossPagodaCycleData(session.GetUserId(), mapData)
|
||||||
|
|
||||||
// 加经验
|
// 加经验
|
||||||
|
@ -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)
|
tableName := fmt.Sprintf("%s-%s-%d", db.CrossTag(), this.TableName, key)
|
||||||
if result, err = model.Redis.ZRevRange(tableName, 0, comm.MaxRankNum).Result(); err != nil {
|
if result, err = model.Redis.ZRevRange(tableName, 0, comm.MaxRankNum).Result(); err != nil {
|
||||||
//this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ranks = make([]string, 0)
|
ranks = make([]string, 0)
|
||||||
@ -119,7 +119,7 @@ func (this *ModelRank) queryPlayers(uIds []string) (result []*pb.DBPagodaRecord,
|
|||||||
}
|
}
|
||||||
result = make([]*pb.DBPagodaRecord, 0)
|
result = make([]*pb.DBPagodaRecord, 0)
|
||||||
if _, err = model.GetByUids(uIds, &result); err != nil && err != mgo.MongodbNil {
|
if _, err = model.GetByUids(uIds, &result); err != nil && err != mgo.MongodbNil {
|
||||||
//this.module.Errorln(err)
|
this.module.Errorln(err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -31,6 +31,7 @@ type Pagoda struct {
|
|||||||
friend comm.IFriend
|
friend comm.IFriend
|
||||||
modelRacePagoda *ModelRace
|
modelRacePagoda *ModelRace
|
||||||
modelCyclePagoda *ModelCycle
|
modelCyclePagoda *ModelCycle
|
||||||
|
battlerecord comm.IBattleRecord // 战报模块
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewModule() core.IModule {
|
func NewModule() core.IModule {
|
||||||
@ -92,6 +93,11 @@ func (this *Pagoda) Start() (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.friend = module.(comm.IFriend)
|
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)
|
//this.service.RegisterFunctionName(string(comm.Rpc_ModuleSeasonPagodaReward), this.Rpc_ModuleSeasonPagodaReward)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user