mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-12 14:26:16 +00:00
Compare commits
24 Commits
v3.1.2
...
feature/sh
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f000ab2b2 | ||
|
|
d6bd0ec221 | ||
|
|
a9f8d1b42c | ||
|
|
83e662f633 | ||
|
|
c7b924bf2f | ||
|
|
e0d69ccf9d | ||
|
|
aa4e71076d | ||
|
|
eccff27739 | ||
|
|
601b3b0a00 | ||
|
|
1ceea5d5a3 | ||
|
|
9c99724e7d | ||
|
|
55e0f42702 | ||
|
|
b355930eaf | ||
|
|
57b47951a1 | ||
|
|
4780640ed0 | ||
|
|
8b92c8fdd9 | ||
|
|
acd98d0aad | ||
|
|
27239f848e | ||
|
|
c4d0a8eb94 | ||
|
|
60b12b2435 | ||
|
|
1c9515516f | ||
|
|
58a89372ab | ||
|
|
90841bf5e4 | ||
|
|
5564644378 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -10,3 +10,4 @@ out
|
||||
ludusavi/
|
||||
hydra-python-rpc/
|
||||
aria2/
|
||||
.python-version
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
3.9.20
|
||||
@@ -14,7 +14,7 @@
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](README.pt-BR.md)
|
||||
[](README.md)
|
||||
[](../README.md)
|
||||
[](README.ru.md)
|
||||
[](README.uk-UA.md)
|
||||
[](README.be.md)
|
||||
@@ -27,7 +27,7 @@
|
||||
[](README.nb.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
|
||||
<h1 align="center">Hydra Launcher</h1>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](README.pt-BR.md)
|
||||
[](README.md)
|
||||
[](../README.md)
|
||||
[](README.ru.md)
|
||||
[](README.uk-UA.md)
|
||||
[](README.be.md)
|
||||
@@ -27,7 +27,7 @@
|
||||
[](README.nb.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](README.pt-BR.md)
|
||||
[](README.md)
|
||||
[](../README.md)
|
||||
[](README.ru.md)
|
||||
[](README.uk-UA.md)
|
||||
[](README.be.md)
|
||||
@@ -26,7 +26,7 @@
|
||||
[](README.da.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
[](https://github.com/hydralauncher/hydra/actions)
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](README.md)
|
||||
[](../README.md)
|
||||
[](README.be.md)
|
||||
[](README.pl.md)
|
||||
[](README.pt-BR.md)
|
||||
@@ -27,7 +27,7 @@
|
||||
[](README.nb.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
|
||||
<h1 align="center">Hydra Launcher</h1>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](README.pt-BR.md)
|
||||
[](README.md)
|
||||
[](../README.md)
|
||||
[](README.ru.md)
|
||||
[](README.uk-UA.md)
|
||||
[](README.be.md)
|
||||
@@ -27,7 +27,7 @@
|
||||
[](README.nb.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -11,21 +11,21 @@
|
||||
[](https://github.com/hydralauncher/hydra/actions)
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](./README.pt-BR.md)
|
||||
[](./README.md)
|
||||
[](./README.ru.md)
|
||||
[](./README.uk-UA.md)
|
||||
[](./README.be.md)
|
||||
[](./README.es.md)
|
||||
[](./README.fr.md)
|
||||
[](./README.de.md)
|
||||
[](./README.it.md)
|
||||
[](./README.cs.md)
|
||||
[](./README.da.md)
|
||||
[](./README.nb.md)
|
||||
[](./README.et.md)
|
||||
[](README.pt-BR.md)
|
||||
[](../README.md)
|
||||
[](README.ru.md)
|
||||
[](README.uk-UA.md)
|
||||
[](README.be.md)
|
||||
[](README.es.md)
|
||||
[](README.fr.md)
|
||||
[](README.de.md)
|
||||
[](README.it.md)
|
||||
[](README.cs.md)
|
||||
[](README.da.md)
|
||||
[](README.nb.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
|
||||
<h1 align="center">Hydra Launcher</h1>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](README.pt-BR.md)
|
||||
[](README.md)
|
||||
[](../README.md)
|
||||
[](README.ru.md)
|
||||
[](README.uk-UA.md)
|
||||
[](README.be.md)
|
||||
@@ -27,7 +27,7 @@
|
||||
[](README.nb.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
|
||||
<h1 align="center">Hydra Launcher</h1>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](README.pt-BR.md)
|
||||
[](README.md)
|
||||
[](../README.md)
|
||||
[](README.ru.md)
|
||||
[](README.uk-UA.md)
|
||||
[](README.be.md)
|
||||
@@ -26,7 +26,7 @@
|
||||
[](README.nb.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[<img src="./resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
[<img src="../resources/icon.png" width="144"/>](https://help.hydralauncher.gg)
|
||||
|
||||
<h1 align="center">Hydra Launcher</h1>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
[](https://github.com/hydralauncher/hydra/releases)
|
||||
|
||||
[](README.pt-BR.md)
|
||||
[](README.md)
|
||||
[](../README.md)
|
||||
[](README.ru.md)
|
||||
[](README.uk-UA.md)
|
||||
[](README.be.md)
|
||||
@@ -27,7 +27,7 @@
|
||||
[](README.nb.md)
|
||||
[](README.et.md)
|
||||
|
||||

|
||||

|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
"developers": "Desarrolladores",
|
||||
"genres": "Géneros",
|
||||
"tags": "Marcadores",
|
||||
"publishers": "Distribuidoras",
|
||||
"publishers": "Editores",
|
||||
"download_sources": "Fuentes de descarga",
|
||||
"result_count": "{{resultCount}} resultados",
|
||||
"filter_count": "{{filterCount}} disponibles",
|
||||
@@ -175,7 +175,7 @@
|
||||
"backup_from": "Copia de seguridad de {{date}}",
|
||||
"custom_backup_location_set": "Se configuró la carpeta de copia de seguridad",
|
||||
"clear": "Limpiar",
|
||||
"no_directory_selected": "No se seleccionó un directório"
|
||||
"no_directory_selected": "No se seleccionó un directorio"
|
||||
},
|
||||
"activation": {
|
||||
"title": "Activar Hydra",
|
||||
@@ -208,7 +208,11 @@
|
||||
"queued": "En cola",
|
||||
"no_downloads_title": "Esto está tan... vacío",
|
||||
"no_downloads_description": "No has descargado nada con Hydra... aún, ¡pero nunca es tarde para comenzar!.",
|
||||
"checking_files": "Verificando archivos…"
|
||||
"checking_files": "Verificando archivos…",
|
||||
"seeding": "Seeding",
|
||||
"stop_seeding": "Detener seeding",
|
||||
"resume_seeding": "Continuar seeding",
|
||||
"options": "Gestionar"
|
||||
},
|
||||
"settings": {
|
||||
"downloads_path": "Ruta de descarga",
|
||||
@@ -265,7 +269,9 @@
|
||||
"user_unblocked": "El usuario ha sido desbloqueado",
|
||||
"enable_achievement_notifications": "Cuando un logro se desbloquea",
|
||||
"launch_minimized": "Iniciar Hydra minimizado",
|
||||
"disable_nsfw_alert": "Desactivar alerta NSFW"
|
||||
"disable_nsfw_alert": "Desactivar alerta NSFW",
|
||||
"seed_after_download_complete": "Realizar seeding después de que se completa la descarga",
|
||||
"show_hidden_achievement_description": "Ocultar descripción de logros ocultos antes de desbloquearlos"
|
||||
},
|
||||
"notifications": {
|
||||
"download_complete": "Descarga completada",
|
||||
@@ -366,7 +372,16 @@
|
||||
"upload_banner": "Subir un banner",
|
||||
"uploading_banner": "Subiendo banner…",
|
||||
"background_image_updated": "Imagen de fondo actualizada",
|
||||
"playing": "Jugando {{game}}"
|
||||
"playing": "Jugando {{game}}",
|
||||
"achievements": "logros",
|
||||
"achievements_unlocked": "Logros desbloqueados",
|
||||
"earned_points": "Puntos Obtenidos",
|
||||
"show_achievements_on_profile": "Mostrar tus logros en tu perfil",
|
||||
"show_points_on_profile": "Mostrar tus puntos obtenidos en tu perfil",
|
||||
"games": "Juegos",
|
||||
"ranking_updated_weekly": "El Ranking se actualiza semanalmente",
|
||||
"stats": "Estadísticas",
|
||||
"top_percentile": "Top {{percentile}}%"
|
||||
},
|
||||
"achievement": {
|
||||
"achievement_unlocked": "Logro desbloqueado",
|
||||
@@ -376,7 +391,12 @@
|
||||
"subscription_needed": "Se necesita una suscripción a Hydra Cloud necesita para ver este contenido",
|
||||
"new_achievements_unlocked": "Desbloqueados {{achievementCount}} nuevos logros de {{gameCount}} juegos",
|
||||
"achievement_progress": "{{unlockedCount}}/{{totalCount}} logros",
|
||||
"achievements_unlocked_for_game": "Se han desbloqueado {{achievementCount}} nuevos logros de {{gameTitle}}"
|
||||
"achievements_unlocked_for_game": "Se han desbloqueado {{achievementCount}} nuevos logros de {{gameTitle}}",
|
||||
"hidden_achievement_tooltip": "Este es un logro oculto",
|
||||
"achievement_earn_points": "Obtén {{points}} puntos con este logro",
|
||||
"earned_points": "Puntos obtenidos:",
|
||||
"available_points": "Puntos disponibles:",
|
||||
"how_to_earn_achievements_points": "¿Cómo obtener puntos de logros?"
|
||||
},
|
||||
"hydra_cloud": {
|
||||
"subscription_tour_title": "Suscripción Hydra Cloud",
|
||||
@@ -386,6 +406,9 @@
|
||||
"animated_profile_picture": "Fotos de perfil animadas",
|
||||
"premium_support": "Soporte Premium",
|
||||
"show_and_compare_achievements": "Muestra y compara tus logros con otros usuarios",
|
||||
"animated_profile_banner": "Fondo de perfil animado"
|
||||
"animated_profile_banner": "Fondo de perfil animado",
|
||||
"hydra_cloud": "Hydra Cloud",
|
||||
"hydra_cloud_feature_found": "¡Has descubierto una característica de Hydra Cloud!",
|
||||
"learn_more": "Aprender más"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ export const gamesPlaytime = new Map<
|
||||
interface ExecutableInfo {
|
||||
name: string;
|
||||
os: string;
|
||||
exe: string;
|
||||
}
|
||||
|
||||
interface GameExecutables {
|
||||
@@ -30,47 +31,65 @@ interface GameExecutables {
|
||||
const TICKS_TO_UPDATE_API = 120;
|
||||
let currentTick = 1;
|
||||
|
||||
const gameExecutables = (
|
||||
await axios
|
||||
.get(
|
||||
import.meta.env.MAIN_VITE_EXTERNAL_RESOURCES_URL +
|
||||
"/game-executables.json"
|
||||
)
|
||||
.catch(() => {
|
||||
return { data: {} };
|
||||
})
|
||||
).data as GameExecutables;
|
||||
const isWindowsPlatform = process.platform === "win32";
|
||||
const isLinuxPlatform = process.platform === "linux";
|
||||
|
||||
const getGameExecutables = async () => {
|
||||
const gameExecutables = (
|
||||
await axios
|
||||
.get(
|
||||
import.meta.env.MAIN_VITE_EXTERNAL_RESOURCES_URL +
|
||||
"/game-executables.json"
|
||||
)
|
||||
.catch(() => {
|
||||
return { data: {} };
|
||||
})
|
||||
).data as GameExecutables;
|
||||
|
||||
Object.keys(gameExecutables).forEach((key) => {
|
||||
gameExecutables[key] = gameExecutables[key]
|
||||
.filter((executable) => {
|
||||
if (isWindowsPlatform) {
|
||||
return executable.os === "win32";
|
||||
} else if (isLinuxPlatform) {
|
||||
return executable.os === "linux" || executable.os === "win32";
|
||||
}
|
||||
return false;
|
||||
})
|
||||
.map((executable) => {
|
||||
return {
|
||||
name: isWindowsPlatform
|
||||
? executable.name.replace(/\//g, "\\")
|
||||
: executable.name,
|
||||
os: executable.os,
|
||||
exe: executable.name.slice(executable.name.lastIndexOf("/") + 1),
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
return gameExecutables;
|
||||
};
|
||||
|
||||
const gameExecutables = await getGameExecutables();
|
||||
|
||||
const findGamePathByProcess = (
|
||||
processMap: Map<string, Set<string>>,
|
||||
gameId: string
|
||||
) => {
|
||||
const executables = gameExecutables[gameId].filter((info) => {
|
||||
if (process.platform === "linux" && info.os === "linux") return true;
|
||||
return info.os === "win32";
|
||||
});
|
||||
const executables = gameExecutables[gameId];
|
||||
|
||||
for (const executable of executables) {
|
||||
const exe = executable.name.slice(executable.name.lastIndexOf("/") + 1);
|
||||
|
||||
if (!exe) continue;
|
||||
|
||||
const pathSet = processMap.get(exe);
|
||||
const pathSet = processMap.get(executable.exe);
|
||||
|
||||
if (pathSet) {
|
||||
const executableName =
|
||||
process.platform === "win32"
|
||||
? executable.name.replace(/\//g, "\\")
|
||||
: executable.name;
|
||||
|
||||
pathSet.forEach((path) => {
|
||||
if (path.toLowerCase().endsWith(executableName)) {
|
||||
if (path.toLowerCase().endsWith(executable.name)) {
|
||||
gameRepository.update(
|
||||
{ objectID: gameId, shop: "steam" },
|
||||
{ executablePath: path }
|
||||
);
|
||||
|
||||
if (process.platform === "linux") {
|
||||
if (isLinuxPlatform) {
|
||||
exec(commands.findWineDir, (err, out) => {
|
||||
if (err) return;
|
||||
|
||||
@@ -105,7 +124,7 @@ const getSystemProcessMap = async () => {
|
||||
map.set(key, currentSet.add(value));
|
||||
});
|
||||
|
||||
if (process.platform === "linux") {
|
||||
if (isLinuxPlatform) {
|
||||
await new Promise((res) => {
|
||||
exec(commands.findWineExecutables, (err, out) => {
|
||||
if (err) {
|
||||
@@ -152,7 +171,6 @@ export const watchProcesses = async () => {
|
||||
|
||||
for (const game of games) {
|
||||
const executablePath = game.executablePath;
|
||||
|
||||
if (!executablePath) {
|
||||
if (gameExecutables[game.objectID]) {
|
||||
findGamePathByProcess(processMap, game.objectID);
|
||||
@@ -161,10 +179,7 @@ export const watchProcesses = async () => {
|
||||
}
|
||||
|
||||
const executable = executablePath
|
||||
.slice(
|
||||
executablePath.lastIndexOf(process.platform === "win32" ? "\\" : "/") +
|
||||
1
|
||||
)
|
||||
.slice(executablePath.lastIndexOf(isWindowsPlatform ? "\\" : "/") + 1)
|
||||
.toLowerCase();
|
||||
|
||||
const hasProcess = processMap.get(executable)?.has(executablePath);
|
||||
|
||||
Reference in New Issue
Block a user