feat(session): disable sent chat messages being filtered (#525)
This commit is contained in:
parent
1549f157a6
commit
dd6e9450fc
@ -175,6 +175,7 @@ namespace big
|
|||||||
} custom_time;
|
} custom_time;
|
||||||
bool join_queued = false;
|
bool join_queued = false;
|
||||||
rage::rlSessionInfo info;
|
rage::rlSessionInfo info;
|
||||||
|
bool disable_chat_filter = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct settings {
|
struct settings {
|
||||||
|
@ -15,6 +15,8 @@ namespace big::functions
|
|||||||
using ptr_to_handle = Entity(*)(void* entity);
|
using ptr_to_handle = Entity(*)(void* entity);
|
||||||
using get_script_handle_t = uint64_t(*)(int64_t);
|
using get_script_handle_t = uint64_t(*)(int64_t);
|
||||||
|
|
||||||
|
using multiplayer_chat_filter = int(__int64 chat_type, const char* input, const char** output);
|
||||||
|
|
||||||
using get_gameplay_cam_coords = Vector3(*)();
|
using get_gameplay_cam_coords = Vector3(*)();
|
||||||
|
|
||||||
using get_screen_coords_for_world_coords = bool(*)(float* world_coords, float* out_x, float* out_y);
|
using get_screen_coords_for_world_coords = bool(*)(float* world_coords, float* out_x, float* out_y);
|
||||||
|
@ -26,6 +26,9 @@ namespace big
|
|||||||
// Get Label Text
|
// Get Label Text
|
||||||
m_get_label_text("GLT", g_pointers->m_get_label_text, &hooks::get_label_text),
|
m_get_label_text("GLT", g_pointers->m_get_label_text, &hooks::get_label_text),
|
||||||
|
|
||||||
|
// Multiplayer chat filter
|
||||||
|
m_multiplayer_chat_filter("MCF", g_pointers->m_multiplayer_chat_filter, &hooks::multiplayer_chat_filter),
|
||||||
|
|
||||||
// GTA Thead Start
|
// GTA Thead Start
|
||||||
m_gta_thread_start_hook("GTS", g_pointers->m_gta_thread_start, &hooks::gta_thread_start),
|
m_gta_thread_start_hook("GTS", g_pointers->m_gta_thread_start, &hooks::gta_thread_start),
|
||||||
// GTA Thread Kill
|
// GTA Thread Kill
|
||||||
@ -79,6 +82,7 @@ namespace big
|
|||||||
|
|
||||||
m_run_script_threads_hook.enable();
|
m_run_script_threads_hook.enable();
|
||||||
m_get_label_text.enable();
|
m_get_label_text.enable();
|
||||||
|
m_multiplayer_chat_filter.enable();
|
||||||
m_gta_thread_start_hook.enable();
|
m_gta_thread_start_hook.enable();
|
||||||
m_gta_thread_kill_hook.enable();
|
m_gta_thread_kill_hook.enable();
|
||||||
m_network_group_override.enable();
|
m_network_group_override.enable();
|
||||||
@ -115,6 +119,7 @@ namespace big
|
|||||||
m_network_group_override.disable();
|
m_network_group_override.disable();
|
||||||
m_gta_thread_kill_hook.disable();
|
m_gta_thread_kill_hook.disable();
|
||||||
m_gta_thread_start_hook.disable();
|
m_gta_thread_start_hook.disable();
|
||||||
|
m_multiplayer_chat_filter.disable();
|
||||||
m_get_label_text.disable();
|
m_get_label_text.disable();
|
||||||
m_run_script_threads_hook.disable();
|
m_run_script_threads_hook.disable();
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ namespace big
|
|||||||
static LRESULT wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
|
static LRESULT wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
|
||||||
|
|
||||||
static const char* get_label_text(void* unk, const char* label);
|
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 GtaThread* gta_thread_start(unsigned int** a1, unsigned int a2);
|
static GtaThread* gta_thread_start(unsigned int** a1, unsigned int a2);
|
||||||
static rage::eThreadState gta_thread_kill(GtaThread* thread);
|
static rage::eThreadState gta_thread_kill(GtaThread* thread);
|
||||||
@ -98,6 +99,7 @@ namespace big
|
|||||||
detour_hook m_run_script_threads_hook;
|
detour_hook m_run_script_threads_hook;
|
||||||
|
|
||||||
detour_hook m_get_label_text;
|
detour_hook m_get_label_text;
|
||||||
|
detour_hook m_multiplayer_chat_filter;
|
||||||
|
|
||||||
detour_hook m_gta_thread_start_hook;
|
detour_hook m_gta_thread_start_hook;
|
||||||
detour_hook m_gta_thread_kill_hook;
|
detour_hook m_gta_thread_kill_hook;
|
||||||
|
13
BigBaseV2/src/hooks/misc/multiplayer_chat_filter.cpp
Normal file
13
BigBaseV2/src/hooks/misc/multiplayer_chat_filter.cpp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#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->m_multiplayer_chat_filter.get_original<decltype(&hooks::multiplayer_chat_filter)>()(chat_type, input, output);
|
||||||
|
}
|
||||||
|
}
|
@ -329,6 +329,12 @@ namespace big
|
|||||||
m_get_label_text = ptr.sub(19).as<PVOID>();
|
m_get_label_text = ptr.sub(19).as<PVOID>();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 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)>();
|
||||||
|
});
|
||||||
|
|
||||||
// Network
|
// Network
|
||||||
main_batch.add("N", "48 8B 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 84 C0 75 17 48 8B 0D ? ? ? ? 48 8B D7", [this](memory::handle ptr)
|
main_batch.add("N", "48 8B 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 84 C0 75 17 48 8B 0D ? ? ? ? 48 8B D7", [this](memory::handle ptr)
|
||||||
{
|
{
|
||||||
|
@ -50,6 +50,7 @@ namespace big
|
|||||||
PVOID m_native_return;
|
PVOID m_native_return;
|
||||||
PVOID m_network_group_override;
|
PVOID m_network_group_override;
|
||||||
PVOID m_get_label_text;
|
PVOID m_get_label_text;
|
||||||
|
functions::multiplayer_chat_filter* m_multiplayer_chat_filter{};
|
||||||
|
|
||||||
FriendRegistry* m_friend_registry{};
|
FriendRegistry* m_friend_registry{};
|
||||||
|
|
||||||
|
@ -25,5 +25,11 @@ namespace big
|
|||||||
}
|
}
|
||||||
ImGui::EndListBox();
|
ImGui::EndListBox();
|
||||||
}
|
}
|
||||||
|
if (ImGui::TreeNode("Chat"))
|
||||||
|
{
|
||||||
|
ImGui::Checkbox("Disable Filter", &g->session.disable_chat_filter);
|
||||||
|
|
||||||
|
ImGui::TreePop();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user