converted some Player commands to command lists; added db type checks in server

This commit is contained in:
Max-Wilhelm Bruker 2012-01-02 19:41:37 +01:00
parent 0c9a2b061c
commit 4634787b00
4 changed files with 127 additions and 75 deletions

View file

@ -56,7 +56,7 @@ public:
Servatrice(QSettings *_settings, QObject *parent = 0);
~Servatrice();
bool openDatabase();
void checkSql();
bool checkSql();
bool execSqlQuery(QSqlQuery &query);
QString getServerName() const { return serverName; }
QString getLoginMessage() const { return loginMessage; }
@ -87,6 +87,10 @@ protected:
bool userExists(const QString &user);
AuthenticationResult checkUserPassword(Server_ProtocolHandler *handler, const QString &user, const QString &password, QString &reasonStr);
private:
enum AuthenticationMethod { AuthenticationNone, AuthenticationSql };
enum DatabaseType { DatabaseNone, DatabaseMySql };
AuthenticationMethod authenticationMethod;
DatabaseType databaseType;
QTimer *pingClock, *statusUpdateClock;
QTcpServer *tcpServer;
QString serverName;