Changes to allow regex bans. Might need updating of pro-files due to boost::regex dependency.

This commit is contained in:
lotodore
2009-04-07 22:04:38 +00:00
parent 3abaaa94f7
commit e59e50c10b
2 changed files with 48 additions and 2 deletions
+8 -1
View File
@@ -29,6 +29,7 @@
#include <deque>
#include <list>
#include <boost/regex.hpp>
#include <third_party/boost/timers.hpp>
#define NET_LOBBY_THREAD_TERMINATE_TIMEOUT_MSEC 20000
@@ -68,6 +69,8 @@ public:
void HandleGameRetrieveAvatar(SessionWrapper session, const NetPacketRetrieveAvatar &tmpPacket);
bool KickPlayerByName(const std::string &playerName);
void BanPlayerRegex(const std::string &playerRegex);
void ClearBanList();
void RemovePlayer(unsigned playerId, unsigned errorCode);
void SendGlobalChat(const std::string &message);
@@ -156,7 +159,8 @@ protected:
ServerSenderCallback &GetSenderCallback();
GuiInterface &GetGui();
bool IsPlayerConnected(const std::string &name);
bool IsPlayerConnected(const std::string &name) const;
bool IsPlayerBanned(const std::string &name) const;
static boost::shared_ptr<NetPacket> CreateNetPacketGameListNew(const ServerGameThread &game);
static boost::shared_ptr<NetPacket> CreateNetPacketGameListUpdate(unsigned gameId, GameMode mode);
@@ -187,6 +191,9 @@ private:
SessionIdList m_resubscribeList;
mutable boost::mutex m_resubscribeListMutex;
RegExList m_banPlayerNameList;
mutable boost::mutex m_banPlayerNameListMutex;
GameMap m_gameMap;
boost::shared_ptr<SenderInterface> m_sender;