Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
Revert custom chat hook (#198)
Browse files Browse the repository at this point in the history
Forcing the revert to avoid bans
  • Loading branch information
manianac authored Jun 6, 2021
1 parent ba3c318 commit b61661b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 12 deletions.
1 change: 0 additions & 1 deletion appdata/il2cpp-functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
7 changes: 0 additions & 7 deletions hooks/Chat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
}
2 changes: 0 additions & 2 deletions hooks/_hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
3 changes: 1 addition & 2 deletions hooks/_hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
void dChatController_Update(ChatController* __this, MethodInfo* method);

0 comments on commit b61661b

Please sign in to comment.