-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
Feature: Allow client and server to negotiate on compression to use for the savegame #8805
Conversation
217de99
to
e0b1d88
Compare
More generally, is it really necessary that the server operator is able to manually specify the algorithm order and levels? |
@JGRennison Some people still prefer to use a slightly larger but much faster savegame compression method (such as lzo instead of lzma) in order to reduce the CPU time required to save the game at the cost of some storage space. Example: |
@JGRennison My main reason was to allow disabling certain method if something goes wrong with it. Also wouldn't hurt for better DoS protection as it allows to disable slower or less efficient methods. And it doesn't rly make it simpler as it only saves a bit of parsing but requires some ifdefed constant or smth. |
98e4090
to
235ed77
Compare
Not that I'm completely happy with it but at least it looks decent now. Anyway I'm out of ideas for how to improve it so I guess it's ready for a review. |
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.
And I just noticed I had started a review, but never submitted it.
235ed77
to
4a4a8c9
Compare
As mentioned in #8773, this PR only has merit if there is more than one compression being offered that are useful. As there currently aren't, let's close this up for now, and reopen when we ever need it again. |
Motivation / Problem
Client and server can be compiled with different sets of compression libraries. If client doesn't have the compression server uses it just fails. Also game uses lzma:2 for everything which isn't the best option for the network.
Description
Client on join sends bitset of all supported compressions to the server and lets the server to chose whichever it likes more. For that server has network.savegame_formats setting that allows specifying multiple compressions (space-separated) that will be tried in that order (if not specified it uses "zlib:2 lzma:0 lzo:0"). This also allows the server to use different compression methods for network connections and local saves.
In a way this is also a preparation for zstd inclusion (#8773) as otherwise it will have to use the older zstd version to support old platforms.
Checklist for review
Some things are not automated, and forgotten often. This list is a reminder for the reviewers.