mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-23 18:20:19 +03:00
1.9.0 preparations, part 2
- updated Indonesian - added Maroxy's patch's repo mirror support
This commit is contained in:
parent
2292e2720c
commit
00796bee6f
3 changed files with 30 additions and 13 deletions
|
@ -40,7 +40,7 @@
|
|||
"YouPlayedFor": "Kamu sudah bermain selama",
|
||||
"hours": "jam",
|
||||
"minutes": "menit",
|
||||
"YourLauncherLevel": "Your launcher's level",
|
||||
"YourLauncherLevel": "Level peluncur kamu",
|
||||
"Downloading": "Mengunduh",
|
||||
"Unpacking": "Membuka paket",
|
||||
"GameDownloaded": "Game berhasil dipasang",
|
||||
|
@ -60,8 +60,8 @@
|
|||
"LauncherUpdateTitle": "Pembaruan Peluncur tersedia: ",
|
||||
"LauncherUpdateBody": "Kamu dapat mengunduh versi baru peluncur dari repositori di {uri.launcher}",
|
||||
"TelemetryNotDisabled": "Peladen telemetri {placeholders.uppercase.company} tidak dimatikan!",
|
||||
"PatchRepoUnavailableTitle": "Patch's repository is not available",
|
||||
"PatchRepoUnavailableBody": "Most likely notabug is under attack and is not responding",
|
||||
"PatchRepoUnavailableTitle": "Repositori patch tidak tersedia",
|
||||
"PatchRepoUnavailableBody": "Sepertinya notabug sedang dalam serangan dan tidak merespon",
|
||||
"DefPrefix": "Reset to Default",
|
||||
"ChangePrefix": "Change Prefix"
|
||||
}
|
|
@ -212,24 +212,24 @@ export default class LauncherLib
|
|||
* Get patch's state and version from the repository
|
||||
* @returns information about the patch, or null if repository is not available
|
||||
*/
|
||||
public static async getPatchInfo(): Promise<{ version: string, state: 'testing' | 'stable' }|null>
|
||||
public static async getPatchInfo(source: 'origin' | 'additional' = 'origin'): Promise<{ version: string, state: 'testing' | 'stable' }|null>
|
||||
{
|
||||
return new Promise(resolve => {
|
||||
this.getData().then(async (data) => {
|
||||
let gameLatest: string = data.game.latest.version;
|
||||
|
||||
got(`${constants.uri.patch}/raw/master/${gameLatest.replaceAll('.', '')}/patch.sh`, {
|
||||
got(`${constants.uri.patch[source]}/raw/master/${gameLatest.replaceAll('.', '')}/patch.sh`, {
|
||||
timeout: {
|
||||
request: 4000
|
||||
request: 3000
|
||||
}
|
||||
}).then((patch: any) => {
|
||||
/**
|
||||
* [game version]/patch.sh file exists
|
||||
* so it's testing or stable version
|
||||
*/
|
||||
got(`${constants.uri.patch}/raw/master/${gameLatest.replaceAll('.', '')}/patch_files/unityplayer_patch.vcdiff`, {
|
||||
got(`${constants.uri.patch[source]}/raw/master/${gameLatest.replaceAll('.', '')}/patch_files/unityplayer_patch.vcdiff`, {
|
||||
timeout: {
|
||||
request: 4000
|
||||
request: 3000
|
||||
}
|
||||
}).then(() => {
|
||||
/**
|
||||
|
@ -246,10 +246,17 @@ export default class LauncherLib
|
|||
console.error(error);
|
||||
|
||||
/**
|
||||
* Notabug is not responding
|
||||
* Source is not responding
|
||||
*/
|
||||
if (error.message.includes('Timeout awaiting'))
|
||||
resolve(null);
|
||||
{
|
||||
// If it was a notabug - then we can try to use
|
||||
// Maroxy's patch's repo mirror
|
||||
if (source === 'origin')
|
||||
this.getPatchInfo('additional').then(resolve);
|
||||
|
||||
else resolve(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* [game version]/patch_files/unityplayer_patch
|
||||
|
@ -270,10 +277,17 @@ export default class LauncherLib
|
|||
console.error(error);
|
||||
|
||||
/**
|
||||
* Notabug is not responding
|
||||
* Source is not responding
|
||||
*/
|
||||
if (error.message.includes('Timeout awaiting'))
|
||||
resolve(null);
|
||||
{
|
||||
// If it was a notabug - then we can try to use
|
||||
// Maroxy's patch's repo mirror
|
||||
if (source === 'origin')
|
||||
this.getPatchInfo('additional').then(resolve);
|
||||
|
||||
else resolve(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Otherwise it's definitely preparation
|
||||
|
|
|
@ -24,7 +24,10 @@ export default class constants
|
|||
|
||||
public static readonly uri = {
|
||||
api: `https://sdk-os-static.${this.placeholders.lowercase.company}.com/hk4e_global/mdk/launcher/api`,
|
||||
patch: 'https://notabug.org/Krock/dawn',
|
||||
patch: {
|
||||
origin: 'https://notabug.org/Krock/dawn',
|
||||
additional: 'https://dev.kaifa.ch/Maroxy/dawn'
|
||||
},
|
||||
launcher: 'https://gitlab.com/KRypt0n_/an-anime-game-launcher',
|
||||
telemetry: [
|
||||
`log-upload-os.${this.placeholders.lowercase.company}.com`,
|
||||
|
|
Loading…
Reference in a new issue