add "Hide Name in Crashlogs" option#2010
add "Hide Name in Crashlogs" option#2010TheSillyDoggo wants to merge 5 commits intogeode-sdk:mainfrom
Conversation
|
replace with |
|
changed to "<user>" |
|
|
||
| #if defined(GEODE_IS_WINDOWS) || defined(GEODE_IS_MACOS) | ||
| if (Mod::get()->getSettingValue<bool>("hide-user-in-crashlogs")) { | ||
| const char* user = std::getenv("USER"); |
There was a problem hiding this comment.
i don't think USER is defined on windows, you might be better off using the apis provided by the os like GetUserName
(if you had objective c you could use NSUserName on mac but unfortunately you are stuck with environment variables)
There was a problem hiding this comment.
mac has objc crashlog
actually why not add it as geode util
getLocalUsername
There was a problem hiding this comment.
i did env variable so i could hide linux username, the winapi function just returns "steamuser"
There was a problem hiding this comment.
if its not useful to expose it can be a private func
There was a problem hiding this comment.
we do have a way to check for wine, so if you want that behavior (which makes sense to do on linux) then i'd only do it when wine is detected
also as alk said, this might be best as a proper geode util, which we definitely would want working correctly on both wine and non-wine gd
There was a problem hiding this comment.
USER env variable is not defined on native Windows, USERNAME is (which should return the same thing as GetUserName, which means steamuser in Wine)
The current approach won't work on native Windows. Not personally sure if we should have a Geode util return the Linux username inside of Wine, I feel like getting steamuser would be more expected, though I can see that returning the Linux username would be more useful for this use case.
|
the entire way of replacing the username is a bit hacky, afaik there's only two places where the username can appear so it's cleaner to just sanitize these parts instead of running find and replace on the entire text. I would suggest modifying |
Tested on macOS and Linux (proton)
