mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Registered Only Server
Implemented the ability to set the server to only allow registered users. Also updated client to reflect the log-in rejection as well as put a check in place for the server to not start if db connection is not available yet registration is required.
This commit is contained in:
parent
fb4a7b3274
commit
d246fa39fe
7 changed files with 27 additions and 6 deletions
|
|
@ -132,12 +132,18 @@ bool Servatrice::initServer()
|
|||
{
|
||||
serverName = settings->value("server/name").toString();
|
||||
serverId = settings->value("server/id", 0).toInt();
|
||||
|
||||
bool 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