Release v1.9.0-RC2 #52
|
@ -69,10 +69,10 @@ campaignPlayer.route('/ranking/:campaignId')
|
||||||
resItem.respawn += player.respawn;
|
resItem.respawn += player.respawn;
|
||||||
resItem.flagTouch += player.flagTouch;
|
resItem.flagTouch += player.flagTouch;
|
||||||
if (player.travelDistance) {
|
if (player.travelDistance) {
|
||||||
resItem.travelDistance += Math.round(player.travelDistance / 1000);
|
resItem.travelDistance += Math.round(player.travelDistance / 1000); // meters -> km
|
||||||
}
|
}
|
||||||
if (player.driverDistance) {
|
if (player.driverDistance) {
|
||||||
resItem.driverDistance += Math.round(player.driverDistance / 1000);
|
resItem.driverDistance += Math.round(player.driverDistance / 1000); // meters -> km
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
resItem.warCount = playerInstances.length;
|
resItem.warCount = playerInstances.length;
|
||||||
|
@ -82,12 +82,12 @@ campaignPlayer.route('/ranking/:campaignId')
|
||||||
|
|
||||||
const getSortedField = (fieldName) => {
|
const getSortedField = (fieldName) => {
|
||||||
let num = 1;
|
let num = 1;
|
||||||
const filteredSortResult = rankingItems.map(item => {
|
const filteredSortResult = rankingItems.map((item) => {
|
||||||
return {
|
return {
|
||||||
name: item.name,
|
name: item.name,
|
||||||
fraction: item.fraction,
|
fraction: item.fraction,
|
||||||
[fieldName]: item[fieldName]
|
[fieldName]: item[fieldName],
|
||||||
}
|
};
|
||||||
})
|
})
|
||||||
.sort((a, b) => b[fieldName] - a[fieldName]);
|
.sort((a, b) => b[fieldName] - a[fieldName]);
|
||||||
const res = JSON.parse(JSON.stringify(filteredSortResult));
|
const res = JSON.parse(JSON.stringify(filteredSortResult));
|
||||||
|
|
Loading…
Reference in New Issue