mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 10:31:47 -03:00
@@ -5,7 +5,7 @@ async function getLatestClientVersion(branch = 'release') {
|
||||
console.log(`Fetching latest client version from API (branch: ${branch})...`);
|
||||
const response = await axios.get('https://files.hytalef2p.com/api/version_client', {
|
||||
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: {
|
||||
'User-Agent': 'Hytale-F2P-Launcher'
|
||||
}
|
||||
@@ -16,13 +16,13 @@ async function getLatestClientVersion(branch = 'release') {
|
||||
console.log(`Latest client version for ${branch}: ${version}`);
|
||||
return version;
|
||||
} else {
|
||||
console.log('Warning: Invalid API response, falling back to default version');
|
||||
return '4.pwr';
|
||||
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 '7.pwr';
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error fetching client version:', error.message);
|
||||
console.log('Warning: API unavailable, falling back to default version');
|
||||
return '4.pwr';
|
||||
console.log('Warning: API unavailable, falling back to latest known version (7.pwr - 2026-01-29)');
|
||||
return '7.pwr';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user