From 2ed9e320c143915b1bea4c030a5c217f130b2982 Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Sat, 13 Jun 2020 11:58:36 +0200 Subject: [PATCH 1/5] Bouncer OnTileEdit - Remove redundant Boulder placement check --- CHANGELOG.md | 1 + TShockAPI/Bouncer.cs | 8 -------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8c1336f..da149c8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed an issue in the SendTileSquare handler that was rejecting valid tile objects (@QuiCM) * Fixed the issue where players were unable to place regular ropes because of the valid placement being caught in Bouncer OnTileEdit. (@Patrikkk) * Remove checks that prevented people placing personal storage tiles in SSC as the personal storage is synced with the server.(@Patrikkk) +* Remove redundant Boulder placement check that prevents placing them, as it no longer crashes the server. "1.2.3: Boulders with Chests on them no longer crash the game if the boulder is hit." (@kevzhao2, @Patrikkk) ## TShock 4.4.0 (Pre-release 11) * New permission `tshock.tp.pylon` to enable teleporting via Teleportation Pylons (@QuiCM) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index e2580d87..0d98c11d 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -377,14 +377,6 @@ namespace TShockAPI args.Handled = true; return; } - if ((TShock.Utils.TilePlacementValid(tileX, tileY + 1) && Main.tile[tileX, tileY + 1].type == TileID.Boulder) || - (TShock.Utils.TilePlacementValid(tileX + 1, tileY + 1) && Main.tile[tileX + 1, tileY + 1].type == TileID.Boulder)) - { - TShock.Log.ConsoleDebug("Bouncer / OnTileEdit rejected from (validplacement) {0} {1} {2}", args.Player.Name, action, editData); - args.Player.SendTileSquare(tileX, tileY, 3); - args.Handled = true; - return; - } } } else if (action == EditAction.PlaceWire || action == EditAction.PlaceWire2 || action == EditAction.PlaceWire3) From 447cf9d21ea10a2f8a98376c470391b94df4bee2 Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Sat, 13 Jun 2020 12:08:58 +0200 Subject: [PATCH 2/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da149c8a..94b5f42c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed an issue in the SendTileSquare handler that was rejecting valid tile objects (@QuiCM) * Fixed the issue where players were unable to place regular ropes because of the valid placement being caught in Bouncer OnTileEdit. (@Patrikkk) * Remove checks that prevented people placing personal storage tiles in SSC as the personal storage is synced with the server.(@Patrikkk) -* Remove redundant Boulder placement check that prevents placing them, as it no longer crashes the server. "1.2.3: Boulders with Chests on them no longer crash the game if the boulder is hit." (@kevzhao2, @Patrikkk) +* Remove redundant Boulder placement check that prevented placing chests on them, as it is no longer possible to place a chest on a boulder, so nothing crashes the server. "1.2.3: Boulders with Chests on them no longer crash the game if the boulder is hit." (@kevzhao2, @Patrikkk) ## TShock 4.4.0 (Pre-release 11) * New permission `tshock.tp.pylon` to enable teleporting via Teleportation Pylons (@QuiCM) From 067006a092cf002d56fef1c135dc9a2788bedc5d Mon Sep 17 00:00:00 2001 From: stacey <57187883+moisterrific@users.noreply.github.com> Date: Sat, 13 Jun 2020 13:13:46 -0400 Subject: [PATCH 3/5] Add clarity to !HasPermission error messages And a few other minor formatting/grammar changes. --- TShockAPI/GetDataHandlers.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 931167c0..4a1c90fd 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -2628,7 +2628,7 @@ namespace TShockAPI if (Main.npc[id].townNPC && !args.Player.HasPermission(Permissions.hurttownnpc)) { - args.Player.SendErrorMessage("You do not have permission to hurt this NPC."); + args.Player.SendErrorMessage("You do not have permission to hurt Town NPCs."); args.Player.SendData(PacketTypes.NpcUpdate, "", id); TShock.Log.ConsoleDebug("GetDataHandlers / HandleNpcStrike rejected npc strike {0}", args.Player.Name); return true; @@ -3017,7 +3017,7 @@ namespace TShockAPI if (type == 1 && TShock.Config.DisableDungeonGuardian) { TShock.Log.ConsoleDebug("GetDataHandlers / HandleSpecial rejected type 1 for {0}", args.Player.Name); - args.Player.SendMessage("The Dungeon Guardian returned you to your spawn point", Color.Purple); + args.Player.SendMessage("The Dungeon Guardian returned you to your spawn point.", Color.Purple); args.Player.Spawn(PlayerSpawnContext.RecallFromItem); return true; } @@ -3025,7 +3025,7 @@ namespace TShockAPI if (type == 3 && !args.Player.HasPermission(Permissions.usesundial)) { TShock.Log.ConsoleDebug("GetDataHandlers / HandleSpecial rejected enchanted sundial permission {0}", args.Player.Name); - args.Player.SendErrorMessage("You do not have permission to use the Enchanted Sundial!"); + args.Player.SendErrorMessage("You do not have permission to use the Enchanted Sundial."); return true; } @@ -3070,7 +3070,7 @@ namespace TShockAPI if (!args.Player.HasPermission(Permissions.movenpc)) { TShock.Log.ConsoleDebug("GetDataHandlers / UpdateNPCHome rejected no permission {0}", args.Player.Name); - args.Player.SendErrorMessage("You do not have permission to relocate NPCs."); + args.Player.SendErrorMessage("You do not have permission to relocate Town NPCs."); args.Player.SendData(PacketTypes.UpdateNPCHome, "", id, Main.npc[id].homeTileX, Main.npc[id].homeTileY, Convert.ToByte(Main.npc[id].homeless)); return true; @@ -3097,14 +3097,14 @@ namespace TShockAPI if (bosses.Contains(thingType) && !args.Player.HasPermission(Permissions.summonboss)) { TShock.Log.ConsoleDebug("GetDataHandlers / HandleSpawnBoss rejected boss {0} {1}", args.Player.Name, thingType); - args.Player.SendErrorMessage("You do not have permission to summon a boss."); + args.Player.SendErrorMessage("You do not have permission to summon bosses."); return true; } if (invasions.Contains(thingType) && !args.Player.HasPermission(Permissions.startinvasion)) { TShock.Log.ConsoleDebug("GetDataHandlers / HandleSpawnBoss rejected invasion {0} {1}", args.Player.Name, thingType); - args.Player.SendErrorMessage("You do not have permission to start an invasion."); + args.Player.SendErrorMessage("You do not have permission to start invasions."); return true; } @@ -3302,8 +3302,8 @@ namespace TShockAPI if (type == 0 && !args.Player.HasPermission(Permissions.rod)) { TShock.Log.ConsoleDebug("GetDataHandlers / HandleTeleport rejected rod type {0} {1}", args.Player.Name, type); - args.Player.SendErrorMessage("You do not have permission to teleport."); - args.Player.Teleport(args.TPlayer.position.X, args.TPlayer.position.Y); + args.Player.SendErrorMessage("You do not have permission to teleport using items."); // Was going to write using RoD but Hook of Disonnance and Potion of Return both use the same teleport packet as RoD. + args.Player.Teleport(args.TPlayer.position.X, args.TPlayer.position.Y); // Suggest renaming rod permission unless someone plans to add separate perms for the other 2 tp items. return true; } @@ -3326,7 +3326,7 @@ namespace TShockAPI if (!args.Player.HasPermission(Permissions.wormhole)) { TShock.Log.ConsoleDebug("GetDataHandlers / HandleTeleport rejected p2p wormhole permission {0} {1}", args.Player.Name, type); - args.Player.SendErrorMessage("You do not have permission to teleport."); + args.Player.SendErrorMessage("You do not have permission to teleport using Wormhole Potions."); args.Player.Teleport(args.TPlayer.position.X, args.TPlayer.position.Y); return true; } @@ -3597,7 +3597,7 @@ namespace TShockAPI if (!args.Player.HasPermission(Permissions.startdd2)) { TShock.Log.ConsoleDebug("GetDataHandlers / HandleOldOnesArmy rejected permissions {0}", args.Player.Name); - args.Player.SendErrorMessage("You do not have permission to start the Old One's Army event."); + args.Player.SendErrorMessage("You do not have permission to start the Old One's Army."); return true; } From b831832fedbf729ac02b8528e0c3ec8e14d26e88 Mon Sep 17 00:00:00 2001 From: stacey <57187883+moisterrific@users.noreply.github.com> Date: Sat, 13 Jun 2020 13:17:24 -0400 Subject: [PATCH 4/5] Improved clarity for !HasPermission error msg --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 593e7c05..67d75f0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Fixed the issue where players were unable to place regular ropes because of the valid placement being caught in Bouncer OnTileEdit. (@Patrikkk) * Remove checks that prevented people placing personal storage tiles in SSC as the personal storage is synced with the server.(@Patrikkk) * Cleaned up a check in Bouner OnTileEdit where it checks for using the respective item when placing a tile to make it clearer. This change also fixed the issue in a previous commit where valid replace action was caught. Moved the check for max tile/wall types to the beginning of the method. (@Patrikkk) +* Improved clarity for insufficient permission related error messages. (@moisterrific) ## TShock 4.4.0 (Pre-release 11) * New permission `tshock.tp.pylon` to enable teleporting via Teleportation Pylons (@QuiCM) From 4949410cfaec31a51daced7c736bcd7c59e0b620 Mon Sep 17 00:00:00 2001 From: stacey <57187883+moisterrific@users.noreply.github.com> Date: Sat, 13 Jun 2020 13:26:34 -0400 Subject: [PATCH 5/5] minor grammar update --- TShockAPI/Handlers/NetModules/PylonHandler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Handlers/NetModules/PylonHandler.cs b/TShockAPI/Handlers/NetModules/PylonHandler.cs index 75ca0c1d..7cbe054b 100644 --- a/TShockAPI/Handlers/NetModules/PylonHandler.cs +++ b/TShockAPI/Handlers/NetModules/PylonHandler.cs @@ -51,7 +51,7 @@ namespace TShockAPI.Handlers.NetModules if (!player.HasPermission(Permissions.pylon)) { rejectPacket = true; - player.SendErrorMessage("You do not have permission to teleport with pylons."); + player.SendErrorMessage("You do not have permission to teleport using pylons."); return; } }