英雄加经验 返回给英雄唯一id

This commit is contained in:
meixiongfeng 2023-07-05 16:00:08 +08:00
parent 460725a94f
commit 39fe1e88c9
4 changed files with 25 additions and 7 deletions

View File

@ -146,7 +146,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if cfgHunting.Heroexp > 0 && !v.Ishelp { // 助战英雄不加经验 if cfgHunting.Heroexp > 0 && !v.Ishelp { // 助战英雄不加经验
this.module.ModuleHero.AddHeroExp(session, v.Oid, cfgHunting.Heroexp) this.module.ModuleHero.AddHeroExp(session, v.Oid, cfgHunting.Heroexp)
changExp[v.HeroID] = cfgHunting.Heroexp changExp[v.Oid] = cfgHunting.Heroexp
} }
} }

View File

@ -31,7 +31,9 @@ func (this *ModelSign) Init(service core.IService, module core.IModule, comp cor
} }
func (this *ModelSign) GetUserSign(uid string) (result *pb.DBSign, err error) { func (this *ModelSign) GetUserSign(uid string) (result *pb.DBSign, err error) {
result = &pb.DBSign{} result = &pb.DBSign{
Puzzle: make([]int32, 31),
}
if err = this.module.modelSign.Get(uid, result); err != nil { if err = this.module.modelSign.Get(uid, result); err != nil {
if mongo.ErrNoDocuments == err { // 创建一条新的数据 if mongo.ErrNoDocuments == err { // 创建一条新的数据
_data := this.module.configure.GetSignConf(1, 1) _data := this.module.configure.GetSignConf(1, 1)

View File

@ -152,7 +152,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal
for _, v := range req.Report.Info.Redflist[0].Team { for _, v := range req.Report.Info.Redflist[0].Team {
if vikingCfg.Heroexp > 0 && !v.Ishelp { // 助战英雄不加经验 if vikingCfg.Heroexp > 0 && !v.Ishelp { // 助战英雄不加经验
this.module.ModuleHero.AddHeroExp(session, v.Oid, vikingCfg.Heroexp) this.module.ModuleHero.AddHeroExp(session, v.Oid, vikingCfg.Heroexp)
changExp[v.HeroID] = vikingCfg.Heroexp changExp[v.Oid] = vikingCfg.Heroexp
} }
if v.Ishelp { if v.Ishelp {
bHelp = true bHelp = true

View File

@ -8,8 +8,11 @@ package viking
import ( import (
"context" "context"
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/redis/pipe" "go_dreamfactory/lego/sys/redis/pipe"
"go_dreamfactory/utils"
"go_dreamfactory/modules" "go_dreamfactory/modules"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/sys/db" "go_dreamfactory/sys/db"
@ -27,7 +30,7 @@ type Viking struct {
configure *configureComp configure *configureComp
modulerank *ModelRank modulerank *ModelRank
battle comm.IBattle battle comm.IBattle
service core.IService service base.IRPCXService
} }
func NewModule() core.IModule { func NewModule() core.IModule {
@ -40,7 +43,7 @@ func (this *Viking) GetType() core.M_Modules {
func (this *Viking) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { func (this *Viking) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options) err = this.ModuleBase.Init(service, module, options)
this.service = service this.service = service.(base.IRPCXService)
return return
} }
@ -341,8 +344,6 @@ func (this *Viking) AutoBattleOver(session comm.IUserSession, Report *pb.BattleR
} }
} }
// 随机任务统计 // 随机任务统计
// this.ModuleBuried.SendToRtask(session, comm.Rtype73, difficulty, bossId, 1)
// this.ModuleBuried.SendToRtask(session, comm.Rtype78, difficulty, bossId, Report.Costtime)
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype73, 1, bossId, difficulty)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype73, 1, bossId, difficulty))
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype78, difficulty, bossId, Report.Costtime)) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype78, difficulty, bossId, Report.Costtime))
if Report != nil && Report.Info != nil && len(Report.Info.Redflist) > 0 { if Report != nil && Report.Info != nil && len(Report.Info.Redflist) > 0 {
@ -367,3 +368,18 @@ func (this *Viking) CheckBattelParameter(session comm.IUserSession, battle *pb.B
}) })
return return
} }
// 检查当前赛季是在本服还是在跨服
func (this *Viking) CheckSeasonData() (bLocal bool) {
openTime := this.service.GetOpentime().Unix()
this.Debugf("%d", openTime)
// 获取第一个赛季结束的时间
endSeasonTime := utils.GetTodayZeroTime(openTime) + int64((7-this.service.GetOpentime().Day())*3600*24)
this.Debugf("%d", endSeasonTime)
// 校验是否过了一个月
openTime = openTime + 30*3600*24
// 第三个赛季
return true
}