From 3ac0bc62478309fd60532e29aba88b348c8108bd Mon Sep 17 00:00:00 2001 From: stonedDiscord Date: Wed, 13 Oct 2021 22:45:59 +0200 Subject: [PATCH] add web range bans --- core/src/packets.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/src/packets.cpp b/core/src/packets.cpp index 52c37c3..76a5e63 100644 --- a/core/src/packets.cpp +++ b/core/src/packets.cpp @@ -398,6 +398,16 @@ void AOClient::pktWebSocketIp(AreaData* area, int argc, QStringList argv, AOPack qDebug() << "ws ip set to" << argv[0]; #endif m_remote_ip = QHostAddress(argv[0]); + + if (isIPBanned(m_remote_ip)){ + QString l_reason = "Your IP has been banned by a moderator."; + AOPacket l_ban_reason("BD", {l_reason}); + m_socket->write(l_ban_reason.toUtf8()); + client->deleteLater(); + m_socket->close(); + return; + } + calculateIpid(); auto l_ban = server->db_manager->isIPBanned(m_ipid); if (l_ban.first) {