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