I need to get all clients data and compare certain properties to determine who won the game

Code to give an example:

```
socket.on('joinedRoom', function(roomData){
    socket.join(roomData.roomname);
    socket.score = 0;
}):

```

and here I increment the player's score: 

```
socket.on('sendPlayerScore', function(username){
    socket.score++;
});

```

So the idea is, I would get all scores from that specific room to determine who score more points.

Is there any good way to accomplish this?

Thanks!