mitigate potential $persist abuse

This commit is contained in:
Martin Michelsen
2023-12-13 21:07:13 -08:00
parent 974269187b
commit 2bd43391a6
4 changed files with 89 additions and 21 deletions
+2
View File
@@ -484,6 +484,8 @@ static void server_command_persist(shared_ptr<Client> c, const std::string&) {
send_text_message(c, "$C6Private lobbies\ncannot be marked\npersistent");
} else if (l->check_flag(Lobby::Flag::QUEST_IN_PROGRESS) || l->check_flag(Lobby::Flag::JOINABLE_QUEST_IN_PROGRESS)) {
send_text_message(c, "$C6Games cannot be\npersistent if a\nquest has already\nbegun");
} else if (l->check_flag(Lobby::Flag::IS_SPECTATOR_TEAM)) {
send_text_message(c, "$C6Spectator teams\ncannot be marked\npersistent");
} else {
l->toggle_flag(Lobby::Flag::PERSISTENT);
send_text_message_printf(l, "Lobby persistence\n%s", l->check_flag(Lobby::Flag::PERSISTENT) ? "enabled" : "disabled");