Added support for password protected irc channels. Added server IRC mode for admin use, to allow requesting statistics and kicking players.
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <game_defs.h>
|
||||
#include <core/thread.h>
|
||||
|
||||
#include <gui/guiinterface.h>
|
||||
#include <string>
|
||||
|
||||
@@ -32,20 +33,31 @@ class ServerSenderCallback;
|
||||
class SenderThread;
|
||||
class ConfigFile;
|
||||
class AvatarManager;
|
||||
class IrcThread;
|
||||
struct GameData;
|
||||
|
||||
class ServerAcceptThread : public Thread
|
||||
class ServerAcceptThread : public Thread, public IrcCallback
|
||||
{
|
||||
public:
|
||||
ServerAcceptThread(GuiInterface &gui, ConfigFile *config, AvatarManager &avatarManager);
|
||||
virtual ~ServerAcceptThread();
|
||||
|
||||
// Set the parameters.
|
||||
void Init(unsigned serverPort, bool ipv6, bool sctp, const std::string &pwd, const std::string &logDir);
|
||||
void Init(unsigned serverPort, bool ipv6, bool sctp, const std::string &pwd, const std::string &logDir, boost::shared_ptr<IrcThread> ircThread);
|
||||
|
||||
ServerCallback &GetCallback();
|
||||
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);
|
||||
|
||||
protected:
|
||||
|
||||
// Main function of the thread.
|
||||
@@ -64,6 +76,9 @@ private:
|
||||
boost::shared_ptr<ServerLobbyThread> m_lobbyThread;
|
||||
|
||||
GuiInterface &m_gui;
|
||||
|
||||
std::string m_ircNick;
|
||||
boost::shared_ptr<IrcThread> m_ircThread;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user