Replace TSPlayer.IgnoreActionsForInventory => IsDisabledForSSC.

This is the first commit in a series to rewrite CheckIgnores()
into whatever its replacement becomes.

IgnoreActionsForInventory was probably used by the SSC system prior
to when we had in-game support for SSC (ergo, when we just checked
to make sure you had removed all items before joining and worked
our way up in inventory data to track it). I could be wrong about
this though.

Now, IsDisabledForSSC tracks only if a player is shut down due to
SSC, rather than a reason that gets broadcast.
This commit is contained in:
Lucas Nicodemus 2017-12-20 16:52:49 -07:00
parent 4fa0f888ea
commit 1ef28dfe0d
5 changed files with 11 additions and 10 deletions

View file

@ -277,7 +277,8 @@ namespace TShockAPI
private string CacheIP;
public string IgnoreActionsForInventory = "none";
/// <summary>Determines if the player is disabled by the SSC subsystem for not being logged in.</summary>
public bool IsDisabledForSSC = false;
public string IgnoreActionsForCheating = "none";
@ -297,7 +298,7 @@ namespace TShockAPI
/// <returns>bool - True if any ignore is not none, false, or login state differs from the required state.</returns>
public bool CheckIgnores()
{
return IgnoreActionsForInventory != "none" || IgnoreActionsForCheating != "none" || IgnoreActionsForDisabledArmor != "none" || IgnoreActionsForClearingTrashCan || !IsLoggedIn && TShock.Config.RequireLogin;
return IsDisabledForSSC || IgnoreActionsForCheating != "none" || IgnoreActionsForDisabledArmor != "none" || IgnoreActionsForClearingTrashCan || !IsLoggedIn && TShock.Config.RequireLogin;
}
/// <summary>
@ -656,7 +657,7 @@ namespace TShockAPI
PlayerHooks.OnPlayerLogout(this);
if (Main.ServerSideCharacter)
{
IgnoreActionsForInventory = $"Server side characters is enabled! Please {Commands.Specifier}register or {Commands.Specifier}login to play!";
IsDisabledForSSC = true;
if (!IgnoreActionsForClearingTrashCan && (!Dead || TPlayer.difficulty != 2))
{
PlayerData.CopyCharacter(this);