From fa6a39aafebf723134217583d552fd86b5b92d68 Mon Sep 17 00:00:00 2001 From: moisterrific <57187883+moisterrific@users.noreply.github.com> Date: Thu, 4 Jun 2020 20:51:00 -0400 Subject: [PATCH 1/3] Add KickOnThresholdBroken for more thresholds There's KickOnDamageThresholdBroken but no option for kick for other thresholds, thought I should add it. --- TShockAPI/ConfigFile.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index 89b3c702..996823b1 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -272,22 +272,42 @@ namespace TShockAPI /// Disables a player and reverts their actions if this number of tile kills is exceeded within 1 second. [Description("Disables a player and reverts their actions if this number of tile kills is exceeded within 1 second.")] public int TileKillThreshold = 60; + + /// Whether or not to kick users when they surpass the TileKill threshold. + [Description("Whether or not to kick users when they surpass the TileKill threshold.")] + public bool KickOnTileKillThresholdBroken = false; /// Disables a player and reverts their actions if this number of tile places is exceeded within 1 second. [Description("Disables a player and reverts their actions if this number of tile places is exceeded within 1 second.")] public int TilePlaceThreshold = 32; + + /// Whether or not to kick users when they surpass the TilePlace threshold. + [Description("Whether or not to kick users when they surpass the TilePlace threshold.")] + public bool KickOnTilePlaceThresholdBroken = false; /// Disables a player if this number of liquid sets is exceeded within 1 second. [Description("Disables a player if this number of liquid sets is exceeded within 1 second.")] public int TileLiquidThreshold = 50; + + /// Whether or not to kick users when they surpass the TileLiquid threshold. + [Description("Whether or not to kick users when they surpass the TileLiquid threshold.")] + public bool KickOnTileLiquidThresholdBroken = false; /// Disable a player if this number of projectiles is created within 1 second. [Description("Disable a player if this number of projectiles is created within 1 second.")] public int ProjectileThreshold = 50; + + /// Whether or not to kick users when they surpass the Projectile threshold. + [Description("Whether or not to kick users when they surpass the Projectile threshold.")] + public bool KickOnProjectileThresholdBroken = false; /// Disables a player if this number of HealOtherPlayer packets is sent within 1 second. [Description("Disables a player if this number of HealOtherPlayer packets is sent within 1 second.")] public int HealOtherThreshold = 50; + + /// Whether or not to kick users when they surpass the HealOther threshold. + [Description("Whether or not to kick users when they surpass the HealOther threshold.")] + public bool KickOnHealOtherThresholdBroken = false; /// Whether or not to ignore shrapnel from crystal bullets for the projectile threshold count. [Description("Whether or not to ignore shrapnel from crystal bullets for the projectile threshold count.")] @@ -452,6 +472,10 @@ namespace TShockAPI /// Disables a player if this number of tiles is painted within 1 second. [Description("Disables a player if this number of tiles is painted within 1 second.")] public int TilePaintThreshold = 15; + + /// Whether or not to kick users when they surpass the TilePaint threshold. + [Description("Whether or not to kick users when they surpass the TilePaint threshold.")] + public bool KickOnTilePaintThresholdBroken = false; /// Forces Halloween-only events to occur all year. [Description("Forces Halloween-only events to occur all year.")] From bcdd0dc8be9b3985bdc37824d7832a51671cf05a Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Fri, 5 Jun 2020 03:46:04 +0200 Subject: [PATCH 2/3] GetDataHandler - Add missing PlayerInfo data. --- TShockAPI/GetDataHandlers.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 496a7053..931167c0 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2142,14 +2142,20 @@ namespace TShockAPI byte difficulty = 0; if (extra[0]) { - difficulty++; + difficulty = 1; } else if (extra[1]) { - difficulty += 2; + difficulty = 2; + } + else if (extra[3]) + { + difficulty = 3; } - bool extraSlot = extra[2]; + BitsByte torchFlags = args.Data.ReadInt8(); + bool usingBiomeTorches = torchFlags[0]; + bool happyFunTorchTime = torchFlags[1]; if (OnPlayerInfo(args.Player, args.Data, playerid, hair, skinVariant, difficulty, name)) { From b0c512a12719a29173696ddbfd49b376c37325d8 Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Fri, 5 Jun 2020 03:47:02 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0906ec4..9a0712a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Add SyncTilePicking event. This is called when a player damages a tile. Implementing SyncTilePickingHandler and patching tile damaging related exploits. (Preventing player sending invalid world position data which disconnects other players.) * Fix the issue where mobs could not be fished out during bloodmoon because of Bouncer checks. (@Patrikkk) * Update for OTAPI 2.0.0.37 and Terraria 1.4.0.5. (@hakusaro, @Patrikkk) +* Adding missing PlayerInfo data in GetDataHandler. (@Patrikkk) ## TShock 4.4.0 (Pre-release 10) * Fix all rope coils. (@Olink)