Name length check now works.

Bans now run by name too.
Closes #36
This commit is contained in:
Shank 2011-06-07 00:08:32 -06:00
parent 3589886eab
commit b7a87866fe

View file

@ -201,6 +201,15 @@ namespace TShockAPI
{
if (e.MsgID == 4)
{
var ban = Bans.GetBanByName(Main.player[e.Msg.whoAmI].name);
if (ban != null)
{
Tools.Kick(e.Msg.whoAmI, "You are banned: " + ban.Reason);
}
if (Main.player[e.Msg.whoAmI].name.Length > 32)
{
Tools.Kick(e.Msg.whoAmI, "Name exceeded 32 characters.");
}
if (players[e.Msg.whoAmI] == null)
{
Tools.Kick(e.Msg.whoAmI, "Player doesn't exist");
@ -612,11 +621,6 @@ namespace TShockAPI
{
Tools.Kick(ply, "You are banned: " + ban.Reason);
}
else if (Tools.FindPlayer(ply).Length > 32)
{
Tools.Kick(ply, "Your name was too long.");
Tools.Broadcast(ip + " was kicked because their name exceeded 32 characters.");
}
if (!FileTools.OnWhitelist(ip))
{
Tools.Kick(ply, "Not on whitelist.");