OBT/1.2.0(Spring Update)
Sync with Upstream
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using Barotrauma.LuaCs.Events;
|
||||
using MoonSharp.Interpreter;
|
||||
using MoonSharp.VsCodeDebugger.SDK;
|
||||
using System;
|
||||
using System.Text;
|
||||
|
||||
namespace Barotrauma.Networking
|
||||
{
|
||||
@@ -67,6 +69,9 @@ namespace Barotrauma.Networking
|
||||
txt = msg.ReadString() ?? "";
|
||||
}
|
||||
|
||||
// Sanitize incoming text message from client so they can't use RichString features
|
||||
txt = txt.Replace('‖', ' ');
|
||||
|
||||
if (!NetIdUtils.IdMoreRecent(ID, c.LastSentChatMsgID)) { return; }
|
||||
|
||||
c.LastSentChatMsgID = ID;
|
||||
@@ -86,12 +91,9 @@ namespace Barotrauma.Networking
|
||||
HandleSpamFilter(c, txt, out bool flaggedAsSpam, similarityMultiplier);
|
||||
if (flaggedAsSpam) { return; }
|
||||
|
||||
var should = GameMain.LuaCs.Hook.Call<bool?>("chatMessage", txt, c, type);
|
||||
|
||||
if (should != null && should.Value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
bool? should = null;
|
||||
LuaCsSetup.Instance.EventService.PublishEvent<IEventChatMessage>(x => should = x.OnChatMessage(txt, c, type, ChatMessage.Create(c.Name, txt, type, null, c)) ?? should);
|
||||
if (should != null && should.Value) { return; }
|
||||
|
||||
if (type == ChatMessageType.Order)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user