add web range bans

This commit is contained in:
stonedDiscord 2021-10-13 22:45:59 +02:00 committed by Salanto
parent 09df305de2
commit 3ac0bc6247

View File

@ -398,6 +398,16 @@ void AOClient::pktWebSocketIp(AreaData* area, int argc, QStringList argv, AOPack
qDebug() << "ws ip set to" << argv[0]; qDebug() << "ws ip set to" << argv[0];
#endif #endif
m_remote_ip = QHostAddress(argv[0]); 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(); calculateIpid();
auto l_ban = server->db_manager->isIPBanned(m_ipid); auto l_ban = server->db_manager->isIPBanned(m_ipid);
if (l_ban.first) { if (l_ban.first) {