Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

This commit is contained in:
Vincent_Michael
2013-03-15 23:03:06 +01:00
10 changed files with 61 additions and 112 deletions

View File

@@ -27,6 +27,7 @@ EndScriptData */
#include "ChannelMgr.h"
#include "Language.h"
#include "Player.h"
#include "ObjectMgr.h"
class message_commandscript : public CommandScript
{
@@ -186,7 +187,7 @@ public:
return true;
}
std::string argStr = (char*)args;
std::string argStr = strtok((char*)args, " ");
// whisper on
if (argStr == "on")
{
@@ -205,6 +206,23 @@ public:
return true;
}
if (argStr == "remove")
{
std::string name = strtok(NULL, " ");
if (normalizePlayerName(name))
if (Player* player = sObjectAccessor->FindPlayerByName(name))
{
handler->GetSession()->GetPlayer()->RemoveFromWhisperWhiteList(player->GetGUID());
handler->PSendSysMessage(LANG_COMMAND_WHISPEROFFPLAYER, name);
return true;
}
else
{
handler->PSendSysMessage(LANG_PLAYER_NOT_FOUND, name);
handler->SetSentErrorMessage(true);
return false;
}
}
handler->SendSysMessage(LANG_USE_BOL);
handler->SetSentErrorMessage(true);
return false;