- spam filter closeFactor works correctly even if the client has sent less than 20 messages, slightly more aggressive filtering

- anti-husk drug
- resized medicine/chemical physics bodies to match the sprites
- damage done to items is determined by the structureDamage value of an attack
This commit is contained in:
Regalis
2016-08-28 17:29:32 +03:00
parent 7e644ebb9d
commit e715f07922
5 changed files with 76 additions and 34 deletions

View File

@@ -1474,13 +1474,13 @@ namespace Barotrauma.Networking
similarity += sender.ChatSpamSpeed * 0.05f; //the faster messages are being sent, the faster the filter will block
for (int i = 0; i < sender.ChatMessages.Count; i++)
{
float closeFactor = 1.0f / (20.0f - i);
float closeFactor = 1.0f / (sender.ChatMessages.Count - i);
int levenshteinDist = ToolBox.LevenshteinDistance(message.Text, sender.ChatMessages[i]);
similarity += Math.Max((message.Text.Length - levenshteinDist) / message.Text.Length * closeFactor, 0.0f);
}
if (similarity > 6.0f)
if (similarity > 5.0f)
{
sender.ChatSpamCount++;