diff --git a/TShockAPI/DB/CharacterManager.cs b/TShockAPI/DB/CharacterManager.cs index 575ac3dc..5a5e13a6 100644 --- a/TShockAPI/DB/CharacterManager.cs +++ b/TShockAPI/DB/CharacterManager.cs @@ -189,6 +189,9 @@ namespace TShockAPI.DB if (!player.IsLoggedIn) return false; + if (player.State < 10) + return false; + if (player.HasPermission(Permissions.bypassssc) && !fromCommand) { TShock.Log.ConsoleInfo(GetParticularString("{0} is a player name", $"Skipping SSC save (due to tshock.ignore.ssc) for {player.Account.Name}")); diff --git a/TShockAPI/Handlers/SendTileRectHandler.cs b/TShockAPI/Handlers/SendTileRectHandler.cs index 3ff85fea..80d5a47c 100644 --- a/TShockAPI/Handlers/SendTileRectHandler.cs +++ b/TShockAPI/Handlers/SendTileRectHandler.cs @@ -38,6 +38,10 @@ namespace TShockAPI.Handlers { TileID.JungleGrass } }, + { TileID.AshPlants, new HashSet() + { + TileID.AshGrass + } }, }; /// @@ -67,6 +71,10 @@ namespace TShockAPI.Handlers { 9, 10, 11, 12, 13, 14, 15, 16, } }, + { TileID.AshPlants, new HashSet() + { + 6, 7, 8, 9, 10, + } }, }; /// @@ -173,6 +181,7 @@ namespace TShockAPI.Handlers } NetTile newTile = tiles[x, y]; + TileObjectData data; // If the new tile has an associated TileObjectData object, we take the tile and the surrounding tiles that make up the tile object @@ -210,10 +219,26 @@ namespace TShockAPI.Handlers case TileID.ShimmerMonolith: { // Allowed changes + + // Based on empirical tests, these should be some conservative upper bounds for framing values + if (newTile.FrameX != -1 || newTile.FrameY != -1) + { + if (newTile.FrameX is < 0 or > 1000) + { + processed[x, y] = true; + continue; + } + if (newTile.FrameY is < 0 or > 5000) + { + processed[x, y] = true; + continue; + } + } } break; default: { + processed[x, y] = true; continue; } } @@ -233,10 +258,26 @@ namespace TShockAPI.Handlers case TileID.TargetDummy: { // Allowed placements + + // Based on empirical tests, these should be some conservative upper bounds for framing values + if (newTile.FrameX != -1 || newTile.FrameY != -1) + { + if (newTile.FrameX is < 0 or > 1000) + { + processed[x, y] = true; + continue; + } + if (newTile.FrameY is < 0 or > 500) + { + processed[x, y] = true; + continue; + } + } } break; default: { + processed[x, y] = true; continue; } } diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 7a5a38af..65380a52 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -676,17 +676,13 @@ namespace TShockAPI if (args.Chest != null) { + // After checking for protected regions, no further range checking is necessarily because the client packet only specifies the + // inventory slot to quick stack. The vanilla Terraria server itself determines what chests are close enough to the player. if (Config.Settings.RegionProtectChests && !Regions.CanBuild((int)args.WorldPosition.X, (int)args.WorldPosition.Y, tsplr)) { args.Handled = true; return; } - - if (!tsplr.IsInRange(args.Chest.x, args.Chest.y)) - { - args.Handled = true; - return; - } } } diff --git a/docs/changelog.md b/docs/changelog.md index 2f0f20c9..c4a95d14 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -107,6 +107,9 @@ Use past tense when adding new entries; sign your name off when you add or chang * Fixed unable to use Purification/Evil Powder in jungle. (@sgkoishi) * Set the `GetDataHandledEventArgs.Player` property for the `SyncTilePicking` data handler. (@drunderscore) * Relaxed custom death message restrictions to allow Inferno potions in PvP. (@drunderscore) +* Allowed Flower Boots to place Ash Flowers on Ash Grass blocks. (@punchready) +* Removed unnecessary range check that artifically shortened quick stack reach. (@boddyn, #2885, @bcat) +* Improved the exploit protection in tile rect handling. (@punchready) ## TShock 5.1.3 * Added support for Terraria 1.4.4.9 via OTAPI 3.1.20. (@SignatureBeef)