mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2025-01-01 22:47:19 +03:00
Add Downloading of mismatched files
Add Locales
This commit is contained in:
parent
e47dd445a5
commit
7327231c04
11 changed files with 79 additions and 6 deletions
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Spiel wird entpackt...
|
unpacking: Spiel wird entpackt...
|
||||||
applying_changes: Änderungen werden angewandt...
|
applying_changes: Änderungen werden angewandt...
|
||||||
deleting_outdated: Lösche veraltete dateien...
|
deleting_outdated: Lösche veraltete dateien...
|
||||||
|
integrity_check: Verifiziere Dateien...
|
||||||
|
download_mismatch_files: Lade nicht übereinstimmenden Dateien herunter...
|
||||||
|
|
||||||
# Voice packages installation
|
# Voice packages installation
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Starten
|
launch: Starten
|
||||||
predownload: Update vorinstallieren
|
predownload: Update vorinstallieren
|
||||||
|
integrity: Dateien verifizieren und reparieren
|
||||||
|
|
||||||
# Einstellungs Fenster
|
# Einstellungs Fenster
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Unpacking game...
|
unpacking: Unpacking game...
|
||||||
applying_changes: Applying changes...
|
applying_changes: Applying changes...
|
||||||
deleting_outdated: Deleting outdated files...
|
deleting_outdated: Deleting outdated files...
|
||||||
|
integrity_check: Verifying Files...
|
||||||
|
download_mismatch_files: Downloading mismatched files...
|
||||||
|
|
||||||
# Voice packages installation
|
# Voice packages installation
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Launch
|
launch: Launch
|
||||||
predownload: Pre-download update
|
predownload: Pre-download update
|
||||||
|
integrity: Verify Files & Repair
|
||||||
|
|
||||||
# Settings window
|
# Settings window
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Descomprimiendo el juego...
|
unpacking: Descomprimiendo el juego...
|
||||||
applying_changes: Applying changes...
|
applying_changes: Applying changes...
|
||||||
deleting_outdated: Borrando archivos viejos...
|
deleting_outdated: Borrando archivos viejos...
|
||||||
|
integrity_check: Verifying Files...
|
||||||
|
download_mismatch_files: Downloading mismatched files...
|
||||||
|
|
||||||
# Instalación de paquetes de voz
|
# Instalación de paquetes de voz
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Jugar
|
launch: Jugar
|
||||||
predownload: Pre-descargar actualización
|
predownload: Pre-descargar actualización
|
||||||
|
integrity: Verify Files & Repair
|
||||||
|
|
||||||
# Ventana de opciones
|
# Ventana de opciones
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Décompression du jeu...
|
unpacking: Décompression du jeu...
|
||||||
applying_changes: Application des changements...
|
applying_changes: Application des changements...
|
||||||
deleting_outdated: Suppression des fichiers non à jour...
|
deleting_outdated: Suppression des fichiers non à jour...
|
||||||
|
integrity_check: Verifying Files...
|
||||||
|
download_mismatch_files: Downloading mismatched files...
|
||||||
|
|
||||||
# Voice packages installation
|
# Voice packages installation
|
||||||
voice:
|
voice:
|
||||||
|
@ -73,6 +75,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Lancer
|
launch: Lancer
|
||||||
predownload: Pre-téléchargement de mise à jour
|
predownload: Pre-téléchargement de mise à jour
|
||||||
|
integrity: Verify Files & Repair
|
||||||
|
|
||||||
# Settings window
|
# Settings window
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Játék kibontása folyamatban...
|
unpacking: Játék kibontása folyamatban...
|
||||||
applying_changes: Változások alkalmazása...
|
applying_changes: Változások alkalmazása...
|
||||||
deleting_outdated: Lejárt fájlok kitörlése...
|
deleting_outdated: Lejárt fájlok kitörlése...
|
||||||
|
integrity_check: Verifying Files...
|
||||||
|
download_mismatch_files: Downloading mismatched files...
|
||||||
|
|
||||||
# Voice packages installation
|
# Voice packages installation
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Indítás
|
launch: Indítás
|
||||||
predownload: Frissítés előtöltése
|
predownload: Frissítés előtöltése
|
||||||
|
integrity: Verify Files & Repair
|
||||||
|
|
||||||
# Settings window
|
# Settings window
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Membongkar game...
|
unpacking: Membongkar game...
|
||||||
applying_changes: Applying changes...
|
applying_changes: Applying changes...
|
||||||
deleting_outdated: Menghapus file lama...
|
deleting_outdated: Menghapus file lama...
|
||||||
|
integrity_check: Verifying Files...
|
||||||
|
download_mismatch_files: Downloading mismatched files...
|
||||||
|
|
||||||
# Voice packages installation
|
# Voice packages installation
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Luncurkan
|
launch: Luncurkan
|
||||||
predownload: Pembaruan pra-unduh
|
predownload: Pembaruan pra-unduh
|
||||||
|
integrity: Verify Files & Repair
|
||||||
|
|
||||||
# Settings window
|
# Settings window
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Decomprimendo il gioco...
|
unpacking: Decomprimendo il gioco...
|
||||||
applying_changes: Applying changes...
|
applying_changes: Applying changes...
|
||||||
deleting_outdated: Cancellando file vecchi...
|
deleting_outdated: Cancellando file vecchi...
|
||||||
|
integrity_check: Verifying Files...
|
||||||
|
download_mismatch_files: Downloading mismatched files...
|
||||||
|
|
||||||
# Voice packages installation
|
# Voice packages installation
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Avvia
|
launch: Avvia
|
||||||
predownload: Pre-scarica aggiornamento
|
predownload: Pre-scarica aggiornamento
|
||||||
|
integrity: Verify Files & Repair
|
||||||
|
|
||||||
# Settings window
|
# Settings window
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Pakker ut spill...
|
unpacking: Pakker ut spill...
|
||||||
applying_changes: Applying changes...
|
applying_changes: Applying changes...
|
||||||
deleting_outdated: Fjerner utdaterte filer...
|
deleting_outdated: Fjerner utdaterte filer...
|
||||||
|
integrity_check: Verifying Files...
|
||||||
|
download_mismatch_files: Downloading mismatched files...
|
||||||
|
|
||||||
# Voice packages installation
|
# Voice packages installation
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Start
|
launch: Start
|
||||||
predownload: Forhånds-nedlast oppdatering
|
predownload: Forhånds-nedlast oppdatering
|
||||||
|
integrity: Verify Files & Repair
|
||||||
|
|
||||||
# Settings window
|
# Settings window
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: Распаковка игры...
|
unpacking: Распаковка игры...
|
||||||
applying_changes: Применение изменений...
|
applying_changes: Применение изменений...
|
||||||
deleting_outdated: Удаление устаревших файлов...
|
deleting_outdated: Удаление устаревших файлов...
|
||||||
|
integrity_check: Verifying Files...
|
||||||
|
download_mismatch_files: Downloading mismatched files...
|
||||||
|
|
||||||
# Установка звуковых пакетов
|
# Установка звуковых пакетов
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: Запустить
|
launch: Запустить
|
||||||
predownload: Предзагрузить обновление
|
predownload: Предзагрузить обновление
|
||||||
|
integrity: Verify Files & Repair
|
||||||
|
|
||||||
# Окно настроек
|
# Окно настроек
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -25,6 +25,8 @@ launcher:
|
||||||
unpacking: unpacking g-game (o^▽^o)
|
unpacking: unpacking g-game (o^▽^o)
|
||||||
applying_changes: appwying changes...
|
applying_changes: appwying changes...
|
||||||
deleting_outdated: deweting outdated fiwes...
|
deleting_outdated: deweting outdated fiwes...
|
||||||
|
integrity_check: vewifying fiwes...
|
||||||
|
download_mismatch_files: downwoading mismatched fiwes...
|
||||||
|
|
||||||
# Voice packages installation
|
# Voice packages installation
|
||||||
voice:
|
voice:
|
||||||
|
@ -70,6 +72,7 @@ launcher:
|
||||||
ready:
|
ready:
|
||||||
launch: launch (◕▿◕✿)
|
launch: launch (◕▿◕✿)
|
||||||
predownload: pwe-downwoad update
|
predownload: pwe-downwoad update
|
||||||
|
integrity: vewify files & wepaiw
|
||||||
|
|
||||||
# Settings window
|
# Settings window
|
||||||
settings:
|
settings:
|
||||||
|
|
|
@ -1,14 +1,43 @@
|
||||||
import type Launcher from '../../Launcher';
|
import type Launcher from '../../Launcher';
|
||||||
|
|
||||||
import { Debug, fs, path } from '../../../empathize';
|
import { Debug, fs, path, Cache, Downloader } from '../../../empathize';
|
||||||
|
|
||||||
import constants from '../../Constants';
|
import constants from '../../Constants';
|
||||||
import Patch from "../../Patch";
|
import Patch from "../../Patch";
|
||||||
import Locales from '../Locales';
|
import Locales from '../Locales';
|
||||||
import Voice from "../../Voice"
|
import Voice from "../../Voice";
|
||||||
|
|
||||||
declare const Neutralino;
|
declare const Neutralino;
|
||||||
|
|
||||||
|
async function download(fileInfo): Promise<boolean>
|
||||||
|
{
|
||||||
|
return new Promise(async (resolve) => {
|
||||||
|
const gameDir = await constants.paths.gameDir;
|
||||||
|
const cache = await Cache.get('Game.getLatestData.ServerResponse');
|
||||||
|
|
||||||
|
let uri = `${cache!.value['game']['latest']['decompressed_path']}/${fileInfo.remoteName}`;
|
||||||
|
|
||||||
|
Downloader.download(uri, `${gameDir}/${fileInfo.remoteName}.new`).then((stream) => {
|
||||||
|
stream.finish(async () => {
|
||||||
|
const process = await Neutralino.os.execCommand(`md5sum "${path.addSlashes(`${gameDir}/${fileInfo.remoteName}.new`)}"`);
|
||||||
|
const fileHash = (process.stdOut || process.stdErr).split(' ')[0];
|
||||||
|
|
||||||
|
if (fileHash == fileInfo.md5)
|
||||||
|
{
|
||||||
|
await fs.remove(`${gameDir}/${fileInfo.remoteName}`);
|
||||||
|
await fs.move(`${gameDir}/${fileInfo.remoteName}.new`, `${gameDir}/${fileInfo.remoteName}`);
|
||||||
|
resolve(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
await fs.remove(`${gameDir}/${fileInfo.remoteName}.new`);
|
||||||
|
resolve(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export default (launcher: Launcher): Promise<void> => {
|
export default (launcher: Launcher): Promise<void> => {
|
||||||
return new Promise(async (resolve) => {
|
return new Promise(async (resolve) => {
|
||||||
const gameDir = await constants.paths.gameDir;
|
const gameDir = await constants.paths.gameDir;
|
||||||
|
@ -74,7 +103,7 @@ export default (launcher: Launcher): Promise<void> => {
|
||||||
`Checked ${total} files with ${mismatchedFiles.length} mismatches` :
|
`Checked ${total} files with ${mismatchedFiles.length} mismatches` :
|
||||||
[
|
[
|
||||||
`Checked ${total} files with ${mismatchedFiles.length} mismatch(es):`,
|
`Checked ${total} files with ${mismatchedFiles.length} mismatch(es):`,
|
||||||
...mismatchedFiles
|
...mismatchedFiles.map(e => `[${e.md5}] ${e.remoteName}`)
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -83,10 +112,24 @@ export default (launcher: Launcher): Promise<void> => {
|
||||||
|
|
||||||
// Replace mismatched files
|
// Replace mismatched files
|
||||||
|
|
||||||
for (const file of mismatchedFiles)
|
mismatchedFiles.forEach(async (fileInfo: { remoteName: string, md5: string, fileSize: number }) =>
|
||||||
{
|
{
|
||||||
const fileInfo = JSON.parse(file) as { remoteName: string, md5: string, fileSize: number };
|
launcher.progressBar?.init({
|
||||||
}
|
label: Locales.translate('launcher.progress.game.download_mismatch_files') as string,
|
||||||
|
showSpeed: false,
|
||||||
|
showEta: false,
|
||||||
|
showPercents: false,
|
||||||
|
showTotals: false
|
||||||
|
});
|
||||||
|
|
||||||
|
download(fileInfo).then(async (success) => {
|
||||||
|
if (!success)
|
||||||
|
Debug.log({
|
||||||
|
function: 'Launcher/States/Integrity',
|
||||||
|
message: `Download of ${fileInfo.remoteName} failed`
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
resolve();
|
resolve();
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue