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

@ -100,7 +100,7 @@ func (k *KeepAlive) Run(ctx context.Context) {
func (k *KeepAlive) ClientJoin(client *Client, _ *Player) { k.join <- client }
// ClientLeft implement Component for KeepAlive
func (k *KeepAlive) ClientLeft(client *Client, _ *Player) { k.quit <- client }
func (k *KeepAlive) ClientLeft(client *Client, _ *Player, _ error) { k.quit <- client }
func (k KeepAlive) pushPlayer(p *Client) {
k.listIndex[p] = k.pingList.PushBack(