LoginHandler::LoginHandler(Client *client, SessionServer *server) : QObject(client), _client(client), _server(server), _hostPrivilege(false), _complete(false) { connect(client, SIGNAL(loginMessage(protocol::MessagePtr)), this, SLOT(handleLoginMessage(protocol::MessagePtr))); connect(server, &SessionServer::sessionChanged, this, &LoginHandler::announceSession); connect(server, &SessionServer::sessionEnded, this, &LoginHandler::announceSessionEnd); }
void AccountClient::login(const QString &username, const QString &password, const QByteArray &salt) { MessageOut loginMessage(PAMSG_LOGIN); loginMessage.writeInt32(PROTOCOL_VERSION); loginMessage.writeString(username); loginMessage.writeString(passwordSaltedHash(username, password, salt)); send(loginMessage); }
void RequestWorker::run() { try { Logger::setPidName("net"); LOG(logDEBUG) << "request execution thread started"; m_pyloadConnection = new PyLoadThriftConnector(m_hostname, m_port); bool loginSuccesfull = m_pyloadConnection->login("buildserver", "buildserver"); std::string loginMessage("Login to thrift failed"); if (loginSuccesfull) { loginMessage = "Login to thrift succesfull"; } LOG(logINFO) << loginMessage; while (true) { Request* r = m_requestQueue.getNextRequest(); r->execute(m_pyloadConnection); delete r; } } catch (boost::thread_interrupted&) { LOG(logDEBUG) << "terminate request execution thread"; } }