mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-02 03:23:56 -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
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue