Added irc support for lobby dialog. Takes some time to connect before messages can be sent/received. No special stuff yet, no user list, no connection notifications. Still work in progress.
This commit is contained in:
@@ -68,6 +68,8 @@ HEADERS += \
|
|||||||
src/net/socket_helper.h \
|
src/net/socket_helper.h \
|
||||||
src/net/socket_msg.h \
|
src/net/socket_msg.h \
|
||||||
src/net/socket_startup.h \
|
src/net/socket_startup.h \
|
||||||
|
src/net/irccallback.h \
|
||||||
|
src/net/ircthread.h \
|
||||||
src/core/tinyxml/tinystr.h \
|
src/core/tinyxml/tinystr.h \
|
||||||
src/core/tinyxml/tinyxml.h \
|
src/core/tinyxml/tinyxml.h \
|
||||||
src/core/libircclient/include/libircclient.h \
|
src/core/libircclient/include/libircclient.h \
|
||||||
@@ -154,6 +156,8 @@ SOURCES += \
|
|||||||
src/net/common/netcontext.cpp \
|
src/net/common/netcontext.cpp \
|
||||||
src/net/common/netexception.cpp \
|
src/net/common/netexception.cpp \
|
||||||
src/net/common/receiverhelper.cpp \
|
src/net/common/receiverhelper.cpp \
|
||||||
|
src/net/common/irccallback.cpp \
|
||||||
|
src/net/common/ircthread.cpp \
|
||||||
src/gui/qttoolsinterface.cpp \
|
src/gui/qttoolsinterface.cpp \
|
||||||
src/gui/qt/qttools/qttoolswrapper.cpp \
|
src/gui/qt/qttools/qttoolswrapper.cpp \
|
||||||
src/gui/qt/qttools/qthelper/qthelper.cpp \
|
src/gui/qt/qttools/qthelper/qthelper.cpp \
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
ServerGuiWrapper::ServerGuiWrapper(ConfigFile *config, ClientCallback *clientcb, ServerCallback *servercb)
|
ServerGuiWrapper::ServerGuiWrapper(ConfigFile *config, ClientCallback *clientcb, ServerCallback *servercb, IrcCallback *irccb)
|
||||||
: myConfig(config), myClientcb(clientcb), myServercb(servercb)
|
: myConfig(config), myClientcb(clientcb), myServercb(servercb), myIrccb(irccb)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,3 +125,4 @@ void ServerGuiWrapper::SignalNetClientWaitDialog() { if (myClientcb) myClientcb-
|
|||||||
void ServerGuiWrapper::SignalNetServerSuccess(int actionID) { if (myServercb) myServercb->SignalNetServerSuccess(actionID); }
|
void ServerGuiWrapper::SignalNetServerSuccess(int actionID) { if (myServercb) myServercb->SignalNetServerSuccess(actionID); }
|
||||||
void ServerGuiWrapper::SignalNetServerError(int errorID, int osErrorID) { if (myServercb) myServercb->SignalNetServerError(errorID, osErrorID); }
|
void ServerGuiWrapper::SignalNetServerError(int errorID, int osErrorID) { if (myServercb) myServercb->SignalNetServerError(errorID, osErrorID); }
|
||||||
|
|
||||||
|
void ServerGuiWrapper::SignalIrcChatMsg(const string &nickName, const string &msg) { if (myIrccb) myIrccb->SignalIrcChatMsg(nickName, msg); }
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class Session;
|
|||||||
class ServerGuiWrapper : public GuiInterface
|
class ServerGuiWrapper : public GuiInterface
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ServerGuiWrapper(ConfigFile *config, ClientCallback *clientcb, ServerCallback *servercb);
|
ServerGuiWrapper(ConfigFile *config, ClientCallback *clientcb, ServerCallback *servercb, IrcCallback *irccb);
|
||||||
~ServerGuiWrapper();
|
~ServerGuiWrapper();
|
||||||
|
|
||||||
void initGui(int speed);
|
void initGui(int speed);
|
||||||
@@ -110,6 +110,8 @@ public:
|
|||||||
void SignalNetServerSuccess(int actionID);
|
void SignalNetServerSuccess(int actionID);
|
||||||
void SignalNetServerError(int errorID, int osErrorID);
|
void SignalNetServerError(int errorID, int osErrorID);
|
||||||
|
|
||||||
|
void SignalIrcChatMsg(const std::string &nickName, const std::string &msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
boost::shared_ptr<Session> mySession;
|
boost::shared_ptr<Session> mySession;
|
||||||
@@ -117,6 +119,7 @@ private:
|
|||||||
|
|
||||||
ClientCallback *myClientcb;
|
ClientCallback *myClientcb;
|
||||||
ServerCallback *myServercb;
|
ServerCallback *myServercb;
|
||||||
|
IrcCallback *myIrccb;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <net/clientcallback.h>
|
#include <net/clientcallback.h>
|
||||||
#include <net/servercallback.h>
|
#include <net/servercallback.h>
|
||||||
|
#include <net/irccallback.h>
|
||||||
#include <game_defs.h>
|
#include <game_defs.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
@@ -30,7 +31,7 @@
|
|||||||
class Session;
|
class Session;
|
||||||
|
|
||||||
|
|
||||||
class GuiInterface : public ClientCallback, public ServerCallback {
|
class GuiInterface : public ClientCallback, public ServerCallback, public IrcCallback {
|
||||||
public:
|
public:
|
||||||
virtual ~GuiInterface();
|
virtual ~GuiInterface();
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,11 @@ gameLobbyDialogImpl::gameLobbyDialogImpl(QWidget *parent, ConfigFile *c)
|
|||||||
|
|
||||||
void gameLobbyDialogImpl::exec()
|
void gameLobbyDialogImpl::exec()
|
||||||
{
|
{
|
||||||
|
assert(mySession);
|
||||||
|
mySession->terminateIrcClient();
|
||||||
|
mySession->startIrcClient();
|
||||||
QDialog::exec();
|
QDialog::exec();
|
||||||
|
mySession->terminateIrcClient();
|
||||||
clearDialog();
|
clearDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,9 +388,10 @@ void gameLobbyDialogImpl::kickPlayer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void gameLobbyDialogImpl::sendChatMessage() { myChat->sendMessage(); }
|
void gameLobbyDialogImpl::sendChatMessage() { myChat->sendMessage(); }
|
||||||
|
void gameLobbyDialogImpl::displayChatMessage(QString nickName, QString msg) { myChat->receiveMessage(nickName, msg); }
|
||||||
void gameLobbyDialogImpl::checkChatInputLength(QString string) { myChat->checkInputLength(string); }
|
void gameLobbyDialogImpl::checkChatInputLength(QString string) { myChat->checkInputLength(string); }
|
||||||
|
|
||||||
void gameLobbyDialogImpl::keyPressEvent ( QKeyEvent * event ) {
|
void gameLobbyDialogImpl::keyPressEvent ( QKeyEvent * event ) {
|
||||||
|
|
||||||
if (event->key() == Qt::Key_Enter) {}
|
if (event->key() == Qt::Key_Enter) { sendChatMessage(); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ public slots:
|
|||||||
void clearDialog();
|
void clearDialog();
|
||||||
|
|
||||||
void sendChatMessage();
|
void sendChatMessage();
|
||||||
|
void displayChatMessage(QString nickName, QString msg);
|
||||||
void checkChatInputLength(QString string);
|
void checkChatInputLength(QString string);
|
||||||
|
|
||||||
void keyPressEvent(QKeyEvent * event);
|
void keyPressEvent(QKeyEvent * event);
|
||||||
|
|||||||
@@ -38,8 +38,12 @@ LobbyChat::~LobbyChat()
|
|||||||
|
|
||||||
void LobbyChat::sendMessage() {
|
void LobbyChat::sendMessage() {
|
||||||
|
|
||||||
myLobby->getSession().sendChatMessage(myLobby->lineEdit_ChatInput->text().toUtf8().constData());
|
QString tmpMsg(myLobby->lineEdit_ChatInput->text());
|
||||||
|
myLobby->getSession().sendIrcChatMessage(tmpMsg.toUtf8().constData());
|
||||||
myLobby->lineEdit_ChatInput->setText("");
|
myLobby->lineEdit_ChatInput->setText("");
|
||||||
|
|
||||||
|
// TODO: just temporary instead of callback
|
||||||
|
receiveMessage("(me)", tmpMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LobbyChat::receiveMessage(QString playerName, QString message) {
|
void LobbyChat::receiveMessage(QString playerName, QString message) {
|
||||||
|
|||||||
@@ -139,3 +139,5 @@ void GuiWrapper::SignalNetClientWaitDialog() { myW->signalShowNetworkStartDialog
|
|||||||
void GuiWrapper::SignalNetServerSuccess(int actionID) { }
|
void GuiWrapper::SignalNetServerSuccess(int actionID) { }
|
||||||
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); }
|
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myW->signalNetServerError(errorID, osErrorID); }
|
||||||
|
|
||||||
|
void GuiWrapper::SignalIrcChatMsg(const std::string &nickName, const std::string &msg) { myW->signalIrcChatMessage(QString::fromUtf8(nickName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||||
|
|
||||||
|
|||||||
@@ -118,6 +118,8 @@ public:
|
|||||||
void SignalNetServerSuccess(int actionID);
|
void SignalNetServerSuccess(int actionID);
|
||||||
void SignalNetServerError(int errorID, int osErrorID);
|
void SignalNetServerError(int errorID, int osErrorID);
|
||||||
|
|
||||||
|
void SignalIrcChatMsg(const std::string &nickName, const std::string &msg);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
Log *myLog;
|
Log *myLog;
|
||||||
|
|||||||
@@ -676,6 +676,8 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
|
|||||||
connect(this, SIGNAL(signalNetServerError(int, int)), this, SLOT(networkError(int, int)));
|
connect(this, SIGNAL(signalNetServerError(int, int)), this, SLOT(networkError(int, int)));
|
||||||
connect(this, SIGNAL(signalNetClientGameStart(boost::shared_ptr<Game>)), this, SLOT(networkStart(boost::shared_ptr<Game>)));
|
connect(this, SIGNAL(signalNetClientGameStart(boost::shared_ptr<Game>)), this, SLOT(networkStart(boost::shared_ptr<Game>)));
|
||||||
|
|
||||||
|
connect(this, SIGNAL(signalIrcChatMessage(QString, QString)), myGameLobbyDialog, SLOT(displayChatMessage(QString, QString)));
|
||||||
|
|
||||||
//Sound
|
//Sound
|
||||||
mySDLPlayer = new SDLPlayer(myConfig);
|
mySDLPlayer = new SDLPlayer(myConfig);
|
||||||
|
|
||||||
@@ -758,7 +760,7 @@ void mainWindowImpl::callCreateNetworkGameDialog() {
|
|||||||
if (!myServerGuiInterface.get())
|
if (!myServerGuiInterface.get())
|
||||||
{
|
{
|
||||||
// Create pseudo Gui Wrapper for the server.
|
// Create pseudo Gui Wrapper for the server.
|
||||||
myServerGuiInterface.reset(new ServerGuiWrapper(myConfig, mySession->getGui(), mySession->getGui()));
|
myServerGuiInterface.reset(new ServerGuiWrapper(myConfig, mySession->getGui(), mySession->getGui(), mySession->getGui()));
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Session> session(new Session(myServerGuiInterface.get(), myConfig));
|
boost::shared_ptr<Session> session(new Session(myServerGuiInterface.get(), myConfig));
|
||||||
myServerGuiInterface->setSession(session);
|
myServerGuiInterface->setSession(session);
|
||||||
|
|||||||
@@ -138,6 +138,8 @@ signals:
|
|||||||
void signalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId);
|
void signalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId);
|
||||||
void signalNetClientGameStart(boost::shared_ptr<Game> game);
|
void signalNetClientGameStart(boost::shared_ptr<Game> game);
|
||||||
|
|
||||||
|
void signalIrcChatMessage(QString nickName, QString msg);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
||||||
void initGui(int speed);
|
void initGui(int speed);
|
||||||
|
|||||||
@@ -34,11 +34,25 @@ struct IrcContext
|
|||||||
string channel;
|
string channel;
|
||||||
};
|
};
|
||||||
|
|
||||||
void event_connect(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned count)
|
void
|
||||||
|
irc_connect(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned count)
|
||||||
{
|
{
|
||||||
IrcContext *ctx = (IrcContext *) irc_get_ctx(session);
|
IrcContext *context = (IrcContext *) irc_get_ctx(session);
|
||||||
|
|
||||||
irc_cmd_join(session, ctx->channel.c_str(), 0);
|
irc_cmd_join(session, context->channel.c_str(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
irc_channel(irc_session_t *session, const char *event, const char *origin, const char **params, unsigned count)
|
||||||
|
{
|
||||||
|
IrcContext *context = (IrcContext *) irc_get_ctx(session);
|
||||||
|
|
||||||
|
if (context->channel == params[0]) // check whether this message is for our channel
|
||||||
|
{
|
||||||
|
// Signal the message (if any) to GUI.
|
||||||
|
if (params[1] && *params[1] != 0)
|
||||||
|
context->ircThread.GetCallback().SignalIrcChatMsg(origin, params[1]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -69,7 +83,7 @@ IrcThread::Init(const std::string &serverAddress, unsigned serverPort, bool ipv6
|
|||||||
irc_callbacks_t callbacks;
|
irc_callbacks_t callbacks;
|
||||||
memset (&callbacks, 0, sizeof(callbacks));
|
memset (&callbacks, 0, sizeof(callbacks));
|
||||||
|
|
||||||
callbacks.event_connect = event_connect;
|
callbacks.event_connect = irc_connect;
|
||||||
//callbacks.event_join
|
//callbacks.event_join
|
||||||
//callbacks.event_nick
|
//callbacks.event_nick
|
||||||
//callbacks.event_quit
|
//callbacks.event_quit
|
||||||
@@ -77,7 +91,7 @@ IrcThread::Init(const std::string &serverAddress, unsigned serverPort, bool ipv6
|
|||||||
//callbacks.event_mode
|
//callbacks.event_mode
|
||||||
//callbacks.event_topic
|
//callbacks.event_topic
|
||||||
//callbacks.event_kick
|
//callbacks.event_kick
|
||||||
//callbacks.event_channel
|
callbacks.event_channel = irc_channel;
|
||||||
//callbacks.event_privmsg
|
//callbacks.event_privmsg
|
||||||
//callbacks.event_notice
|
//callbacks.event_notice
|
||||||
//callbacks.event_invite
|
//callbacks.event_invite
|
||||||
@@ -100,6 +114,13 @@ IrcThread::Init(const std::string &serverAddress, unsigned serverPort, bool ipv6
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
IrcThread::SendChatMessage(const std::string &msg)
|
||||||
|
{
|
||||||
|
IrcContext &context = GetContext();
|
||||||
|
irc_cmd_msg(context.session, context.channel.c_str(), msg.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
IrcThread::SignalTermination()
|
IrcThread::SignalTermination()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class IrcCallback
|
|||||||
public:
|
public:
|
||||||
virtual ~IrcCallback();
|
virtual ~IrcCallback();
|
||||||
|
|
||||||
virtual void SignalIrcPlayerJoined(const std::string &nickName) = 0;
|
virtual void SignalIrcChatMsg(const std::string &nickName, const std::string &msg) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+5
-2
@@ -36,8 +36,13 @@ public:
|
|||||||
// Set the parameters.
|
// Set the parameters.
|
||||||
void Init(const std::string &serverAddress, unsigned serverPort, bool ipv6, const std::string &nick, const std::string &channel);
|
void Init(const std::string &serverAddress, unsigned serverPort, bool ipv6, const std::string &nick, const std::string &channel);
|
||||||
|
|
||||||
|
// Send a chat message to the channel.
|
||||||
|
void SendChatMessage(const std::string &msg);
|
||||||
|
|
||||||
virtual void SignalTermination();
|
virtual void SignalTermination();
|
||||||
|
|
||||||
|
IrcCallback &GetCallback();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Main function of the thread.
|
// Main function of the thread.
|
||||||
@@ -46,8 +51,6 @@ protected:
|
|||||||
const IrcContext &GetContext() const;
|
const IrcContext &GetContext() const;
|
||||||
IrcContext &GetContext();
|
IrcContext &GetContext();
|
||||||
|
|
||||||
IrcCallback &GetCallback();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::auto_ptr<IrcContext> m_context;
|
std::auto_ptr<IrcContext> m_context;
|
||||||
IrcCallback &m_callback;
|
IrcCallback &m_callback;
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ main(int argc, char *argv[])
|
|||||||
socket_startup();
|
socket_startup();
|
||||||
|
|
||||||
// Create pseudo Gui Wrapper for the server.
|
// Create pseudo Gui Wrapper for the server.
|
||||||
boost::shared_ptr<GuiInterface> myServerGuiInterface(new ServerGuiWrapper(myConfig, NULL, NULL));
|
boost::shared_ptr<GuiInterface> myServerGuiInterface(new ServerGuiWrapper(myConfig, NULL, NULL, NULL));
|
||||||
{
|
{
|
||||||
boost::shared_ptr<Session> session(new Session(myServerGuiInterface.get(), myConfig));
|
boost::shared_ptr<Session> session(new Session(myServerGuiInterface.get(), myConfig));
|
||||||
session->init(); // TODO handle error
|
session->init(); // TODO handle error
|
||||||
|
|||||||
+43
-2
@@ -25,19 +25,21 @@
|
|||||||
#include <clientenginefactory.h>
|
#include <clientenginefactory.h>
|
||||||
#include <net/clientthread.h>
|
#include <net/clientthread.h>
|
||||||
#include <net/serveracceptthread.h>
|
#include <net/serveracceptthread.h>
|
||||||
|
#include <net/ircthread.h>
|
||||||
#include <core/avatarmanager.h>
|
#include <core/avatarmanager.h>
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#define NET_CLIENT_TERMINATE_TIMEOUT_MSEC 1000
|
#define NET_CLIENT_TERMINATE_TIMEOUT_MSEC 1000
|
||||||
#define NET_SERVER_TERMINATE_TIMEOUT_MSEC 1000
|
#define NET_SERVER_TERMINATE_TIMEOUT_MSEC 2000
|
||||||
|
#define NET_IRC_TERMINATE_TIMEOUT_MSEC 2000
|
||||||
|
|
||||||
#define NET_DEFAULT_GAME "default"
|
#define NET_DEFAULT_GAME "default"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
Session::Session(GuiInterface *g, ConfigFile *c)
|
Session::Session(GuiInterface *g, ConfigFile *c)
|
||||||
: currentGameID(0), myNetClient(0), myNetServer(0), myGui(g), myConfig(c)
|
: currentGameID(0), myNetClient(NULL), myNetServer(NULL), myIrcThread(NULL), myGui(g), myConfig(c)
|
||||||
{
|
{
|
||||||
myAvatarManager.reset(new AvatarManager);
|
myAvatarManager.reset(new AvatarManager);
|
||||||
}
|
}
|
||||||
@@ -47,6 +49,7 @@ Session::~Session()
|
|||||||
{
|
{
|
||||||
terminateNetworkClient();
|
terminateNetworkClient();
|
||||||
terminateNetworkServer();
|
terminateNetworkServer();
|
||||||
|
terminateIrcClient();
|
||||||
delete myConfig;
|
delete myConfig;
|
||||||
myConfig = 0;
|
myConfig = 0;
|
||||||
}
|
}
|
||||||
@@ -242,6 +245,44 @@ void Session::waitForNetworkServer(unsigned timeoutMsec)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Session::startIrcClient()
|
||||||
|
{
|
||||||
|
if (myIrcThread || !myGui)
|
||||||
|
{
|
||||||
|
assert(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
myIrcThread = new IrcThread(*myGui);
|
||||||
|
myIrcThread->Init(
|
||||||
|
myConfig->readConfigString("IRCServerAddress"),
|
||||||
|
myConfig->readConfigInt("IRCServerPort"),
|
||||||
|
myConfig->readConfigInt("IRCServerUseIpv6") == 1,
|
||||||
|
myConfig->readConfigString("MyName"),
|
||||||
|
myConfig->readConfigString("IRCChannel"));
|
||||||
|
myIrcThread->Run();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Session::sendIrcChatMessage(const std::string &message)
|
||||||
|
{
|
||||||
|
if (!myIrcThread)
|
||||||
|
return;
|
||||||
|
myIrcThread->SendChatMessage(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Session::terminateIrcClient()
|
||||||
|
{
|
||||||
|
if (!myIrcThread)
|
||||||
|
return; // already terminated
|
||||||
|
myIrcThread->SignalTermination();
|
||||||
|
// Give the thread some time to terminate.
|
||||||
|
if (myIrcThread->Join(NET_IRC_TERMINATE_TIMEOUT_MSEC))
|
||||||
|
delete myIrcThread;
|
||||||
|
else
|
||||||
|
assert(false);
|
||||||
|
// If termination fails, leave a memory leak to prevent a crash.
|
||||||
|
myIrcThread = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void Session::sendLeaveCurrentGame()
|
void Session::sendLeaveCurrentGame()
|
||||||
{
|
{
|
||||||
if (!myNetClient)
|
if (!myNetClient)
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ class Game;
|
|||||||
class ConfigFile;
|
class ConfigFile;
|
||||||
class ClientThread;
|
class ClientThread;
|
||||||
class ServerAcceptThread;
|
class ServerAcceptThread;
|
||||||
|
class IrcThread;
|
||||||
class AvatarManager;
|
class AvatarManager;
|
||||||
|
|
||||||
class Session{
|
class Session{
|
||||||
@@ -61,6 +62,10 @@ public:
|
|||||||
void terminateNetworkServer();
|
void terminateNetworkServer();
|
||||||
void waitForNetworkServer(unsigned timeoutMsec);
|
void waitForNetworkServer(unsigned timeoutMsec);
|
||||||
|
|
||||||
|
void startIrcClient();
|
||||||
|
void sendIrcChatMessage(const std::string &message);
|
||||||
|
void terminateIrcClient();
|
||||||
|
|
||||||
void sendClientPlayerAction();
|
void sendClientPlayerAction();
|
||||||
|
|
||||||
void setCurrentGameID(int theValue) { currentGameID = theValue; }
|
void setCurrentGameID(int theValue) { currentGameID = theValue; }
|
||||||
@@ -81,6 +86,7 @@ private:
|
|||||||
|
|
||||||
ClientThread *myNetClient;
|
ClientThread *myNetClient;
|
||||||
ServerAcceptThread *myNetServer;
|
ServerAcceptThread *myNetServer;
|
||||||
|
IrcThread *myIrcThread;
|
||||||
boost::shared_ptr<AvatarManager> myAvatarManager;
|
boost::shared_ptr<AvatarManager> myAvatarManager;
|
||||||
|
|
||||||
boost::shared_ptr<Game> currentGame;
|
boost::shared_ptr<Game> currentGame;
|
||||||
|
|||||||
Reference in New Issue
Block a user