diff --git a/CHANGELOG.md b/CHANGELOG.md index f78915fe..57edca99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed an issue where player build permissions would reject gem lock changes, even if `RegionProtectGemLocks` was disabled in the config file. Now, players will be permitted to use gem locks if they don't have build permission in a region, but `RegionProtectGemLocks` is disabled. If `RegionProtectGemLocks` is enabled, players will be unable to use gem locks in a build region. (@hakusaro, @Kojirremer, @Arthri) * Fixed an issue where `/god [player]` would tell `[player]` that they were in godmode regardless of whether or not they were or not. (@hakusaro, @Kojirremer) * In `TSAPI`: Updated `PacketTypes` to support `SetMiscEventValues` (140), `RequestLucyPopup` (141), and `SyncProjectileTrackers` (142). (@hakusaro) +* Added `DisableDefaultIPBan` to the config file. If set to `true`, the server will not automatically IP ban players when banning them. This is useful if you run an intercepting proxy in front of TShock, and all players share the same IP. (@hakusaro, and Telegram user xmzzhh233) ## TShock 4.5.5 * Changed the world autosave message so that it no longer warns of a "potential lag spike." (@hakusaro) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 8d620e73..00a745f9 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1514,6 +1514,11 @@ namespace TShockAPI if (!exactTarget && !banAccount && !banUuid && !banName && !banIp) { banAccount = banUuid = banIp = true; + + if (TShock.Config.Settings.DisableDefaultIPBan) + { + banIp = false; + } } reason = reason ?? "Banned"; diff --git a/TShockAPI/Configuration/TShockConfig.cs b/TShockAPI/Configuration/TShockConfig.cs index 38ed0c46..18499f87 100644 --- a/TShockAPI/Configuration/TShockConfig.cs +++ b/TShockAPI/Configuration/TShockConfig.cs @@ -312,6 +312,10 @@ namespace TShockAPI.Configuration [Description("The reason given if banning a mediumcore player on death.")] public string MediumcoreBanReason = "Death results in a ban"; + /// Disbales IP bans by default, if no arguments are passed to the ban command. + [Description("Disbales IP bans by default, if no arguments are passed to the ban command.")] + public bool DisableDefaultIPBan; + /// Enable or disable the whitelist based on IP addresses in the whitelist.txt file. [Description("Enable or disable the whitelist based on IP addresses in the whitelist.txt file.")] public bool EnableWhitelist;