Enable sending of a global message box through the irc bot, to inform clients about server reboots.
This commit is contained in:
@@ -138,6 +138,7 @@ void ServerGuiWrapper::SignalNetClientGameListPlayerJoined(unsigned gameId, unsi
|
||||
void ServerGuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId) { if (myClientcb) myClientcb->SignalNetClientGameListPlayerLeft(gameId, playerId); }
|
||||
void ServerGuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) { if (myClientcb) myClientcb->SignalNetClientGameStart(game); }
|
||||
void ServerGuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { if (myClientcb) myClientcb->SignalNetClientChatMsg(playerName, msg); }
|
||||
void ServerGuiWrapper::SignalNetClientMsgBox(const string &msg) { if (myClientcb) myClientcb->SignalNetClientMsgBox(msg); }
|
||||
void ServerGuiWrapper::SignalNetClientWaitDialog() { if (myClientcb) myClientcb->SignalNetClientWaitDialog(); }
|
||||
|
||||
void ServerGuiWrapper::SignalNetServerSuccess(int actionID) { if (myServercb) myServercb->SignalNetServerSuccess(actionID); }
|
||||
|
||||
@@ -137,6 +137,7 @@ public:
|
||||
void SignalIrcPlayerKicked(const std::string &nickName, const std::string &byWhom, const std::string &reason);
|
||||
void SignalIrcPlayerLeft(const std::string &nickName);
|
||||
void SignalIrcChatMsg(const std::string &nickName, const std::string &msg);
|
||||
void SignalNetClientMsgBox(const std::string &msg);
|
||||
void SignalIrcError(int errorCode);
|
||||
void SignalIrcServerError(int errorCode);
|
||||
|
||||
|
||||
@@ -160,9 +160,9 @@ void GuiWrapper::SignalNetClientGameListPlayerJoined(unsigned gameId, unsigned p
|
||||
void GuiWrapper::SignalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId) { myStartWindow->signalNetClientGameListPlayerLeft(gameId, playerId); }
|
||||
void GuiWrapper::SignalNetClientGameStart(boost::shared_ptr<Game> game) { myStartWindow->signalNetClientGameStart(game); }
|
||||
|
||||
|
||||
void GuiWrapper::SignalNetClientWaitDialog() { myStartWindow->signalShowClientDialog(); }
|
||||
void GuiWrapper::SignalNetClientChatMsg(const string &playerName, const string &msg) { myStartWindow->signalNetClientChatMsg(QString::fromUtf8(playerName.c_str()), QString::fromUtf8(msg.c_str())); }
|
||||
void GuiWrapper::SignalNetClientMsgBox(const string &msg) { myStartWindow->signalNetClientMsgBox(QString::fromUtf8(msg.c_str())); }
|
||||
|
||||
void GuiWrapper::SignalNetServerSuccess(int /*actionID*/) { }
|
||||
void GuiWrapper::SignalNetServerError(int errorID, int osErrorID) { myStartWindow->signalNetServerError(errorID, osErrorID); }
|
||||
|
||||
@@ -125,6 +125,7 @@ public:
|
||||
void SignalNetClientPlayerLeft(unsigned playerId, const std::string &playerName, int removeReason);
|
||||
void SignalNetClientNewGameAdmin(unsigned playerId, const std::string &playerName);
|
||||
void SignalNetClientChatMsg(const std::string &playerName, const std::string &msg);
|
||||
void SignalNetClientMsgBox(const std::string &msg);
|
||||
void SignalNetClientWaitDialog();
|
||||
|
||||
void SignalNetClientGameListNew(unsigned gameId);
|
||||
|
||||
@@ -138,6 +138,7 @@ startWindowImpl::startWindowImpl(ConfigFile *c)
|
||||
|
||||
connect(this, SIGNAL(signalNetClientChatMsg(QString, QString)), myStartNetworkGameDialog, SLOT(receiveChatMsg(QString, QString)));
|
||||
connect(this, SIGNAL(signalNetClientChatMsg(QString, QString)), myGuiInterface->getMyW()->getMyChat(), SLOT(receiveMessage(QString, QString)));
|
||||
connect(this, SIGNAL(signalNetClientMsgBox(QString)), this, SLOT(networkMessage(QString)));
|
||||
|
||||
connect(this, SIGNAL(signalNetClientShowTimeoutDialog(int, unsigned)), this, SLOT(showTimeoutDialog(int, unsigned)));
|
||||
|
||||
@@ -869,6 +870,14 @@ void startWindowImpl::networkNotification(int notificationId)
|
||||
}
|
||||
}
|
||||
|
||||
void startWindowImpl::networkMessage(QString msg)
|
||||
{
|
||||
QMessageBox msgBox(QMessageBox::Information, tr("Server Message"),
|
||||
msg, QMessageBox::Close, this);
|
||||
msgBox.setTextFormat(Qt::RichText);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
void startWindowImpl::networkStart(boost::shared_ptr<Game> game)
|
||||
{
|
||||
mySession->startClientGame(game);
|
||||
|
||||
@@ -77,6 +77,7 @@ signals:
|
||||
void signalNetClientGameListPlayerLeft(unsigned gameId, unsigned playerId);
|
||||
void signalNetClientGameStart(boost::shared_ptr<Game> game);
|
||||
void signalNetClientChatMsg(QString nickName, QString msg);
|
||||
void signalNetClientMsgBox(QString msg);
|
||||
|
||||
void signalIrcConnect(QString server);
|
||||
void signalIrcSelfJoined(QString nickName, QString channel);
|
||||
@@ -109,6 +110,7 @@ public slots:
|
||||
|
||||
void networkError(int, int);
|
||||
void networkNotification(int);
|
||||
void networkMessage(QString);
|
||||
|
||||
void networkStart(boost::shared_ptr<Game> game);
|
||||
QStringList getPlayerNicksList();
|
||||
|
||||
Reference in New Issue
Block a user