Allow Friends Into Locked Lobby (#1747)
This commit is contained in:
parent
1d78388519
commit
95056d5af3
@ -371,6 +371,7 @@ namespace big
|
|||||||
bool is_team = false;
|
bool is_team = false;
|
||||||
bool join_in_sctv_slots = false;
|
bool join_in_sctv_slots = false;
|
||||||
bool lock_session = false;
|
bool lock_session = false;
|
||||||
|
bool allow_friends_into_locked_session = false;
|
||||||
|
|
||||||
const char chat_command_prefix = '/';
|
const char chat_command_prefix = '/';
|
||||||
const char chat_output_prefix = '>';
|
const char chat_output_prefix = '>';
|
||||||
@ -410,7 +411,7 @@ namespace big
|
|||||||
|
|
||||||
bool fast_join = false;
|
bool fast_join = false;
|
||||||
|
|
||||||
NLOHMANN_DEFINE_TYPE_INTRUSIVE(session, 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, fast_join, unhide_players_from_player_list)
|
NLOHMANN_DEFINE_TYPE_INTRUSIVE(session, 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, fast_join, unhide_players_from_player_list, allow_friends_into_locked_session)
|
||||||
} session{};
|
} session{};
|
||||||
|
|
||||||
struct settings
|
struct settings
|
||||||
|
@ -127,11 +127,20 @@ namespace big
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (g.session.lock_session && g_player_service->get_self()->is_host())
|
if (g.session.lock_session && g_player_service->get_self()->is_host())
|
||||||
|
{
|
||||||
|
if (plyr->is_friend() && g.session.allow_friends_into_locked_session)
|
||||||
|
{
|
||||||
|
g_notification_service->push_success("Lock Session",
|
||||||
|
std::format("A friend with the name of {} has been allowed to join the locked session",
|
||||||
|
plyr->get_net_data()->m_name));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(plyr, {});
|
dynamic_cast<player_command*>(command::get(RAGE_JOAAT("breakup")))->call(plyr, {});
|
||||||
g_notification_service->push_warning("Lock Session",
|
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));
|
std::format("A player with the name of {} has been denied entry", plyr->get_net_data()->m_name));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (is_spoofed_host_token(plyr->get_net_data()->m_host_token))
|
if (is_spoofed_host_token(plyr->get_net_data()->m_host_token))
|
||||||
{
|
{
|
||||||
|
@ -116,10 +116,17 @@ namespace big
|
|||||||
|
|
||||||
ImGui::BeginDisabled(!g_player_service->get_self()->is_host());
|
ImGui::BeginDisabled(!g_player_service->get_self()->is_host());
|
||||||
|
|
||||||
ImGui::Checkbox("Lobby Lock", &g.session.lock_session);
|
|
||||||
|
if (ImGui::Checkbox("Lobby Lock", &g.session.lock_session))
|
||||||
|
{
|
||||||
|
ImGui::Checkbox("Allow Friends Into Locked Lobby", &g.session.allow_friends_into_locked_session);
|
||||||
|
if (ImGui::IsItemHovered())
|
||||||
|
ImGui::SetTooltip("Allows Friends to Join Lobby While Locked");
|
||||||
|
}
|
||||||
if (ImGui::IsItemHovered())
|
if (ImGui::IsItemHovered())
|
||||||
ImGui::SetTooltip("Blocks all players from joining. May not work on some modders.");
|
ImGui::SetTooltip("Blocks all players from joining. May not work on some modders.");
|
||||||
|
|
||||||
|
|
||||||
ImGui::EndDisabled();
|
ImGui::EndDisabled();
|
||||||
|
|
||||||
components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T, &g.session.decloak_players, "Reveals players that are off the radar");
|
components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T, &g.session.decloak_players, "Reveals players that are off the radar");
|
||||||
|
Reference in New Issue
Block a user