mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -07:00
database interface separated from server, multiple concurrent database connections are now possible
This commit is contained in:
parent
2b89c353bf
commit
b328c1ed4d
21 changed files with 347 additions and 310 deletions
|
|
@ -5,6 +5,7 @@
|
|||
LocalServer::LocalServer(QObject *parent)
|
||||
: Server(parent)
|
||||
{
|
||||
setDatabaseInterface(new LocalServer_DatabaseInterface(this));
|
||||
addRoom(new Server_Room(0, QString(), QString(), false, QString(), QStringList(), this));
|
||||
}
|
||||
|
||||
|
|
@ -15,14 +16,26 @@ LocalServer::~LocalServer()
|
|||
|
||||
LocalServerInterface *LocalServer::newConnection()
|
||||
{
|
||||
LocalServerInterface *lsi = new LocalServerInterface(this);
|
||||
LocalServerInterface *lsi = new LocalServerInterface(this, getDatabaseInterface());
|
||||
addClient(lsi);
|
||||
return lsi;
|
||||
}
|
||||
|
||||
ServerInfo_User LocalServer::getUserData(const QString &name, bool /*withId*/)
|
||||
LocalServer_DatabaseInterface::LocalServer_DatabaseInterface(LocalServer *_localServer)
|
||||
: Server_DatabaseInterface(_localServer),
|
||||
nextGameId(0),
|
||||
nextReplayId(0)
|
||||
{
|
||||
}
|
||||
|
||||
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, QString &reasonStr, int &secondsLeft)
|
||||
{
|
||||
return UnknownUser;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue