Implemented HWID punishment affect.

This commit is contained in:
MobiusDevelopment 2021-08-06 17:20:31 +00:00
parent 9130a64259
commit d5387bb853
238 changed files with 3875 additions and 287 deletions

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11321,7 +11321,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11329,7 +11332,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -53,6 +54,8 @@ import org.l2jmobius.gameserver.model.clan.Clan;
import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -236,12 +239,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -635,6 +632,7 @@ public class EnterWorld implements IClientIncomingPacket
player.updateAbnormalVisualEffects();
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -680,6 +678,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -702,6 +707,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11328,7 +11328,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11336,7 +11339,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -54,6 +55,8 @@ import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder;
import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -241,12 +244,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -673,6 +670,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -718,6 +716,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -740,6 +745,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11330,7 +11330,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11338,7 +11341,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -54,6 +55,8 @@ import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder;
import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -241,12 +244,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -673,6 +670,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -718,6 +716,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -740,6 +745,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11311,7 +11311,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11319,7 +11322,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -54,6 +55,8 @@ import org.l2jmobius.gameserver.model.holders.AttendanceInfoHolder;
import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -241,12 +244,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -673,6 +670,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -718,6 +716,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -740,6 +745,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11301,7 +11301,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11309,7 +11312,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -55,6 +56,8 @@ import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -240,12 +243,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -679,6 +676,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -724,6 +722,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -746,6 +751,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11304,7 +11304,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11312,7 +11315,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -55,6 +56,8 @@ import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -240,12 +243,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -679,6 +676,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -724,6 +722,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -746,6 +751,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11310,7 +11310,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11318,7 +11321,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -55,6 +56,8 @@ import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -240,12 +243,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -679,6 +676,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -724,6 +722,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -746,6 +751,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11320,7 +11320,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11328,7 +11331,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -55,6 +56,8 @@ import org.l2jmobius.gameserver.model.holders.ClientHardwareInfoHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -241,12 +244,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -685,6 +682,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -730,6 +728,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -752,6 +757,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11436,7 +11436,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11444,7 +11447,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -57,6 +58,8 @@ import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -246,12 +249,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -702,6 +699,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -747,6 +745,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -769,6 +774,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

View File

@ -12,6 +12,7 @@
<a action="bypass -h admin_punishment info %acc% ACCOUNT">Punishments for account: %acc%</a><br1>
<a action="bypass -h admin_punishment info %char% CHARACTER">Punishments for character: %char%</a><br1>
<a action="bypass -h admin_punishment info %ip% IP">Punishments for IP: %ip%</a><br1>
<a action="bypass -h admin_punishment info %hwid% HWID">Punishments for HWID: %hwid%</a><br1>
<br>
<table width=280 bgcolor="666666" cellspacing="0" cellpadding="6">
<tr>
@ -41,6 +42,11 @@
<td>%ip%</td>
<td><a action="bypass -h admin_punishment_add %ip% IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td>%hwid%</td>
<td><a action="bypass -h admin_punishment_add %hwid% HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -51,6 +51,11 @@
<td><edit var="ip" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $ip IP $punishmentType $expiration $reason">Ban</a></td>
</tr>
<tr>
<td>HWID:</td>
<td><edit var="hwid" width="130" height="12"></td>
<td><a action="bypass -h admin_punishment_add $hwid HWID $punishmentType $expiration $reason">Ban</a></td>
</tr>
</table>
</center>
<br>

View File

@ -54,6 +54,8 @@ public class AdminPunishment implements IAdminCommandHandler
"admin_punishment_remove",
"admin_ban_acc",
"admin_unban_acc",
"admin_ban_hwid",
"admin_unban_hwid",
"admin_ban_chat",
"admin_unban_chat",
"admin_ban_char",
@ -182,6 +184,7 @@ public class AdminPunishment implements IAdminCommandHandler
content = content.replace("%acc%", target.getAccountName());
content = content.replace("%char%", target.getName());
content = content.replace("%ip%", target.getIPAddress());
content = content.replace("%hwid%", (target.getClient() == null) || (target.getClient().getHardwareInfo() == null) ? "Unknown" : target.getClient().getHardwareInfo().getMacAddress());
activeChar.sendPacket(new NpcHtmlMessage(0, 1, content));
}
else
@ -355,6 +358,22 @@ public class AdminPunishment implements IAdminCommandHandler
}
break;
}
case "admin_ban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_add %s %s %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN, 0, "Banned by admin"), activeChar);
}
break;
}
case "admin_unban_hwid":
{
if (st.hasMoreTokens())
{
return useAdminCommand(String.format("admin_punishment_remove %s %s %s", st.nextToken(), PunishmentAffect.HWID, PunishmentType.BAN), activeChar);
}
break;
}
case "admin_ban_chat":
{
if (st.hasMoreTokens())

View File

@ -76,6 +76,19 @@ public class BanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(player);
}
}
break;
}
}
}

View File

