mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 17:49:25 +08:00
add: chapter auto next battle
This commit is contained in:
@@ -960,6 +960,28 @@ CrackerServer::CrackerServer() {
|
||||
CRACK_OK();
|
||||
});
|
||||
|
||||
Post("/enable_chapter_auto_next_battle", [](const httplib::Request& req, httplib::Response& res) {
|
||||
try {
|
||||
Cracker::Instance().enable_chapter_auto_next_battle();
|
||||
} catch (std::exception& e) {
|
||||
SPDLOG_ERROR("Enable chapter auto next battle failed: {}", e.what());
|
||||
res.status = 500;
|
||||
return;
|
||||
}
|
||||
CRACK_OK();
|
||||
});
|
||||
|
||||
Post("/disable_chapter_auto_next_battle", [](const httplib::Request& req, httplib::Response& res) {
|
||||
try {
|
||||
Cracker::Instance().disable_chapter_auto_next_battle();
|
||||
} catch (std::exception& e) {
|
||||
SPDLOG_ERROR("Disable chapter auto next battle 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