compress DOL files before sending them to clients

This commit is contained in:
Martin Michelsen
2023-05-27 09:57:36 -07:00
parent 9ec72212cf
commit 54a734e049
8 changed files with 200 additions and 10 deletions
+8 -1
View File
@@ -24,6 +24,7 @@ ServerState::ServerState(const char* config_filename, bool is_replay)
allow_saving(true),
item_tracking_enabled(true),
episode_3_send_function_call_enabled(false),
enable_dol_compression(false),
catch_handler_exceptions(true),
ep3_behavior_flags(0),
run_shell_behavior(RunShellBehavior::DEFAULT),
@@ -654,6 +655,12 @@ void ServerState::parse_config(shared_ptr<const JSONObject> config_json) {
this->episode_3_send_function_call_enabled = false;
}
try {
this->enable_dol_compression = d.at("CompressDOLFiles")->as_bool();
} catch (const out_of_range&) {
this->enable_dol_compression = false;
}
try {
this->catch_handler_exceptions = d.at("CatchHandlerExceptions")->as_bool();
} catch (const out_of_range&) {
@@ -860,5 +867,5 @@ void ServerState::compile_functions() {
void ServerState::load_dol_files() {
config_log.info("Loading DOL files");
this->dol_file_index.reset(new DOLFileIndex("system/dol"));
this->dol_file_index.reset(new DOLFileIndex("system/dol", this->enable_dol_compression));
}