mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 09:21:48 -03:00
@@ -5,7 +5,7 @@ async function getLatestClientVersion(branch = 'release') {
|
|||||||
console.log(`Fetching latest client version from API (branch: ${branch})...`);
|
console.log(`Fetching latest client version from API (branch: ${branch})...`);
|
||||||
const response = await axios.get('https://files.hytalef2p.com/api/version_client', {
|
const response = await axios.get('https://files.hytalef2p.com/api/version_client', {
|
||||||
params: { branch },
|
params: { branch },
|
||||||
timeout: 5000,
|
timeout: 40000, // fixed from 5000 to 40000 to make sure the client trying to connect on the server with slow internet
|
||||||
headers: {
|
headers: {
|
||||||
'User-Agent': 'Hytale-F2P-Launcher'
|
'User-Agent': 'Hytale-F2P-Launcher'
|
||||||
}
|
}
|
||||||
@@ -16,13 +16,13 @@ async function getLatestClientVersion(branch = 'release') {
|
|||||||
console.log(`Latest client version for ${branch}: ${version}`);
|
console.log(`Latest client version for ${branch}: ${version}`);
|
||||||
return version;
|
return version;
|
||||||
} else {
|
} else {
|
||||||
console.log('Warning: Invalid API response, falling back to default version');
|
console.log('Warning: Invalid API response, falling back to latest known version (7.pwr - 2026-01-29)'); // added latest version fallback and latest known version as per today
|
||||||
return '4.pwr';
|
return '7.pwr';
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching client version:', error.message);
|
console.error('Error fetching client version:', error.message);
|
||||||
console.log('Warning: API unavailable, falling back to default version');
|
console.log('Warning: API unavailable, falling back to latest known version (7.pwr - 2026-01-29)');
|
||||||
return '4.pwr';
|
return '7.pwr';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user