mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
improved code for automatic joining of persistent games; disconnecting + reconnecting works as it should with ISL
This commit is contained in:
parent
5db0fcd6ae
commit
af8e357487
13 changed files with 215 additions and 135 deletions
|
|
@ -49,14 +49,6 @@ IslInterface::~IslInterface()
|
|||
|
||||
// As these signals are connected with Qt::QueuedConnection implicitly,
|
||||
// we don't need to worry about them modifying the lists while we're iterating.
|
||||
server->clientsLock.lockForRead();
|
||||
QMapIterator<QString, Server_AbstractUserInterface *> extUsers(server->getExternalUsers());
|
||||
while (extUsers.hasNext()) {
|
||||
extUsers.next();
|
||||
if (extUsers.value()->getUserInfo()->server_id() == serverId)
|
||||
emit externalUserLeft(extUsers.key());
|
||||
}
|
||||
server->clientsLock.unlock();
|
||||
|
||||
server->roomsLock.lockForRead();
|
||||
QMapIterator<int, Server_Room *> roomIterator(server->getRooms());
|
||||
|
|
@ -72,6 +64,15 @@ IslInterface::~IslInterface()
|
|||
room->usersLock.unlock();
|
||||
}
|
||||
server->roomsLock.unlock();
|
||||
|
||||
server->clientsLock.lockForRead();
|
||||
QMapIterator<QString, Server_AbstractUserInterface *> extUsers(server->getExternalUsers());
|
||||
while (extUsers.hasNext()) {
|
||||
extUsers.next();
|
||||
if (extUsers.value()->getUserInfo()->server_id() == serverId)
|
||||
emit externalUserLeft(extUsers.key());
|
||||
}
|
||||
server->clientsLock.unlock();
|
||||
}
|
||||
|
||||
void IslInterface::initServer()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue