普通塔通关 发送广播消息

This commit is contained in:
meixiongfeng 2022-09-15 16:02:54 +08:00
parent 82a2f11b9a
commit 67dafc242c
3 changed files with 13 additions and 2 deletions

View File

@ -50,7 +50,6 @@ func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChalle
code = pb.ErrorCode_MainlineNotFindChapter code = pb.ErrorCode_MainlineNotFindChapter
return return
} }
code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{ code, record := this.module.battle.CreatePveBattle(session, &pb.BattlePVEReq{
Ptype: pb.PlayType_moonfantasy, Ptype: pb.PlayType_moonfantasy,
Leadpos: req.Leadpos, Leadpos: req.Leadpos,

View File

@ -1,6 +1,7 @@
package pagoda package pagoda
import ( import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core" "go_dreamfactory/lego/core"
"go_dreamfactory/modules" "go_dreamfactory/modules"
) )
@ -17,6 +18,7 @@ type apiComp struct {
modules.MCompGate modules.MCompGate
service core.IService service core.IService
module *Pagoda module *Pagoda
chat comm.IChat
} }
//组件初始化接口 //组件初始化接口
@ -30,6 +32,10 @@ func (this *apiComp) Init(service core.IService, module core.IModule, comp core.
func (this *apiComp) Start() (err error) { func (this *apiComp) Start() (err error) {
err = this.MCompGate.Start() err = this.MCompGate.Start()
var module core.IModule
if module, err = this.service.GetModule(comm.ModuleChat); err != nil {
return
}
this.chat = module.(comm.IChat)
return return
} }

View File

@ -81,6 +81,12 @@ func (this *apiComp) ChallengeOver(session comm.IUserSession, req *pb.PagodaChal
code = this.module.ModifyPagodaData(session.GetUserId(), mapData) code = this.module.ModifyPagodaData(session.GetUserId(), mapData)
session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda}) session.SendMsg(string(this.module.GetType()), PagodaChallengeOverResp, &pb.PagodaChallengeOverResp{Data: pagoda})
if user := this.module.ModuleUser.GetUser(session.GetUserId()); user != nil {
this.chat.SendSysChatToWorld(comm.EquipmentUpgradeNotice, pagoda.PagodaId, user.Name)
} else {
this.module.Errorf("no found userdata uid:%s", session.GetUserId())
}
// 普通塔通关了 // 普通塔通关了
Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, pagoda.PagodaId+1) Nomalcfg := this.module.configure.GetPagodaConfigData(comm.PagodaType, pagoda.PagodaId+1)
if Nomalcfg == nil { // 创建赛季塔数据 if Nomalcfg == nil { // 创建赛季塔数据