diff --git a/modules/hunting/api_challengeover.go b/modules/hunting/api_challengeover.go index c90cceb36..980182fec 100644 --- a/modules/hunting/api_challengeover.go +++ b/modules/hunting/api_challengeover.go @@ -146,7 +146,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.HuntingCha for _, v := range req.Report.Info.Redflist[0].Team { if cfgHunting.Heroexp > 0 && !v.Ishelp { // 助战英雄不加经验 this.module.ModuleHero.AddHeroExp(session, v.Oid, cfgHunting.Heroexp) - changExp[v.HeroID] = cfgHunting.Heroexp + changExp[v.Oid] = cfgHunting.Heroexp } } diff --git a/modules/user/model_sign.go b/modules/user/model_sign.go index 445a79451..c6331fea8 100644 --- a/modules/user/model_sign.go +++ b/modules/user/model_sign.go @@ -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) { - result = &pb.DBSign{} + result = &pb.DBSign{ + Puzzle: make([]int32, 31), + } if err = this.module.modelSign.Get(uid, result); err != nil { if mongo.ErrNoDocuments == err { // 创建一条新的数据 _data := this.module.configure.GetSignConf(1, 1) diff --git a/modules/viking/api_challengeover.go b/modules/viking/api_challengeover.go index 1254e1a12..bcf820a52 100644 --- a/modules/viking/api_challengeover.go +++ b/modules/viking/api_challengeover.go @@ -152,7 +152,7 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.VikingChal for _, v := range req.Report.Info.Redflist[0].Team { if vikingCfg.Heroexp > 0 && !v.Ishelp { // 助战英雄不加经验 this.module.ModuleHero.AddHeroExp(session, v.Oid, vikingCfg.Heroexp) - changExp[v.HeroID] = vikingCfg.Heroexp + changExp[v.Oid] = vikingCfg.Heroexp } if v.Ishelp { bHelp = true diff --git a/modules/viking/module.go b/modules/viking/module.go index 2541f2552..35632977f 100644 --- a/modules/viking/module.go +++ b/modules/viking/module.go @@ -8,8 +8,11 @@ package viking import ( "context" "go_dreamfactory/comm" + "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" "go_dreamfactory/lego/sys/redis/pipe" + "go_dreamfactory/utils" + "go_dreamfactory/modules" "go_dreamfactory/pb" "go_dreamfactory/sys/db" @@ -27,7 +30,7 @@ type Viking struct { configure *configureComp modulerank *ModelRank battle comm.IBattle - service core.IService + service base.IRPCXService } 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) { err = this.ModuleBase.Init(service, module, options) - this.service = service + this.service = service.(base.IRPCXService) 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.Rtype78, difficulty, bossId, Report.Costtime)) 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 } + +// 检查当前赛季是在本服还是在跨服 +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 +}