-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,8 @@ | |
|
||
import com.google.common.base.Joiner; | ||
import com.google.common.collect.ImmutableList; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.terasology.config.Config; | ||
import org.terasology.config.SystemConfig; | ||
import org.terasology.crashreporter.CrashReporter; | ||
|
@@ -41,6 +43,7 @@ | |
import org.terasology.engine.subsystem.openvr.OpenVRInput; | ||
import org.terasology.engine.subsystem.rpc.DiscordRPCSubSystem; | ||
import org.terasology.game.GameManifest; | ||
import org.terasology.logic.characters.CharacterSystem; | ||
import org.terasology.network.NetworkMode; | ||
import org.terasology.rendering.nui.layers.mainMenu.savedGames.GameInfo; | ||
import org.terasology.rendering.nui.layers.mainMenu.savedGames.GameProvider; | ||
|
@@ -107,13 +110,16 @@ public final class Terasology { | |
private static final String NO_SPLASH = "-noSplash"; | ||
private static final String SERVER_PORT = "-serverPort="; | ||
private static final String OVERRIDE_DEFAULT_CONFIG = "-overrideDefaultConfig="; | ||
private static final Logger logger = LoggerFactory.getLogger(Terasology.class); | ||
|
||
|
||
private static boolean isHeadless; | ||
private static boolean crashReportEnabled = true; | ||
private static boolean soundEnabled = true; | ||
private static boolean splashEnabled = true; | ||
private static boolean loadLastGame; | ||
|
||
|
||
private Terasology() { | ||
} | ||
|
||
|
@@ -362,8 +368,13 @@ private static void handleLaunchArguments(String[] args) { | |
} | ||
|
||
} catch (IOException e) { | ||
reportException(e); | ||
System.exit(0); | ||
logger.warn("The game cannot detect default home directory"); | ||
try { | ||
PathManager.getInstance().chooseHomePathManually(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 :) |
||
} catch (IOException ex) { | ||
reportException(ex); | ||
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.
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