批量发送邮件改红点推送
This commit is contained in:
parent
438dda8e45
commit
1033d34b64
@ -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 {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user