Replace TSPlayer.IgnoreActionsForCheating w/ boolean

This replaces IgnoreActionsForCheating in TSPlayer with a new
IsDisabledForStackDetection field that tracks the same basic data.

The previous way we did this was storing a string as the "reason"
why a player was disabled for cheating, but it only stored the last
hacked item stack that caused the check to fail. Since we already
have OnSecondUpdate which notifies on _all_ items, we don't need
to store this info in such a useless way anyway. They'll find out
in one second what they need to remove in a more alarmist way.
This commit is contained in:
Lucas Nicodemus 2017-12-20 17:19:14 -07:00
parent 1ef28dfe0d
commit 7efcfd055f
5 changed files with 10 additions and 9 deletions

View file

@ -847,9 +847,9 @@ namespace TShockAPI
if (distance > TShock.Config.MaxRangeForDisabled)
{
// We need to tell them they were disabled and why, then revert the change.
if (args.Player.IgnoreActionsForCheating != "none")
if (args.Player.IsDisabledForStackDetection == true)
{
args.Player.SendErrorMessage("Disabled for cheating: " + args.Player.IgnoreActionsForCheating);
args.Player.SendErrorMessage("Disabled. You went too far with hacked item stacks.");
}
else if (args.Player.IgnoreActionsForDisabledArmor != "none")
{
@ -857,7 +857,7 @@ namespace TShockAPI
}
else if (args.Player.IsDisabledForSSC == true)
{
args.Player.SendErrorMessage("Disabled. Server side characters is enabled, and you aren't logged in.");
args.Player.SendErrorMessage("Disabled. You need to {0}login, since server side characters is enabled.", TShock.Config.CommandSpecifier);
}
else if (TShock.Config.RequireLogin && !args.Player.IsLoggedIn)
{