Warn players if bypass SSC permission is enabled
If a player has the tshock.ignore.ssc permission, odds are that they may want to know that their data isn't being saved or not. This change allows users to be notified if they have SSC data stored in the DB but they aren't having it loaded due to the aforementioned permission. This permission causes great confusion, but we can't really change it because we would break existing setups. This is an easy change that gives people a reason why they suddenly "have no items." This new option can be turned off in the config file for SSC if it's not desired. This change also modifies some of the log messages so that it's clear why the SSC save didn't occur for a given player.
This commit is contained in:
parent
c9b13b493e
commit
68ae73ffef
5 changed files with 16 additions and 3 deletions
|
|
@ -2411,6 +2411,12 @@ namespace TShockAPI
|
|||
{
|
||||
if (args.Player.HasPermission(Permissions.bypassssc))
|
||||
{
|
||||
if (args.Player.PlayerData.exists && TShock.ServerSideCharacterConfig.Settings.WarnPlayersAboutBypassPermission)
|
||||
{
|
||||
args.Player.SendWarningMessage("Bypass SSC is enabled for your account. SSC data will not be loaded or saved.");
|
||||
TShock.Log.ConsoleInfo(args.Player.Name + " has SSC data in the database, but has the tshock.ignore.ssc permission. This means their SSC data is being ignored.");
|
||||
TShock.Log.ConsoleInfo("You may wish to consider removing the tshock.ignore.ssc permission or negating it for this player.");
|
||||
}
|
||||
args.Player.PlayerData.CopyCharacter(args.Player);
|
||||
TShock.CharacterDB.InsertPlayerData(args.Player);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue