mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-11 04:43:56 -07:00
Server Startup Verify
Implement check during server startup to validate it wont start with no db connection yet require registered users.
This commit is contained in:
parent
a6bd08815c
commit
3fbdf735ee
1 changed files with 9 additions and 3 deletions
|
|
@ -132,12 +132,18 @@ bool Servatrice::initServer()
|
|||
{
|
||||
serverName = settings->value("server/name").toString();
|
||||
serverId = settings->value("server/id", 0).toInt();
|
||||
|
||||
regServerOnly = settings->value("server/regonly", 0).toBool();
|
||||
|
||||
const QString authenticationMethodStr = settings->value("authentication/method").toString();
|
||||
if (authenticationMethodStr == "sql")
|
||||
if (authenticationMethodStr == "sql") {
|
||||
authenticationMethod = AuthenticationSql;
|
||||
else
|
||||
} else {
|
||||
if (regServerOnly) {
|
||||
qDebug() << "Registration only server enabled but no DB Connection : Error.";
|
||||
return false;
|
||||
}
|
||||
authenticationMethod = AuthenticationNone;
|
||||
}
|
||||
|
||||
QString dbTypeStr = settings->value("database/type").toString();
|
||||
if (dbTypeStr == "mysql")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue