This commit is contained in:
aozhiwei 2024-04-13 17:54:20 +08:00
parent bb7718dae7
commit 619efdb644
2 changed files with 9 additions and 0 deletions

View File

@ -35,6 +35,10 @@ func (this *mail) loadFromDb(ds *f5.DataSet) {
}
func (this *mail) isType(mailType int32) bool {
return this.mailType == mailType
}
func newMail() *mail {
p := new(mail)
p.init()

View File

@ -29,6 +29,8 @@ type mailMgr struct {
func (this *mailMgr) Init() {
this.idHash = make(map[int64]*mail)
this.allMails = make(map[int64]*mail)
this.groupHash = make(map[int64]*userGroup)
this.loadMails()
}
@ -80,4 +82,7 @@ func (this *mailMgr) traversePlayerMail(hum common.Player, cb func(*mail) bool)
func (this *mailMgr) addMail(m *mail) {
this.idHash[m.mailId] = m
if m.isType(constant.MAIL_TYPE_ALL) {
this.allMails[m.mailId] = m
}
}