From cf3a50d6b544fa11da8036e2a5ee361ce8d44fbe Mon Sep 17 00:00:00 2001 From: MapleWheels Date: Sun, 22 Mar 2026 18:05:21 -0400 Subject: [PATCH] - Added back modifyChatMessage. - Added missing commit file for previous commit. --- .../ServerSource/Characters/CharacterNetworking.cs | 2 +- .../BarotraumaServer/ServerSource/Networking/GameServer.cs | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaServer/ServerSource/Characters/CharacterNetworking.cs b/Barotrauma/BarotraumaServer/ServerSource/Characters/CharacterNetworking.cs index 65d87e934..e17618343 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Characters/CharacterNetworking.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Characters/CharacterNetworking.cs @@ -811,7 +811,7 @@ namespace Barotrauma var tempBuffer = new ReadWriteMessage(); WriteStatus(tempBuffer, forceAfflictionData: true); - if (msgLengthBeforeStatus + tempBuffer.LengthBytes >= 255 && restrictMessageSize && (LuaCsSetup.Instance.RestrictMessageSize)) + if (msgLengthBeforeStatus + tempBuffer.LengthBytes >= 255 && restrictMessageSize) { msg.WriteBoolean(false); if (msgLengthBeforeStatus < 255) diff --git a/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs b/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs index ac6d9374a..041b1936d 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Networking/GameServer.cs @@ -3969,7 +3969,11 @@ namespace Barotrauma.Networking //send to chat-linked wifi components Signal s = new Signal(message, sender: senderCharacter, source: senderRadio.Item); senderRadio.TransmitSignal(s, sentFromChat: true); - } + } + + var hookChatMsg = ChatMessage.Create(senderName, message, (ChatMessageType)type, senderCharacter, senderClient, changeType); + + var should = LuaCsSetup.Instance.Hook.Call("modifyChatMessage", hookChatMsg, senderRadio); //check which clients can receive the message and apply distance effects foreach (Client client in ConnectedClients)