From 790806b6637f2c10459ea119bf6333b6267f3cf9 Mon Sep 17 00:00:00 2001 From: SGKoishi Date: Sat, 13 Apr 2024 20:28:06 -0700 Subject: [PATCH] Show State for ModdedChatSpam check --- Core/Modded.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Core/Modded.cs b/Core/Modded.cs index 159465a..2afaf39 100644 --- a/Core/Modded.cs +++ b/Core/Modded.cs @@ -64,13 +64,11 @@ static bool ModdedFakeName(int whoAmI, Span data) var whoAmI = args.Instance.whoAmI; if (ModdedEarlyChatSpam(whoAmI, args.PacketId)) { - Terraria.NetMessage.TrySendData((int) PacketTypes.Disconnect, whoAmI, -1, Terraria.Lang.mp[1].ToNetworkText()); this.Statistics.ModdedEarlyChatSpam++; - TShockAPI.TShock.Log.ConsoleInfo($"Unusual chat detected and disconnected. ({Terraria.Netplay.Clients[whoAmI].Socket.GetRemoteAddress()})"); - // Stop handling any data + TShockAPI.TShock.Log.ConsoleInfo($"Unusual packet {args.PacketId} detected at state {Terraria.Netplay.Clients[whoAmI].State} and disconnected. ({Terraria.Netplay.Clients[whoAmI].Socket.GetRemoteAddress()})"); + args.CancelPacket(); Terraria.Netplay.Clients[whoAmI].PendingTermination = true; Terraria.Netplay.Clients[whoAmI].PendingTerminationApproved = true; - args.CancelPacket(); } if (args.PacketId == (byte) PacketTypes.PlayerInfo)