裂魂战报数据记录
This commit is contained in:
parent
a411cdb3e7
commit
b7ac0d3c49
@ -5,6 +5,7 @@ import (
|
|||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
cfg "go_dreamfactory/sys/configure/structs"
|
cfg "go_dreamfactory/sys/configure/structs"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 参数校验
|
// 参数校验
|
||||||
@ -35,6 +36,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
|||||||
consumPs int32
|
consumPs int32
|
||||||
changExp map[string]int32
|
changExp map[string]int32
|
||||||
szAtno []*pb.UserAtno // atno 类型
|
szAtno []*pb.UserAtno // atno 类型
|
||||||
|
bNewRecord bool // 新纪录
|
||||||
)
|
)
|
||||||
changExp = map[string]int32{}
|
changExp = map[string]int32{}
|
||||||
mapData = make(map[string]interface{}, 0)
|
mapData = make(map[string]interface{}, 0)
|
||||||
@ -114,7 +116,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
|||||||
if hunting.BossTime[key] == 0 || hunting.BossTime[key] > req.Report.Costtime {
|
if hunting.BossTime[key] == 0 || hunting.BossTime[key] > req.Report.Costtime {
|
||||||
hunting.BossTime[key] = req.Report.Costtime
|
hunting.BossTime[key] = req.Report.Costtime
|
||||||
mapData["bossTime"] = hunting.BossTime // 更新时间
|
mapData["bossTime"] = hunting.BossTime // 更新时间
|
||||||
|
bNewRecord = true
|
||||||
}
|
}
|
||||||
// 发放通关随机奖励
|
// 发放通关随机奖励
|
||||||
user, err := this.module.GetUserForSession(session)
|
user, err := this.module.GetUserForSession(session)
|
||||||
@ -186,6 +188,9 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
|||||||
Sell: del,
|
Sell: del,
|
||||||
Heroexp: changExp,
|
Heroexp: changExp,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if bNewRecord { // 只有新记录才记录战报数据
|
||||||
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
szLine := make([]*pb.LineUp, 0)
|
szLine := make([]*pb.LineUp, 0)
|
||||||
var Leadpos int32
|
var Leadpos int32
|
||||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||||
@ -200,13 +205,15 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
go func() {
|
|
||||||
line := &pb.LineData{
|
line := &pb.LineData{
|
||||||
Leadpos: Leadpos,
|
Leadpos: Leadpos,
|
||||||
Line: szLine,
|
Line: szLine,
|
||||||
|
Bid: req.Report.Info.Id, // 战报id
|
||||||
}
|
}
|
||||||
|
this.module.battlerecord.WrietBattleRecord(session.GetUserId(), req.Report, time.Now().Add(time.Hour*24*8))
|
||||||
this.module.modulerank.CheckRank(session.GetUserId(), req.BossType, req.Difficulty, line, req.Report.Costtime)
|
this.module.modulerank.CheckRank(session.GetUserId(), req.BossType, req.Difficulty, line, req.Report.Costtime)
|
||||||
}()
|
})
|
||||||
|
}
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype80, 1, req.BossType, req.Difficulty))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype80, 1, req.BossType, req.Difficulty))
|
||||||
// 随机任务统计
|
// 随机任务统计
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype81, req.Difficulty, req.BossType))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype81, req.Difficulty, req.BossType))
|
||||||
|
@ -15,6 +15,7 @@ type Hunting struct {
|
|||||||
modulerank *ModelRank
|
modulerank *ModelRank
|
||||||
battle comm.IBattle
|
battle comm.IBattle
|
||||||
service core.IService
|
service core.IService
|
||||||
|
battlerecord comm.IBattleRecord // 战报模块
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewModule() core.IModule {
|
func NewModule() core.IModule {
|
||||||
@ -43,6 +44,10 @@ func (this *Hunting) Start() (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.battle = module.(comm.IBattle)
|
this.battle = module.(comm.IBattle)
|
||||||
|
if module, err = this.service.GetModule(comm.ModuleBattleRecord); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.battlerecord = module.(comm.IBattleRecord)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +134,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
|||||||
total += v
|
total += v
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go this.module.AsynHandleSession(session.Clone(), func(session comm.IUserSession) {
|
||||||
szLine := make([]*pb.LineUp, 0)
|
szLine := make([]*pb.LineUp, 0)
|
||||||
var Leadpos int32
|
var Leadpos int32
|
||||||
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
if req.Report != nil && req.Report.Info != nil && len(req.Report.Info.Redflist) > 0 {
|
||||||
@ -155,14 +155,14 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
|
|||||||
Bid: req.Report.Info.Id, // 战报id
|
Bid: req.Report.Info.Id, // 战报id
|
||||||
}
|
}
|
||||||
if bNewRecord {
|
if bNewRecord {
|
||||||
go this.module.battlerecord.WrietBattleRecord(session.GetUserId(), req.Report, time.Now().Add(time.Hour*24*8))
|
this.module.battlerecord.WrietBattleRecord(session.GetUserId(), req.Report, time.Now().Add(time.Hour*24*8))
|
||||||
this.module.modulerank.CheckRank(session.GetUserId(), req.BossId, req.Difficulty, line, req.Report.Costtime)
|
this.module.modulerank.CheckRank(session.GetUserId(), req.BossId, req.Difficulty, line, req.Report.Costtime)
|
||||||
}
|
}
|
||||||
// 连续自动战斗
|
// 连续自动战斗
|
||||||
if len(viking.Round) == 10 {
|
if len(viking.Round) == 10 {
|
||||||
this.module.modelsrank.CheckSeasonRank(session.GetUserId(), req.BossId, req.Difficulty, line, total)
|
this.module.modelsrank.CheckSeasonRank(session.GetUserId(), req.BossId, req.Difficulty, line, total)
|
||||||
}
|
}
|
||||||
}()
|
})
|
||||||
reward = this.module.ModuleTools.GetGroupDataByLottery(vikingCfg.Drop, user.Vip, user.Lv)
|
reward = this.module.ModuleTools.GetGroupDataByLottery(vikingCfg.Drop, user.Vip, user.Lv)
|
||||||
|
|
||||||
b := this.module.ModuleActivity.HDCelebration(session, 2, req.BossId)
|
b := this.module.ModuleActivity.HDCelebration(session, 2, req.BossId)
|
||||||
|
Loading…
Reference in New Issue
Block a user