fixed kicking and banning, and removed a unused variable
This commit is contained in:
parent
a7e912c9f4
commit
df9e2bb423
3 changed files with 11 additions and 6 deletions
|
|
@ -17,7 +17,6 @@ namespace TShockAPI
|
|||
public static bool infiniteInvasion;
|
||||
public static bool permaPvp;
|
||||
public static int killCount;
|
||||
public static bool startedInvasion;
|
||||
public static bool kickCheater = true;
|
||||
public static bool banCheater = true;
|
||||
public static bool kickGriefer = true;
|
||||
|
|
|
|||
|
|
@ -840,8 +840,11 @@ namespace TShockAPI
|
|||
|
||||
public static void Ban(int plr, string reason = "")
|
||||
{
|
||||
Tools.Kick(plr, reason);
|
||||
Bans.AddBan(Tools.GetPlayerIP(plr), Main.player[plr].name, reason);
|
||||
if (!players[plr].group.HasPermission("immunetoban"))
|
||||
{
|
||||
Tools.Kick(plr,"Banned: " + reason);
|
||||
Bans.AddBan(Tools.GetPlayerIP(plr), Main.player[plr].name, reason);
|
||||
}
|
||||
}
|
||||
|
||||
public class Position
|
||||
|
|
|
|||
|
|
@ -215,9 +215,12 @@ namespace TShockAPI
|
|||
/// <param name="reason">string reason</param>
|
||||
public static void Kick(int ply, string reason)
|
||||
{
|
||||
string displayName = FindPlayer(ply).Equals("") ? GetPlayerIP(ply) : FindPlayer(ply);
|
||||
NetMessage.SendData(0x2, ply, -1, reason, 0x0, 0f, 0f, 0f);
|
||||
Log.Info("Kicked " + displayName + " for : " + reason);
|
||||
if (!TShock.players[ply].group.HasPermission("immunetokick") || reason.Contains("Banned: "))
|
||||
{
|
||||
string displayName = FindPlayer(ply).Equals("") ? GetPlayerIP(ply) : FindPlayer(ply);
|
||||
NetMessage.SendData(0x2, ply, -1, reason, 0x0, 0f, 0f, 0f);
|
||||
Log.Info("Kicked " + displayName + " for : " + reason);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue