diff options
| author | XTZGZoReX <none@none> | 2008-10-12 14:03:38 -0500 |
|---|---|---|
| committer | XTZGZoReX <none@none> | 2008-10-12 14:03:38 -0500 |
| commit | 054725122f1ef534063ffcbc54b25e167ec3ed9c (patch) | |
| tree | e476f95db36b0599d54b74eb01d850d212a09d21 /src/game/Level1.cpp | |
| parent | e539b4ca7f89eaaf3efe4cffea7e143f41fc592b (diff) | |
[svn] * Various small changes here and there.
* Implementing MangChat IRC system.
* Added new config option, MAX_WHO, can be used to set the limit of characters being sent in a /who request from client.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Level1.cpp')
| -rw-r--r-- | src/game/Level1.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 9bcbb80b811..cf4123c2f24 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -31,6 +31,7 @@ #include "Language.h" #include "CellImpl.h" #include "InstanceSaveMgr.h" +#include "IRCClient.h" #include "Util.h" #ifdef _DEBUG_VMAPS #include "VMapFactory.h" @@ -123,6 +124,14 @@ bool ChatHandler::HandleAnnounceCommand(const char* args) return false; sWorld.SendWorldText(LANG_SYSTEMMESSAGE,args); + + if((sIRC.BOTMASK & 256) != 0) + { + std::string ircchan = "#"; + ircchan += sIRC._irc_chan[sIRC.anchn].c_str(); + sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 System Message \00304,08\037/!\\\037\017 %s", "%s", args), true); + } + return true; } @@ -139,6 +148,13 @@ bool ChatHandler::HandleNotifyCommand(const char* args) data << str; sWorld.SendGlobalMessage(&data); + if((sIRC.BOTMASK & 256) != 0) + { + std::string ircchan = "#"; + ircchan += sIRC._irc_chan[sIRC.anchn].c_str(); + sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 Global Notify \00304,08\037/!\\\037\017 %s", "%s", args), true); + } + return true; } @@ -2348,6 +2364,25 @@ bool ChatHandler::HandleGoXYZCommand(const char* args) return true; } +bool ChatHandler::HandleIRCpmCommand(const char* args) +{ + std::string Msg = args; + if (Msg.find(" ") == std::string::npos) + return false; + std::string To = Msg.substr(0, Msg.find(" ")); + Msg = Msg.substr(Msg.find(" ") + 1); + std::size_t pos; + while((pos = To.find("||")) != std::string::npos) + { + std::size_t find1 = To.find("||", pos); + To.replace(pos, find1 - pos + 2, "|"); + } + sIRC.SendIRC("PRIVMSG "+To+" : <WoW>["+m_session->GetPlayerName()+"] : " + Msg); + //Msg = "|cffCC4ACCTo [" + To + "]: " + Msg + "|r"; + sIRC.Send_WoW_Player(m_session->GetPlayer(), "|cffCC4ACCTo ["+To+"]: "+Msg); + return true; +} + //teleport at coordinates bool ChatHandler::HandleGoZoneXYCommand(const char* args) { |
