Fixeds kick not working
This commit is contained in:
parent
693e279a78
commit
d7987ac633
2 changed files with 11 additions and 6 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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: "))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue