1
0
mirror of https://github.com/0O0o0oOoO00/Alas.git synced 2026-05-22 03:29:28 +08:00

add: keep 1 level white flagship when auto retire

This commit is contained in:
0O0o0oOoO00
2026-03-20 22:50:36 +08:00
parent 289652382a
commit b777b9656d
15 changed files with 77 additions and 0 deletions

View File

@@ -1382,6 +1382,20 @@ CrackerServer::CrackerServer() {
CRACK_OK();
});
Post("/set_white_flagship_keep_count", [](const httplib::Request& req, httplib::Response& res) {
try {
Json::Reader reader;
Json::Value j;
reader.parse(req.body, j);
Cracker::Instance().set_white_flagship_keep_count(j["count"].asInt());
} catch (std::exception& e) {
SPDLOG_ERROR("Set white flagship keep count failed: {}", e.what());
res.status = 500;
return;
}
CRACK_OK();
});
Post("/enable_auto_retire", [](const httplib::Request& req, httplib::Response& res) {
try {
Cracker::Instance().enable_auto_retire();