-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for UnrealEngine's wrong file path #174
base: master
Are you sure you want to change the base?
Conversation
ab77730
to
057e18f
Compare
Really, I'm a trash generator.. |
Sorry, I can't test it, |
Yes I tested it in both PlayTools and pure C program. |
|
||
static char const* ue_fix_filename(char const* filename) { | ||
static char UE_PATTERN[1024] = "//Users/"; | ||
getlogin_r(UE_PATTERN + 8, sizeof(UE_PATTERN) - 8); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this function do in the code (seems unused)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The prefix //Users
can be insufficient, so I added the username to the prefix path UE_PATTERN
.
static char UE_PATTERN[1024] = "//Users/"; | ||
getlogin_r(UE_PATTERN + 8, sizeof(UE_PATTERN) - 8); | ||
|
||
char const* p = filename; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rename this variable so it is more descriptive of its purpose?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rename the variable UE_PATTERN
to USER_HOME
and add a comment for it.
if (is_ue4) { | ||
[PlayKeychain debugLogger: [NSString stringWithFormat:@"Is it UE4? : %@", @(is_ue4)]]; | ||
|
||
if (ue_status == 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will ue_status
never equal 0
on initialization?
The file name ue4commandline.txt has been changed to uecommandline.txt in UE5.
Some applications mistakenly use both Library\Users and Documents\Users paths multiple times within a single path, more often than I expected.
To address this, I ensure that PlayTools retrieves the string from the last needle of the incorrect path.
Issue: PlayCover/PlayCover#1755