mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Serve the login message through the database interface (#7854)
This commit is contained in:
parent
ec3ad812f0
commit
f8f8fffa6b
4 changed files with 35 additions and 18 deletions
|
|
@ -3293,6 +3293,23 @@ Server_DatabaseInterface::UptimeSnapshot Servatrice_DatabaseInterface::getLatest
|
|||
return snapshot;
|
||||
}
|
||||
|
||||
bool Servatrice_DatabaseInterface::getLatestServerMessage(int serverId, QString &message)
|
||||
{
|
||||
if (!checkSql()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
QSqlQuery *query = prepareQuery(
|
||||
"select message from {prefix}_servermessages where id_server = :id_server order by timest desc limit 1");
|
||||
query->bindValue(":id_server", serverId);
|
||||
if (!execSqlQuery(query) || !query->next()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
message = query->value(0).toString();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Servatrice_DatabaseInterface::removeUserAvatar(const QString &userName)
|
||||
{
|
||||
if (!checkSql()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue