mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 08:43:48 +03:00
feat: creamapi process
This commit is contained in:
parent
b3a1111bfc
commit
387ee86c0f
@ -66,6 +66,11 @@ export const parseAchievementFile = async (
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type === Cracker.creamAPI) {
|
||||||
|
const parsed = await iniParse(filePath);
|
||||||
|
return processCreamAPI(parsed);
|
||||||
|
}
|
||||||
|
|
||||||
achievementsLogger.log(`${type} achievements found on ${filePath}`);
|
achievementsLogger.log(`${type} achievements found on ${filePath}`);
|
||||||
return [];
|
return [];
|
||||||
};
|
};
|
||||||
@ -125,6 +130,27 @@ const processOnlineFix = (unlockedAchievements: any): UnlockedAchievement[] => {
|
|||||||
return parsedUnlockedAchievements;
|
return parsedUnlockedAchievements;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const processCreamAPI = (unlockedAchievements: any): UnlockedAchievement[] => {
|
||||||
|
const parsedUnlockedAchievements: UnlockedAchievement[] = [];
|
||||||
|
|
||||||
|
for (const achievement of Object.keys(unlockedAchievements)) {
|
||||||
|
const unlockedAchievement = unlockedAchievements[achievement];
|
||||||
|
|
||||||
|
if (unlockedAchievement?.achieved) {
|
||||||
|
const unlockTime = unlockedAchievement.unlocktime;
|
||||||
|
parsedUnlockedAchievements.push({
|
||||||
|
name: achievement,
|
||||||
|
unlockTime:
|
||||||
|
unlockTime.length === 7
|
||||||
|
? unlockTime * 1000 * 1000
|
||||||
|
: unlockTime * 1000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return parsedUnlockedAchievements;
|
||||||
|
};
|
||||||
|
|
||||||
const processSkidrow = (unlockedAchievements: any): UnlockedAchievement[] => {
|
const processSkidrow = (unlockedAchievements: any): UnlockedAchievement[] => {
|
||||||
const parsedUnlockedAchievements: UnlockedAchievement[] = [];
|
const parsedUnlockedAchievements: UnlockedAchievement[] = [];
|
||||||
const achievements = unlockedAchievements["Achievements"];
|
const achievements = unlockedAchievements["Achievements"];
|
||||||
|
Loading…
Reference in New Issue
Block a user