mirror of
https://gitea.shironeko-all.duckdns.org/shironeko/Hytale-F2P-2.git
synced 2026-02-26 10:41:46 -03:00
fixing
This commit is contained in:
@@ -107,7 +107,17 @@ async function applyPWR(pwrFile, progressCallback, gameDir = GAME_DIR, toolsDir
|
|||||||
|
|
||||||
// Check for EOF error (corrupted PWR file)
|
// Check for EOF error (corrupted PWR file)
|
||||||
if (stderr && stderr.includes('unexpected EOF')) {
|
if (stderr && stderr.includes('unexpected EOF')) {
|
||||||
reject(new Error(`Corrupted PWR file detected. Please delete the cache and reinstall: ${pwrFile}`));
|
// Delete corrupted PWR file
|
||||||
|
console.log('Corrupted PWR file detected, deleting:', pwrFile);
|
||||||
|
try {
|
||||||
|
if (fs.existsSync(pwrFile)) {
|
||||||
|
fs.unlinkSync(pwrFile);
|
||||||
|
console.log('Corrupted PWR file deleted. Please try again to re-download.');
|
||||||
|
}
|
||||||
|
} catch (delErr) {
|
||||||
|
console.error('Failed to delete corrupted PWR file:', delErr);
|
||||||
|
}
|
||||||
|
reject(new Error(`Corrupted PWR file detected and deleted. Please try launching the game again.`));
|
||||||
} else {
|
} else {
|
||||||
reject(new Error(`Patch installation failed: ${error.message}${stderr ? '\n' + stderr : ''}`));
|
reject(new Error(`Patch installation failed: ${error.message}${stderr ? '\n' + stderr : ''}`));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,15 +56,9 @@ async function handleFirstLaunchCheck(progressCallback) {
|
|||||||
try {
|
try {
|
||||||
const config = loadConfig();
|
const config = loadConfig();
|
||||||
|
|
||||||
// Initialize version_branch and version_client if not set
|
// Initialize version_client if not set (but don't force version_branch)
|
||||||
const currentBranch = loadVersionBranch();
|
|
||||||
const currentVersion = loadVersionClient();
|
const currentVersion = loadVersionClient();
|
||||||
|
|
||||||
if (!currentBranch) {
|
|
||||||
console.log('Initializing version_branch to "release"');
|
|
||||||
saveVersionBranch('release');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentVersion === undefined || currentVersion === null) {
|
if (currentVersion === undefined || currentVersion === null) {
|
||||||
console.log('Initializing version_client to null (will trigger installation)');
|
console.log('Initializing version_client to null (will trigger installation)');
|
||||||
saveVersionClient(null);
|
saveVersionClient(null);
|
||||||
|
|||||||
Reference in New Issue
Block a user