Merge pull request #1522 from Pryaxis/ssc-force

Allow /savessc to work on players that bypass ssc
This commit is contained in:
Lucas Nicodemus 2017-12-06 13:14:03 -07:00 committed by GitHub
commit 18f0711278
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View file

@ -18,6 +18,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Removed /ban addip and /ban addtemp. Now covered under /ban add. (@hakusaro)
* 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)
* Default permission sets for new databases are more modern. (@hakusaro)
* Added the ability to ban by account name instead of just banning a character name assuming its an account name. (@hakusaro)

View file

@ -1632,7 +1632,7 @@ namespace TShockAPI
{
if (player != null && player.IsLoggedIn && !player.IgnoreActionsForClearingTrashCan)
{
TShock.CharacterDB.InsertPlayerData(player);
TShock.CharacterDB.InsertPlayerData(player, true);
}
}
}

View file

@ -156,17 +156,17 @@ namespace TShockAPI.DB
/// </summary>
/// <param name="player">player to take data from</param>
/// <returns>true if inserted successfully</returns>
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)