Added config reload via IPC pipes

master
acidicoala 1 year ago
parent d52e752723
commit dfbce391a7
No known key found for this signature in database
GPG Key ID: D24C6065B49C645B

@ -1 +1 @@
Subproject commit 41649fd55c6b720b4136ab983640312cbddfdd8c
Subproject commit c1e97c8101fe0369985aad85298b1b6b3e3c9ca6

@ -8,6 +8,7 @@
#include <koalabox/dll_monitor.hpp>
#include <koalabox/logger.hpp>
#include <koalabox/win_util.hpp>
#include <koalabox/ipc.hpp>
namespace koalageddon {
@ -117,5 +118,21 @@ namespace koalageddon {
}
}
);
NEW_THREAD({
koalabox::ipc::init_pipe_server("smoke_api.koalageddon", [](const koalabox::ipc::Request& request) {
koalabox::ipc::Response response;
if (request.name < equals > "config::reload") {
smoke_api::config::ReloadConfig();
response.success = true;
} else {
response.success = false;
response.data["error_message"] = "Invalid request name: " + request.name;
}
return response;
});
})
}
}

@ -54,4 +54,6 @@ namespace smoke_api::config {
Vector<DLC> get_extra_dlcs(AppId_t app_id);
bool is_dlc_unlocked(uint32_t app_id, uint32_t dlc_id, const Function<bool()>& original_function);
DLL_EXPORT(void) ReloadConfig();
}

@ -113,6 +113,7 @@ namespace smoke_api {
} else {
init_proxy_mode();
}
LOG_INFO("🚀 Initialization complete")
} catch (const Exception& ex) {
koalabox::util::panic(fmt::format("Initialization error: {}", ex.what()));

Loading…
Cancel
Save