@ -73,6 +73,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -117,6 +130,19 @@ public class ChatBanHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -127,7 +153,7 @@ public class ChatBanHandler implements IPunishmentHandler
*/
private void applyToPlayer(PunishmentTask task, PlayerInstance player)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been chat banned for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -102,6 +102,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
applyToPlayer(task, player);
}
}
break;
}
}
}
@ -146,6 +159,19 @@ public class JailHandler implements IPunishmentHandler
}
break;
}
case HWID:
{
final String hwid = String.valueOf(task.getKey());
for (PlayerInstance player : World.getInstance().getPlayers())
{
final GameClient client = player.getClient();
if ((client != null) && client.getHardwareInfo().getMacAddress().equals(hwid))
{
removeFromPlayer(player);
}
}
break;
}
}
}
@ -181,7 +207,7 @@ public class JailHandler implements IPunishmentHandler
player.sendPacket(msg);
if (task != null)
{
final long delay = ((task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000);
final long delay = (task.getExpirationTime() - Chronos.currentTimeMillis()) / 1000;
if (delay > 0)
{
player.sendMessage("You've been jailed for " + (delay > 60 ? ((delay / 60) + " minutes.") : delay + " seconds."));

View File

@ -11462,7 +11462,10 @@ public class PlayerInstance extends Playable
*/
public boolean isJailed()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.JAIL) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.JAIL) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.JAIL));
}
/**
@ -11470,7 +11473,10 @@ public class PlayerInstance extends Playable
*/
public boolean isChatBanned()
{
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) || PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN);
return PunishmentManager.getInstance().hasPunishment(getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.CHAT_BAN) //
|| PunishmentManager.getInstance().hasPunishment(getIPAddress(), PunishmentAffect.IP, PunishmentType.CHAT_BAN) //
|| ((_client.getHardwareInfo() != null) && PunishmentManager.getInstance().hasPunishment(_client.getHardwareInfo().getMacAddress(), PunishmentAffect.HWID, PunishmentType.CHAT_BAN));
}
public void startFameTask(long delay, int fameFixRate)

View File

@ -23,8 +23,8 @@ public enum PunishmentAffect
{
ACCOUNT,
CHARACTER,
IP;
// HWID; Not implemented yet.
IP,
HWID;
public static PunishmentAffect getByName(String name)
{

View File

@ -101,7 +101,9 @@ public class CharacterSelect implements IClientIncomingPacket
}
// Banned?
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) || PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
if (PunishmentManager.getInstance().hasPunishment(info.getObjectId(), PunishmentAffect.CHARACTER, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getAccountName(), PunishmentAffect.ACCOUNT, PunishmentType.BAN) //
|| PunishmentManager.getInstance().hasPunishment(client.getConnectionAddress().getHostAddress(), PunishmentAffect.IP, PunishmentType.BAN))
{
client.close(ServerClose.STATIC_PACKET);
return;

View File

@ -42,6 +42,7 @@ import org.l2jmobius.gameserver.instancemanager.FortSiegeManager;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.instancemanager.MailManager;
import org.l2jmobius.gameserver.instancemanager.PetitionManager;
import org.l2jmobius.gameserver.instancemanager.PunishmentManager;
import org.l2jmobius.gameserver.instancemanager.ServerRestartManager;
import org.l2jmobius.gameserver.instancemanager.SiegeManager;
import org.l2jmobius.gameserver.instancemanager.events.GameEvent;
@ -57,6 +58,8 @@ import org.l2jmobius.gameserver.model.itemcontainer.Inventory;
import org.l2jmobius.gameserver.model.items.Item;
import org.l2jmobius.gameserver.model.items.instance.ItemInstance;
import org.l2jmobius.gameserver.model.items.type.EtcItemType;
import org.l2jmobius.gameserver.model.punishment.PunishmentAffect;
import org.l2jmobius.gameserver.model.punishment.PunishmentType;
import org.l2jmobius.gameserver.model.quest.Quest;
import org.l2jmobius.gameserver.model.residences.ClanHall;
import org.l2jmobius.gameserver.model.siege.Fort;
@ -248,12 +251,6 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Chat banned icon.
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
// Set dead status if applies
if (player.getCurrentHp() < 0.5)
{
@ -712,6 +709,7 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Delayed HWID checks.
if (Config.HARDWARE_INFO_ENABLED)
{
ThreadPool.schedule(() ->
@ -757,6 +755,13 @@ public class EnterWorld implements IClientIncomingPacket
}
}
// Banned?
if ((hwInfo != null) && PunishmentManager.getInstance().hasPunishment(hwInfo.getMacAddress(), PunishmentAffect.HWID, PunishmentType.BAN))
{
Disconnection.of(client).defaultSequence(false);
return;
}
// Check max players.
if (Config.KICK_MISSING_HWID && (hwInfo == null))
{
@ -779,6 +784,15 @@ public class EnterWorld implements IClientIncomingPacket
}
}, 5000);
}
// Chat banned icon.
ThreadPool.schedule(() ->
{
if (player.isChatBanned())
{
player.getEffectList().startAbnormalVisualEffect(AbnormalVisualEffect.NO_CHAT);
}
}, 5500);
}
/**

Some files were not shown because too many files have changed in this diff Show More