OBT/1.2.1(Summer update)
Sync with upstream
This commit is contained in:
@@ -8,6 +8,17 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
partial class ChatMessage
|
||||
{
|
||||
private static string SanitizeText(Client client, string text)
|
||||
{
|
||||
if (!client.HasPermission(ClientPermissions.SpamImmunity))
|
||||
{
|
||||
// Prevent clients without spam immunity from being able to use RichString features
|
||||
text = text.Replace('‖', ' ');
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
|
||||
public static void ServerRead(IReadMessage msg, Client c)
|
||||
{
|
||||
c.KickAFKTimer = 0.0f;
|
||||
@@ -69,8 +80,7 @@ namespace Barotrauma.Networking
|
||||
txt = msg.ReadString() ?? "";
|
||||
}
|
||||
|
||||
// Sanitize incoming text message from client so they can't use RichString features
|
||||
txt = txt.Replace('‖', ' ');
|
||||
txt = SanitizeText(c, txt);
|
||||
|
||||
if (!NetIdUtils.IdMoreRecent(ID, c.LastSentChatMsgID)) { return; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user