feat(cli): Load save and replay files from absolute paths - #3152
Draft
bobtista wants to merge 10 commits into
Draft
feat(cli): Load save and replay files from absolute paths#3152bobtista wants to merge 10 commits into
bobtista wants to merge 10 commits into
Conversation
…adless saves (Generals)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-loadsaveand-loadreplayresolve their argument inside the managed user Save and Replays directories, so a file anywhere else has to be copied in before it can be opened. That rules out launching the game directly for a.savor.repfrom an operating-system file handler.Now an absolute path is opened in place while a relative name still resolves from its managed directory, so both forms keep working.
FileSystem::isAbsolutePathclassifies the argument - a drive root (C:\,C:/), a current-drive or UNC root (leading separator), or a POSIX root - andGameState::getSaveGamePathForReadreturns the path untouched when it is absolute. Save writes and the save menu are unaffected; they continue to use the managed directory.-loadreplayis added alongside the existing-replayso an externally supplied replay goes through normal Replay synchronization handling. Suppressing synchronization errors stays opt-in through-ignoreReplaySyncErrorsrather than being implied by loading from a path.Command-line saves and replays are now also validated and deferred until the client has initialized the shell, so a bad path reports cleanly instead of failing partway into startup.
Verified on Windows against a clean upstream data set, with a bogus path as a control so a pass
is distinguishable from "the game started anyway":
\\localhost\C$\...)InGame:C337AE46 Replay:7FB5DE80)Paths containing spaces work when quoted, which is the form an operating-system file handler
passes.
nextParamis quote-aware: a token beginning with"terminates on the next"ratherthan on whitespace, so the spaces inside are preserved.
Todo:
z_generalsandg_generals, 1458/1458)-ignoreReplaySyncErrors