diff --git a/modules/equipment/api_upgrade.go b/modules/equipment/api_upgrade.go index 4a05d85b9..5ad01df3a 100644 --- a/modules/equipment/api_upgrade.go +++ b/modules/equipment/api_upgrade.go @@ -54,7 +54,9 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade code = pb.ErrorCode_EquipmentLvlimitReached return } - + if code = this.module.ConsumeRes(session, intensify.Need, true); code != pb.ErrorCode_Success { + return + } if equipment.KeepFailNum >= intensify.Num { //没有达到保底次数 根据概率随机成功失败 issucc = true } else { //随机 千分比 @@ -66,9 +68,6 @@ func (this *apiComp) Upgrade(session comm.IUserSession, req *pb.EquipmentUpgrade } } if issucc { - if code = this.module.ConsumeRes(session, intensify.Need, true); code != pb.ErrorCode_Success { - return - } modifyequipments = make([]*pb.DB_Equipment, 0) //叠加装备 拆分处理 if equipment.IsInitialState && equipment.OverlayNum > 1 { diff --git a/modules/martialhall/api_receive.go b/modules/martialhall/api_receive.go index aa46e8c79..f95a2d72b 100644 --- a/modules/martialhall/api_receive.go +++ b/modules/martialhall/api_receive.go @@ -62,10 +62,10 @@ func (this *apiComp) Receive(session comm.IUserSession, req *pb.MartialhallRecei code = pb.ErrorCode_MartialhallInUse return } - //此处发放英雄经验增长 - //... - //... + if code = this.module.ModuleHero.AddHeroExp(session, pillar.Hero, pillar.Reward); code != pb.ErrorCode_Success { + return + } this.module.modelMartialhall.Change(session.GetUserId(), map[string]interface{}{ filed: pillar, diff --git a/modules/martialhall/module.go b/modules/martialhall/module.go index 15481148c..c163abcd6 100644 --- a/modules/martialhall/module.go +++ b/modules/martialhall/module.go @@ -27,7 +27,7 @@ type Martialhall struct { //模块名 func (this *Martialhall) GetType() core.M_Modules { - return comm.ModuleChat + return comm.ModuleMartialhall } //模块初始化接口 注册用户创建角色事件 diff --git a/services/worker/main.go b/services/worker/main.go index 132283c2b..3b964b178 100644 --- a/services/worker/main.go +++ b/services/worker/main.go @@ -13,6 +13,7 @@ import ( "go_dreamfactory/modules/items" "go_dreamfactory/modules/mail" "go_dreamfactory/modules/mainline" + "go_dreamfactory/modules/martialhall" "go_dreamfactory/modules/notify" "go_dreamfactory/modules/pagoda" "go_dreamfactory/modules/shop" @@ -61,6 +62,7 @@ func main() { forum.NewModule(), pagoda.NewModule(), gourmet.NewModule(), + martialhall.NewModule(), ) }