From 4c92f0c26d61527a7455b50a32f006d8bc54f731 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 3 Feb 2024 10:52:16 -0500 Subject: [PATCH] Core/Chat: Explicitly ignore disabling chat feature Port From (https://github.com/TrinityCore/TrinityCore/commit/42c44bd787458a8a0c7a12bbab874388537d61ed) --- Source/Game/Handlers/ChatHandler.cs | 12 ++++++++ Source/Game/Networking/Packets/ChatPackets.cs | 29 ++++++++++++++++++- 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/Source/Game/Handlers/ChatHandler.cs b/Source/Game/Handlers/ChatHandler.cs index 459409abf..06b53ce70 100644 --- a/Source/Game/Handlers/ChatHandler.cs +++ b/Source/Game/Handlers/ChatHandler.cs @@ -649,5 +649,17 @@ namespace Game canLocalWhisperTargetResponse.Status = status; SendPacket(canLocalWhisperTargetResponse); } + + [WorldPacketHandler(ClientOpcodes.UpdateAadcStatus, Processing = PacketProcessing.Inplace)] + void HandleChatUpdateAADCStatus(UpdateAADCStatus updateAADCStatus) + { + // disabling chat not supported + // send Sueccess and force chat disabled to false instead of sending that change failed + // this makes client change the cvar back to false instead of just printing error message in console + UpdateAADCStatusResponse response = new(); + response.Success = true; + response.ChatDisabled = false; + SendPacket(response); + } } } diff --git a/Source/Game/Networking/Packets/ChatPackets.cs b/Source/Game/Networking/Packets/ChatPackets.cs index 7ece0e1f3..2e675a1b2 100644 --- a/Source/Game/Networking/Packets/ChatPackets.cs +++ b/Source/Game/Networking/Packets/ChatPackets.cs @@ -497,7 +497,34 @@ namespace Game.Networking.Packets _worldPacket.WriteInt32((int)Status); } } - + + class UpdateAADCStatus : ClientPacket + { + public bool ChatDisabled; + + public UpdateAADCStatus(WorldPacket packet) : base(packet) { } + + public override void Read() + { + ChatDisabled = _worldPacket.HasBit(); + } + } + + class UpdateAADCStatusResponse : ServerPacket + { + public bool Success; + public bool ChatDisabled; + + public UpdateAADCStatusResponse() : base(ServerOpcodes.UpdateAadcStatusResponse) { } + + public override void Write() + { + _worldPacket.WriteBit(Success); + _worldPacket.WriteBit(ChatDisabled); + _worldPacket.FlushBits(); + } + } + public class ChatAddonMessageParams { public void Read(WorldPacket data)