Add a specific prompt for a moderator joining a password protected game.

This commit is contained in:
Pentarctagon 2021-12-05 18:32:22 -06:00 committed by Pentarctagon
parent 378301722b
commit e02cb3f8c2

View file

@ -849,7 +849,11 @@ void mp_lobby::enter_game(const mp::game_info& game, JOIN_MODE mode)
join_data["id"] = std::to_string(game.id);
join_data["observe"] = try_obsv;
if(!join_data.empty() && game.password_required) {
if(mp::logged_in_as_moderator() && game.password_required) {
if(gui2::show_message(_("Join"), _("This game is password protected. Join using moderator rights anyway?"), gui2::dialogs::message::yes_no_buttons) != gui2::retval::OK) {
return;
}
} else if(!join_data.empty() && game.password_required) {
std::string password;
if(!gui2::dialogs::mp_join_game_password_prompt::execute(password)) {