Merge remote-tracking branch 'upstream/master'

Conflicts:
	TShockAPI/Commands.cs
	TShockAPI/TShock.cs
This commit is contained in:
ricky 2011-06-07 18:45:09 +10:00
commit 070f5a7801
2 changed files with 45 additions and 10 deletions

16
TShockAPI/TShock.cs Normal file → Executable file
View file

@ -15,7 +15,7 @@ namespace TShockAPI
public static string saveDir = "./tshock/";
public static Version VersionNum = new Version(1, 9, 0, 0);
public static Version VersionNum = new Version(1, 9, 0, 1);
public static string VersionCodename = "SPACEEE";
@ -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.ForceKick(e.Msg.whoAmI, "Player doesn't exist");
@ -549,11 +558,6 @@ namespace TShockAPI
Tools.ForceKick(ply, "You are banned: " + ban.Reason);
handler.Handled = true;
}
else if (Tools.FindPlayer(ply).Length > 32)
{
Tools.ForceKick(ply, "Your name was too long.");
handler.Handled = true;
}
else if (!FileTools.OnWhitelist(ip))
{
Tools.ForceKick(ply, "Not on whitelist.");