This commit is contained in:
aozhiwei 2024-04-13 21:40:08 +08:00
parent 822447799d
commit 244a12b318

View File

@ -115,31 +115,27 @@ func (this *mailMgr) caDeleteMails(hum common.Player, c *gin.Context) {
}
func (this *mailMgr) traversePlayerMail(hum common.Player, cb func(*mail) bool) {
this.wholeMails.Range(
func (k, v interface {}) bool {
m := v.(*mail)
if m.isValid(hum) {
cb(m)
stop := false
traversFunc := func (k, v interface{}) bool {
m := v.(*mail)
if m.isValid(hum) {
if !(cb(m)) {
stop = true
return false
}
return true
})
this.groupMails.Range(
func (k, v interface {}) bool {
m := v.(*mail)
if m.isValid(hum) {
cb(m)
}
return true
})
}
return true
}
this.wholeMails.Range(traversFunc)
if stop {
return
}
this.groupMails.Range(traversFunc)
if stop {
return
}
if p, ok := this.personalMails.Load(hum.GetAccountId()); ok {
(p.(*sync.Map)).Range(
func (k, v interface{}) bool {
m := v.(*mail)
if m.isValid(hum) {
cb(m)
}
return true
})
(p.(*sync.Map)).Range(traversFunc)
}
}