优化
This commit is contained in:
parent
4e07455a63
commit
dad0c67a6a
@ -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{
|
this.DB.CreateIndex(core.SqlTable(this.TableName), mongo.IndexModel{
|
||||||
Keys: bsonx.Doc{{Key: "uid", Value: bsonx.Int32(1)}},
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ func (this *apiComp) Init(service core.IService, module core.IModule, comp core.
|
|||||||
err = this.MCompGate.Init(service, module, comp, options)
|
err = this.MCompGate.Init(service, module, comp, options)
|
||||||
this.module = module.(*Smithy)
|
this.module = module.(*Smithy)
|
||||||
this.service = service
|
this.service = service
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,10 +147,8 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
costRes = append(costRes, reelcfg.BasicCos...)
|
costRes = append(costRes, reelcfg.BasicCos...)
|
||||||
subAtn := this.module.modelStove.CheckForgeConsume(req.ReelId, stove.Data[req.ReelId].Lv)
|
subAtn := this.module.modelStove.CheckForgeConsume(req.ReelId, stove.Data[req.ReelId].Lv)
|
||||||
|
|
||||||
_costRes := make([]*cfg.Gameatn, 0)
|
_costRes := make([]*cfg.Gameatn, 0)
|
||||||
for _, v := range costRes {
|
for _, v := range costRes {
|
||||||
_costRes = append(_costRes, &cfg.Gameatn{
|
_costRes = append(_costRes, &cfg.Gameatn{
|
||||||
@ -163,7 +161,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
_costRes = append(_costRes, lava)
|
_costRes = append(_costRes, lava)
|
||||||
}
|
}
|
||||||
if len(subAtn) > 0 {
|
if len(subAtn) > 0 {
|
||||||
//_costRes = append(_costRes, subAtn...)
|
|
||||||
for _, v := range subAtn {
|
for _, v := range subAtn {
|
||||||
_costRes = append(_costRes, &cfg.Gameatn{
|
_costRes = append(_costRes, &cfg.Gameatn{
|
||||||
A: v.A,
|
A: v.A,
|
||||||
@ -196,7 +193,6 @@ func (this *apiComp) ForgeEquip(session comm.IUserSession, req *pb.SmithyForgeEq
|
|||||||
hitLen += v
|
hitLen += v
|
||||||
addProbability += v * confMake.Probability
|
addProbability += v * confMake.Probability
|
||||||
}
|
}
|
||||||
|
|
||||||
// 总次数校验
|
// 总次数校验
|
||||||
maxHitCount := this.module.ModuleTools.GetGlobalConf().GameMakeTunkNum
|
maxHitCount := this.module.ModuleTools.GetGlobalConf().GameMakeTunkNum
|
||||||
if hitLen > maxHitCount {
|
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)
|
session.SendMsg(string(this.module.GetType()), "forgeequip", rsp)
|
||||||
|
|
||||||
// 炉温恢复时间红点推送
|
// 炉温恢复时间红点推送
|
||||||
i, err := this.module.service.GetModule(comm.ModuleReddot)
|
this.module.reddot.PushReddot(session, &pb.ReddotItem{
|
||||||
if err != nil {
|
Rid: int32(comm.Reddot17108),
|
||||||
errdata = &pb.ErrorData{
|
Nextchanagetime: stove.RecoveTime,
|
||||||
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,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
//session.SendMsg(string(this.GetType()), "change", &pb.ReddotChangePush{Rids: reddot})
|
//session.SendMsg(string(this.GetType()), "change", &pb.ReddotChangePush{Rids: reddot})
|
||||||
// 校验图鉴信息
|
// 校验图鉴信息
|
||||||
this.module.modelAtlas.CheckActivateEquipAtlas(session.GetUserId(), rsp.Equip, preHitCount)
|
this.module.modelAtlas.CheckActivateEquipAtlas(session.GetUserId(), rsp.Equip, preHitCount)
|
||||||
|
@ -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})
|
session.SendMsg(string(this.module.GetType()), "rise", &pb.SmithyRiseResp{Data: stove})
|
||||||
|
|
||||||
// 炉温恢复时间红点推送
|
// 炉温恢复时间红点推送
|
||||||
i, err := this.module.service.GetModule(comm.ModuleReddot)
|
|
||||||
if err != nil {
|
this.module.reddot.PushReddot(session, &pb.ReddotItem{
|
||||||
this.module.Error(err.Error())
|
Rid: int32(comm.Reddot17108),
|
||||||
return
|
Nextchanagetime: stove.RecoveTime,
|
||||||
}
|
})
|
||||||
if b, y := i.(comm.IReddot); y {
|
|
||||||
b.PushReddot(session, &pb.ReddotItem{
|
|
||||||
Rid: int32(comm.Reddot17108),
|
|
||||||
Nextchanagetime: stove.RecoveTime,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature))
|
tasks = append(tasks, comm.GetBuriedParam(comm.Rtype175, stove.Temperature))
|
||||||
}
|
}
|
||||||
if len(tasks) > 0 {
|
if len(tasks) > 0 {
|
||||||
|
@ -30,6 +30,7 @@ type Smithy struct {
|
|||||||
modelStove *modelStove
|
modelStove *modelStove
|
||||||
modelAtlas *modelAtlas
|
modelAtlas *modelAtlas
|
||||||
modelTask *modelTask
|
modelTask *modelTask
|
||||||
|
reddot comm.IReddot
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewModule() core.IModule {
|
func NewModule() core.IModule {
|
||||||
@ -45,6 +46,11 @@ func (this *Smithy) Init(service core.IService, module core.IModule, options cor
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.service = service.(base.IRPCXService)
|
this.service = service.(base.IRPCXService)
|
||||||
|
|
||||||
|
if module, err = this.service.GetModule(comm.ModuleReddot); err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.reddot = module.(comm.IReddot)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,19 +187,11 @@ func (this *Smithy) BuriedsNotify(session comm.IUserSession, conds []*pb.ConIPro
|
|||||||
}
|
}
|
||||||
if v.State == pb.BuriedItemFinishState_buried_finish {
|
if v.State == pb.BuriedItemFinishState_buried_finish {
|
||||||
tt.Received = 1
|
tt.Received = 1
|
||||||
i, err := this.service.GetModule(comm.ModuleReddot)
|
this.reddot.PushReddot(session, &pb.ReddotItem{
|
||||||
if err != nil {
|
Rid: int32(comm.Reddot17107),
|
||||||
this.Error(err.Error())
|
Activated: true,
|
||||||
return
|
Nextchanagetime: 0,
|
||||||
}
|
})
|
||||||
if b, y := i.(comm.IReddot); y {
|
|
||||||
b.PushReddot(session, &pb.ReddotItem{
|
|
||||||
Rid: int32(comm.Reddot17107),
|
|
||||||
Activated: true,
|
|
||||||
Nextchanagetime: 0,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
dt.Tasks = append(dt.Tasks, tt)
|
dt.Tasks = append(dt.Tasks, tt)
|
||||||
if err := this.modelTask.Add(session.GetUserId(), dt); err != nil {
|
if err := this.modelTask.Add(session.GetUserId(), dt); err != nil {
|
||||||
|
@ -17,9 +17,6 @@ type ModuleSys struct {
|
|||||||
configure *configureComp
|
configure *configureComp
|
||||||
service base.IRPCXService
|
service base.IRPCXService
|
||||||
modelSys *ModelSys
|
modelSys *ModelSys
|
||||||
mainline comm.IMainline
|
|
||||||
pagoda comm.IPagoda
|
|
||||||
sociaty comm.ISociaty
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewModule() core.IModule {
|
func NewModule() core.IModule {
|
||||||
@ -57,23 +54,6 @@ func (this *ModuleSys) Start() (err error) {
|
|||||||
}
|
}
|
||||||
this.wtask = module.(comm.IWtask)
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user