aboutsummaryrefslogtreecommitdiff
path: root/build/database.js
diff options
context:
space:
mode:
Diffstat (limited to 'build/database.js')
-rw-r--r--build/database.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/build/database.js b/build/database.js
index 2c57d8c..e889f1e 100644
--- a/build/database.js
+++ b/build/database.js
@@ -155,7 +155,6 @@ async function fetchAllMemberLeaderboardAttributes() {
'first_join',
'purse',
'visited_zones',
- 'leaderboards_count'
];
}
exports.fetchAllMemberLeaderboardAttributes = fetchAllMemberLeaderboardAttributes;
@@ -215,7 +214,7 @@ async function fetchMemberLeaderboardSpots(player, profile) {
const fullMember = fullProfile.members.find(m => m.username.toLowerCase() === player.toLowerCase() || m.uuid === player);
// update the leaderboard positions for the member
await updateDatabaseMember(fullMember, fullProfile);
- const applicableAttributes = await getApplicableAttributes(fullMember, fullProfile);
+ const applicableAttributes = await getApplicableAttributes(fullMember);
const memberLeaderboardSpots = [];
for (const leaderboardName in applicableAttributes) {
const leaderboard = await fetchMemberLeaderboardRaw(leaderboardName);
@@ -239,7 +238,7 @@ async function getMemberLeaderboardRequirement(name) {
return null;
}
/** Get the attributes for the member, but only ones that would put them on the top 100 for leaderboards */
-async function getApplicableAttributes(member, profile) {
+async function getApplicableAttributes(member) {
const leaderboardAttributes = getMemberLeaderboardAttributes(member);
const applicableAttributes = {};
for (const [leaderboard, attributeValue] of Object.entries(leaderboardAttributes)) {
@@ -250,13 +249,6 @@ async function getApplicableAttributes(member, profile) {
applicableAttributes[leaderboard] = attributeValue;
}
}
- let leaderboardsCount = Object.keys(applicableAttributes).length;
- const leaderboardsCountRequirement = await getMemberLeaderboardRequirement('leaderboards_count');
- if ((leaderboardsCountRequirement === null)
- || (leaderboardsCount > leaderboardsCountRequirement)) {
- // add 1 extra because this attribute also counts :)
- applicableAttributes['leaderboards_count'] = leaderboardsCount + 1;
- }
return applicableAttributes;
}
/** Update the member's leaderboard data on the server if applicable */
@@ -279,7 +271,7 @@ async function updateDatabaseMember(member, profile) {
await constants.addSlayers(member.slayers.bosses.map(s => s.raw_name));
if (_1.debug)
console.log('done constants..');
- const leaderboardAttributes = await getApplicableAttributes(member, profile);
+ const leaderboardAttributes = await getApplicableAttributes(member);
if (_1.debug)
console.log('done getApplicableAttributes..', leaderboardAttributes);
await memberLeaderboardsCollection.updateOne({