Move local/remote client and local server files.

Took 32 minutes


Took 8 seconds
This commit is contained in:
Lukas Brübach 2025-10-08 13:15:50 +02:00
parent 484e177589
commit 4e7c98829a
47 changed files with 291 additions and 43 deletions

View file

@ -1,51 +0,0 @@
#include "local_server.h"
#include "local_server_interface.h"
#include <libcockatrice/server/server_room.h>
LocalServer::LocalServer(QObject *parent) : Server(parent)
{
setDatabaseInterface(new LocalServer_DatabaseInterface(this));
addRoom(new Server_Room(0, 0, QString(), QString(), QString(), QString(), false, QString(), QStringList(), this));
}
LocalServer::~LocalServer()
{
// LocalServer is single threaded so it doesn't need locks on this
for (auto *client : clients) {
client->prepareDestroy();
}
prepareDestroy();
}
LocalServerInterface *LocalServer::newConnection()
{
LocalServerInterface *lsi = new LocalServerInterface(this, getDatabaseInterface());
addClient(lsi);
return lsi;
}
LocalServer_DatabaseInterface::LocalServer_DatabaseInterface(LocalServer *_localServer)
: Server_DatabaseInterface(_localServer), localServer(_localServer)
{
}
ServerInfo_User LocalServer_DatabaseInterface::getUserData(const QString &name, bool /*withId*/)
{
ServerInfo_User result;
result.set_name(name.toStdString());
return result;
}
AuthenticationResult LocalServer_DatabaseInterface::checkUserPassword(Server_ProtocolHandler * /* handler */,
const QString & /* user */,
const QString & /* password */,
const QString & /* clientId */,
QString & /* reasonStr */,
int & /* banSecondsLeft */,
bool /* passwordNeedsHash */)
{
return UnknownUser;
}