Files
Hytale-F2P-2/backend/launcher.js
Rahul Sahani b05aeef66d feat: Add Repair Game button, UserData backup and cache clearing (#79)
* feat: Add Repair Game functionality including UserData backup and cache clearing

* feat: Add In-App Logs Viewer and Logs Folder shortcut

* feat: Add Open Logs feature

* disable dev tools

* Fix Settings UI

* fix reorder settings section in index.html

relocated sections in settings from most used to least:
1. game options (playername, opengamedir, repair, GPUpreference)
2. player uuid management
3. discord integration rich presence
4. custom java path

---------

Co-authored-by: Fazri Gading <super.fai700@gmail.com>
2026-01-21 06:27:33 +08:00

169 lines
3.2 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,
saveModsToConfig,
loadModsFromConfig,
getUuidForUser,
isFirstLaunch,
markAsLaunched,
// UUID Management
getCurrentUuid,
getAllUuidMappings,
setUuidForUser,
generateNewUuid,
deleteUuidForUser,
resetCurrentUserUuid,
// GPU Preference
saveGpuPreference,
loadGpuPreference
} = 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 {
getInstalledClientVersion,
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,
// GPU Preference functions
saveGpuPreference,
loadGpuPreference,
detectGpu,
// Version functions
getInstalledClientVersion,
getLatestClientVersion,
// 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
};