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 [Description("Disable users from being able to login with account password when joining.")] public bool
DisableLoginBeforeJoin; DisableLoginBeforeJoin;
[Description("Disable users from being able to login with their client UUID.")] [Description("Disable users from being able to login with their client UUID.")] public bool DisableUUIDLogin;
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 register any username with /register.")] public bool AllowRegisterAnyUsername;
[Description("Allows users to login with any username with /login.")] public bool AllowLoginAnyUsername = true; [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; args.Handled = true;
return; 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; Ban ban = null;
if (Config.EnableBanOnUsernames) if (Config.EnableBanOnUsernames)
@ -884,7 +889,7 @@ namespace TShockAPI
ban = Bans.GetBanByIp(player.IP); ban = Bans.GetBanByIp(player.IP);
} }
if (Config.EnableUUIDBans && null == ban) if (Config.EnableUUIDBans && null == ban && !String.IsNullOrWhiteSpace(player.UUID))
{ {
ban = Bans.GetBanByUUID(player.UUID); ban = Bans.GetBanByUUID(player.UUID);
} }