Preparing the server management irc bot for further tasks.

This commit is contained in:
lotodore
2009-08-20 11:02:05 +00:00
parent 44d32b7376
commit 0aa285621b
8 changed files with 456 additions and 252 deletions
+5 -21
View File
@@ -22,7 +22,7 @@
#define _SERVERMANAGER_H_
#include <boost/asio.hpp>
#include <third_party/boost/timers.hpp>
#include <net/serverircbot.h>
#include <string>
#include <list>
@@ -30,13 +30,13 @@
#include <gui/guiinterface.h>
class ServerLobbyThread;
class IrcThread;
class ServerAcceptHelper;
class SenderThread;
class ConfigFile;
class AvatarManager;
class IrcThread;
class ServerManager : public IrcCallback
class ServerManager
{
public:
ServerManager(GuiInterface &gui, ConfigFile *config, AvatarManager &avatarManager);
@@ -55,20 +55,7 @@ public:
bool JoinAll(bool wait);
GuiInterface &GetGui();
virtual void SignalIrcConnect(const std::string &server);
virtual void SignalIrcSelfJoined(const std::string &nickName, const std::string &channel);
virtual void SignalIrcPlayerJoined(const std::string & /*nickName*/) {}
virtual void SignalIrcPlayerChanged(const std::string & /*oldNick*/, const std::string & /*newNick*/) {}
virtual void SignalIrcPlayerKicked(const std::string & /*nickName*/, const std::string & /*byWhom*/, const std::string & /*reason*/) {}
virtual void SignalIrcPlayerLeft(const std::string & /*nickName*/) {}
virtual void SignalIrcChatMsg(const std::string &nickName, const std::string &msg);
virtual void SignalIrcError(int errorCode);
virtual void SignalIrcServerError(int errorCode);
virtual void SignalLobbyPlayerJoined(unsigned, const std::string & /*nickName*/) {}
virtual void SignalLobbyPlayerKicked(const std::string & /*nickName*/, const std::string & /*byWhom*/, const std::string & /*reason*/) {}
virtual void SignalLobbyPlayerLeft(unsigned) {}
ServerIrcBot &GetIrcBot();
protected:
typedef std::list<boost::shared_ptr<ServerAcceptHelper> > AcceptHelperList;
@@ -80,12 +67,9 @@ private:
ConfigFile *m_playerConfig;
AvatarManager &m_avatarManager;
std::string m_ircNick;
boost::shared_ptr<boost::asio::io_service> m_ioService;
boost::shared_ptr<ServerLobbyThread> m_lobbyThread;
boost::shared_ptr<IrcThread> m_ircThread;
boost::timers::portable::microsec_timer m_ircRestartTimer;
boost::shared_ptr<ServerIrcBot> m_ircBot;
AcceptHelperList m_acceptHelperPool;
};