- updated readme; added roadmap goals
- fixed deletefiles.txt file processing
- updated patch's url
- fixed patch's information gathering algo
This commit is contained in:
Observer KRypt0n_ 2021-11-24 17:14:41 +02:00
parent 478131179b
commit 79ead16bad
No known key found for this signature in database
GPG key ID: DC5D4EC1303465DA
11 changed files with 51 additions and 39 deletions

View file

@ -10,23 +10,11 @@
<br><br>
# About 2.3.0 update
1. To update background image, change the launcher language to some another, return it back **and restart the launcher to refresh the launch button's state**
2. After you press the update button, everything will be ok before launcher will not stop at the end of the process. You should close the launcher, go to the `~/local/share/an-anime-game` folder and change the `version` field in the `config.json` file to the `2.3.0`
3. After that you can launch the launcher
4. You will receive analytics window. Please, participate)
5. **DON'T PRESS THE "TEST PATCH" BUTTON**. That's a error and I don't want to know what will happen if you will press it. Just wait before I will make a hot fixes of all these issues
More datailed info you can find in our discord server. Fixes will be uploaded today, so you can just wait before I will make a `1.5.6` launcher version
# Status
| Game version | Launcher version | Patch version |
| :---: | :---: | :---: |
| 2.3.0 | 1.5.5 | 2.2.0 stable ❌ |
> ⚠️ New patch's version will be delayed for a week because of some author's personal reasons
| 2.3.0 | 1.5.6 | 2.3.0 testing ⚠️ |
We have our own [An Anime Game](https://discord.gg/MA8fTBarfj) discord server where you can ask any questions
@ -46,6 +34,10 @@ This launcher also available as the [an-anime-game-launcher](https://aur.archlin
<img src="repository-pics/stats/2.2.0.png">
### 2.3.0
<img src="repository-pics/stats/2.3.0.png">
> You can suggest colors for your countries
<br>
@ -139,8 +131,8 @@ npm start
- Always participate in patches testing
- Applying anti login crash patch
- Remove patch
And don't forget to change the patch's URI when it will be changed
* GameMode integration (#28)
* Hybrid GPU integration (#29)
> Now I'm working on moving the project to the Tauri. Also for some personal reasons I, like the patch's author, will be busy, but until Christmas, so it's a bit more than a month. I will make some critical updates if they will be required, but the development will be frozen for this period. I hope you will enjoy playing the game, and I will enjoy continuing the development of this project
>

View file

@ -1,6 +1,6 @@
{
"name": "an-anime-game-launcher",
"version": "1.5.5",
"version": "1.5.6",
"description": "An Anime Game Linux Launcher",
"author": "Nikita Podvirnyy <suimin.tu.mu.ga.mi@gmail.com>",
"contributors": [
@ -55,6 +55,7 @@
"electron-store": "^8.0.1",
"follow-redirects": "^1.14.5",
"get-pixels": "^3.3.3",
"got": "^11.8.3",
"semver": "^7.3.5"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 KiB

After

Width:  |  Height:  |  Size: 592 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 157 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

View file

@ -382,11 +382,12 @@ $(() => {
// If this update has excess files we should delete them
if (fs.existsSync(path.join(constants.gameDir, 'deletefiles.txt')))
{
let deleteFiles = fs.readFileSync(path.join(constants.gameDir, 'deletefiles.txt'));
let deleteFiles = fs.readFileSync(path.join(constants.gameDir, 'deletefiles.txt'), { encoding: 'utf-8' });
deleteFiles.split(/\r\n|\r|\n/).forEach((file: string) => {
fs.unlinkSync(path.join(constants.gameDir, file.trim()));
});
if (deleteFiles != '')
deleteFiles.split(/\r\n|\r|\n/).forEach((file: string) => {
fs.unlinkSync(path.join(constants.gameDir, file.trim()));
});
}
LauncherLib.updateConfig('version', data.game.latest.version);

View file

@ -9,6 +9,7 @@ const { spawn, exec } = require('child_process');
const store = require('electron-store');
const https = require('follow-redirects').https;
const got = require('got');
const config = new store ({
cwd: path.join(os.homedir(), '.local', 'share', 'anime-game-launcher'),
@ -163,29 +164,37 @@ export default class LauncherLib
return background;
}
public static async getPatchInfo (): Promise<{ version: string, state: 'stable' | 'testing' }>
public static async getPatchInfo (): Promise<{ version: string, state: 'testing' | 'stable' }>
{
return new Promise(resolve => {
this.getData().then(data => {
this.getData().then(async (data) => {
let gameLatest: string = data.game.latest.version;
fetch(`${constants.uri.patch}/raw/master/${gameLatest.replaceAll('.', '')}/patch.sh`)
.then(response => response.text())
.then((patch: string) => {
// patch.sh exists so patch in testing, stable or it's just a preparation
fetch(`${constants.uri.patch}/raw/master/${gameLatest.replaceAll('.', '')}/patch_files/unityplayer_patch.vcdiff`)
.then(response => response.text())
.then((unityPatch: string) => {
// unityplayer_patch exists so it's testing or stable
got(`${constants.uri.patch}/raw/master/${gameLatest.replaceAll('.', '')}/patch.sh`)
.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`)
.then(() => {
/**
* [game version]/patch_files/unityplayer_patch
* exists so it's testing or stable
*/
resolve({
version: gameLatest,
state: patch.includes('#echo "If you would like to test this patch, modify this script and remove the line below this one."') ?
state: patch.body.includes('#echo "If you would like to test this patch, modify this script and remove the line below this one."') ?
'stable' : 'testing'
});
})
.catch(() => {
// unityplayer_patch doesn't exist so it's just a preparation
// TODO: add preparation state
/**
* [game version]/patch_files/unityplayer_patch
* doesn't exist so it's just a preparation
*
* TODO: add preparation state
*/
resolve({
version: data.game.diffs[0].version,
state: 'stable'
@ -193,7 +202,9 @@ export default class LauncherLib
});
})
.catch(() => {
// patch.sh doesn't exist so patch is not available
/**
* Otherwise it's definitely preparation
*/
resolve({
version: data.game.diffs[0].version,
state: 'stable'
@ -278,7 +289,7 @@ export default class LauncherLib
// Delete zip file and assign patch directory.
fs.unlinkSync(path.join(constants.launcherDir, 'patch.zip'));
const patchDir = path.join(constants.launcherDir, 'gi-on-linux', pathInfo.version.replaceAll('.', ''));
const patchDir = path.join(constants.launcherDir, 'dawn', pathInfo.version.replaceAll('.', ''));
// Patch out the testing phase content from the shell files if active and make sure the shell files are executable.
exec(`cd ${patchDir} && sed -i '/^echo "If you would like to test this patch, modify this script and remove the line below this one."/,+5d' patch.sh`);
@ -323,7 +334,7 @@ export default class LauncherLib
this.updateConfig('patch.version', pathInfo.version);
this.updateConfig('patch.state', pathInfo.state);
fs.rmSync(path.join(constants.launcherDir, 'gi-on-linux'), { recursive: true });
fs.rmSync(path.join(constants.launcherDir, 'dawn'), { recursive: true });
onFinish();
});

View file

@ -102,8 +102,8 @@ export default class LauncherUI
public static async updateLauncherState(data: any = null)
{
let gameData = data ?? await LauncherLib.getData();
let patchInfo = await LauncherLib.getPatchInfo();
const gameData = data ?? await LauncherLib.getData();
const patchInfo = await LauncherLib.getPatchInfo();
// Update available
if (LauncherLib.version != gameData.game.latest.version)

View file

@ -21,7 +21,7 @@ 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/GI-on-Linux',
patch: 'https://notabug.org/Krock/dawn',
launcher: 'https://notabug.org/nobody/an-anime-game-launcher',
telemetry: [
`log-upload-os.${this.placeholders.lowercase.company}.com`,
@ -29,6 +29,13 @@ export default class constants
]
};
// 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
];*/
// TODO: dirs pathes
public static readonly appDir = path.resolve(__dirname, '..', '..', '..');