📅  最后修改于: 2022-03-11 15:02:07.255000             🧑  作者: Mango
function getUserRooms(socket) {
return Object.entries(rooms).reduce((names, [name, room]) => {
if (room.users[socket.id] != null) names.push(name)
return names
}, [])
}