Hacked clients can't send chat messages from other characters anymore
Also added sendername as userdata in chat messages, for now it's not used for anything but we'll probably find something where this is useful
This commit is contained in:
@@ -1443,6 +1443,7 @@ namespace Barotrauma.Networking
|
||||
{
|
||||
Client sender = connectedClients.Find(x => x.Connection == inc.SenderConnection);
|
||||
ChatMessage message = ChatMessage.ReadNetworkMessage(inc);
|
||||
if (message == null) return;
|
||||
|
||||
List<Client> recipients = new List<Client>();
|
||||
|
||||
@@ -1494,7 +1495,7 @@ namespace Barotrauma.Networking
|
||||
if (similarity > 5.0f)
|
||||
{
|
||||
sender.ChatSpamCount++;
|
||||
|
||||
|
||||
if (sender.ChatSpamCount > 3)
|
||||
{
|
||||
//kick for spamming too much
|
||||
@@ -1633,10 +1634,10 @@ namespace Barotrauma.Networking
|
||||
headSpriteId = 0;
|
||||
}
|
||||
|
||||
if (sender.characterInfo != null)
|
||||
{
|
||||
//clients can't change their character's name once it's been set
|
||||
name = sender.characterInfo.Name;
|
||||
if (sender.characterInfo != null)
|
||||
{
|
||||
//clients can't change their character's name once it's been set
|
||||
name = sender.characterInfo.Name;
|
||||
}
|
||||
|
||||
List<JobPrefab> jobPreferences = new List<JobPrefab>();
|
||||
|
||||
Reference in New Issue
Block a user