Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Final fix for overflow bug #169

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .github/dependabot.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/ci-cd.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/greetings.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules/
.prettierrc.json
config.json
auth-cache/
3 changes: 1 addition & 2 deletions API/functions/getLatestProfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/* eslint-disable no-throw-literal */
const { getUUID } = require("../../src/contracts/API/PlayerDBAPI.js");
const { getMuseum } = require("./getMuseum.js");
const { isUuid } = require("../utils/uuid.js");
const config = require("../../config.json");
const axios = require("axios");
const { getUUID } = require("../../src/contracts/API/PlayerDBAPI.js");

const cache = new Map();

Expand Down
63 changes: 32 additions & 31 deletions API/stats/dungeons.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ const { titleCase } = require("../constants/functions.js");
module.exports = (player, profile) => {
try {
const dungeons = profile?.dungeons;
const catacombs = dungeons?.dungeon_types.catacombs;
const MASTER_CATACOMBS = dungeons?.dungeon_types.master_catacombs;
const catacombs = dungeons?.dungeon_types?.catacombs;
const MASTER_CATACOMBS = dungeons?.dungeon_types?.master_catacombs;

const floors = {};
const AVAILABLE_FLOORS = Object.keys(dungeons?.dungeon_types.catacombs.times_played || []);
const AVAILABLE_FLOORS = Object.keys(dungeons?.dungeon_types?.catacombs?.times_played || []);

for (const floor in AVAILABLE_FLOORS) {
let floorName = "entrance";
Expand All @@ -29,17 +29,17 @@ module.exports = (player, profile) => {

const MASTER_MODE_FLOORS = {};

for (let i = 1; i <= dungeons?.dungeon_types.master_catacombs.highest_tier_completed; i++) {
for (let i = 1; i <= dungeons?.dungeon_types?.master_catacombs?.highest_tier_completed; i++) {
MASTER_MODE_FLOORS[`floor_${i}`] = {
completions: MASTER_CATACOMBS?.tier_completions[i] ?? 0,
completions: MASTER_CATACOMBS?.tier_completions?.[i] ?? 0,
best_score: {
score: MASTER_CATACOMBS?.best_score[i] ?? 0,
name: getScoreName(MASTER_CATACOMBS?.best_score[i] ?? 0),
score: MASTER_CATACOMBS?.best_score?.[i] ?? 0,
name: getScoreName(MASTER_CATACOMBS?.best_score?.[i] ?? 0),
},
fastest: MASTER_CATACOMBS?.fastest_time[i] ?? 0,
fastest_s: MASTER_CATACOMBS?.fastest_time_s[i] ?? 0,
fastest: MASTER_CATACOMBS?.fastest_time?.[i] ?? 0,
fastest_s: MASTER_CATACOMBS?.fastest_time_s?.[i] ?? 0,
fastest_s_plus: MASTER_CATACOMBS?.fastest_time_s_plus?.[i] || 0,
mobs_killed: MASTER_CATACOMBS?.mobs_killed[i] ?? 0,
mobs_killed: MASTER_CATACOMBS?.mobs_killed?.[i] ?? 0,
};
}

Expand All @@ -50,41 +50,42 @@ module.exports = (player, profile) => {
: null;

const perks = {
catacombs_boss_luck: profile?.perks.catacombs_boss_luck ?? 0,
catacombs_looting: profile?.perks.catacombs_looting ?? 0,
catacombs_intelligence: profile?.perks.catacombs_intelligence ?? 0,
catacombs_health: profile?.perks.catacombs_health ?? 0,
catacombs_strength: profile?.perks.catacombs_strength ?? 0,
catacombs_crit_damage: profile?.perks.catacombs_crit_damage ?? 0,
catacombs_defense: profile?.perks.catacombs_defense ?? 0,
permanent_speed: profile?.perks.permanent_defense ?? 0,
permanent_intelligence: profile?.perks.permanent_intelligence ?? 0,
permanent_health: profile?.perks.permanent_health ?? 0,
permanent_defense: profile?.perks.permanent_defense ?? 0,
permanent_strength: profile?.perks.permanent_strength ?? 0,
forbidden_blessing: profile?.perks.forbidden_blessing ?? 0,
revive_stone: profile?.perks.revive_stone ?? 0,
catacombs_boss_luck: profile?.perks?.catacombs_boss_luck ?? 0,
catacombs_looting: profile?.perks?.catacombs_looting ?? 0,
catacombs_intelligence: profile?.perks?.catacombs_intelligence ?? 0,
catacombs_health: profile?.perks?.catacombs_health ?? 0,
catacombs_strength: profile?.perks?.catacombs_strength ?? 0,
catacombs_crit_damage: profile?.perks?.catacombs_crit_damage ?? 0,
catacombs_defense: profile?.perks?.catacombs_defense ?? 0,
permanent_speed: profile?.perks?.permanent_defense ?? 0,
permanent_intelligence: profile?.perks?.permanent_intelligence ?? 0,
permanent_health: profile?.perks?.permanent_health ?? 0,
permanent_defense: profile?.perks?.permanent_defense ?? 0,
permanent_strength: profile?.perks?.permanent_strength ?? 0,
forbidden_blessing: profile?.perks?.forbidden_blessing ?? 0,
revive_stone: profile?.perks?.revive_stone ?? 0,
};

return {
selected_class: titleCase(dungeons?.selected_dungeon_class),
secrets_found: player?.achievements?.skyblock_treasure_hunter ?? 0,
secrets_found: player?.achievements?.skyblock_treasure_hunter || 0,
classes: {
healer: calcSkill("dungeoneering", dungeons?.player_classes.healer.experience || 0),
mage: calcSkill("dungeoneering", dungeons?.player_classes.mage.experience || 0),
berserk: calcSkill("dungeoneering", dungeons?.player_classes.berserk.experience || 0),
archer: calcSkill("dungeoneering", dungeons?.player_classes.archer.experience || 0),
tank: calcSkill("dungeoneering", dungeons?.player_classes.tank.experience || 0),
healer: calcSkill("dungeoneering", dungeons?.player_classes?.healer?.experience || 0),
mage: calcSkill("dungeoneering", dungeons?.player_classes?.mage?.experience || 0),
berserk: calcSkill("dungeoneering", dungeons?.player_classes?.berserk?.experience || 0),
archer: calcSkill("dungeoneering", dungeons?.player_classes?.archer?.experience || 0),
tank: calcSkill("dungeoneering", dungeons?.player_classes?.tank?.experience || 0),
},
catacombs: {
skill: calcSkill("dungeoneering", dungeons?.dungeon_types.catacombs.experience || 0),
skill: calcSkill("dungeoneering", dungeons?.dungeon_types?.catacombs?.experience || 0),
perks,
HIGEHST_TIER_COMPLETED,
floors,
MASTER_MODE_FLOORS,
},
};
} catch (error) {
console.log(error);
return null;
}
};
Expand Down
11 changes: 5 additions & 6 deletions API/stats/pets.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,12 @@ module.exports = (profile) => {
});

// now we push the lore of the held items
if (!heldItemObj) {
heldItemObj = constants.pet_items[heldItem];
}
lore.push("", `§6Held Item: §${constants.rarityColors[heldItemObj.tier.toLowerCase()]}${heldItemObj.name}`);
if (heldItemObj) {
lore.push("", `§6Held Item: §${constants.rarityColors[heldItemObj.tier.toLowerCase()]}${heldItemObj.name}`);

if (heldItem in constants.pet_items) {
lore.push(constants.pet_items[heldItem].description);
if (heldItem in constants.pet_items) {
lore.push(constants.pet_items[heldItem].description);
}
}
// extra line
lore.push(" ");
Expand Down
21 changes: 0 additions & 21 deletions Dockerfile

This file was deleted.

Loading