Skip to content
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

Add savegame file path resolver to ClientServerCommandLineParser #4621

Merged
merged 4 commits into from
Jul 16, 2023

Conversation

pakfront
Copy link
Collaborator

@pakfront pakfront commented Jul 13, 2023

This moves the savegame file checks from DedicatedServer and MegaMekGUI into a common method on ClientServerCommandLineParser.
This new method fixes #4618, a common user error
-host and -dedicated args now both will look in ./savegames for a non-absolute file if it is not readable from ./
It also improves the error reporting by reporting the absolute paths of where it looked:
-dedicated ddmysave.sav,gz, which does not exist in this example, will report in the log:
Unable to read savegame file at "C:\Users\Natasha\Games\megamek\ddmysave.sav.gz" or "C:\Users\Natasha\Games\MegaMek\megamek\.\savegames\ddmysave.sav.gz"
This should work on macOS and Linux as well.

@pakfront pakfront marked this pull request as draft July 13, 2023 02:21
@pakfront pakfront marked this pull request as ready for review July 14, 2023 01:07
@SJuliez SJuliez merged commit 6610995 into MegaMek:master Jul 16, 2023
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.

Can't start dedicated server loaging savedgame
3 participants