mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 00:24:47 -07:00
rooms work mostly
This commit is contained in:
parent
b73001e9fd
commit
80277ff573
25 changed files with 726 additions and 576 deletions
|
|
@ -64,7 +64,7 @@ Servatrice::Servatrice(QObject *parent)
|
|||
}
|
||||
settings->endArray();
|
||||
|
||||
loginMessage = settings->value("messages/login").toString();
|
||||
updateLoginMessage();
|
||||
|
||||
maxGameInactivityTime = settings->value("game/max_game_inactivity_time").toInt();
|
||||
maxPlayerInactivityTime = settings->value("game/max_player_inactivity_time").toInt();
|
||||
|
|
@ -185,6 +185,16 @@ ServerInfo_User *Servatrice::getUserData(const QString &name)
|
|||
return new ServerInfo_User(name, ServerInfo_User::IsUser);
|
||||
}
|
||||
|
||||
void Servatrice::updateLoginMessage()
|
||||
{
|
||||
checkSql();
|
||||
QSqlQuery query;
|
||||
query.prepare("select message from " + dbPrefix + "_servermessages order by timest desc limit 1");
|
||||
if (execSqlQuery(query))
|
||||
if (query.next())
|
||||
loginMessage = query.value(0).toString();
|
||||
}
|
||||
|
||||
void Servatrice::statusUpdate()
|
||||
{
|
||||
uptime += statusUpdateClock->interval() / 1000;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@ public:
|
|||
int getMaxGameInactivityTime() const { return maxGameInactivityTime; }
|
||||
int getMaxPlayerInactivityTime() const { return maxPlayerInactivityTime; }
|
||||
QString getDbPrefix() const { return dbPrefix; }
|
||||
void updateLoginMessage();
|
||||
protected:
|
||||
AuthenticationResult checkUserPassword(const QString &user, const QString &password);
|
||||
ServerInfo_User *getUserData(const QString &name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue