mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-23 07:39:28 +08:00
add: better global speedup crack
This commit is contained in:
@@ -770,6 +770,42 @@ CrackerServer::CrackerServer() {
|
||||
CRACK_OK();
|
||||
});
|
||||
|
||||
Post("/enable_better_global_speedup", [](const httplib::Request& req, httplib::Response& res) {
|
||||
try {
|
||||
Cracker::Instance().enable_better_global_speedup();
|
||||
} catch (std::exception& e) {
|
||||
SPDLOG_ERROR("Enable better global speedup failed: {}", e.what());
|
||||
res.status = 500;
|
||||
return;
|
||||
}
|
||||
CRACK_OK();
|
||||
});
|
||||
|
||||
Post("/update_better_global_speedup_rate", [](const httplib::Request& req, httplib::Response& res) {
|
||||
try {
|
||||
Json::Reader reader;
|
||||
Json::Value j;
|
||||
reader.parse(req.body, j);
|
||||
Cracker::Instance().update_better_global_speedup_rate(j["rate"].asDouble());
|
||||
} catch (std::exception& e) {
|
||||
SPDLOG_ERROR("Update better global speedup rate failed: {}", e.what());
|
||||
res.status = 500;
|
||||
return;
|
||||
}
|
||||
CRACK_OK();
|
||||
});
|
||||
|
||||
Post("/disable_better_global_speedup", [](const httplib::Request& req, httplib::Response& res) {
|
||||
try {
|
||||
Cracker::Instance().disable_better_global_speedup();
|
||||
} catch (std::exception& e) {
|
||||
SPDLOG_ERROR("Disable better global speedup failed: {}", e.what());
|
||||
res.status = 500;
|
||||
return;
|
||||
}
|
||||
CRACK_OK();
|
||||
});
|
||||
|
||||
Post("/init", [](const httplib::Request& req, httplib::Response& res) {
|
||||
try {
|
||||
Cracker::Instance();
|
||||
|
||||
Reference in New Issue
Block a user