feat(Session): Lock Lobby (#1342)

This commit is contained in:
Rxann 2023-06-05 15:59:56 -04:00 committed by GitHub
parent 56d9d39b71
commit 28707968a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -352,6 +352,7 @@ namespace big
int player_magnet_count = 32;
bool is_team = false;
bool join_in_sctv_slots = false;
bool lock_session = false;
const char chat_command_prefix = '/';
const char chat_output_prefix = '>';
@ -389,7 +390,7 @@ namespace big
bool show_cheating_message = false;
bool anonymous_bounty = true;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(session, local_weather, override_time, override_weather, custom_time, chat_force_clean, log_chat_messages, log_text_messages, decloak_players, force_session_host, force_script_host, player_magnet_enabled, player_magnet_count, is_team, join_in_sctv_slots, kick_chat_spammers, kick_host_when_forcing_host, explosion_karma, damage_karma, disable_traffic, disable_peds, force_thunder, block_ceo_money, randomize_ceo_colors, block_jobs, block_muggers, block_ceo_raids, send_to_apartment_idx, send_to_warehouse_idx, chat_commands, chat_command_default_access_level, show_cheating_message, anonymous_bounty)
NLOHMANN_DEFINE_TYPE_INTRUSIVE(session, local_weather, override_time, override_weather, custom_time, chat_force_clean, log_chat_messages, log_text_messages, decloak_players, force_session_host, force_script_host, player_magnet_enabled, player_magnet_count, is_team, join_in_sctv_slots, kick_chat_spammers, kick_host_when_forcing_host, explosion_karma, damage_karma, disable_traffic, disable_peds, force_thunder, block_ceo_money, randomize_ceo_colors, block_jobs, block_muggers, block_ceo_raids, send_to_apartment_idx, send_to_warehouse_idx, chat_commands, chat_command_default_access_level, show_cheating_message, anonymous_bounty, lock_session)
} session{};
struct settings

View File

@ -77,10 +77,10 @@ namespace big
net_player_data->m_gamer_handle.m_rockstar_id)));
}
auto id = player->m_player_id;
bool lock_session = g.session.lock_session;
auto id = player->m_player_id;
g_fiber_pool->queue_job([id] {
g_fiber_pool->queue_job([id, lock_session] {
if (auto plyr = g_player_service->get_by_id(id))
{
if (plyr->get_net_data()->m_gamer_handle.m_rockstar_id != 0)
@ -109,6 +109,12 @@ namespace big
plyr->get_net_data()->m_name));
LOG(WARNING) << "Sending Breakup Kick due to block join failure... ";
}
if (lock_session)
{
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(plyr, {});
g_notification_service->push_warning("Lock Session",
std::format("A player with the name of {} has been denied entry", plyr->get_net_data()->m_name));
}
}
});
}

View File

@ -124,6 +124,10 @@ namespace big
}
}
components::sub_title("Lobby Lock");
ImGui::Checkbox("Lock", &g.session.lock_session);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Blocks all players from joining. May not work on some modders.");
components::sub_title("DECLOAK"_T);
components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T, &g.session.decloak_players);