From 1033d34b6448dea3e45b07aa87621bdc4e889ab0 Mon Sep 17 00:00:00 2001 From: meixiongfeng <766881921@qq.com> Date: Wed, 19 Jul 2023 10:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=87=8F=E5=8F=91=E9=80=81=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E6=94=B9=E7=BA=A2=E7=82=B9=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/imodule.go | 2 +- modules/mail/module.go | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/comm/imodule.go b/comm/imodule.go index 60e500f0d..ededbe826 100644 --- a/comm/imodule.go +++ b/comm/imodule.go @@ -53,7 +53,7 @@ type ( // 所有邮件奖励统一调这个接口 SendRewardMailByCid(session IUserSession, cid string, res []*cfg.Gameatn) bool // 批量发邮件结果: cid 邮件表ID, 没有附件 res 传空 - SendMailToUsers(uids []string, cid string, res []*cfg.Gameatn, param []string, bPush bool) bool // 批量发送邮件 支持跨服 + SendMailToUsers(uids []string, cid string, res []*cfg.Gameatn, param []string) bool // 批量发送邮件 支持跨服 } //道具背包接口 IItems interface { diff --git a/modules/mail/module.go b/modules/mail/module.go index 745733800..0bbc84884 100644 --- a/modules/mail/module.go +++ b/modules/mail/module.go @@ -365,7 +365,7 @@ func (this *Mail) SendRewardMailByCid(session comm.IUserSession, cid string, res return true } -func (this *Mail) SendMailToUsers(uids []string, cid string, res []*cfg.Gameatn, param []string, bPush bool) bool { +func (this *Mail) SendMailToUsers(uids []string, cid string, res []*cfg.Gameatn, param []string) bool { var ( resReward []*pb.UserAssets ) @@ -411,14 +411,6 @@ func (this *Mail) SendMailToUsers(uids []string, cid string, res []*cfg.Gameatn, mail.Reward = false } _, err = dbModel.DB.InsertOne(comm.TableMail, mail) - if bPush { - if session, ok := this.GetUserSession(id); ok { // 通知玩家 - session.SendMsg(string(this.GetType()), "getnewmail", &pb.MailGetNewMailPush{Mail: mail}) - if err := session.Push(); err != nil { - this.Errorf("err:%v", err) - } - } - } } } } @@ -442,16 +434,16 @@ func (this *Mail) SendMailToUsers(uids []string, cid string, res []*cfg.Gameatn, mail.Reward = false } this.modelMail.DB.InsertOne(comm.TableMail, mail) - if bPush { - if session, ok := this.GetUserSession(id); ok { // 通知玩家 - session.SendMsg(string(this.GetType()), "getnewmail", &pb.MailGetNewMailPush{Mail: mail}) - if err := session.Push(); err != nil { - this.Errorf("err:%v", err) - } - } - } + } } - + redot := &pb.ReddotItem{ + Rid: int32(comm.Reddot12102), + Activated: false, + Nextchanagetime: 0, + } + this.SendMsgToUsers("reddot", "change", &pb.ReddotChangePush{ + Rids: []*pb.ReddotItem{redot}, + }, uids...) return true }