diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs index e9940942..740fc7b7 100644 --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -215,6 +215,9 @@ namespace TShockAPI [Description("Protect chests with region and build permissions")] public bool RegionProtectChests = false; + + [Description("Disable users from being able to login with account password when joining")] + public bool DisableLoginBeforeJoin = false; public static ConfigFile Read(string path) { diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 66c6ba83..99819d5f 100644 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -246,7 +246,7 @@ namespace TShockAPI private static bool HandleConnecting(GetDataHandlerArgs args) { var user = TShock.Users.GetUserByName(args.Player.Name); - if (user != null) + if (user != null && !TShock.Config.DisableLoginBeforeJoin) { args.Player.RequiresPassword = true; NetMessage.SendData((int)PacketTypes.PasswordRequired, args.Player.Index);