mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-26 09:11:49 -03:00
Merge pull request #5 from crimera/main
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}`);
|
throw new Error(`Game client missing. Tried: ${attempted}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uuid = uuidv4();
|
const uuid = getUuidForUser(playerName);
|
||||||
const args = [
|
const args = [
|
||||||
'--app-dir', gameLatest,
|
'--app-dir', gameLatest,
|
||||||
'--java-exec', javaBin,
|
'--java-exec', javaBin,
|
||||||
@@ -717,6 +717,21 @@ function loadUsername() {
|
|||||||
return config.username || 'Player';
|
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) {
|
function saveJavaPath(javaPath) {
|
||||||
const trimmed = (javaPath || '').trim();
|
const trimmed = (javaPath || '').trim();
|
||||||
saveConfig({ javaPath: trimmed });
|
saveConfig({ javaPath: trimmed });
|
||||||
|
|||||||
Reference in New Issue
Block a user