X Tutup
Skip to content

Read/write save games from/to the savefiles folder#6083

Merged
fluffyfreak merged 1 commit intopioneerspacesim:masterfrom
fluffyfreak:fix-savegamedump
Mar 6, 2025
Merged

Read/write save games from/to the savefiles folder#6083
fluffyfreak merged 1 commit intopioneerspacesim:masterfrom
fluffyfreak:fix-savegamedump

Conversation

@fluffyfreak
Copy link
Contributor

@fluffyfreak fluffyfreak commented Feb 21, 2025

I was trying to use the savegamedump.exe to extract the JSON for a few save game file when debugging a crash issue reported on Discord. It refused to load the file and I realised that it was looking in the root of the userfiles location. However the savegames are actually saved in the sub-directory savefiles

This is a draft PR because I wonder if there's a better way to do the pathing. Otherwise I've tested it and it all works
I've tested it and it all works

@sturnclaw
Copy link
Member

SaveGameManager should likely provide a method to retrieve the savefile path. The existing method to retrieve the directory name is meant to be used for logging purposes only (hence why it returns an absolute filesystem path), but for the use of tooling I can definitely endorse providing methods to query the savefile directory within the FileSystem API.

@fluffyfreak
Copy link
Contributor Author

SaveGameManager should likely provide a method to retrieve the savefile path. The existing method to retrieve the directory name is meant to be used for logging purposes only (hence why it returns an absolute filesystem path), but for the use of tooling I can definitely endorse providing methods to query the savefile directory within the FileSystem API.

Small problem, this requires me to pull in SaveGameManager.cpp which brings with it Jobs, Game, etc and an expanding cloud of dependencies and problems to get savegamedump.exe to build.

Whereas this PR is currently quite a self contained change for a utility tool.

It's far more hassle than it's worth just so I can type filename intead of typing savefiles/filename

@sturnclaw
Copy link
Member

Hmm, yeah, good point. As-is, this is fine. I had originally required the use of the savegames/ prefix to support loading savefiles from anywhere within the user directory, but that's probably not a needed feature at all (in fact I've never used it once myself).

@fluffyfreak fluffyfreak marked this pull request as ready for review February 25, 2025 10:34
@fluffyfreak fluffyfreak merged commit e463192 into pioneerspacesim:master Mar 6, 2025
4 checks passed
@fluffyfreak fluffyfreak deleted the fix-savegamedump branch March 6, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup