Skip to content

Conversation

@JamesVanBoxtel
Copy link
Contributor

We were accidentally overriding the functions even when you didn't have arguments passed in.

Now only add them if set, and don't make extra unneeded globals.

We were accidentally overriding the functions even when you didn't have arguments passed in.

Now only add them if set, and don't make extra unneeded globals.
Comment on lines 78 to 85
function developerTools.wrapUserIDRead(customUserID)
assert(customUserID)

local readId = save.read_user_id_file
save.read_user_id_file = function(serverIP)
realId = readId(serverIP)
return CUSTOM_USER_ID or realId
end
logger.debug("Overwriting userID with command line argument")

local writeId = save.write_user_id_file
save.write_user_id_file = function(userID, serverIP)
if userID == CUSTOM_USER_ID then
userID = realId
end
writeId(userID, serverIP)
local save = require("client.src.save")
save.read_user_id_file = function(serverIP)
return customUserID
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There used to be a function here that handled the write and ensured that the write function for the user id would only ever write the real user id. I'm aware that we currently have no scenario that will randomly cause a write for regular users but I think it is better to have that safeguard rather than losing your ID.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Endaris Endaris merged commit 0cab36a into panel-attack:beta Nov 17, 2025
2 checks passed
@JamesVanBoxtel JamesVanBoxtel deleted the fixUsernameChanging branch December 1, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants