2021-11-01 13:46:10 +03:00
|
|
|
const path = require('path');
|
|
|
|
const os = require('os');
|
2021-11-28 21:13:42 +03:00
|
|
|
import LauncherLib from "./LauncherLib";
|
2021-11-01 13:46:10 +03:00
|
|
|
|
2021-11-16 21:20:24 +03:00
|
|
|
export default class constants
|
2021-11-01 13:46:10 +03:00
|
|
|
{
|
2021-11-01 15:50:48 +03:00
|
|
|
public static readonly placeholders = {
|
2021-11-01 14:01:28 +03:00
|
|
|
uppercase:
|
|
|
|
{
|
|
|
|
first: Buffer.from('R2Vuc2hpbg==', 'base64').toString(),
|
|
|
|
second: Buffer.from('SW1wYWN0', 'base64').toString(),
|
2021-11-01 15:50:48 +03:00
|
|
|
full: Buffer.from('R2Vuc2hpbiBJbXBhY3Q=', 'base64').toString(),
|
|
|
|
company: Buffer.from('bWlIb1lv', 'base64').toString()
|
2021-11-01 14:01:28 +03:00
|
|
|
},
|
|
|
|
|
|
|
|
lowercase:
|
|
|
|
{
|
|
|
|
first: Buffer.from('Z2Vuc2hpbg==', 'base64').toString(),
|
|
|
|
company: Buffer.from('bWlob3lv', 'base64').toString()
|
|
|
|
}
|
2021-11-01 13:46:10 +03:00
|
|
|
};
|
|
|
|
|
2021-11-01 15:50:48 +03:00
|
|
|
public static readonly uri = {
|
|
|
|
api: `https://sdk-os-static.${this.placeholders.lowercase.company}.com/hk4e_global/mdk/launcher/api`,
|
2021-11-24 18:14:41 +03:00
|
|
|
patch: 'https://notabug.org/Krock/dawn',
|
2021-11-27 20:49:36 +03:00
|
|
|
launcher: 'https://gitlab.com/KRypt0n_/an-anime-game-launcher',
|
2021-11-01 15:50:48 +03:00
|
|
|
telemetry: [
|
|
|
|
`log-upload-os.${this.placeholders.lowercase.company}.com`,
|
|
|
|
'overseauspider.yuanshen.com'
|
2021-11-25 22:40:54 +03:00
|
|
|
],
|
|
|
|
winetricks: 'https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks'
|
2021-11-01 15:50:48 +03:00
|
|
|
};
|
|
|
|
|
2021-11-24 18:14:41 +03:00
|
|
|
// TODO: cache drops at that dates instead of the 7 days period
|
|
|
|
/*public static readonly cacheDropDates = [
|
|
|
|
new Date('November 24, 2021').getTime(), // 2.3.0 half 1 release
|
|
|
|
new Date('December 15, 2021').getTime(), // 2.3.0 half 2 release
|
|
|
|
new Date('January 5, 2022').getTime() // 2.4.0 half 1 release
|
|
|
|
];*/
|
|
|
|
|
2021-11-13 21:26:24 +03:00
|
|
|
// TODO: dirs pathes
|
|
|
|
|
2021-11-12 23:29:31 +03:00
|
|
|
public static readonly appDir = path.resolve(__dirname, '..', '..', '..');
|
|
|
|
public static readonly shadersDir = path.join(this.appDir, 'public', 'shaders');
|
|
|
|
|
2021-11-01 13:46:10 +03:00
|
|
|
public static readonly launcherDir: string = path.join(os.homedir(), '.local', 'share', 'anime-game-launcher');
|
|
|
|
|
2021-11-28 21:13:42 +03:00
|
|
|
public static prefixDir: string = LauncherLib.getConfig('prefix');
|
2021-11-01 15:50:48 +03:00
|
|
|
public static readonly gameDir: string = path.join(this.prefixDir, 'drive_c', 'Program Files', this.placeholders.uppercase.full);
|
2021-11-04 17:09:41 +03:00
|
|
|
public static readonly voiceDir: string = path.join(this.gameDir, `${this.placeholders.uppercase.first + this.placeholders.uppercase.second}_Data`, 'StreamingAssets', 'Audio', 'GeneratedSoundBanks', 'Windows');
|
|
|
|
|
2021-11-01 13:46:10 +03:00
|
|
|
public static readonly runnersDir: string = path.join(this.launcherDir, 'runners');
|
|
|
|
public static readonly dxvksDir: string = path.join(this.launcherDir, 'dxvks');
|
|
|
|
|
2021-11-01 15:50:48 +03:00
|
|
|
public static readonly versionsUri: string = `${this.uri.api}/resource?key=gcStgarh&launcher_id=10`;
|
2021-11-25 17:48:29 +03:00
|
|
|
public static readonly backgroundUri: string = `${this.uri.api}/content?filter_adv=true&launcher_id=10&key=gcStgarh&language=`;
|
2021-11-01 13:46:10 +03:00
|
|
|
|
2021-11-01 15:50:48 +03:00
|
|
|
public static readonly patchUri: string = `${this.uri.patch}/archive/master.zip`;
|
2021-11-01 13:46:10 +03:00
|
|
|
|
2021-11-01 15:50:48 +03:00
|
|
|
public static readonly runnersUri: string = `${this.uri.launcher}/raw/main/runners.json`;
|
|
|
|
public static readonly dxvksUri: string = `${this.uri.launcher}/raw/main/dxvks.json`;
|
2021-11-01 13:46:10 +03:00
|
|
|
}
|