From 8471c502a47b9bf665060bf6924c89457ea18e03 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 17 Apr 2024 09:16:24 +0800 Subject: [PATCH] 1 --- server/mailserver/player/player.go | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/server/mailserver/player/player.go b/server/mailserver/player/player.go index a4314c33..865bd14a 100644 --- a/server/mailserver/player/player.go +++ b/server/mailserver/player/player.go @@ -2,6 +2,7 @@ package player import ( "sync" + "main/common" ) type ReadMail struct { @@ -17,10 +18,12 @@ type DeletedMail struct { } type player struct { - lock sync.Mutex - accountId string - sessionId string - registerTime int32 + lock sync.Mutex + accountId string + sessionId string + registerTime int32 + readMailHash map[int64]*ReadMail + deletedMailHash map[int64]*DeletedMail } func (this *player) Lock() { @@ -34,3 +37,21 @@ func (this *player) UnLock() { func (this *player) GetAccountId() string { return this.accountId } + +func (this *player) MarkMails(mails []common.Mail) { + +} + +func (this *player) GetAttachment(mails []common.Mail) { + +} + +func (this *player) DeleteMails(mails []common.Mail) { + +} + +func (this *player) checkLock() { + if !this.lock.TryLock() { + panic("player checkLock error") + } +}