mirror of
https://github.com/an-anime-team/an-anime-game-launcher.git
synced 2024-12-24 02:28:15 +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",
|
"YouPlayedFor": "Kamu sudah bermain selama",
|
||||||
"hours": "jam",
|
"hours": "jam",
|
||||||
"minutes": "menit",
|
"minutes": "menit",
|
||||||
"YourLauncherLevel": "Your launcher's level",
|
"YourLauncherLevel": "Level peluncur kamu",
|
||||||
"Downloading": "Mengunduh",
|
"Downloading": "Mengunduh",
|
||||||
"Unpacking": "Membuka paket",
|
"Unpacking": "Membuka paket",
|
||||||
"GameDownloaded": "Game berhasil dipasang",
|
"GameDownloaded": "Game berhasil dipasang",
|
||||||
|
@ -60,8 +60,8 @@
|
||||||
"LauncherUpdateTitle": "Pembaruan Peluncur tersedia: ",
|
"LauncherUpdateTitle": "Pembaruan Peluncur tersedia: ",
|
||||||
"LauncherUpdateBody": "Kamu dapat mengunduh versi baru peluncur dari repositori di {uri.launcher}",
|
"LauncherUpdateBody": "Kamu dapat mengunduh versi baru peluncur dari repositori di {uri.launcher}",
|
||||||
"TelemetryNotDisabled": "Peladen telemetri {placeholders.uppercase.company} tidak dimatikan!",
|
"TelemetryNotDisabled": "Peladen telemetri {placeholders.uppercase.company} tidak dimatikan!",
|
||||||
"PatchRepoUnavailableTitle": "Patch's repository is not available",
|
"PatchRepoUnavailableTitle": "Repositori patch tidak tersedia",
|
||||||
"PatchRepoUnavailableBody": "Most likely notabug is under attack and is not responding",
|
"PatchRepoUnavailableBody": "Sepertinya notabug sedang dalam serangan dan tidak merespon",
|
||||||
"DefPrefix": "Reset to Default",
|
"DefPrefix": "Reset to Default",
|
||||||
"ChangePrefix": "Change Prefix"
|
"ChangePrefix": "Change Prefix"
|
||||||
}
|
}
|
|
@ -212,24 +212,24 @@ export default class LauncherLib
|
||||||
* Get patch's state and version from the repository
|
* Get patch's state and version from the repository
|
||||||
* @returns information about the patch, or null if repository is not available
|
* @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 => {
|
return new Promise(resolve => {
|
||||||
this.getData().then(async (data) => {
|
this.getData().then(async (data) => {
|
||||||
let gameLatest: string = data.game.latest.version;
|
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: {
|
timeout: {
|
||||||
request: 4000
|
request: 3000
|
||||||
}
|
}
|
||||||
}).then((patch: any) => {
|
}).then((patch: any) => {
|
||||||
/**
|
/**
|
||||||
* [game version]/patch.sh file exists
|
* [game version]/patch.sh file exists
|
||||||
* so it's testing or stable version
|
* 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: {
|
timeout: {
|
||||||
request: 4000
|
request: 3000
|
||||||
}
|
}
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
/**
|
/**
|
||||||
|
@ -246,10 +246,17 @@ export default class LauncherLib
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notabug is not responding
|
* Source is not responding
|
||||||
*/
|
*/
|
||||||
if (error.message.includes('Timeout awaiting'))
|
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
|
* [game version]/patch_files/unityplayer_patch
|
||||||
|
@ -270,10 +277,17 @@ export default class LauncherLib
|
||||||
console.error(error);
|
console.error(error);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notabug is not responding
|
* Source is not responding
|
||||||
*/
|
*/
|
||||||
if (error.message.includes('Timeout awaiting'))
|
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
|
* Otherwise it's definitely preparation
|
||||||
|
|
|
@ -24,7 +24,10 @@ export default class constants
|
||||||
|
|
||||||
public static readonly uri = {
|
public static readonly uri = {
|
||||||
api: `https://sdk-os-static.${this.placeholders.lowercase.company}.com/hk4e_global/mdk/launcher/api`,
|
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',
|
launcher: 'https://gitlab.com/KRypt0n_/an-anime-game-launcher',
|
||||||
telemetry: [
|
telemetry: [
|
||||||
`log-upload-os.${this.placeholders.lowercase.company}.com`,
|
`log-upload-os.${this.placeholders.lowercase.company}.com`,
|
||||||
|
|
Loading…
Reference in a new issue