From 42b34b6fe58445d9aa3614ab7c18c337823b6548 Mon Sep 17 00:00:00 2001 From: Matthew Lam Date: Fri, 3 Jun 2022 07:54:00 -0400 Subject: [PATCH] Add compression usage option. --- UI/OptionsWnd.cpp | 1 + default/stringtables/en.txt | 6 ++++++ util/MultiplayerCommon.cpp | 1 + 3 files changed, 8 insertions(+) diff --git a/UI/OptionsWnd.cpp b/UI/OptionsWnd.cpp index 73ad4f3f8..fd196f533 100644 --- a/UI/OptionsWnd.cpp +++ b/UI/OptionsWnd.cpp @@ -794,6 +794,7 @@ void OptionsWnd::CompleteConstruction() { //BoolOption(current_page, 0, "resource.shipdesign.default.enabled", UserString("OPTIONS_ADD_DEFAULT_DESIGNS")); // hidden due to issues with implementation when not enabled preventing designs from being added or recreated BoolOption(current_page, 0, "save.format.binary.enabled", UserString("OPTIONS_USE_BINARY_SERIALIZATION")); BoolOption(current_page, 0, "save.format.xml.zlib.enabled", UserString("OPTIONS_USE_XML_ZLIB_SERIALIZATION")); + BoolOption(current_page, 0, "network.message.zlib.enabled", UserString("OPTIONS_USE_MSG_ZLIB_CPR")); BoolOption(current_page, 0, "ui.map.sitrep.invalid.shown", UserString("OPTIONS_VERBOSE_SITREP_DESC")); BoolOption(current_page, 0, "effects.accounting.enabled", UserString("OPTIONS_EFFECT_ACCOUNTING")); diff --git a/default/stringtables/en.txt b/default/stringtables/en.txt index c8b90dd06..b60e7b03d 100644 --- a/default/stringtables/en.txt +++ b/default/stringtables/en.txt @@ -2180,6 +2180,9 @@ The server will use Binary serialization for client-server interaction if the cl OPTIONS_DB_XML_ZLIB_SERIALIZATION When saving games with XML serialization, compress most of the XML before writing the file. Compression substantially reduces save file sizes, but may make saves unloadable due to memory requirements to decompress the save data. +OPTIONS_DB_USE_MSG_ZLIB_CPR +Notifes a remote server that the client is able to receive and send compressed data. Data may be transmitted uncompressed based on server settings. + OPTIONS_DB_UI_WINDOWS_EXISTS True if the window with a given config name currently exists, false if one was created and deleted, doesn't exist if no window has yet been created with that name. @@ -3414,6 +3417,9 @@ Create Binary Save Files OPTIONS_USE_XML_ZLIB_SERIALIZATION Use Compression for XML Save Files +OPTIONS_USE_MSG_ZLIB_CPR +Allow remote servers to send compressed data. + OPTIONS_CREATE_PERSISTENT_CONFIG Write Persistent Config File diff --git a/util/MultiplayerCommon.cpp b/util/MultiplayerCommon.cpp index cd8849e48..bd56c2837 100644 --- a/util/MultiplayerCommon.cpp +++ b/util/MultiplayerCommon.cpp @@ -37,6 +37,7 @@ namespace { db.Add("resource.stringtable.path", UserStringNop("OPTIONS_DB_STRINGTABLE_FILENAME"), ""); db.Add("save.format.binary.enabled", UserStringNop("OPTIONS_DB_BINARY_SERIALIZATION"), false); db.Add("save.format.xml.zlib.enabled", UserStringNop("OPTIONS_DB_XML_ZLIB_SERIALIZATION"), true); + db.Add("network.message.zlib.enabled", UserStringNop("OPTIONS_DB_USE_MSG_ZLIB_CPR"), true); db.Add("save.auto.hostless.enabled", UserStringNop("OPTIONS_DB_AUTOSAVE_HOSTLESS"), true); db.Add("save.auto.hostless.each-player.enabled", UserStringNop("OPTIONS_DB_AUTOSAVE_HOSTLESS_EACH_PLAYER"), false); db.Add("save.auto.interval", UserStringNop("OPTIONS_DB_AUTOSAVE_INTERVAL"), 0); -- 2.36.1