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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user