diff --git a/TShockAPI/ConfigFile.cs b/TShockAPI/ConfigFile.cs old mode 100644 new mode 100755 index 36ec35de..84a923ee --- a/TShockAPI/ConfigFile.cs +++ b/TShockAPI/ConfigFile.cs @@ -207,10 +207,10 @@ namespace TShockAPI [Description("Disable users from being able to login with account password when joining.")] public bool DisableLoginBeforeJoin; - [Description("Disable users from being able to login with their client UUID.")] - public bool - DisableUUIDLogin; + [Description("Disable users from being able to login with their client UUID.")] public bool DisableUUIDLogin; + [Description("Kick clients that don't send a UUID to the server.")] public bool KickEmptyUUID; + [Description("Allows users to register any username with /register.")] public bool AllowRegisterAnyUsername; [Description("Allows users to login with any username with /login.")] public bool AllowLoginAnyUsername = true; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 2de0913a..47b05882 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -870,6 +870,11 @@ namespace TShockAPI args.Handled = true; return; } + + if (Config.KickEmptyUUID && String.IsNullOrWhiteSpace(player.UUID)) + { + Utils.ForceKick(player, "Your client did not send a UUID, this server is not configured to accept such a client"); + } Ban ban = null; if (Config.EnableBanOnUsernames) @@ -884,7 +889,7 @@ namespace TShockAPI ban = Bans.GetBanByIp(player.IP); } - if (Config.EnableUUIDBans && null == ban) + if (Config.EnableUUIDBans && null == ban && !String.IsNullOrWhiteSpace(player.UUID)) { ban = Bans.GetBanByUUID(player.UUID); }