From 98eed425e238cad814c85a754053b2f48b117a5c Mon Sep 17 00:00:00 2001 From: ohayo Date: Wed, 12 Feb 2025 21:51:14 +1000 Subject: [PATCH] Suppress logging of un-spawnable npcs Not anything related to the handshake fixes, but still a nice fix which could help server owners deal with mischievous client users. --- TShockAPI/GetDataHandlers.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 684d7f3e..1454299b 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -3648,10 +3648,15 @@ namespace TShockAPI thing = GetString("{0} summoned the {1}!", args.Player.Name, npc.FullName); break; } - if (TShock.Config.Settings.AnonymousBossInvasions) - TShock.Utils.SendLogs(thing, Color.PaleVioletRed, args.Player); - else - TShock.Utils.Broadcast(thing, 175, 75, 255); + + if (NPCID.Sets.MPAllowedEnemies[thingType]) + { + if (TShock.Config.Settings.AnonymousBossInvasions) + TShock.Utils.SendLogs(thing, Color.PaleVioletRed, args.Player); + else + TShock.Utils.Broadcast(thing, 175, 75, 255); + } + return false; }