From cdbc37b0244c7420b9deb7ac8876556f70080fd6 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 3 Dec 2017 16:22:46 -0700 Subject: [PATCH 1/2] Allow /savessc to work on players that bypass ssc Fixes #1506 --- TShockAPI/Commands.cs | 2 +- TShockAPI/DB/CharacterManager.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/TShockAPI/Commands.cs b/TShockAPI/Commands.cs index 7e180f3c..11d41505 100644 --- a/TShockAPI/Commands.cs +++ b/TShockAPI/Commands.cs @@ -1636,7 +1636,7 @@ namespace TShockAPI { if (player != null && player.IsLoggedIn && !player.IgnoreActionsForClearingTrashCan) { - TShock.CharacterDB.InsertPlayerData(player); + TShock.CharacterDB.InsertPlayerData(player, true); } } } diff --git a/TShockAPI/DB/CharacterManager.cs b/TShockAPI/DB/CharacterManager.cs index ab663ef1..2c264138 100644 --- a/TShockAPI/DB/CharacterManager.cs +++ b/TShockAPI/DB/CharacterManager.cs @@ -156,17 +156,17 @@ namespace TShockAPI.DB /// /// player to take data from /// true if inserted successfully - public bool InsertPlayerData(TSPlayer player) + public bool InsertPlayerData(TSPlayer player, bool fromCommand = false) { PlayerData playerData = player.PlayerData; if (!player.IsLoggedIn) return false; - if (player.HasPermission(Permissions.bypassssc)) + if (player.HasPermission(Permissions.bypassssc) && !fromCommand) { TShock.Log.ConsoleInfo("Skipping SSC Backup for " + player.User.Name); // Debug code - return true; + return false; } if (!GetPlayerData(player, player.User.ID).exists) From f319ec94b42fd55007e244e9e829d9eb47fb5c36 Mon Sep 17 00:00:00 2001 From: Lucas Nicodemus Date: Sun, 3 Dec 2017 16:26:41 -0700 Subject: [PATCH 2/2] Updated changelog to reflect ssc changes --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11c6aad5..fb2bc485 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin * Added /region rename and OnRegionRenamed hook (@koneko-nyan, @deadsurgeon42) * Added /su, which temporarily elevates players with the tshock.su permission to super admin. In addition added, a new group, owner, that is suggested for new users to setup TShock with as opposed to superadmin. Finally, /su is implemented such that a 10 minute timeout will occur preventing people from just camping with it on. (@hakusaro) * Added /sudo, which runs a command as the superadmin group. If a user fails to execute a command but can sudo, they'll be told that they can override the permission check with sudo. Much better than just telling them to run /su and then re-run the command. (@hakusaro) +* Fixed /savessc not bothering to save ssc data for people who bypass ssc. (@hakusaro) ## TShock 4.3.24