This commit is contained in:
meixiongfeng 2023-09-18 14:24:09 +08:00
parent 4e07455a63
commit dad0c67a6a
6 changed files with 23 additions and 66 deletions

View File

@ -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
}

View File

@ -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
}

View File

@ -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{
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)

View File

@ -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{
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 {

View File

@ -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,20 +187,12 @@ 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{
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 {
this.Error(err.Error())

View File

@ -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
}