1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-17 15:59:28 +08:00

fix: handle battle verify for global speedup of hook

This commit is contained in:
0O0o0oOoO00
2025-05-12 15:40:49 +08:00
parent 190294e2da
commit e63d9326f1
6 changed files with 58 additions and 10 deletions

View File

@@ -604,11 +604,22 @@ CrackerServer::CrackerServer() {
});
Post("/enable_global_speedup", [](const httplib::Request& req, httplib::Response& res) {
try {
Cracker::Instance().enable_global_speedup();
} catch (std::exception& e) {
SPDLOG_ERROR("Enable global speedup failed: {}", e.what());
res.status = 500;
return;
}
res.status = 200;
});
Post("/update_global_speedup_rate", [](const httplib::Request& req, httplib::Response& res) {
try {
Json::Reader reader;
Json::Value j;
reader.parse(req.body, j);
Cracker::Instance().enable_global_speedup(j["rate"].asFloat());
Cracker::Instance().update_global_speedup_rate(j["rate"].asFloat());
} catch (std::exception& e) {
SPDLOG_ERROR("Enable global speedup failed: {}", e.what());
res.status = 500;