diff --git a/modules/activity/model_hddata.go b/modules/activity/model_hddata.go index 6d9c9f8db..b670e7c5a 100644 --- a/modules/activity/model_hddata.go +++ b/modules/activity/model_hddata.go @@ -25,9 +25,7 @@ func (this *modelhdData) Init(service core.IService, module core.IModule, comp c this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}}, }) - this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{ - Keys: bsonx.Doc{{Key: "hdid", Value: bsonx.Int32(1)}}, - }) + return } diff --git a/modules/smithy/api.go b/modules/smithy/api.go index ac92b2ac9..3ebb2fe32 100644 --- a/modules/smithy/api.go +++ b/modules/smithy/api.go @@ -25,6 +25,7 @@ func (this *apiComp) Init(service core.IService, module core.IModule, comp core. err = this.MCompGate.Init(service, module, comp, options) this.module = module.(*Smithy) this.service = service + return } diff --git a/modules/smithy/api_forgeequip.go b/modules/smithy/api_forgeequip.go index dd34aa664..6f43173aa 100644 --- a/modules/smithy/api_forgeequip.go +++ b/modules/smithy/api_forgeequip.go @@ -147,10 +147,8 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq } } } - costRes = append(costRes, reelcfg.BasicCos...) subAtn := this.module.modelStove.CheckForgeConsume(req.ReelId, stove.Data[req.ReelId].Lv) - _costRes := make([]*cfg.Gameatn, 0) for _, v := range costRes { _costRes = append(_costRes, &cfg.Gameatn{ @@ -163,7 +161,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq _costRes = append(_costRes, lava) } if len(subAtn) > 0 { - //_costRes = append(_costRes, subAtn...) for _, v := range subAtn { _costRes = append(_costRes, &cfg.Gameatn{ A: v.A, @@ -196,7 +193,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq hitLen += v addProbability += v * confMake.Probability } - // 总次数校验 maxHitCount := this.module.ModuleTools.GetGlobalConf().GameMakeTunkNum if hitLen > maxHitCount { @@ -326,21 +322,11 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq session.SendMsg(string(this.module.GetType()), "forgeequip", rsp) // 炉温恢复时间红点推送 - i, err := this.module.service.GetModule(comm.ModuleReddot) - if err != nil { - errdata = &pb.ErrorData{ - Code: pb.ErrorCode_DBError, - Title: pb.ErrorCode_DBError.ToString(), - Message: err.Error(), - } - return - } - if b, y := i.(comm.IReddot); y { - b.PushReddot(session, &pb.ReddotItem{ - Rid: int32(comm.Reddot17108), - Nextchanagetime: stove.RecoveTime, - }) - } + this.module.reddot.PushReddot(session, &pb.ReddotItem{ + Rid: int32(comm.Reddot17108), + Nextchanagetime: stove.RecoveTime, + }) + //session.SendMsg(string(this.GetType()), "change", &pb.ReddotChangePush{Rids: reddot}) // 校验图鉴信息 this.module.modelAtlas.CheckActivateEquipAtlas(session.GetUserId(), rsp.Equip, preHitCount) diff --git a/modules/smithy/api_rise.go b/modules/smithy/api_rise.go index 9f5f0f643..0aa243ef7 100644 --- a/modules/smithy/api_rise.go +++ b/modules/smithy/api_rise.go @@ -75,17 +75,11 @@ func (this *apiComp) Rise(session comm.IUserSession, req *pb.SmithyRiseReq) (err session.SendMsg(string(this.module.GetType()), "rise", &pb.SmithyRiseResp{Data: stove}) // 炉温恢复时间红点推送 - i, err := this.module.service.GetModule(comm.ModuleReddot) - if err != nil { - this.module.Error(err.Error()) - return - } - if b, y := i.(comm.IReddot); y { - b.PushReddot(session, &pb.ReddotItem{ - Rid: int32(comm.Reddot17108), - Nextchanagetime: stove.RecoveTime, - }) - } + + this.module.reddot.PushReddot(session, &pb.ReddotItem{ + Rid: int32(comm.Reddot17108), + Nextchanagetime: stove.RecoveTime, + }) tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature)) } if len(tasks) > 0 { diff --git a/modules/smithy/module.go b/modules/smithy/module.go index 6de1bf170..3a6211e7f 100644 --- a/modules/smithy/module.go +++ b/modules/smithy/module.go @@ -30,6 +30,7 @@ type Smithy struct { modelStove *modelStove modelAtlas *modelAtlas modelTask *modelTask + reddot comm.IReddot } func NewModule() core.IModule { @@ -45,6 +46,11 @@ func (this *Smithy) Init(service core.IService, module core.IModule, options cor return } this.service = service.(base.IRPCXService) + + if module, err = this.service.GetModule(comm.ModuleReddot); err != nil { + return + } + this.reddot = module.(comm.IReddot) return } @@ -181,19 +187,11 @@ func (this *Smithy) BuriedsNotify(session comm.IUserSession, conds []*pb.ConIPro } if v.State == pb.BuriedItemFinishState_buried_finish { tt.Received = 1 - i, err := this.service.GetModule(comm.ModuleReddot) - if err != nil { - this.Error(err.Error()) - return - } - if b, y := i.(comm.IReddot); y { - b.PushReddot(session, &pb.ReddotItem{ - Rid: int32(comm.Reddot17107), - Activated: true, - Nextchanagetime: 0, - }) - } - + this.reddot.PushReddot(session, &pb.ReddotItem{ + Rid: int32(comm.Reddot17107), + Activated: true, + Nextchanagetime: 0, + }) } dt.Tasks = append(dt.Tasks, tt) if err := this.modelTask.Add(session.GetUserId(), dt); err != nil { diff --git a/modules/sys/module.go b/modules/sys/module.go index 5d62f9e26..a31472466 100644 --- a/modules/sys/module.go +++ b/modules/sys/module.go @@ -17,9 +17,6 @@ type ModuleSys struct { configure *configureComp service base.IRPCXService modelSys *ModelSys - mainline comm.IMainline - pagoda comm.IPagoda - sociaty comm.ISociaty } func NewModule() core.IModule { @@ -57,23 +54,6 @@ func (this *ModuleSys) Start() (err error) { } this.wtask = module.(comm.IWtask) - if module, err = this.service.GetModule(comm.ModuleMainline); err != nil { - - return - } - this.mainline = module.(comm.IMainline) - - if module, err = this.service.GetModule(comm.ModulePagoda); err != nil { - - return - } - this.pagoda = module.(comm.IPagoda) - - if module, err = this.service.GetModule(comm.ModuleSociaty); err != nil { - - return - } - this.sociaty = module.(comm.ISociaty) return }