diff --git a/modules/caravan/module.go b/modules/caravan/module.go index 1fc4dbc7f..d7ddfdf19 100644 --- a/modules/caravan/module.go +++ b/modules/caravan/module.go @@ -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 } diff --git a/modules/mail/module.go b/modules/mail/module.go index e0627de58..40814baed 100644 --- a/modules/mail/module.go +++ b/modules/mail/module.go @@ -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 }