From b61661b3ef7df1623be621a44c5a145d301ab35e Mon Sep 17 00:00:00 2001 From: Manianac Date: Sat, 5 Jun 2021 21:46:19 -0400 Subject: [PATCH] Revert custom chat hook (#198) Forcing the revert to avoid bans --- appdata/il2cpp-functions.h | 1 - hooks/Chat.cpp | 7 ------- hooks/_hooks.cpp | 2 -- hooks/_hooks.h | 3 +-- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/appdata/il2cpp-functions.h b/appdata/il2cpp-functions.h index 29f2e940..f53e15ea 100644 --- a/appdata/il2cpp-functions.h +++ b/appdata/il2cpp-functions.h @@ -180,5 +180,4 @@ DO_APP_FUNC(bool, EOSManager_IsFreechatAllowed, (EOSManager* __this, MethodInfo* DO_APP_FUNC(void, TextMeshPro_SetFaceColor, (TextMeshPro* __this, Color32 color, MethodInfo* method), "Unity.TextMeshPro, System.Void TMPro.TextMeshPro::SetFaceColor(UnityEngine.Color32)"); DO_APP_FUNC(void, TextMeshPro_SetOutlineColor, (TextMeshPro* __this, Color32 color, MethodInfo* method), "Unity.TextMeshPro, System.Void TMPro.TextMeshPro::SetOutlineColor(UnityEngine.Color32)"); -DO_APP_FUNC(bool, TextBoxTMP_IsCharAllowed, (TextBoxTMP* __this, uint16_t unicode_char, MethodInfo* method), "Assembly-CSharp, System.Boolean TextBoxTMP::IsCharAllowed(System.Char)"); DO_APP_FUNC(Color32, Color32_op_Implicit, (Color c, MethodInfo* method), "UnityEngine.CoreModule, UnityEngine.Color32 UnityEngine.Color32::op_Implicit(UnityEngine.Color)"); diff --git a/hooks/Chat.cpp b/hooks/Chat.cpp index 16c3e51b..f6e9425c 100644 --- a/hooks/Chat.cpp +++ b/hooks/Chat.cpp @@ -5,7 +5,6 @@ #include "state.hpp" void dChatController_AddChat(ChatController* __this, PlayerControl* sourcePlayer, String* chatText, MethodInfo* method) { - //Modify chat text here for markup if (State.ReadGhostMessages) { bool wasDead = false; GameData_PlayerInfo* player = GetPlayerData(sourcePlayer); @@ -58,10 +57,4 @@ void dChatController_Update(ChatController* __this, MethodInfo* method) SaveManager__TypeInfo->static_fields->chatModeType = 1; SaveManager__TypeInfo->static_fields->isGuest = false; ChatController_Update(__this, method); -} - -//This should apply to all text fields, not just chat -bool dTextBoxTMP_IsCharAllowed(TextBoxTMP* __this, uint16_t unicode_char, MethodInfo* method) -{ - return (unicode_char != 0x08); //List invalid characters here } \ No newline at end of file diff --git a/hooks/_hooks.cpp b/hooks/_hooks.cpp index 1b6839a3..98f2d3dc 100644 --- a/hooks/_hooks.cpp +++ b/hooks/_hooks.cpp @@ -113,7 +113,6 @@ void DetourInitilization() { HOOKFUNC(EOSManager_ReallyBeginFlow); HOOKFUNC(EOSManager_IsFreechatAllowed); HOOKFUNC(ChatController_Update); - HOOKFUNC(TextBoxTMP_IsCharAllowed); if (!HookFunction(&(PVOID&)oPresent, dPresent, "D3D_PRESENT_FUNCTION")) return; @@ -184,7 +183,6 @@ void DetourUninitialization() UNHOOKFUNC(EOSManager_ReallyBeginFlow); UNHOOKFUNC(EOSManager_IsFreechatAllowed); UNHOOKFUNC(ChatController_Update); - UNHOOKFUNC(TextBoxTMP_IsCharAllowed); if (DetourDetach(&(PVOID&)oPresent, dPresent) != 0) return; diff --git a/hooks/_hooks.h b/hooks/_hooks.h index 122270c1..5725986f 100644 --- a/hooks/_hooks.h +++ b/hooks/_hooks.h @@ -63,5 +63,4 @@ void dEOSManager_InitializePlatformInterface(EOSManager* __this, MethodInfo* met void dEOSManager_BeginLoginFlow(EOSManager* __this, MethodInfo* method); void dEOSManager_ReallyBeginFlow(EOSManager* __this, MethodInfo* method); bool dEOSManager_IsFreechatAllowed(EOSManager* __this, MethodInfo* method); -void dChatController_Update(ChatController* __this, MethodInfo* method); -bool dTextBoxTMP_IsCharAllowed(TextBoxTMP* __this, uint16_t unicode_char, MethodInfo* method); \ No newline at end of file +void dChatController_Update(ChatController* __this, MethodInfo* method); \ No newline at end of file