database interface separated from server, multiple concurrent database connections are now possible

This commit is contained in:
Max-Wilhelm Bruker 2012-05-28 16:32:45 +02:00
parent 2b89c353bf
commit b328c1ed4d
21 changed files with 347 additions and 310 deletions

View file

@ -2,6 +2,7 @@
#define LOCALSERVER_H
#include "server.h"
#include "server_database_interface.h"
class LocalServerInterface;
@ -13,8 +14,20 @@ public:
~LocalServer();
LocalServerInterface *newConnection();
};
class LocalServer_DatabaseInterface : public Server_DatabaseInterface {
Q_OBJECT
private:
LocalServer *localServer;
int nextGameId, nextReplayId;
protected:
ServerInfo_User getUserData(const QString &name, bool withId = false);
public:
LocalServer_DatabaseInterface(LocalServer *_localServer);
AuthenticationResult checkUserPassword(Server_ProtocolHandler *handler, const QString &user, const QString &password, QString &reasonStr, int &secondsLeft);
int getNextGameId() { return ++nextGameId; }
int getNextReplayId() { return ++nextReplayId; }
};
#endif