Skip to content

Commit

Permalink
Show State for ModdedChatSpam check
Browse files Browse the repository at this point in the history
  • Loading branch information
sgkoishi committed Apr 14, 2024
1 parent be5aeaf commit 790806b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Core/Modded.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,11 @@ static bool ModdedFakeName(int whoAmI, Span<byte> 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)
Expand Down

0 comments on commit 790806b

Please sign in to comment.