Merge pull request #1522 from Pryaxis/ssc-force
Allow /savessc to work on players that bypass ssc
This commit is contained in:
commit
18f0711278
3 changed files with 5 additions and 4 deletions
|
|
@ -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)
|
* 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 /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)
|
* 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)
|
* 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)
|
* Added the ability to ban by account name instead of just banning a character name assuming its an account name. (@hakusaro)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1632,7 +1632,7 @@ namespace TShockAPI
|
||||||
{
|
{
|
||||||
if (player != null && player.IsLoggedIn && !player.IgnoreActionsForClearingTrashCan)
|
if (player != null && player.IsLoggedIn && !player.IgnoreActionsForClearingTrashCan)
|
||||||
{
|
{
|
||||||
TShock.CharacterDB.InsertPlayerData(player);
|
TShock.CharacterDB.InsertPlayerData(player, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -156,17 +156,17 @@ namespace TShockAPI.DB
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="player">player to take data from</param>
|
/// <param name="player">player to take data from</param>
|
||||||
/// <returns>true if inserted successfully</returns>
|
/// <returns>true if inserted successfully</returns>
|
||||||
public bool InsertPlayerData(TSPlayer player)
|
public bool InsertPlayerData(TSPlayer player, bool fromCommand = false)
|
||||||
{
|
{
|
||||||
PlayerData playerData = player.PlayerData;
|
PlayerData playerData = player.PlayerData;
|
||||||
|
|
||||||
if (!player.IsLoggedIn)
|
if (!player.IsLoggedIn)
|
||||||
return false;
|
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
|
TShock.Log.ConsoleInfo("Skipping SSC Backup for " + player.User.Name); // Debug code
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetPlayerData(player, player.User.ID).exists)
|
if (!GetPlayerData(player, player.User.ID).exists)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue