// Register storage backends here!
registerStorageBackend(new SqliteStorage(this));
if(!_storageBackends.count()) {
// Register storage backends here!
registerStorageBackend(new SqliteStorage(this));
if(!_storageBackends.count()) {
- quWarning() << qPrintable(tr("Could not initialize any storage backend! Exiting..."));
- quWarning() << qPrintable(tr("Currently, Quassel only supports SQLite3. You need to build your\n"
+ qWarning() << qPrintable(tr("Could not initialize any storage backend! Exiting..."));
+ qWarning() << qPrintable(tr("Currently, Quassel only supports SQLite3. You need to build your\n"
"Qt library with the sqlite plugin enabled in order for quasselcore\n"
"to work."));
exit(1); // TODO make this less brutal (especially for mono client -> popup)
"Qt library with the sqlite plugin enabled in order for quasselcore\n"
"to work."));
exit(1); // TODO make this less brutal (especially for mono client -> popup)
return configured = false;
}
if(!storage->init(dbSettings)) {
if(!setup || !(storage->setup(dbSettings) && storage->init(dbSettings))) {
return configured = false;
}
if(!storage->init(dbSettings)) {
if(!setup || !(storage->setup(dbSettings) && storage->init(dbSettings))) {
// in mono mode we only start a local port if a port is specified in the cli call
if(Quassel::runMode() == Quassel::Monolithic && !Quassel::isOptionSet("port"))
return true;
// in mono mode we only start a local port if a port is specified in the cli call
if(Quassel::runMode() == Quassel::Monolithic && !Quassel::isOptionSet("port"))
return true;
bool success = false;
uint port = Quassel::optionValue("port").toUInt();
if(_server.listen(QHostAddress::Any, port)) {
bool success = false;
uint port = Quassel::optionValue("port").toUInt();
if(_server.listen(QHostAddress::Any, port)) {
<< "using protocol version" << Quassel::buildInfo().protocolVersion;
success = true;
}
if(_v6server.listen(QHostAddress::AnyIPv6, port)) {
<< "using protocol version" << Quassel::buildInfo().protocolVersion;
success = true;
}
if(_v6server.listen(QHostAddress::AnyIPv6, port)) {
void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) {
if(!msg.contains("MsgType")) {
// Client is way too old, does not even use the current init format
void Core::processClientMessage(QTcpSocket *socket, const QVariantMap &msg) {
if(!msg.contains("MsgType")) {
// Client is way too old, does not even use the current init format
"This core needs at least client/core protocol version %1.<br>"
"Please consider upgrading your client.").arg(Quassel::buildInfo().coreNeedsProtocol);
SignalProxy::writeDataToDevice(socket, reply);
"This core needs at least client/core protocol version %1.<br>"
"Please consider upgrading your client.").arg(Quassel::buildInfo().coreNeedsProtocol);
SignalProxy::writeDataToDevice(socket, reply);
#ifdef HAVE_SSL
// after we told the client that we are ssl capable we switch to ssl mode
if(supportSsl && msg["UseSsl"].toBool()) {
#ifdef HAVE_SSL
// after we told the client that we are ssl capable we switch to ssl mode
if(supportSsl && msg["UseSsl"].toBool()) {
connect(sslSocket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
sslSocket->startServerEncryption();
}
connect(sslSocket, SIGNAL(sslErrors(const QList<QSslError> &)), this, SLOT(sslErrors(const QList<QSslError> &)));
sslSocket->startServerEncryption();
}
#ifndef QT_NO_COMPRESS
if(supportsCompression && msg["UseCompression"].toBool()) {
socket->setProperty("UseCompression", true);
#ifndef QT_NO_COMPRESS
if(supportsCompression && msg["UseCompression"].toBool()) {
socket->setProperty("UseCompression", true);
reply["MsgType"] = "ClientLoginReject";
reply["Error"] = tr("<b>Client not initialized!</b><br>You need to send an init message before trying to login.");
SignalProxy::writeDataToDevice(socket, reply);
reply["MsgType"] = "ClientLoginReject";
reply["Error"] = tr("<b>Client not initialized!</b><br>You need to send an init message before trying to login.");
SignalProxy::writeDataToDevice(socket, reply);
SessionThread *Core::createSession(UserId uid, bool restore) {
if(sessions.contains(uid)) {
SessionThread *Core::createSession(UserId uid, bool restore) {
if(sessions.contains(uid)) {
void Core::socketError(QAbstractSocket::SocketError err) {
QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(sender());
if(socket && err != QAbstractSocket::RemoteHostClosedError)
void Core::socketError(QAbstractSocket::SocketError err) {
QAbstractSocket *socket = qobject_cast<QAbstractSocket *>(sender());
if(socket && err != QAbstractSocket::RemoteHostClosedError)