This commit is contained in:
liwei1dao 2023-05-23 11:15:46 +08:00
commit 2e66805b3a
2 changed files with 11 additions and 11 deletions

View File

@ -43,11 +43,11 @@ func (this *Caravan) Init(service core.IService, module core.IModule, options co
func (this *Caravan) Start() (err error) {
err = this.ModuleBase.Start()
// var module core.IModule
// this.mail = module.(comm.Imail)
// if module, err = this.service.GetModule(comm.ModuleChat); err != nil {
// return
// }
var module core.IModule
if module, err = this.service.GetModule(comm.ModuleMail); err != nil {
return
}
this.mail = module.(comm.Imail)
this.service.RegisterFunctionName(string(comm.Rpc_ModuleCaravanSettlement), this.Rpc_ModuleCaravanSettlement)
return
}
@ -87,9 +87,6 @@ func (this *Caravan) InitCaravanCityData(uid string, data *pb.DBCaravan) {
} else {
city.Special = append(city.Special, v.Special...)
}
// for _, v := range city.Special {
// city.Count[v] = 40 // 配置暂无 后面走配置
// }
data.City[v.Id] = city
}

View File

@ -219,7 +219,6 @@ func (this *Mail) CheckMaxMail(session comm.IUserSession) bool {
}
func (this *Mail) SendMailByUID(uid string, cid string, res []*cfg.Gameatn) bool {
// 查看玩家在不在线
// 获取额外配置
var reward []*pb.UserAssets
for _, v := range res {
@ -272,8 +271,12 @@ func (this *Mail) SendMailByUID(uid string, cid string, res []*cfg.Gameatn) bool
return false
}
}
// 通知玩家
//this.AddNewMailPush(session, mail)
if session, ok := this.GetUserSession(uid); ok { // 通知玩家
session.SendMsg(string(this.GetType()), "getnewmail", &pb.MailGetNewMailPush{Mail: mail})
if err := session.Push(); err != nil {
this.Errorf("err:%v", err)
}
}
return true
}