mirror of
https://github.com/amiayweb/Hytale-F2P.git
synced 2026-02-26 09:11:59 -03:00
Only generate uuid for new username strings
This commit is contained in:
@@ -685,7 +685,7 @@ async function launchGame(playerName = 'Player', progressCallback, javaPathOverr
|
||||
throw new Error(`Game client missing. Tried: ${attempted}`);
|
||||
}
|
||||
|
||||
const uuid = uuidv4();
|
||||
const uuid = getUuidForUser(playerName);
|
||||
const args = [
|
||||
'--app-dir', gameLatest,
|
||||
'--java-exec', javaBin,
|
||||
@@ -717,6 +717,21 @@ function loadUsername() {
|
||||
return config.username || 'Player';
|
||||
}
|
||||
|
||||
function getUuidForUser(username) {
|
||||
const config = loadConfig();
|
||||
const userUuids = config.userUuids || {};
|
||||
|
||||
if (userUuids[username]) {
|
||||
return userUuids[username];
|
||||
}
|
||||
|
||||
const newUuid = uuidv4();
|
||||
userUuids[username] = newUuid;
|
||||
saveConfig({ userUuids });
|
||||
|
||||
return newUuid;
|
||||
}
|
||||
|
||||
function saveJavaPath(javaPath) {
|
||||
const trimmed = (javaPath || '').trim();
|
||||
saveConfig({ javaPath: trimmed });
|
||||
|
||||
Reference in New Issue
Block a user