Skip to content

Commit

Permalink
fix(backend): fix call to unregister for player quit, use correct client
Browse files Browse the repository at this point in the history
  • Loading branch information
joshzcold committed Feb 20, 2025
1 parent 8a03eb1 commit 723555a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backend/api/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ func quitPlayer(room *room, client *Client, event *Event) error {
if playerClient != nil {
playerClient.client.send <- message
playerClient.client.stop <- true
room.Hub.unregister <- playerClient.client
}
delete(room.Game.RegisteredPlayers, event.ID)
message, err = NewSendData(room.Game)
if err != nil {
return fmt.Errorf(" %w", err)
}
room.Hub.broadcast <- message
room.Hub.unregister <- client
return nil
}

Expand Down

0 comments on commit 723555a

Please sign in to comment.