Forward all lobby chat messages to irc admin bot. Game chat is still private, so don't worry :-).

This commit is contained in:
lotodore
2009-08-20 11:42:13 +00:00
parent 0aa285621b
commit 460090e383
6 changed files with 50 additions and 9 deletions
+14 -1
View File
@@ -59,7 +59,6 @@ ServerIrcBot::SignalIrcSelfJoined(const std::string &nickName, const std::string
{
LOG_MSG("Joined IRC channel " << channel << " as user " << nickName << ".");
m_ircNick = nickName;
m_ircThread->SendPing();
}
void
@@ -253,6 +252,20 @@ ServerIrcBot::SignalIrcServerError(int errorCode)
LOG_MSG("IRC server error " << errorCode << ".");
}
void
ServerIrcBot::SignalLobbyMessage(unsigned playerId, const std::string &playerName, const std::string &msg)
{
if (m_ircThread && !msg.empty())
{
ostringstream ircMsg;
if (playerId)
ircMsg << playerName << " (" << playerId << "): " << msg;
else
ircMsg << playerName << ": " << msg;
m_ircThread->SendChatMessage(ircMsg.str());
}
}
void
ServerIrcBot::Run()
{