Introduce SoftcoreOnly config option to allow only softcore characters

to connect.
This commit is contained in:
James Puleo 2021-07-13 21:49:22 -04:00
parent dcf1f07ff9
commit a40effd55e
No known key found for this signature in database
GPG key ID: 3E16C7EFA34FB15D
3 changed files with 11 additions and 0 deletions

View file

@ -2364,6 +2364,12 @@ namespace TShockAPI
NetMessage.SendData((int)PacketTypes.PlayerInfo, -1, args.Player.Index, NetworkText.FromLiteral(args.Player.Name), args.Player.Index);
return true;
}
if (TShock.Config.Settings.SoftcoreOnly && difficulty != 0)
{
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePlayerInfo rejected softcore required");
args.Player.Kick("You need to join with a softcore player.", true, true);
return true;
}
if (TShock.Config.Settings.MediumcoreOnly && difficulty < 1)
{
TShock.Log.ConsoleDebug("GetDataHandlers / HandlePlayerInfo rejected mediumcore required");