Advertisement
Hamar

asd

Jun 29th, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.29 KB | None | 0 0
  1.     if (lang == LANG_ADDON)
  2.     {
  3.         // LANG_ADDON is only valid for the following message types
  4.         switch (type)
  5.         {
  6.             case CHAT_MSG_PARTY:
  7.             case CHAT_MSG_RAID:
  8.             case CHAT_MSG_GUILD:
  9.             case CHAT_MSG_BATTLEGROUND:
  10.             case CHAT_MSG_WHISPER:
  11.                 if (sWorld->getBoolConfig(CONFIG_CHATLOG_ADDON))
  12.                 {
  13.                     std::string msg = "";
  14.                     recvData >> msg;
  15.  
  16.                     if (msg.empty())
  17.                         return;
  18.  
  19.                     if(msg.find("[HAMAR]"))
  20.                         sender->GetSession()->SendNotification("Hi there");
  21.  
  22.                     sScriptMgr->OnPlayerChat(sender, uint32(CHAT_MSG_ADDON), lang, msg);
  23.                 }
  24.  
  25.                 // Disabled addon channel?
  26.                 if (!sWorld->getBoolConfig(CONFIG_ADDON_CHANNEL))
  27.                     return;
  28.                 break;
  29.             default:
  30.                 TC_LOG_ERROR(LOG_FILTER_NETWORKIO, "Player %s (GUID: %u) sent a chatmessage with an invalid language/message type combination",
  31.                                                      GetPlayer()->GetName().c_str(), GetPlayer()->GetGUIDLow());
  32.  
  33.                 recvData.rfinish();
  34.                 return;
  35.         }
  36.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement