fixed sorting

This commit is contained in:
Tumble 2017-12-16 21:39:18 +00:00
parent 72c196e731
commit 520312b57c
1 changed files with 1 additions and 1 deletions

2
app.js
View File

@ -13,7 +13,7 @@ var players = [];
function UpdatePlayers() {
var top5Players = players.filter(player => player.name !== undefined)
top5Players.sort(function(a,b) {
return a.score - b.score;
return b.score - a.score;
});
top5Players = top5Players.slice(0,5);
io.emit('update-players', top5Players);