mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-28 11:53:11 -07:00
miscellaneous refactors (#4521)
This commit is contained in:
@@ -171,8 +171,6 @@ int main(int argc, char *argv[])
|
||||
std::cerr << "Servatrice " << VERSION_STRING << " starting." << std::endl;
|
||||
std::cerr << "-------------------------" << std::endl;
|
||||
|
||||
PasswordHasher::initialize();
|
||||
|
||||
if (testRandom) {
|
||||
testRNG();
|
||||
}
|
||||
|
||||
@@ -206,8 +206,9 @@ Servatrice::~Servatrice()
|
||||
|
||||
// clients live in other threads, we need to lock them
|
||||
clientsLock.lockForRead();
|
||||
for (auto client : clients)
|
||||
for (auto *client : clients) {
|
||||
QMetaObject::invokeMethod(client, "prepareDestroy", Qt::QueuedConnection);
|
||||
}
|
||||
clientsLock.unlock();
|
||||
|
||||
// client destruction is asynchronous, wait for all clients to be gone
|
||||
|
||||
@@ -893,8 +893,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdWarnUser(const Command_
|
||||
delete se;
|
||||
}
|
||||
|
||||
QListIterator<QString> modIterator(moderatorList);
|
||||
foreach (QString moderator, moderatorList) {
|
||||
for (QString &moderator : moderatorList) {
|
||||
QString notificationMessage = sendingModerator + " has sent a warning with the following information";
|
||||
notificationMessage.append("\n Username: " + userName);
|
||||
notificationMessage.append("\n Reason: " + warningReason);
|
||||
@@ -987,8 +986,7 @@ Response::ResponseCode AbstractServerSocketInterface::cmdBanFromServer(const Com
|
||||
}
|
||||
}
|
||||
|
||||
QListIterator<QString> modIterator(moderatorList);
|
||||
foreach (QString moderator, moderatorList) {
|
||||
for (QString &moderator : moderatorList) {
|
||||
QString notificationMessage =
|
||||
QString::fromStdString(userInfo->name()).simplified() + " has placed a ban with the following information";
|
||||
if (!userName.isEmpty())
|
||||
|
||||
Reference in New Issue
Block a user