Fixed Ban not checking socket status correctly.
Fixed unban/unbanip for real this time
This commit is contained in:
parent
d23db067e9
commit
e66c57450a
2 changed files with 5 additions and 4 deletions
|
|
@ -249,13 +249,14 @@ namespace TShockAPI
|
|||
/// <param name="reason">string reason</param>
|
||||
public static bool Ban(int plr, string reason, string adminUserName = "")
|
||||
{
|
||||
if (!Netplay.serverSock[plr].active || Netplay.serverSock[plr].kill)
|
||||
return true;
|
||||
if (!TShock.players[plr].group.HasPermission("immunetoban"))
|
||||
{
|
||||
string ip = GetPlayerIP(plr);
|
||||
string playerName = Main.player[plr].name;
|
||||
TShock.Bans.AddBan(ip, playerName, reason);
|
||||
if (Main.player[plr].active || !Netplay.serverSock[plr].kill)
|
||||
NetMessage.SendData(0x2, plr, -1, "Banned: " + reason, 0x0, 0f, 0f, 0f);
|
||||
NetMessage.SendData(0x2, plr, -1, "Banned: " + reason, 0x0, 0f, 0f, 0f);
|
||||
Log.Info("Banned " + playerName + " for : " + reason);
|
||||
if (adminUserName.Length == 0)
|
||||
Broadcast(playerName + " was banned for " + reason.ToLower());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue