fix: comprehensive UUID/username persistence bug fixes

Major fixes for UUID/skin reset issues that caused players to lose cosmetics:

Core fixes:
- Username rename now preserves UUID (atomic rename, not new identity)
- Atomic config writes with backup/recovery system
- Case-insensitive UUID lookup with case-preserving storage
- Pre-launch validation blocks play if no username configured
- Removed saveUsername calls from launch/install flows

UUID Modal fixes:
- Fixed isCurrent badge showing on wrong user
- Added switch identity button to change between saved usernames
- Fixed custom UUID input using unsaved DOM username
- UUID list now refreshes when player name changes
- Enabled copy/paste in custom UUID input field

UI/UX improvements:
- Added translation keys for switch username functionality
- CSS user-select fix for UUID input fields
- Allowed Ctrl+V/C/X/A shortcuts in Electron

Files: config.js, gameLauncher.js, gameManager.js, playerManager.js,
launcher.js, settings.js, main.js, preload.js, style.css, en.json

See UUID_BUGS_FIX_PLAN.md for detailed bug list (18 bugs, 16 fixed)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
sanasol
2026-01-31 19:42:01 +01:00
parent 7b2acd49b6
commit 74f99d0aaf
12 changed files with 1476 additions and 163 deletions

View File

@@ -5,6 +5,8 @@
const {
saveUsername,
loadUsername,
loadUsernameWithDefault,
hasUsername,
saveJavaPath,
loadJavaPath,
saveInstallPath,
@@ -27,9 +29,11 @@ const {
getUuidForUser,
isFirstLaunch,
markAsLaunched,
checkLaunchReady,
// UUID Management
getCurrentUuid,
getAllUuidMappings,
getAllUuidMappingsArray,
setUuidForUser,
generateNewUuid,
deleteUuidForUser,
@@ -110,7 +114,10 @@ module.exports = {
// User configuration functions
saveUsername,
loadUsername,
loadUsernameWithDefault,
hasUsername,
getUuidForUser,
checkLaunchReady,
// Java configuration functions
saveJavaPath,
@@ -162,6 +169,7 @@ module.exports = {
// UUID Management functions
getCurrentUuid,
getAllUuidMappings,
getAllUuidMappingsArray,
setUuidForUser,
generateNewUuid,
deleteUuidForUser,