Fixeds kick not working

This commit is contained in:
high 2011-06-07 08:46:33 -04:00
parent 693e279a78
commit d7987ac633
2 changed files with 11 additions and 6 deletions

View file

@ -611,7 +611,6 @@ namespace TShockAPI
}
string ip = Tools.GetPlayerIP(ply);
;
players[ply] = new TSPlayer(ply);
players[ply].group = Tools.GetGroupForIP(ip);
@ -619,6 +618,7 @@ namespace TShockAPI
!players[ply].group.HasPermission("reservedslot"))
{
Tools.Kick(ply, "Server is full");
handler.Handled = true;
return;
}
@ -626,10 +626,14 @@ namespace TShockAPI
if (ban != null)
{
Tools.Kick(ply, "You are banned: " + ban.Reason);
handler.Handled = true;
return;
}
if (!FileTools.OnWhitelist(ip))
{
Tools.Kick(ply, "Not on whitelist.");
handler.Handled = true;
return;
}
}
@ -662,7 +666,7 @@ namespace TShockAPI
{
return;
}
for (uint i = 0; i < Main.maxPlayers; i++)
for (int i = 0; i < Main.maxPlayers; i++)
{
if (Main.player[i].active == false)
{
@ -675,12 +679,13 @@ namespace TShockAPI
if (ConfigurationManager.kickTnt || ConfigurationManager.banTnt)
{
if (ConfigurationManager.banTnt)
Ban((int)i, "Explosives");
Tools.Kick((int)i, "Kill tile abuse detected.");
Ban(i, "Kill Tile Abuse");
else
Tools.Kick(i, "Kill tile abuse detected.");
Tools.Broadcast(Main.player[i].name + " was " +
(ConfigurationManager.banTnt ? "banned" : "kicked") +
" for kill tile abuse.");
RevertKillTile((int)i);
RevertKillTile(i);
players[i].tileThreshold = 0;
players[i].tilesDestroyed.Clear();
}

View file

@ -214,7 +214,7 @@ namespace TShockAPI
/// <param name="reason">string reason</param>
public static void Kick(int ply, string reason)
{
if (!Main.player[ply].active)
if (!Netplay.serverSock[ply].active || Netplay.serverSock[ply].kill)
return;
if (!TShock.players[ply].group.HasPermission("immunetokick") || reason.Contains("Banned: "))
{