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

Enable command line argument to produce an archive checksum to the headless/normal engines #1904

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lhog
Copy link
Collaborator

@lhog lhog commented Jan 17, 2025

Addresses #1903

@@ -63,6 +63,16 @@ bool FileSystemInitializer::Initialize()

SetupThreadReg();

InitializeTry();

// in case of an exception, ErrorMessageBox takes care of this
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't this comment about line 87/97 previously so no longer makes sense after moving?

@@ -144,6 +144,7 @@ DEFINE_string (map, "", "Specify the m
DEFINE_string (menu, "", "Specify a lua menu archive to be used by spring");
DEFINE_string (name, "", "Set your player name");
DEFINE_bool (oldmenu, false, "Start the old menu");
DEFINE_string_EX(calc_checksum, "calc-checksum", "", "Calculate named archive checksum");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've seen something on discord that this doesn't guarantee synchronicity. Maybe it would be good to put this in the description? (I guess this means it does affect archive cache after all)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It runs exact same code as the full engine except without ThreadPool since it's not initialized that early, so it might run slower on SSDs. Generally my note was regarding running several instances of calc-checksum in parallel, which might certainly lead to troubles.

Copy link
Collaborator

@sprunk sprunk Jan 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good. It's not really documented what the real constraints on "normal" parallel engines are though1 and this one otherwise looks like a "const getter" so maybe worth mentioning anyway?

Suggested change
DEFINE_string_EX(calc_checksum, "calc-checksum", "", "Calculate named archive checksum");
DEFINE_string_EX(calc_checksum, "calc-checksum", "", "Calculate named archive checksum and write to cache, cant run in parallel");

Footnotes

  1. somebody on ZK has a replay parser and he runs it in parallel and it seems to work pretty much fine, so maybe it's only dangerous if you actually modify sensitive files like springsettings or archive cache, which doesn't happen if there weren't new maps/games?

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.

2 participants