Add options to kick empty UUID - handling to ignore UUID login and bans for blank UUIDs if this option is not enabled

This commit is contained in:
k0rd 2013-10-09 23:53:24 -04:00
parent a40eecc82f
commit a58e21191b
2 changed files with 9 additions and 4 deletions

6
TShockAPI/ConfigFile.cs Normal file → Executable file
View file

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

View file

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