-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Handle unexpected (old or weird) OSes that may not support our directory detection. #3823
Conversation
…sXP. Giving the user a second chance to run the game. Added a headless server condition to set the homepath as current directory.
Can one of the admins please verify this patch? |
@GooeyHub add to whitelist. |
} catch (IOException ex) { | ||
reportException(e); | ||
System.exit(0); | ||
} | ||
System.exit(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.
shouldn't this be taken out?
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.
Yes it should 👍
* Gives user the option to manually choose home path. | ||
* @throws IOException Thrown when required directories cannot be accessed. | ||
*/ | ||
public void chooseHomePathManually() throws IOException { |
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.
Should/can this be part of useDefaultHomePath
?
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.
It could be but then it would have to catch the exception inside the useDefaultHomePath
, moreover this provides a much modular approach and a generic solution to all further weird OSeS
@@ -363,7 +364,12 @@ private static void handleLaunchArguments(String[] args) { | |||
|
|||
} catch (IOException e) { | |||
reportException(e); | |||
System.exit(0); | |||
try { | |||
PathManager.getInstance().chooseHomePathManually(); |
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.
If this can recover any exception that was thrown before, there is no need to reportException
before trying the backup. At least, it should not be reported as an error (maybe as a warning, or probably just on INFO level).
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.
Yeah , you have a valid point I just thought that it would be good to report an exception without stopping execution. A Warning sounds like a much better approach :)
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.
Thanks for incorporating the requested changes and replying to the questions 😃
Contains
This PR deals with errors thrown during directory detection, specifically giving a chance to run the game again if the default directory detection fails.
In case of headless servers we have defaulted to choosing the home path as the current directory.
Fixes #3566
How to test
Run the game on Windows XP. If you can find something with XP on it or a wierd OS that throws our directory detection out of the window.
Outstanding before merging
If anything. You can use neat checkboxes! Feel free to delete if not needed
The doc has to be updated if in case we hit any such OSes in the future.