mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-11 16:44:48 -07:00
Re-Implemented the moderator notification upon user warning/ban
This commit is contained in:
parent
9c4bd8ebed
commit
acbe2b0b3c
3 changed files with 42 additions and 1 deletions
|
|
@ -262,6 +262,18 @@ void Server::removeClient(Server_ProtocolHandler *client)
|
|||
qDebug() << "Server::removeClient: removed" << (void *) client << ";" << clients.size() << "clients; " << users.size() << "users left";
|
||||
}
|
||||
|
||||
QList<QString> Server::getOnlineModeratorList()
|
||||
{
|
||||
// clients list should be locked by calling function prior to iteration otherwise sigfaults may occur
|
||||
QList<QString> results;
|
||||
for (int i = 0; i < clients.size(); ++i) {
|
||||
ServerInfo_User *data = clients[i]->getUserInfo();
|
||||
if (data->user_level() & ServerInfo_User::IsModerator || data->user_level() & ServerInfo_User::IsAdmin) //TODO: this line should be updated in the event there is any type of new user level created
|
||||
results << QString::fromStdString(data->name()).simplified();
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
void Server::externalUserJoined(const ServerInfo_User &userInfo)
|
||||
{
|
||||
// This function is always called from the main thread via signal/slot.
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public:
|
|||
virtual QMap<QString, bool> getServerRequiredFeatureList() const { return QMap<QString, bool>(); }
|
||||
void addClient(Server_ProtocolHandler *player);
|
||||
void removeClient(Server_ProtocolHandler *player);
|
||||
QList<QString> getOnlineModeratorList();
|
||||
virtual QString getLoginMessage() const { return QString(); }
|
||||
virtual bool permitUnregisteredUsers() const { return true; }
|
||||
virtual bool getGameShouldPing() const { return false; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue