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;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE `cockatrice_servermessages` (
|
CREATE TABLE `cockatrice_servermessages` (
|
||||||
|
`id_server` tinyint(3) not null default 0,
|
||||||
`timest` datetime NOT NULL default '0000-00-00 00:00:00',
|
`timest` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||||
`message` text,
|
`message` text,
|
||||||
PRIMARY KEY (`timest`)
|
PRIMARY KEY (`timest`)
|
||||||
|
|
|
@ -333,7 +333,8 @@ void Servatrice::updateLoginMessage()
|
||||||
QMutexLocker locker(&dbMutex);
|
QMutexLocker locker(&dbMutex);
|
||||||
checkSql();
|
checkSql();
|
||||||
QSqlQuery query;
|
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 (execSqlQuery(query))
|
||||||
if (query.next()) {
|
if (query.next()) {
|
||||||
loginMessage = query.value(0).toString();
|
loginMessage = query.value(0).toString();
|
||||||
|
|
Loading…
Reference in a new issue