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

@ -855,9 +855,9 @@ namespace TShockAPI
{
args.Player.SendErrorMessage("Disabled for banned armor: " + args.Player.IgnoreActionsForDisabledArmor);
}
else if (args.Player.IgnoreActionsForInventory != "none")
else if (args.Player.IsDisabledForSSC == true)
{
args.Player.SendErrorMessage("Disabled for Server Side Inventory: " + args.Player.IgnoreActionsForInventory);
args.Player.SendErrorMessage("Disabled. Server side characters is enabled, and you aren't logged in.");
}
else if (TShock.Config.RequireLogin && !args.Player.IsLoggedIn)
{

View file

@ -848,7 +848,7 @@ namespace TShockAPI
args.Player.tempGroup = null;
args.Player.Account = account;
args.Player.IsLoggedIn = true;
args.Player.IgnoreActionsForInventory = "none";
args.Player.IsDisabledForSSC = false;
if (Main.ServerSideCharacter)
{

View file

@ -1784,7 +1784,7 @@ namespace TShockAPI
args.Player.tempGroup = null;
args.Player.Account = account;
args.Player.IsLoggedIn = true;
args.Player.IgnoreActionsForInventory = "none";
args.Player.IsDisabledForSSC = false;
if (Main.ServerSideCharacter)
{
@ -1856,7 +1856,7 @@ namespace TShockAPI
args.Player.tempGroup = null;
args.Player.Account = account;
args.Player.IsLoggedIn = true;
args.Player.IgnoreActionsForInventory = "none";
args.Player.IsDisabledForSSC = false;
if (Main.ServerSideCharacter)
{

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);

View file

@ -1684,8 +1684,8 @@ namespace TShockAPI
{
if (Main.ServerSideCharacter)
{
player.SendErrorMessage(
player.IgnoreActionsForInventory = String.Format("Server side characters is enabled! Please {0}register or {0}login to play!", Commands.Specifier));
player.IsDisabledForSSC = true;
player.SendErrorMessage(String.Format("Server side characters is enabled! Please {0}register or {0}login to play!", Commands.Specifier));
player.LoginHarassed = true;
}
else if (Config.RequireLogin)