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

@@ -157,6 +157,26 @@ DeadLockCheckInterval = 20
RestartOnDeadlock = False
# ---------------------------------------------------------------------------
# Player HWID settings
# ---------------------------------------------------------------------------
# Check if hardware information is sent upon login.
# WARNING: To receive hardware information client needs a modified
# system for setting GameClient HWID via the setHardwareInfo method.
# Default: False
EnableHardwareInfo = False
# Players without hardware information are kicked from the game.
# Automatically set to True when MaxPlayersPerHWID > 0.
# Default: False
KickMissingHWID = False
# Maximum number of players per HWID allowed to enter game.
# Default: 0 (unlimited)
MaxPlayersPerHWID = 0
# ---------------------------------------------------------------------------
# Misc Player Settings
# ---------------------------------------------------------------------------

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;
}
}
}

View File

@@ -103,6 +103,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;
}
}
}
@@ -147,6 +160,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;
}
}
}