#include <ban.h>
Collaboration diagram for BanManager:Public Member Functions | |
| BanManager (const std::string &banfilepath) | |
| ~BanManager () | |
| void | load () |
| void | save () |
| bool | isIpBanned (const std::string &ip) const |
| std::string | getBanDescription (const std::string &ip_or_name) const |
| std::string | getBanName (const std::string &ip) const |
| void | add (const std::string &ip, const std::string &name) |
| void | remove (const std::string &ip_or_name) |
| bool | isModified () const |
Private Attributes | |
| std::mutex | m_mutex |
| std::string | m_banfilepath = "" |
| StringMap | m_ips |
| bool | m_modified = false |
| BanManager::BanManager | ( | const std::string & | banfilepath | ) |
| BanManager::~BanManager | ( | ) |
| void BanManager::add | ( | const std::string & | ip, |
| const std::string & | name ) |
References m_ips, m_modified, and m_mutex.
Referenced by Server::setIpBanned(), TestBan::testAdd(), TestBan::testGetBanDescription(), TestBan::testGetBanName(), TestBan::testModificationFlag(), and TestBan::testRemove().
Here is the caller graph for this function:| std::string BanManager::getBanDescription | ( | const std::string & | ip_or_name | ) | const |
References m_ips, and m_mutex.
Referenced by Server::getBanDescription(), and TestBan::testGetBanDescription().
Here is the caller graph for this function:| std::string BanManager::getBanName | ( | const std::string & | ip | ) | const |
References m_ips, and m_mutex.
Referenced by Server::denyIfBanned(), TestBan::testAdd(), TestBan::testGetBanName(), and TestBan::testRemove().
Here is the caller graph for this function:| bool BanManager::isIpBanned | ( | const std::string & | ip | ) | const |
References m_ips, and m_mutex.
Referenced by Server::denyIfBanned().
Here is the caller graph for this function:| bool BanManager::isModified | ( | ) | const |
References m_modified, and m_mutex.
Referenced by Server::AsyncRunStep(), and TestBan::testModificationFlag().
Here is the caller graph for this function:| void BanManager::load | ( | ) |
References infostream, m_banfilepath, m_ips, m_modified, m_mutex, BasicStrfnd< T >::next(), open_ifstream(), and trim().
Referenced by BanManager().
Here is the call graph for this function:
Here is the caller graph for this function:| void BanManager::remove | ( | const std::string & | ip_or_name | ) |
References m_ips, m_modified, and m_mutex.
Referenced by TestBan::testModificationFlag(), TestBan::testRemove(), and Server::unsetIpBanned().
Here is the caller graph for this function:| void BanManager::save | ( | ) |
References infostream, m_banfilepath, m_ips, m_modified, m_mutex, and fs::safeWriteToFile().
Referenced by ~BanManager(), Server::AsyncRunStep(), TestBan::testCreate(), and TestBan::testModificationFlag().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Referenced by BanManager(), load(), and save().
|
private |
Referenced by add(), getBanDescription(), getBanName(), isIpBanned(), load(), remove(), and save().
|
private |
Referenced by add(), isModified(), load(), remove(), and save().
|
mutableprivate |
Referenced by add(), getBanDescription(), getBanName(), isIpBanned(), isModified(), load(), remove(), and save().