Components now knows why client exist

This commit is contained in:
Tnze
2022-05-28 13:48:19 +08:00
parent 4cc7ed22b7
commit 33f604aa93
7 changed files with 44 additions and 26 deletions

View File

@ -54,7 +54,7 @@ func (p *PlayerList) ClientJoin(client *Client, player *Player) {
}
// ClientLeft implement Component for PlayerList
func (p *PlayerList) ClientLeft(_ *Client, player *Player) {
func (p *PlayerList) ClientLeft(_ *Client, player *Player, _ error) {
p.playersLock.Lock()
defer p.playersLock.Unlock()
delete(p.clients, player.UUID)