diff --git a/CHANGELOG.md b/CHANGELOG.md index 97492839..7e3de480 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,11 +15,12 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin ## Upcoming changes * Fixed SendTileRectHandler not sending tile rect updates like Pylons/Mannequins to other clients. (@Stealownz) * Introduced `SoftcoreOnly` config option to allow only softcore characters to connect. (@drunderscore) -* Fix some typos that have been in the repository for over a lustrum. (@Killia0) +* Fixed some typos that have been in the repository for over a lustrum. (@Killia0) * Added a `tshock.npc.summonboss` permission check for Lunatic Cultist, players who do not have this permission will not be able to kill Cultist Archers/Devotees to summon the Lunatic Cultist. (@moisterrific) * Added more usage examples for the `ban` command under `ban help examples` to explain how users can ban: offline players by account, offline players by IP, and online players by player index - useful for banning hard to type character names. (@moisterrific) * Changed `/login` and `/register` to provide login help depending on if UUID login is enabled or disabled, and whether or not a player can login via any username or not. In addition, the message parameters will now be differentiated by colour instead of `<>` (@moisterrific, @hakusaro) * Added a new `DisablePrimeBombs` config option (`false` by default). Highly recommended to set this to `true` in order to prevent griefing on servers doing a `for the worthy` play-through, since the prime bombs on this seed can destroy most tiles and bypass region protection. (@moisterrific) +* Added a notification message and silent command support for permanently changing a target player's user group. Now players who received a group change will be notified of their new group if they are currently online. (@moisterrific, @QuiCM) ## 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 0b98c8a5..6a76c651 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1130,6 +1130,11 @@ namespace TShockAPI TShock.UserAccounts.SetUserGroup(account, args.Parameters[2]); TShock.Log.ConsoleInfo(args.Player.Name + " changed account " + account.Name + " to group " + args.Parameters[2] + "."); args.Player.SendSuccessMessage("Account " + account.Name + " has been changed to group " + args.Parameters[2] + "!"); + + //send message to player with matching account name + var player = TShock.Players.FirstOrDefault(p => p != null && p.Account?.Name == account.Name); + if (player != null && !args.Silent) + player.SendSuccessMessage($"{args.Player.Name} has changed your group to {args.Parameters[2]}"); } catch (GroupNotExistsException) {