X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fban.h;h=3e2ab7a877ec989882f5d5e0ec4099b530f45dbb;hb=d73e458db6ab7748fcc7fd485f246971725ea48a;hp=f5b9c4440560e3a22eb0ea8ca0929c01952c4369;hpb=9f031a67594162a53b07acbfbc65faf8c4938e99;p=minetest.git diff --git a/src/ban.h b/src/ban.h index f5b9c4440..3e2ab7a87 100644 --- a/src/ban.h +++ b/src/ban.h @@ -1,6 +1,6 @@ /* -Minetest-c55 -Copyright (C) 2011 celeron55, Perttu Ahola +Minetest +Copyright (C) 2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -17,19 +17,19 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef BAN_HEADER -#define BAN_HEADER +#pragma once +#include "util/string.h" +#include "threading/thread.h" +#include "exceptions.h" #include #include -#include -#include -#include "exceptions.h" +#include class BanManager { public: - BanManager(const std::string &bannfilepath); + BanManager(const std::string &banfilepath); ~BanManager(); void load(); void save(); @@ -40,12 +40,10 @@ class BanManager 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::map m_ips; - bool m_modified; +private: + std::mutex m_mutex; + std::string m_banfilepath = ""; + StringMap m_ips; + bool m_modified = false; }; - -#endif