From 09f75e0db9c3718a54eedbd93e26b3c40421abd5 Mon Sep 17 00:00:00 2001 From: stacey <57187883+moisterrific@users.noreply.github.com> Date: Wed, 26 May 2021 19:31:46 -0400 Subject: [PATCH 1/2] Update OnNPCAddBuff to account for Frost armor set This fixes false positive cheat detection when throwing rotten eggs at town NPCs while wearing Frost armor set. Also made the debug and kick messages more clear for future reference. --- TShockAPI/Bouncer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index ed4c031a..443eb135 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -1537,7 +1537,7 @@ namespace TShockAPI if (npc.townNPC && npc.netID != NPCID.Guide && npc.netID != NPCID.Clothier) { if (type != BuffID.Lovestruck && type != BuffID.Stinky && type != BuffID.DryadsWard && - type != BuffID.Wet && type != BuffID.Slimed && type != BuffID.GelBalloonBuff) + type != BuffID.Wet && type != BuffID.Slimed && type != BuffID.GelBalloonBuff && type != BuffID.Frostburn2) { detectedNPCBuffTimeCheat = true; } @@ -1550,8 +1550,8 @@ namespace TShockAPI if (detectedNPCBuffTimeCheat) { - TShock.Log.ConsoleDebug("Bouncer / OnNPCAddBuff rejected abnormal buff ({1}) from {0}", args.Player.Name, type); - args.Player.Kick($"Added buff to NPC abnormally.", true); + TShock.Log.ConsoleDebug("Bouncer / OnNPCAddBuff rejected abnormal buff ({0}) added to {1} ({2}) from {3}.", type, npc.TypeName, npc.netID, args.Player.Name); + args.Player.Kick($"Added buff to {npc.TypeName} NPC abnormally.", true); args.Handled = true; } } From e30b851b0fd73f786706c4ddb668be81ba0b7da4 Mon Sep 17 00:00:00 2001 From: stacey <57187883+moisterrific@users.noreply.github.com> Date: Wed, 26 May 2021 19:37:12 -0400 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 246db4f5..5ee1cd6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed torchgod settings to include whether or not torchgod has been fought by the player before and respect `usingBiomeTorches` setting. (@Quinci135) * Fixed /worldmode not synchronising data to players after updating the world state (@bartico6, @Arthri) * Added `OnSendNetData` hook to TSAPI, which enables developers to intercept traffic being sent from the server to clients. (@Stealownz) +* Fixed false positive `OnNPCAddBuff` detection when throwing rotten eggs at town NPCs while wearing Frost armor set. (@moisterrific) ## TShock 4.5.3 * Added permissions for using Teleportation Potions, Magic Conch, and Demon Conch. (@drunderscore)