From acb6a96245609c90546d5ecb5da7192562df23c2 Mon Sep 17 00:00:00 2001 From: shell627 <69633838+Terrarxxn@users.noreply.github.com> Date: Wed, 1 Dec 2021 00:18:02 +0600 Subject: [PATCH 01/15] Fix item dupe via /logout & NPC (#2495 issue) --- CHANGELOG.md | 1 + TShockAPI/Commands.cs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62a73f8c..43c4b274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin ## TShock 4.5.12 * Fixed the ability to spawn Zenith projectile with non-original items. (@AgaSpace) +* Fixed item dupe via /logout & NPC. (@Terrarxxn) ## TShock 4.5.11 * Add the new allowed buff TentacleSpike to NPC buff cheat detection bouncer. (@sgkoishi) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 71e10a9d..09d4b253 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -911,6 +911,12 @@ namespace TShockAPI return; } + if (args.Player.TPlayer.talkNPC != -1) + { + args.Player.SendErrorMessage("Please close NPC window for logging out."); + return; + } + args.Player.Logout(); args.Player.SendSuccessMessage("You have been successfully logged out of your account."); if (Main.ServerSideCharacter) From e9b86b8f624b68fd6737dd0b17f98832f5ccbbda Mon Sep 17 00:00:00 2001 From: James Puleo Date: Fri, 16 Jul 2021 02:09:36 -0400 Subject: [PATCH 02/15] Improved the `/grow` command to reduce code duplication, use `TileID` constants for less ambiguous types. --- CHANGELOG.md | 3 + TShockAPI/Commands.cs | 329 +++++++++++++----------------------------- 2 files changed, 104 insertions(+), 228 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c7a1e596..9afbf709 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,9 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Do not forget to sign every line you change with your name. (@hakusaro) * If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. +## Upcoming changes +* Improved the `/grow` command to reduce code duplication, use `TileID` constants for less ambiguous types. (@drunderscore) + ## TShock 4.5.12 * Fixed the ability to spawn Zenith projectile with non-original items. (@AgaSpace) * Added hook `GetDataHandlers.OnNpcTalk` for NpcTalk and a handler for it that stops unregistered and logged out players from interacting with NPCs, preventing them from smuggling or duplicating items via NPC item slots. (@tru321) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 71e10a9d..57e99513 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -6301,7 +6301,7 @@ namespace TShockAPI public static void Grow(CommandArgs args) { - bool growevilAmb = args.Player.HasPermission(Permissions.growevil); + bool canGrowEvil = args.Player.HasPermission(Permissions.growevil); string subcmd = args.Parameters.Count == 0 ? "help" : args.Parameters[0].ToLower(); var name = "Fail"; @@ -6343,284 +6343,163 @@ namespace TShockAPI } break; - case "basic": - for (int i = x - 2; i < x + 3; i++) + bool rejectCannotGrowEvil() { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 2; - Main.tile[i, y].wall = 0; + if(!canGrowEvil) + { + args.Player.SendErrorMessage("You do not have permission to grow this tree type"); + return false; + } + + return true; } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowTree(x, y); - name = "Basic Tree"; + + bool prepareAreaForGrow(ushort groundType = TileID.Grass, bool evil = false) + { + if(evil && !rejectCannotGrowEvil()) + return false; + + for (var i = x - 2; i < x + 3; i++) + { + Main.tile[i, y].active(true); + Main.tile[i, y].type = groundType; + Main.tile[i, y].wall = WallID.None; + } + Main.tile[x, y - 1].wall = WallID.None; + + return true; + } + + bool growTree(ushort groundType, string fancyName, bool evil = false) + { + if(!prepareAreaForGrow(groundType, evil)) + return false; + WorldGen.GrowTree(x, y); + name = fancyName; + + return true; + } + + bool growTreeByType(ushort groundType, string fancyName, ushort typeToPrepare = 2, bool evil = false) + { + if(!prepareAreaForGrow(typeToPrepare, evil)) + return false; + WorldGen.TryGrowingTreeByType(groundType, x, y); + name = fancyName; + + return true; + } + + bool growPalmTree(ushort sandType, ushort supportingType, string properName, bool evil = false) + { + if(evil && !rejectCannotGrowEvil()) + return false; + + for (int i = x - 2; i < x + 3; i++) + { + Main.tile[i, y].active(true); + Main.tile[i, y].type = sandType; + Main.tile[i, y].wall = WallID.None; + } + for (int i = x - 2; i < x + 3; i++) + { + Main.tile[i, y + 1].active(true); + Main.tile[i, y + 1].type = supportingType; + Main.tile[i, y + 1].wall = WallID.None; + } + + Main.tile[x, y - 1].wall = WallID.None; + WorldGen.GrowPalmTree(x, y); + + name = properName; + + return true; + } + + case "basic": + growTree(TileID.Grass, "Basic Tree"); break; case "boreal": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 147; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowTree(x, y); - name = "Boreal Tree"; + growTree(TileID.SnowBlock, "Boreal Tree"); break; case "mahogany": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 60; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowTree(x, y); - name = "Rich Mahogany"; + growTree(TileID.JungleGrass, "Rich Mahogany"); break; case "sakura": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 2; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(596, x, y); - name = "Sakura Tree"; + growTreeByType(TileID.VanityTreeSakura, "Sakura Tree"); break; case "willow": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 2; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(616, x, y); - name = "Willow Tree"; + growTreeByType(TileID.VanityTreeYellowWillow, "Willow Tree"); break; case "shadewood": - if (growevilAmb) - { - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 199; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowTree(x, y); - name = "Shadewood tree"; - } - else args.Player.SendErrorMessage("You do not have permission to grow this tree type"); + if(!growTree(TileID.CrimsonGrass, "Shadewood Tree", true)) + return; break; case "ebonwood": - if (growevilAmb) - { - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 23; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowTree(x, y); - name = "Ebonwood Tree"; - } - else args.Player.SendErrorMessage("You do not have permission to grow this tree type"); + if(!growTree(TileID.CorruptGrass, "Ebonwood Tree", true)) + return; break; case "pearlwood": - if (growevilAmb) - { - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 109; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowTree(x, y); - name = "Pearlwood Tree"; - } - else args.Player.SendErrorMessage("You do not have permission to grow this tree type"); + if(!growTree(TileID.HallowedGrass, "Pearlwood Tree", true)) + return; break; case "palm": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 53; - Main.tile[i, y].wall = 0; - } - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y + 1].active(true); - Main.tile[i, y + 1].type = 397; - Main.tile[i, y + 1].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowPalmTree(x, y); - name = "Desert Palm"; + growPalmTree(TileID.Sand, TileID.HardenedSand, "Desert Palm"); break; case "hallowpalm": - if (growevilAmb) - { - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 116; - Main.tile[i, y].wall = 0; - } - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y + 1].active(true); - Main.tile[i, y + 1].type = 402; - Main.tile[i, y + 1].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowPalmTree(x, y); - name = "Hallow Palm"; - } - else args.Player.SendErrorMessage("You do not have permission to grow this tree type"); + if(!growPalmTree(TileID.Pearlsand, TileID.HallowHardenedSand, "Hallow Palm", true)) + return; break; case "crimsonpalm": - if (growevilAmb) - { - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 234; - Main.tile[i, y].wall = 0; - } - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y + 1].active(true); - Main.tile[i, y + 1].type = 399; - Main.tile[i, y + 1].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowPalmTree(x, y); - name = "Crimson Palm"; - } - else args.Player.SendErrorMessage("You do not have permission to grow this tree type"); + if(!growPalmTree(TileID.Crimsand, TileID.CrimsonHardenedSand, "Crimson Palm", true)) + return; break; case "corruptpalm": - if (growevilAmb) - { - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 112; - Main.tile[i, y].wall = 0; - } - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y + 1].active(true); - Main.tile[i, y + 1].type = 398; - Main.tile[i, y + 1].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.GrowPalmTree(x, y); - name = "Corruption Palm"; - } - else args.Player.SendErrorMessage("You do not have permission to grow this tree type"); + if(!growPalmTree(TileID.Ebonsand, TileID.CorruptHardenedSand, "Corruption Palm", true)) + return; break; case "topaz": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 1; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(583, x, y); - name = "Topaz Gemtree"; + growTreeByType(TileID.TreeTopaz, "Topaz Gemtree", 1); break; case "amethyst": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 1; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(584, x, y); - name = "Amethyst Gemtree"; + growTreeByType(TileID.TreeAmethyst, "Amethyst Gemtree", 1); break; case "sapphire": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 1; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(585, x, y); - name = "Sapphire Gemtree"; + growTreeByType(TileID.TreeSapphire, "Sapphire Gemtree", 1); break; case "emerald": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 1; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(586, x, y); - name = "Emerald Gemtree"; + growTreeByType(TileID.TreeEmerald, "Emerald Gemtree", 1); break; case "ruby": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 1; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(587, x, y); - name = "Ruby Gemtree"; + growTreeByType(TileID.TreeRuby, "Ruby Gemtree", 1); break; case "diamond": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 1; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(588, x, y); - name = "Diamond Gemtree"; + growTreeByType(TileID.TreeDiamond, "Diamond Gemtree", 1); break; case "amber": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 1; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; - WorldGen.TryGrowingTreeByType(589, x, y); - name = "Amber Gemtree"; + growTreeByType(TileID.TreeAmber, "Amber Gemtree", 1); break; case "cactus": - Main.tile[x, y].type = 53; + Main.tile[x, y].type = TileID.Sand; WorldGen.GrowCactus(x, y); name = "Cactus"; break; @@ -6628,19 +6507,13 @@ namespace TShockAPI case "herb": Main.tile[x, y].active(true); Main.tile[x, y].frameX = 36; - Main.tile[x, y].type = 83; + Main.tile[x, y].type = TileID.MatureHerbs; WorldGen.GrowAlch(x, y); name = "Herb"; break; case "mushroom": - for (int i = x - 2; i < x + 3; i++) - { - Main.tile[i, y].active(true); - Main.tile[i, y].type = 70; - Main.tile[i, y].wall = 0; - } - Main.tile[x, y - 1].wall = 0; + prepareAreaForGrow(TileID.MushroomGrass); WorldGen.GrowShroom(x, y); name = "Glowing Mushroom Tree"; break; From 6591b455fc791e39a521cbdf52c7ad79f8a43021 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Wed, 16 Feb 2022 19:45:57 -0800 Subject: [PATCH 03/15] Version tick: 4.5.13 --- CHANGELOG.md | 3 ++- TShockAPI/TShock.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddd198e3..9671fbf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Do not insert tabs into this file, under any circumstances, ever. * Do not forget to sign every line you change with your name. (@hakusaro) * If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. -## Upcoming changes + +## TShock 4.5.13 * Added hook `GetDataHandlers.OnReleaseNpc` to handling ReleaseNPC packet and a bouncer to stops unregistered and logged out players on SSC servers from releasing critters NPC. The bouncer has additional filter to stops players who tried to release different critter using crafted packet, e.g. using bunny item to release golden bunny. (@tru321) * Added filter in `GetDataHandlers.HandleCatchNpc` that stops unregistered and logged out players on SSC servers to catch critters. (@tru321) * Fixed rejection check inside of `HandlePaintTile` to account for the Paint Sprayer (or Architect Gizmo Pack) being inside your inventory, rather than on an accessory slot. (@drunderscore) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 7e15128c..337899d1 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -58,7 +58,7 @@ namespace TShockAPI /// VersionNum - The version number the TerrariaAPI will return back to the API. We just use the Assembly info. public static readonly Version VersionNum = Assembly.GetExecutingAssembly().GetName().Version; /// VersionCodename - The version codename is displayed when the server starts. Inspired by software codenames conventions. - public static readonly string VersionCodename = "Herrscher of Logic"; + public static readonly string VersionCodename = "Let us know if you're using this on raspberry pi or we might drop support for it"; /// SavePath - This is the path TShock saves its data in. This path is relative to the TerrariaServer.exe (not in ServerPlugins). public static string SavePath = "tshock"; From 4cb6a5eb4b622343e6876710a2f2f1f38adc64c4 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Wed, 16 Feb 2022 19:55:06 -0800 Subject: [PATCH 04/15] Really version tick to 4.5.13 this time. --- TShockAPI/Properties/AssemblyInfo.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index df44eb86..d3abb901 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -53,5 +53,5 @@ using System.Runtime.InteropServices; // Also, be sure to release on github with the exact assembly version tag as below // so that the update manager works correctly (via the Github releases api and mimic) -[assembly: AssemblyVersion("4.5.12")] -[assembly: AssemblyFileVersion("4.5.12")] +[assembly: AssemblyVersion("4.5.13")] +[assembly: AssemblyFileVersion("4.5.13")] From 4aa75fe0235117c7dffd71da7ced9a62dfce5598 Mon Sep 17 00:00:00 2001 From: Chris <2648373+QuiCM@users.noreply.github.com> Date: Tue, 22 Feb 2022 19:15:58 +1030 Subject: [PATCH 05/15] Add suggestion Co-authored-by: Lucas Nicodemus --- TShockAPI/Commands.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 09d4b253..fd065025 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -913,7 +913,7 @@ namespace TShockAPI if (args.Player.TPlayer.talkNPC != -1) { - args.Player.SendErrorMessage("Please close NPC window for logging out."); + args.Player.SendErrorMessage("Please close NPC windows before logging out."); return; } From 2f31322b5f8eb875f7f38f09412fd476e2641f03 Mon Sep 17 00:00:00 2001 From: Chris <2648373+QuiCM@users.noreply.github.com> Date: Wed, 23 Feb 2022 20:53:31 +1030 Subject: [PATCH 06/15] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 93f4893e..6868d958 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin ## Upcoming changes * Improved the `/grow` command to reduce code duplication, use `TileID` constants for less ambiguous types. (@drunderscore) +* Fixed item dupe via /logout & NPC. (@Terrarxxn) ## TShock 4.5.13 * Added hook `GetDataHandlers.OnReleaseNpc` to handling ReleaseNPC packet and a bouncer to stops unregistered and logged out players on SSC servers from releasing critters NPC. The bouncer has additional filter to stops players who tried to release different critter using crafted packet, e.g. using bunny item to release golden bunny. (@tru321) @@ -27,7 +28,6 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin ## TShock 4.5.12 * Fixed the ability to spawn Zenith projectile with non-original items. (@AgaSpace) -* Fixed item dupe via /logout & NPC. (@Terrarxxn) * Added hook `GetDataHandlers.OnNpcTalk` for NpcTalk and a handler for it that stops unregistered and logged out players from interacting with NPCs, preventing them from smuggling or duplicating items via NPC item slots. (@tru321) * Fixed the ability to create custom messages with your death (or the death of another player) (@AgaSpace) * Added the `OnSignRead` handler in `GetDataHandler`, and added the `SignRead` event. Added check to ensure the sign being read is within world bounds `(x >= 0 && y >= 0 && x < Main.maxTilesX && y < Main.maxTilesY)`. (@drunderscore) From 1b96ed8992110c5bbcc2ef952cc98459ea194dee Mon Sep 17 00:00:00 2001 From: Patrikkk Date: Fri, 25 Feb 2022 04:42:16 +0100 Subject: [PATCH 07/15] Adding EntitySource parameter to the used at NewNPC and NewItem methods. I've decided to use the DebugCommand entity source for anything server related, as it makes the most sense as source. Feel free to discuss. --- TShockAPI/TSPlayer.cs | 2 +- TShockAPI/TSServerPlayer.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/TShockAPI/TSPlayer.cs b/TShockAPI/TSPlayer.cs index 6a04bf0c..7b452fe4 100644 --- a/TShockAPI/TSPlayer.cs +++ b/TShockAPI/TSPlayer.cs @@ -1379,7 +1379,7 @@ namespace TShockAPI /// The item prefix. public virtual void GiveItem(int type, int stack, int prefix = 0) { - int itemIndex = Item.NewItem((int)X, (int)Y, TPlayer.width, TPlayer.height, type, stack, true, prefix, true); + int itemIndex = Item.NewItem(new EntitySource_DebugCommand(), (int)X, (int)Y, TPlayer.width, TPlayer.height, type, stack, true, prefix, true); SendData(PacketTypes.ItemDrop, "", itemIndex); } diff --git a/TShockAPI/TSServerPlayer.cs b/TShockAPI/TSServerPlayer.cs index d414d424..14ea674b 100644 --- a/TShockAPI/TSServerPlayer.cs +++ b/TShockAPI/TSServerPlayer.cs @@ -26,6 +26,7 @@ using TShockAPI; using TShockAPI.DB; using Terraria.Localization; using System.Linq; +using Terraria.DataStructures; namespace TShockAPI { @@ -166,7 +167,7 @@ namespace TShockAPI int spawnTileY; TShock.Utils.GetRandomClearTileWithInRange(startTileX, startTileY, tileXRange, tileYRange, out spawnTileX, out spawnTileY); - NPC.NewNPC(spawnTileX * 16, spawnTileY * 16, type); + NPC.NewNPC(new EntitySource_DebugCommand(), spawnTileX * 16, spawnTileY * 16, type); } } From e2e5c15be087bdf857b1a6be9c6fb9b284ea5af1 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 00:47:22 -0800 Subject: [PATCH 08/15] Update submodule for OTAPI 2.0.0.48 --- TerrariaServerAPI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerrariaServerAPI b/TerrariaServerAPI index 53146693..16934495 160000 --- a/TerrariaServerAPI +++ b/TerrariaServerAPI @@ -1 +1 @@ -Subproject commit 5314669394193a8a9a6a40036e00bcf8838254af +Subproject commit 1693449540ba0788503e49e82690da0f4d8f74d9 From 9bcec7b2d87a4dbe5a96d666e2d83aa5a16cbf77 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 00:48:43 -0800 Subject: [PATCH 09/15] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6868d958..c5fa0110 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,10 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Do not forget to sign every line you change with your name. (@hakusaro) * If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. - ## Upcoming changes * Improved the `/grow` command to reduce code duplication, use `TileID` constants for less ambiguous types. (@drunderscore) * Fixed item dupe via /logout & NPC. (@Terrarxxn) +* Added preliminary support for Terraria 1.4.3.4 (@SignatureBeef, @Patrikkk, @hakusaro) ## TShock 4.5.13 * Added hook `GetDataHandlers.OnReleaseNpc` to handling ReleaseNPC packet and a bouncer to stops unregistered and logged out players on SSC servers from releasing critters NPC. The bouncer has additional filter to stops players who tried to release different critter using crafted packet, e.g. using bunny item to release golden bunny. (@tru321) From 18fcfe14c9d42efb80a613b268d8920c652b4f91 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 01:08:13 -0800 Subject: [PATCH 10/15] Update submodule to target 91e94388f15bd9b40786e052ef1a06173830b09d --- TerrariaServerAPI | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TerrariaServerAPI b/TerrariaServerAPI index 16934495..91e94388 160000 --- a/TerrariaServerAPI +++ b/TerrariaServerAPI @@ -1 +1 @@ -Subproject commit 1693449540ba0788503e49e82690da0f4d8f74d9 +Subproject commit 91e94388f15bd9b40786e052ef1a06173830b09d From 21d2c0ad10faf6548d0b38e8d7267de9fd3ecfe9 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 01:23:07 -0800 Subject: [PATCH 11/15] Switch GitHub Actions runner to use windows-2019 GitHub is apparently in a 4-week migration to switch to Windows Server 2022 instead of Windows Server 2019 for `windows-latest` tags, and we've been caught in the middle of the transition with a Terraria update. Rather than trying to update our build scripts to run on 2022, this temporarily downgrades us to Windows Server 2019 so we can actually update Terraria and not windows. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8173267b..fda7514d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: [push, pull_request] jobs: build: - runs-on: windows-latest + runs-on: windows-2019 strategy: matrix: mode: ["Debug", "Release"] From c21a80814f6f508862e696069ca7ee68a04b5d57 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 01:37:07 -0800 Subject: [PATCH 12/15] Verison tick: 4.5.14 --- CHANGELOG.md | 3 +++ TShockAPI/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5fa0110..687530af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * If there is no section called "Upcoming changes" below this line, please add one with `## Upcoming changes` as the first line, and then a bulleted item directly after with the first change. ## Upcoming changes +* World peace + +## TShock 4.5.14 * Improved the `/grow` command to reduce code duplication, use `TileID` constants for less ambiguous types. (@drunderscore) * Fixed item dupe via /logout & NPC. (@Terrarxxn) * Added preliminary support for Terraria 1.4.3.4 (@SignatureBeef, @Patrikkk, @hakusaro) diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index d3abb901..9b2f98ef 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -53,5 +53,5 @@ using System.Runtime.InteropServices; // Also, be sure to release on github with the exact assembly version tag as below // so that the update manager works correctly (via the Github releases api and mimic) -[assembly: AssemblyVersion("4.5.13")] -[assembly: AssemblyFileVersion("4.5.13")] +[assembly: AssemblyVersion("4.5.14")] +[assembly: AssemblyFileVersion("4.5.14")] From b80000fb0689240632961f062fe9dee9bf972a2d Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 01:41:29 -0800 Subject: [PATCH 13/15] Add more info about IEntitySource to changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 687530af..04356e09 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 ## TShock 4.5.14 * Improved the `/grow` command to reduce code duplication, use `TileID` constants for less ambiguous types. (@drunderscore) * Fixed item dupe via /logout & NPC. (@Terrarxxn) -* Added preliminary support for Terraria 1.4.3.4 (@SignatureBeef, @Patrikkk, @hakusaro) +* Added preliminary support for Terraria 1.4.3.4. Note that this has the side-effect of adding `IEntitySource` as the first parameter to `Item.NewItem` and `NPC.NewNPC`, and in `TSAPI`, `NpcLootDropEventArgs` passes `IEntitySource` as `Source`. If you're updaitng a plugin, you can either make something that implements with `IEntitySource` or just use `new EntitySource_DebugCommand()` [like TShock does](https://github.com/Pryaxis/TShock/commit/1b96ed8992110c5bbcc2ef952cc98459ea194dee). (@SignatureBeef, @Patrikkk, @hakusaro) ## TShock 4.5.13 * Added hook `GetDataHandlers.OnReleaseNpc` to handling ReleaseNPC packet and a bouncer to stops unregistered and logged out players on SSC servers from releasing critters NPC. The bouncer has additional filter to stops players who tried to release different critter using crafted packet, e.g. using bunny item to release golden bunny. (@tru321) From d21ff1988e8941f632f439c1dfa2460bcc4d0842 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 01:42:21 -0800 Subject: [PATCH 14/15] Update changelog *again* --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04356e09..c25a6fdc 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 ## TShock 4.5.14 * Improved the `/grow` command to reduce code duplication, use `TileID` constants for less ambiguous types. (@drunderscore) * Fixed item dupe via /logout & NPC. (@Terrarxxn) -* Added preliminary support for Terraria 1.4.3.4. Note that this has the side-effect of adding `IEntitySource` as the first parameter to `Item.NewItem` and `NPC.NewNPC`, and in `TSAPI`, `NpcLootDropEventArgs` passes `IEntitySource` as `Source`. If you're updaitng a plugin, you can either make something that implements with `IEntitySource` or just use `new EntitySource_DebugCommand()` [like TShock does](https://github.com/Pryaxis/TShock/commit/1b96ed8992110c5bbcc2ef952cc98459ea194dee). (@SignatureBeef, @Patrikkk, @hakusaro) +* Added preliminary support for Terraria 1.4.3.4. Note that this has the side-effect of adding `IEntitySource` as the first parameter to `Item.NewItem` and `NPC.NewNPC`, and in `TSAPI`, `NpcLootDropEventArgs` passes `IEntitySource` as `Source`. If you're updating a plugin, you can either make something that implements with `IEntitySource` or just use `new EntitySource_DebugCommand()` [like TShock does](https://github.com/Pryaxis/TShock/commit/1b96ed8992110c5bbcc2ef952cc98459ea194dee). (@SignatureBeef, @Patrikkk, @hakusaro) ## TShock 4.5.13 * Added hook `GetDataHandlers.OnReleaseNpc` to handling ReleaseNPC packet and a bouncer to stops unregistered and logged out players on SSC servers from releasing critters NPC. The bouncer has additional filter to stops players who tried to release different critter using crafted packet, e.g. using bunny item to release golden bunny. (@tru321) From 92ea78f4c8874a5be27a1a63eb12467767675e35 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 25 Feb 2022 01:45:55 -0800 Subject: [PATCH 15/15] Remove Rpi doomsday scenario --- TShockAPI/TShock.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 337899d1..8a0ac2a9 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -58,7 +58,7 @@ namespace TShockAPI /// VersionNum - The version number the TerrariaAPI will return back to the API. We just use the Assembly info. public static readonly Version VersionNum = Assembly.GetExecutingAssembly().GetName().Version; /// VersionCodename - The version codename is displayed when the server starts. Inspired by software codenames conventions. - public static readonly string VersionCodename = "Let us know if you're using this on raspberry pi or we might drop support for it"; + public static readonly string VersionCodename = "Minutes to Midnight"; /// SavePath - This is the path TShock saves its data in. This path is relative to the TerrariaServer.exe (not in ServerPlugins). public static string SavePath = "tshock";