mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
added admin tab; server status message update
This commit is contained in:
parent
714a0eee50
commit
bd9e142d1d
20 changed files with 242 additions and 65 deletions
|
|
@ -192,15 +192,24 @@ ServerInfo_User *Servatrice::getUserData(const QString &name)
|
|||
} else
|
||||
return new ServerInfo_User(name, ServerInfo_User::IsUser);
|
||||
}
|
||||
|
||||
#include <QDebug>
|
||||
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())
|
||||
if (query.next()) {
|
||||
loginMessage = query.value(0).toString();
|
||||
|
||||
Event_ServerMessage *event = new Event_ServerMessage(loginMessage);
|
||||
QMapIterator<QString, Server_ProtocolHandler *> usersIterator(users);
|
||||
while (usersIterator.hasNext()) {
|
||||
usersIterator.next().value()->sendProtocolItem(event, false);
|
||||
qDebug() << "sent message to" << usersIterator.value()->getUserInfo()->getName();
|
||||
}
|
||||
delete event;
|
||||
}
|
||||
}
|
||||
|
||||
void Servatrice::statusUpdate()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue