Renamed Disable Chat Filter to Check Chat Profanity (#871)
This commit is contained in:
parent
bc9583b990
commit
23b016f4c8
@ -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,
|
||||
|
@ -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(*)();
|
||||
|
@ -32,7 +32,7 @@ namespace big
|
||||
|
||||
detour_hook_helper::add<hooks::get_label_text>("GLT", g_pointers->m_get_label_text);
|
||||
|
||||
detour_hook_helper::add<hooks::multiplayer_chat_filter>("MCF", g_pointers->m_multiplayer_chat_filter);
|
||||
detour_hook_helper::add<hooks::check_chat_profanity>("CCP", g_pointers->m_check_chat_profanity);
|
||||
|
||||
detour_hook_helper::add<hooks::write_player_game_state_data_node>("WPGSDN", g_pointers->m_write_player_game_state_data_node);
|
||||
|
||||
|
@ -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);
|
||||
|
22
src/hooks/misc/check_chat_profanity.cpp
Normal file
22
src/hooks/misc/check_chat_profanity.cpp
Normal file
@ -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<int>(eProfanity::PROFANITY_CHAT_CLEAN);
|
||||
}
|
||||
return g_hooking->get_original<hooks::check_chat_profanity>()(chat_type, input, output);
|
||||
}
|
||||
}
|
@ -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<hooks::multiplayer_chat_filter>()(chat_type, input, output);
|
||||
}
|
||||
}
|
@ -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<decltype(m_multiplayer_chat_filter)>();
|
||||
m_check_chat_profanity = ptr.add(1).rip().as<decltype(m_check_chat_profanity)>();
|
||||
});
|
||||
|
||||
// Network
|
||||
|
@ -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;
|
||||
|
@ -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];
|
||||
|
Reference in New Issue
Block a user