mirror of
https://github.com/acidicoala/SmokeAPI.git
synced 2025-12-05 21:15:39 -05:00
Added config reload via IPC pipes
This commit is contained in:
2
KoalaBox
2
KoalaBox
Submodule KoalaBox updated: 41649fd55c...c1e97c8101
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user