mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-02-03 08:43:48 +03:00
fix: process user_stats.ini
This commit is contained in:
parent
2a6b757e37
commit
71e7f1ee58
@ -74,11 +74,10 @@ const iniParse = async (filePath: string) => {
|
|||||||
object[objectName] = {};
|
object[objectName] = {};
|
||||||
} else {
|
} else {
|
||||||
const [name, ...value] = line.split("=");
|
const [name, ...value] = line.split("=");
|
||||||
object[objectName][name.trim()] = value.join("").trim();
|
object[objectName][name.trim()] = value.join("=").trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("Parsed ini", object);
|
|
||||||
return object;
|
return object;
|
||||||
} catch {
|
} catch {
|
||||||
return null;
|
return null;
|
||||||
@ -222,7 +221,7 @@ const processUserStats = (unlockedAchievements: any): UnlockedAchievement[] => {
|
|||||||
|
|
||||||
if (!isNaN(unlockTime)) {
|
if (!isNaN(unlockTime)) {
|
||||||
newUnlockedAchievements.push({
|
newUnlockedAchievements.push({
|
||||||
name: achievement,
|
name: achievement.replace(/"/g, ``),
|
||||||
unlockTime: unlockTime,
|
unlockTime: unlockTime,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,8 @@ export const updateAllLocalUnlockedAchievements = async () => {
|
|||||||
achievementsLogger.log(
|
achievementsLogger.log(
|
||||||
"Achievement file for",
|
"Achievement file for",
|
||||||
game.title,
|
game.title,
|
||||||
achievementFile.filePath
|
achievementFile.filePath,
|
||||||
|
parsedAchievements
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@ log.transports.file.resolvePathFn = (
|
|||||||
return path.join(logsPath, "pythoninstance.txt");
|
return path.join(logsPath, "pythoninstance.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message?.scope == "achievements") {
|
||||||
|
return path.join(logsPath, "achievements.txt");
|
||||||
|
}
|
||||||
|
|
||||||
if (message?.level === "error") {
|
if (message?.level === "error") {
|
||||||
return path.join(logsPath, "error.txt");
|
return path.join(logsPath, "error.txt");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user