From 0d2b59176047bc6777241c7a44b29adfe7b4d6e6 Mon Sep 17 00:00:00 2001 From: moisterrific <57187883+moisterrific@users.noreply.github.com> Date: Tue, 26 May 2020 13:45:31 -0400 Subject: [PATCH 1/7] Update NPCAddBuff to include Sparkle Slime debuff It's a new cosmetic debuff added in 1.4, like Wet and Slimed that can be applied to Town NPCs. Wiki: https://terraria.gamepedia.com/Sparkle_Slime_Balloon --- TShockAPI/Bouncer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index ad6e516a..b58681a4 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -1537,7 +1537,7 @@ namespace TShockAPI if (npc.townNPC && npc.netID != NPCID.Guide && npc.netID != NPCID.Clothier) { if (type != BuffID.Lovestruck && type != BuffID.Stinky && type != BuffID.DryadsWard && - type != BuffID.Wet && type != BuffID.Slimed) + type != BuffID.Wet && type != BuffID.Slimed && type != BuffID.GelBalloonBuff) { detectedNPCBuffTimeCheat = true; } From 1f045c9a92373aa2195358c6c1d06d6a7c5623a2 Mon Sep 17 00:00:00 2001 From: moisterrific <57187883+moisterrific@users.noreply.github.com> Date: Tue, 26 May 2020 15:53:58 -0400 Subject: [PATCH 2/7] Update /spawnboss to include the 2 new bosses Added Empress of Light and Queen Slime to the list of bosses that can be spawned individually and "all". Also removed the queen case because there are two bosses with queen in their name now. --- TShockAPI/Commands.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 8d131588..8b5db356 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -2378,7 +2378,7 @@ namespace TShockAPI { case "*": case "all": - int[] npcIds = { 4, 13, 35, 50, 125, 126, 127, 134, 222, 245, 262, 266, 370, 398 }; + int[] npcIds = { 4, 13, 35, 50, 125, 126, 127, 134, 222, 245, 262, 266, 370, 398, 636, 657 }; TSPlayer.Server.SetTime(false, 0.0); foreach (int i in npcIds) { @@ -2442,7 +2442,6 @@ namespace TShockAPI TSPlayer.Server.SpawnNPC(npc.type, npc.FullName, amount, args.Player.TileX, args.Player.TileY); TSPlayer.All.SendSuccessMessage("{0} has spawned Skeletron Prime {1} time(s).", args.Player.Name, amount); return; - case "queen": case "queen bee": npc.SetDefaults(222); TSPlayer.Server.SpawnNPC(npc.type, npc.FullName, amount, args.Player.TileX, args.Player.TileY); @@ -2483,6 +2482,17 @@ namespace TShockAPI TSPlayer.Server.SpawnNPC(npc.type, npc.FullName, amount, args.Player.TileX, args.Player.TileY); TSPlayer.All.SendSuccessMessage("{0} has spawned the Moon Lord {1} time(s).", args.Player.Name, amount); return; + case "empress": + case "empress of light": + npc.SetDefaults(636); + TSPlayer.Server.SpawnNPC(npc.type, npc.FullName, amount, args.Player.TileX, args.Player.TileY); + TSPlayer.All.SendSuccessMessage("{0} has spawned the Empress of Light {1} time(s).", args.Player.Name, amount); + return; + case "queen slime": + npc.SetDefaults(657); + TSPlayer.Server.SpawnNPC(npc.type, npc.FullName, amount, args.Player.TileX, args.Player.TileY); + TSPlayer.All.SendSuccessMessage("{0} has spawned the Queen Slime {1} time(s).", args.Player.Name, amount); + return; default: args.Player.SendErrorMessage("Invalid boss type!"); return; From 2c384aaaeb70f6b284676ae8890e864763ef1045 Mon Sep 17 00:00:00 2001 From: moisterrific <57187883+moisterrific@users.noreply.github.com> Date: Tue, 26 May 2020 17:17:01 -0400 Subject: [PATCH 3/7] Add journey permissions to trustedadmin and owner hope im doing this right lol --- TShockAPI/DB/GroupManager.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs index 6405b5bc..b843f119 100644 --- a/TShockAPI/DB/GroupManager.cs +++ b/TShockAPI/DB/GroupManager.cs @@ -172,7 +172,19 @@ namespace TShockAPI.DB Permissions.settempgroup, Permissions.spawnrate, Permissions.tpoverride, - Permissions.createdumps)); + Permissions.createdumps, + Permissions.journey_timefreeze, + Permissions.journey_timeset, + Permissions.journey_timespeed, + Permissions.journey_godmode, + Permissions.journey_windstrength, + Permissions.journey_windfreeze, + Permissions.journey_rainstrength, + Permissions.journey_rainfreeze, + Permissions.journey_placementrange, + Permissions.journey_setdifficulty, + Permissions.journey_biomespreadfreeze, + Permissions.journey_setdawn)); } // Load Permissions from the DB From 51d2d9af6907ec3a357faac28298a2faeb696959 Mon Sep 17 00:00:00 2001 From: moisterrific <57187883+moisterrific@users.noreply.github.com> Date: Tue, 26 May 2020 18:51:15 -0400 Subject: [PATCH 4/7] Fix error in previous change there's no setdawn, made the mistake of looking at a prev commit instead of the most current version of permissions --- TShockAPI/DB/GroupManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs index b843f119..8c9515a6 100644 --- a/TShockAPI/DB/GroupManager.cs +++ b/TShockAPI/DB/GroupManager.cs @@ -184,7 +184,7 @@ namespace TShockAPI.DB Permissions.journey_placementrange, Permissions.journey_setdifficulty, Permissions.journey_biomespreadfreeze, - Permissions.journey_setdawn)); + Permissions.journey_setspawnrate)); } // Load Permissions from the DB From 54aa2dc070490c28390819866fca7f84b720af73 Mon Sep 17 00:00:00 2001 From: moisterrific <57187883+moisterrific@users.noreply.github.com> Date: Tue, 26 May 2020 19:00:24 -0400 Subject: [PATCH 5/7] updated the changelog with my stuff --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b0eb992..697b8d89 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 * `-worldselectpath` is identical to the old `-worldpath`. If you specify `-worldselectpath` and `-world` without specifying an absolute path the server will crash for sure. * Thank you again to @fjfnaranjo for supplying a [detailed feature request](https://github.com/Pryaxis/TShock/issues/1914) explaining precisely why this option should be available. Without this, we would have had no context as to why this feature was useful or important. Thank you, @fjfnaranjo! * This change was implemented by (@QuiCM, @hakusaro). +* Updated Bouncer to include Sparkle Slime debuff that can be applied to town NPCs. +* Updated /spawnboss command to include Empress of Light and Queen Slime. +* Added journey mode permissions to owner group by default. ## TShock 4.4.0 (Pre-release 8) * Update for OTAPI 2.0.0.36 and Terraria 1.4.0.4. (@hakusaro, @Patrikkk, @DeathCradle) From 44ad2d2effcc2c0e3e82c1944c8737586a78c532 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 29 May 2020 19:50:07 -0700 Subject: [PATCH 6/7] Remove extra debug info from OnGetData Per packet debug logs are redundant for people with the packet monitor plugin. If you need packet monitoring, please install the packet monitor plugin. --- CHANGELOG.md | 9 +++++---- TShockAPI/TShock.cs | 2 -- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02cdc3b2..d409b244 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,10 @@ This is the rolling changelog for TShock for Terraria. Use past tense when adding new entries; sign your name off when you add or change something. This should primarily be things like user changes, not necessarily codebase changes unless it's really relevant or large. ## Upcoming Release -* Fix pet licenses. (@Olink) -* Initial support for Journey mode in SSC worlds. (@Olink) -* Make TShock database MySQL 8 compatible by escaping column names in our IQueryBuilder code. (Name `Groups` is a reserved element in this version, which is used in our `Region` table.) (@Patrikkk) -* Reintroduce `-worldselectpath` per feedback from @fjfnaranjo. This command line argument should be used to specify the place where the interactive server startup will look for worlds to show on the world select screen. The original version of this argument, `-worldpath`, was removed because several game service providers have broken configurations that stop the server from running with an unhelpful error. This specific configuration was `-world` and `-worldpath`. In the new world, you can do the following: +* Fixed pet licenses. (@Olink) +* Added initial support for Journey mode in SSC worlds. (@Olink) +* Made TShock database MySQL 8 compatible by escaping column names in our IQueryBuilder code. (Name `Groups` is a reserved element in this version, which is used in our `Region` table.) (@Patrikkk) +* Reintroduced `-worldselectpath` per feedback from @fjfnaranjo. This command line argument should be used to specify the place where the interactive server startup will look for worlds to show on the world select screen. The original version of this argument, `-worldpath`, was removed because several game service providers have broken configurations that stop the server from running with an unhelpful error. This specific configuration was `-world` and `-worldpath`. In the new world, you can do the following: * `-worldselectpath` should be used if you want to customize the server interactive boot world list (so that you can select from a number of worlds in non-standard locations). * `-world` will behave as an absolute path to the world to load. This is the most common thing you want if you're starting the server and have a specific world in mind. * `-worldselectpath` and `-worldname` should work together enabling you to select from a world from the list that you specify. This is *not* a world file name, but a world name as described by Terraria. @@ -17,6 +17,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Attempted to fix the problem with the magic mirror spawn problems. You should be able to remove your spawn point in SSC by right clicking on a bed now. (@hakusaro, @AxeelAnder) * Added HandleFoodPlatterTryPlacing event, which is called whenever a player places a food in a plate. Add antihack to bouncer, to prevent removing food from plates if the region is protected; To prevent placement if they are not in range; To prevent placement if the item is not placed from player hand. (@Patrikkk) * Fixed an offset error in NetTile that impacted `SendTileSquare`. It was being read as a `byte` and not a `ushort`. (@QuiCM) +* Removed packet monitoring from debug logs. To achieve the same results, install @QuiCM's packet monitor plugin (it does better things). (@hakusaro) ## TShock 4.4.0 (Pre-release 8) * Update for OTAPI 2.0.0.36 and Terraria 1.4.0.4. (@hakusaro, @Patrikkk, @DeathCradle) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 0d19a6fb..3839a5ec 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -1493,8 +1493,6 @@ namespace TShockAPI PacketTypes type = e.MsgID; - Log.ConsoleDebug("Recv: {0:X}: {2} ({1:XX})", e.Msg.whoAmI, (byte)type, type); - var player = Players[e.Msg.whoAmI]; if (player == null || !player.ConnectionAlive) { From f82ab41a254f893f332900e5f22d6bc8cf5f08a2 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Fri, 29 May 2020 21:04:48 -0700 Subject: [PATCH 7/7] Add /sync command to alleviate door related sadness Run /sync if your doors disappear. This will resync your local client with the server state. For more information, please see the associated changelog entry. --- CHANGELOG.md | 6 ++++++ TShockAPI/Bouncer.cs | 6 ++++-- TShockAPI/Commands.cs | 11 +++++++++++ TShockAPI/DB/GroupManager.cs | 3 ++- TShockAPI/Permissions.cs | 3 +++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d409b244..fd59e1e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,12 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Added HandleFoodPlatterTryPlacing event, which is called whenever a player places a food in a plate. Add antihack to bouncer, to prevent removing food from plates if the region is protected; To prevent placement if they are not in range; To prevent placement if the item is not placed from player hand. (@Patrikkk) * Fixed an offset error in NetTile that impacted `SendTileSquare`. It was being read as a `byte` and not a `ushort`. (@QuiCM) * Removed packet monitoring from debug logs. To achieve the same results, install @QuiCM's packet monitor plugin (it does better things). (@hakusaro) +* Updated packet monitoring in send tile square handler for Bouncer debugging. (@hakusaro) +* Added `/sync`, activated with `tshock.synclocalarea`. This is a default guest permission. When the command is issued, the server will resync area around the player in the event of a desync issue. (@hakusaro) + * If your doors disappear, this command will allow a player to resync without having to disconnect from the server. + * The default group that gets this permission is `Guest` for the time being. + * To add this command to your guest group, give them `tshock.synclocalarea`, with `/group addperm guest tshock.synclocalarea`. + * This command may be removed at any time in the future (and will likely be removed when send tile square handling is fixed). ## TShock 4.4.0 (Pre-release 8) * Update for OTAPI 2.0.0.36 and Terraria 1.4.0.4. (@hakusaro, @Patrikkk, @DeathCradle) diff --git a/TShockAPI/Bouncer.cs b/TShockAPI/Bouncer.cs index abd5fe05..c3a62dae 100644 --- a/TShockAPI/Bouncer.cs +++ b/TShockAPI/Bouncer.cs @@ -558,6 +558,8 @@ namespace TShockAPI return; } + bool changed = false; + bool failed = false; try { var tiles = new NetTile[size, size]; @@ -569,7 +571,6 @@ namespace TShockAPI } } - bool changed = false; for (int x = 0; x < size; x++) { int realx = tileX + x; @@ -709,9 +710,10 @@ namespace TShockAPI catch { args.Player.SendTileSquare(tileX, tileY, size); + failed = true; } - TShock.Log.ConsoleDebug("Bouncer / SendTileSquare reimplemented from spaghetti from {0}", args.Player.Name); + TShock.Log.ConsoleDebug("Bouncer / SendTileSquare from {0} {1} {2}", args.Player.Name, changed, failed); args.Handled = true; } diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 8d131588..fd3f5e9e 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -589,6 +589,10 @@ namespace TShockAPI { HelpText = "Creates a reference tables for Terraria data types and the TShock permission system in the server folder." }); + add(new Command(Permissions.synclocalarea, SyncLocalArea, "sync") + { + HelpText = "Sends all tiles from the server to the player to resync the client with the actual world state." + }); #endregion add(new Command(Aliases, "aliases") @@ -5302,6 +5306,13 @@ namespace TShockAPI return; } + private static void SyncLocalArea(CommandArgs args) + { + args.Player.SendTileSquare((int) args.Player.TileX, (int) args.Player.TileY, 32); + args.Player.SendWarningMessage("Sync'd!"); + return; + } + #endregion General Commands #region Cheat Commands diff --git a/TShockAPI/DB/GroupManager.cs b/TShockAPI/DB/GroupManager.cs index 6405b5bc..c9a3b760 100644 --- a/TShockAPI/DB/GroupManager.cs +++ b/TShockAPI/DB/GroupManager.cs @@ -64,7 +64,8 @@ namespace TShockAPI.DB Permissions.canlogin, Permissions.canpartychat, Permissions.cantalkinthird, - Permissions.canchat)); + Permissions.canchat, + Permissions.synclocalarea)); AddDefaultGroup("default", "guest", string.Join(",", diff --git a/TShockAPI/Permissions.cs b/TShockAPI/Permissions.cs index 322b1199..baf21a73 100644 --- a/TShockAPI/Permissions.cs +++ b/TShockAPI/Permissions.cs @@ -465,6 +465,9 @@ namespace TShockAPI [Description("Player can see advanced information about any user account.")] public static readonly string advaccountinfo = "tshock.accountinfo.details"; + + [Description("Player can resync themselves with server state.")] + public static readonly string synclocalarea = "tshock.synclocalarea"; #endregion /// /// Lists all commands associated with a given permission