diff --git a/src/core/globals.hpp b/src/core/globals.hpp index a71654fc..fa5c05e4 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -287,7 +287,7 @@ namespace big NLOHMANN_DEFINE_TYPE_INTRUSIVE(custom_time, hour, minute, second) } custom_time; - bool disable_chat_filter = false; + bool chat_force_clean = false; bool log_chat_messages = false; bool log_text_messages = false; bool decloak_players = false; @@ -335,7 +335,7 @@ namespace big bool anonymous_bounty = true; NLOHMANN_DEFINE_TYPE_INTRUSIVE(session, - local_weather, override_time, override_weather, custom_time, disable_chat_filter, log_chat_messages, + 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, name_spoof_enabled, advertise_menu, spoofed_name, join_in_sctv_slots, kick_chat_spammers, kick_host_when_forcing_host, explosion_karma, damage_karma, disable_traffic, diff --git a/src/function_types.hpp b/src/function_types.hpp index 46b32c4d..8f00f134 100644 --- a/src/function_types.hpp +++ b/src/function_types.hpp @@ -43,7 +43,7 @@ namespace big::functions using ptr_to_handle = Entity(*)(void*); using handle_to_ptr = rage::CDynamicEntity*(*)(Entity); - using multiplayer_chat_filter = int(__int64 chat_type, const char* input, const char** output); + using check_chat_profanity = int(__int64 chat_type, const char* input, const char** output); using write_player_game_state_data_node = bool(*)(rage::netObject* plr, CPlayerGameStateDataNode* node); using get_gameplay_cam_coords = Vector3(*)(); diff --git a/src/hooking.cpp b/src/hooking.cpp index e6d1f9d2..d8b3c748 100644 --- a/src/hooking.cpp +++ b/src/hooking.cpp @@ -32,9 +32,9 @@ namespace big detour_hook_helper::add("GLT", g_pointers->m_get_label_text); - detour_hook_helper::add("MCF", g_pointers->m_multiplayer_chat_filter); + detour_hook_helper::add("CCP", g_pointers->m_check_chat_profanity); - detour_hook_helper::add("WPGSDN", g_pointers->m_write_player_game_state_data_node); + detour_hook_helper::add("WPGSDN", g_pointers->m_write_player_game_state_data_node); detour_hook_helper::add("GTS", g_pointers->m_gta_thread_start); detour_hook_helper::add("GTK", g_pointers->m_gta_thread_kill); diff --git a/src/hooking.hpp b/src/hooking.hpp index 122de153..eec67d4b 100644 --- a/src/hooking.hpp +++ b/src/hooking.hpp @@ -57,7 +57,7 @@ namespace big static LRESULT wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam); static const char* get_label_text(void* unk, const char* label); - static int multiplayer_chat_filter(__int64 chat_type, const char* input, const char** output); + static int check_chat_profanity(__int64 chat_type, const char* input, const char** output); static GtaThread* gta_thread_start(unsigned int** a1, unsigned int a2); static rage::eThreadState gta_thread_kill(GtaThread* thread); diff --git a/src/hooks/misc/check_chat_profanity.cpp b/src/hooks/misc/check_chat_profanity.cpp new file mode 100644 index 00000000..7ea0338a --- /dev/null +++ b/src/hooks/misc/check_chat_profanity.cpp @@ -0,0 +1,22 @@ +#pragma once +#include "hooking.hpp" + +namespace big +{ + enum class eProfanity { + PROFANITY_CHAT_CLEAN = -1, + PROFANITY_CLEAN, + PROFANITY_DIRTY, + PROFANITY_UNK, + PROFANITY_ERROR + }; + + int hooks::check_chat_profanity(__int64 chat_type, const char* input, const char** output) + { + if (g.session.chat_force_clean) + { + return static_cast(eProfanity::PROFANITY_CHAT_CLEAN); + } + return g_hooking->get_original()(chat_type, input, output); + } +} diff --git a/src/hooks/misc/multiplayer_chat_filter.cpp b/src/hooks/misc/multiplayer_chat_filter.cpp deleted file mode 100644 index 02af5aac..00000000 --- a/src/hooks/misc/multiplayer_chat_filter.cpp +++ /dev/null @@ -1,13 +0,0 @@ -#include "hooking.hpp" - -namespace big -{ - int hooks::multiplayer_chat_filter(__int64 chat_type, const char* input, const char** output) - { - if (g.session.disable_chat_filter) - { - return -1; - } - return g_hooking->get_original()(chat_type, input, output); - } -} diff --git a/src/pointers.cpp b/src/pointers.cpp index d2bc36e1..1a217114 100644 --- a/src/pointers.cpp +++ b/src/pointers.cpp @@ -356,7 +356,7 @@ namespace big // Multiplayer chat filter main_batch.add("MCF", "E8 ? ? ? ? 83 F8 FF 75 B9", [this](memory::handle ptr) { - m_multiplayer_chat_filter = ptr.add(1).rip().as(); + m_check_chat_profanity = ptr.add(1).rip().as(); }); // Network diff --git a/src/pointers.hpp b/src/pointers.hpp index 710cb4bc..b644de2e 100644 --- a/src/pointers.hpp +++ b/src/pointers.hpp @@ -69,7 +69,7 @@ namespace big PVOID m_world_model_spawn_bypass; PVOID m_native_return; PVOID m_get_label_text; - functions::multiplayer_chat_filter* m_multiplayer_chat_filter{}; + functions::check_chat_profanity* m_check_chat_profanity{}; functions::write_player_game_state_data_node m_write_player_game_state_data_node{}; ChatData** m_chat_data; diff --git a/src/views/network/view_session.cpp b/src/views/network/view_session.cpp index a1015441..bc314f59 100644 --- a/src/views/network/view_session.cpp +++ b/src/views/network/view_session.cpp @@ -97,7 +97,9 @@ namespace big components::sub_title("Chat"); ImGui::Checkbox("Auto-kick Chat Spammers", &g.session.kick_chat_spammers); - ImGui::Checkbox("Disable Filter", &g.session.disable_chat_filter); + ImGui::Checkbox("Force Clean", &g.session.chat_force_clean); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("Your sent chat messages will not be censored to the receivers"); ImGui::Checkbox("Log Chat Messages", &g.session.log_chat_messages); ImGui::Checkbox("Log Text Messages", &g.session.log_text_messages); static char msg[256];