Преглед на файлове

made the leaderboard sort

tags/v0.2.1^2
Big Bad Waffle преди 5 години
родител
ревизия
132fb935e2
променени са 1 файла, в които са добавени 2 реда и са изтрити 26 реда
  1. +2
    -26
      src/server/leaderboard/leaderboard.js

+ 2
- 26
src/server/leaderboard/leaderboard.js Целия файл

@@ -61,33 +61,9 @@ module.exports = {
prophecies: l.value.prophecies
}));

this.loaded = true;
},

parseList: function (result) {
this.list = JSON.parse(result).list;

if (!(this.list instanceof Array))
this.list = [];

this.list.forEach(function (l) {
if (l.name.indexOf('\'') > -1)
l.name = l.name.split('\'').join('');
});
this.sort();

let doSave = false;

this.waiting.forEach(function (w) {
if (!this.list.some(l => l.name === w.name)) {
this.list.push(w);
doSave = true;
}
}, this);

if (doSave)
this.save();

this.waiting = [];
this.loaded = true;
},

getLevel: function (name) {


Зареждане…
Отказ
Запис