diff options
author | Perttu Ahola <celeron55@gmail.com> | 2011-08-12 13:11:27 +0300 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2011-08-12 13:11:27 +0300 |
commit | e40da2341cfcd6580075571d325105b9a9fe783a (patch) | |
tree | 1af7670dccc4e18f05c8552d6d7540aa1fd5412f /src/ban.h | |
parent | 7aa72c56b6a3d3af8a7dbef36d3a71fa311a7242 (diff) | |
download | minetest-e40da2341cfcd6580075571d325105b9a9fe783a.tar.gz minetest-e40da2341cfcd6580075571d325105b9a9fe783a.tar.bz2 minetest-e40da2341cfcd6580075571d325105b9a9fe783a.zip |
Fixed/extended/modified ban stuff to be good for inclusion
Diffstat (limited to 'src/ban.h')
-rw-r--r-- | src/ban.h | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef BAN_HEADER #define BAN_HEADER -#include <set> +#include <map> #include <string> #include <jthread.h> #include <jmutex.h> @@ -34,14 +34,17 @@ public: ~BanManager(); void load(); void save(); - void add(std::string ip); - void remove(std::string ip); - bool isIpBanned(std::string ip); + bool isIpBanned(const std::string &ip); + // Supplying ip_or_name = "" lists all bans. + std::string getBanDescription(const std::string &ip_or_name); + std::string getBanName(const std::string &ip); + void add(const std::string &ip, const std::string &name); + void remove(const std::string &ip_or_name); bool isModified(); private: JMutex m_mutex; std::string m_banfilepath; - std::set<std::string> m_ips; + std::map<std::string, std::string> m_ips; bool m_modified; }; |