1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

Cosmetic improvements for lobby

This commit is contained in:
nordsoft
2022-11-16 04:22:48 +04:00
parent e0aa26e599
commit 15ba4cda70
5 changed files with 42 additions and 20 deletions

View File

@ -21,16 +21,13 @@ SocketLobby::SocketLobby(QObject *parent) :
connect(socket, SIGNAL(bytesWritten(qint64)), this, SLOT(bytesWritten(qint64)));
}
void SocketLobby::connectServer(const QString & host, int port, const QString & usr)
void SocketLobby::connectServer(const QString & host, int port, const QString & usr, int timeout)
{
const int connectionTimeout = 2000;
username = usr;
emit text("Connecting to " + host + ":" + QString::number(port));
socket->connectToHost(host, port);
if(!socket->waitForDisconnected(connectionTimeout) && !isConnected)
if(!socket->waitForDisconnected(timeout) && !isConnected)
{
emit text("Error: " + socket->errorString());
}