1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-19 06:29:31 +08:00

add: no damage crack

This commit is contained in:
0O0o0oOoO00
2025-09-01 17:08:13 +08:00
parent 64a96496be
commit 1f3d5cba1f
4 changed files with 62 additions and 1 deletions

View File

@@ -806,6 +806,28 @@ CrackerServer::CrackerServer() {
CRACK_OK();
});
Post("/enable_no_damage", [](const httplib::Request& req, httplib::Response& res) {
try {
Cracker::Instance().enable_no_damage();
} catch (std::exception& e) {
SPDLOG_ERROR("Enable no damage failed: {}", e.what());
res.status = 500;
return;
}
CRACK_OK();
});
Post("/disable_no_damage", [](const httplib::Request& req, httplib::Response& res) {
try {
Cracker::Instance().disable_no_damage();
} catch (std::exception& e) {
SPDLOG_ERROR("Disable no damage failed: {}", e.what());
res.status = 500;
return;
}
CRACK_OK();
});
Post("/init", [](const httplib::Request& req, httplib::Response& res) {
try {
Cracker::Instance();