Hi there,
socket.on('disconnect', function() {})
is probably what you’re looking for. Like connect
, the disconnect message is a built in message sent when a client disconnects. You can put code in the handler to remove the corresponding socket.id
from the players
object.