mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
when banning an ip address, terminate the connection of everyone with that address
This commit is contained in:
parent
7faa033855
commit
eb06d6b4ea
3 changed files with 21 additions and 5 deletions
|
|
@ -394,6 +394,16 @@ int Servatrice::getUsersWithAddress(const QHostAddress &address) const
|
|||
return result;
|
||||
}
|
||||
|
||||
QList<ServerSocketInterface *> Servatrice::getUsersWithAddressAsList(const QHostAddress &address) const
|
||||
{
|
||||
QMutexLocker locker(&serverMutex);
|
||||
QList<ServerSocketInterface *> result;
|
||||
for (int i = 0; i < clients.size(); ++i)
|
||||
if (static_cast<ServerSocketInterface *>(clients[i])->getPeerAddress() == address)
|
||||
result.append(static_cast<ServerSocketInterface *>(clients[i]));
|
||||
return result;
|
||||
}
|
||||
|
||||
int Servatrice::startSession(const QString &userName, const QString &address)
|
||||
{
|
||||
if (authenticationMethod == AuthenticationNone)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue