Check banned hwid on login

This commit is contained in:
P0nk
2024-09-29 22:22:23 +02:00
parent 988d898d6f
commit 167937bb88
2 changed files with 3 additions and 1 deletions

View File

@@ -334,6 +334,8 @@ public class Client extends ChannelInboundHandlerAdapter {
return ret; return ret;
} }
// TODO: load hwidbans on server start and query it on demand. This query should not be run on every login!
@Deprecated
public boolean hasBannedHWID() { public boolean hasBannedHWID() {
if (hwid == null) { if (hwid == null) {
return false; return false;

View File

@@ -110,7 +110,7 @@ public final class LoginPasswordHandler implements PacketHandler {
} }
boolean banCheckDisabled = false; boolean banCheckDisabled = false;
if (!banCheckDisabled && (c.hasBannedIP() || c.hasBannedMac())) { if (!banCheckDisabled && (c.hasBannedIP() || c.hasBannedMac() || c.hasBannedHWID())) {
c.sendPacket(PacketCreator.getLoginFailed(3)); c.sendPacket(PacketCreator.getLoginFailed(3));
return; return;
} }