Files
hytale-f2p/backend/launcher.js
2026-01-24 13:44:56 +01:00

188 lines
3.6 KiB
JavaScript

// Main launcher module - orchestrates all launcher functionality
// This file serves as the main entry point and re-exports all necessary functions
// Core modules
const {
saveUsername,
loadUsername,
saveChatUsername,
loadChatUsername,
saveChatColor,
loadChatColor,
saveJavaPath,
loadJavaPath,
saveInstallPath,
loadInstallPath,
saveDiscordRPC,
loadDiscordRPC,
saveLanguage,
loadLanguage,
saveCloseLauncherOnStart,
loadCloseLauncherOnStart,
saveModsToConfig,
loadModsFromConfig,
getUuidForUser,
isFirstLaunch,
markAsLaunched,
// UUID Management
getCurrentUuid,
getAllUuidMappings,
setUuidForUser,
generateNewUuid,
deleteUuidForUser,
resetCurrentUserUuid,
// GPU Preference
saveGpuPreference,
loadGpuPreference,
// Version Management
saveVersionClient,
loadVersionClient,
saveVersionBranch,
loadVersionBranch
} = require('./core/config');
const { getResolvedAppDir, getModsPath } = require('./core/paths');
// Managers
const {
isGameInstalled,
installGame,
uninstallGame,
updateGameFiles,
checkExistingGameInstallation,
repairGame
} = require('./managers/gameManager');
const {
launchGame,
launchGameWithVersionCheck
} = require('./managers/gameLauncher');
const { getJavaDetection } = require('./managers/javaManager');
const {
downloadAndReplaceHomePageUI,
findHomePageUIPath,
downloadAndReplaceLogo,
findLogoPath
} = require('./managers/uiFileManager');
const {
loadInstalledMods,
downloadMod,
uninstallMod,
toggleMod
} = require('./managers/modManager');
// Services
const {
getLatestClientVersion
} = require('./services/versionManager');
const { getHytaleNews } = require('./services/newsManager');
const { getOrCreatePlayerId } = require('./services/playerManager');
const {
proposeGameUpdate,
handleFirstLaunchCheck
} = require('./services/firstLaunch');
// Utils
const { detectGpu } = require('./utils/platformUtils');
// Re-export all functions to maintain backward compatibility
module.exports = {
// Game launch functions
launchGame,
launchGameWithVersionCheck,
// Game installation functions
installGame,
isGameInstalled,
uninstallGame,
updateGameFiles,
repairGame,
// User configuration functions
saveUsername,
loadUsername,
saveChatUsername,
loadChatUsername,
saveChatColor,
loadChatColor,
getUuidForUser,
// Java configuration functions
saveJavaPath,
loadJavaPath,
getJavaDetection,
// Installation path functions
saveInstallPath,
loadInstallPath,
// Discord RPC functions
saveDiscordRPC,
loadDiscordRPC,
// Language functions
saveLanguage,
loadLanguage,
// Close Launcher functions
saveCloseLauncherOnStart,
loadCloseLauncherOnStart,
// GPU Preference functions
saveGpuPreference,
loadGpuPreference,
detectGpu,
// Version functions
getLatestClientVersion,
saveVersionClient,
loadVersionClient,
saveVersionBranch,
loadVersionBranch,
// News functions
getHytaleNews,
// Player ID functions
getOrCreatePlayerId,
// UUID Management functions
getCurrentUuid,
getAllUuidMappings,
setUuidForUser,
generateNewUuid,
deleteUuidForUser,
resetCurrentUserUuid,
// Mod management functions
getModsPath,
loadInstalledMods,
downloadMod,
uninstallMod,
toggleMod,
saveModsToConfig,
loadModsFromConfig,
// UI file management functions
downloadAndReplaceHomePageUI,
findHomePageUIPath,
downloadAndReplaceLogo,
findLogoPath,
// First launch functions
isFirstLaunch,
markAsLaunched,
checkExistingGameInstallation,
proposeGameUpdate,
handleFirstLaunchCheck,
// Path functions
getResolvedAppDir
};