mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
initial commit for connection pools
This commit is contained in:
parent
c2edd33e90
commit
981db47f9e
21 changed files with 829 additions and 700 deletions
36
common/server_database_interface.h
Normal file
36
common/server_database_interface.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef SERVER_DATABASE_INTERFACE_H
|
||||
#define SERVER_DATABASE_INTERFACE_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "server.h"
|
||||
|
||||
class Server_DatabaseInterface : public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
int nextGameId, nextReplayId;
|
||||
public:
|
||||
Server_DatabaseInterface();
|
||||
|
||||
virtual AuthenticationResult checkUserPassword(Server_ProtocolHandler *handler, const QString &user, const QString &password, QString &reasonStr, int &secondsLeft) = 0;
|
||||
virtual bool userExists(const QString &user) { return false; }
|
||||
virtual QMap<QString, ServerInfo_User> getBuddyList(const QString &name) { return QMap<QString, ServerInfo_User>(); }
|
||||
virtual QMap<QString, ServerInfo_User> getIgnoreList(const QString &name) { return QMap<QString, ServerInfo_User>(); }
|
||||
virtual bool isInBuddyList(const QString &whoseList, const QString &who) { return false; }
|
||||
virtual bool isInIgnoreList(const QString &whoseList, const QString &who) { return false; }
|
||||
virtual ServerInfo_User getUserData(const QString &name, bool withId = false) = 0;
|
||||
|
||||
virtual qint64 startSession(const QString &userName, const QString &address) { return 0; }
|
||||
public slots:
|
||||
virtual void endSession(qint64 sessionId) { }
|
||||
public:
|
||||
virtual int getNextGameId() { return nextGameId++; }
|
||||
virtual int getNextReplayId() { return nextReplayId++; }
|
||||
|
||||
virtual void clearSessionTables() { }
|
||||
virtual void lockSessionTables() { }
|
||||
virtual void unlockSessionTables() { }
|
||||
virtual bool userSessionExists(const QString &userName) { return false; }
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue