added id_server to servermessages table
This commit is contained in:
parent
c4ba33dfeb
commit
773f4dd613
2 changed files with 3 additions and 1 deletions
|
@ -126,6 +126,7 @@ CREATE TABLE `cockatrice_uptime` (
|
|||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `cockatrice_servermessages` (
|
||||
`id_server` tinyint(3) not null default 0,
|
||||
`timest` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||
`message` text,
|
||||
PRIMARY KEY (`timest`)
|
||||
|
|
|
@ -333,7 +333,8 @@ void Servatrice::updateLoginMessage()
|
|||
QMutexLocker locker(&dbMutex);
|
||||
checkSql();
|
||||
QSqlQuery query;
|
||||
query.prepare("select message from " + dbPrefix + "_servermessages order by timest desc limit 1");
|
||||
query.prepare("select message from " + dbPrefix + "_servermessages where id_server = :id_server order by timest desc limit 1");
|
||||
query.bindValue(":id_server", serverId);
|
||||
if (execSqlQuery(query))
|
||||
if (query.next()) {
|
||||
loginMessage = query.value(0).toString();
|
||||
|
|
Loading…
Reference in a new issue