Code
# HG changeset patch
# User MaDo
# Date 1326554394 -10800
# Node ID 66812d47f6bcca7a5dd58ebfdb2d5472f77c2b00
# Parent cb04a4a860fb5b33f03bb677ced3d0171efc33df
Ba_Kick_Mute_Announce
diff -r cb04a4a860fb5b33f03bb677ced3d0171efc33df -r 66812d47f6bcca7a5dd58ebfdb2d5472f77c2b00 src/server/game/Chat/Commands/Level2.cpp
--- a/src/server/game/Chat/Commands/Level2.cpp Sun Jan 01 21:00:11 2012 +0300
+++ b/src/server/game/Chat/Commands/Level2.cpp Sat Jan 14 18:19:54 2012 +0300
@@ -46,6 +46,9 @@
//mute player for some times
bool ChatHandler::HandleMuteCommand(const char* args)
{
+
+ std::string announce;
+
char* nameStr;
char* delayStr;
extractOptFirstArg((char*)args, &nameStr, &delayStr);
@@ -57,6 +60,13 @@
if (mutereason != NULL)
mutereasonstr = mutereason;
+ if(!mutereason)
+ {
+ PSendSysMessage("You must enter a reason of mute");
+ SetSentErrorMessage(true);
+ return false;
+ }
+
Player* target;
uint64 target_guid;
std::string target_name;
@@ -104,6 +114,16 @@
PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notspeaktime, mutereasonstr.c_str());
+ announce = "The character '";
+ announce += nameStr;
+ announce += "' was muted for ";
+ announce += delayStr;
+ announce += " minutes by the character '";
+ announce += m_session->GetPlayerName();
+ announce += "'. The reason is: ";
+ announce += mutereason;
+ HandleAnnounceCommand(announce.c_str());
+
return true;
}
@@ -224,6 +244,9 @@
//kick player
bool ChatHandler::HandleKickPlayerCommand(const char *args)
{
+
+ std::string announce;
+
Player* target = NULL;
std::string playerName;
if (!extractPlayerTarget((char*)args, &target, NULL, &playerName))
@@ -246,6 +269,14 @@
PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
target->GetSession()->KickPlayer();
+
+ announce = "The character '";
+ announce += target->GetName();
+ announce += "' was kicked by the character '";
+ announce += m_session->GetPlayerName();
+ announce += "'.";
+ HandleAnnounceCommand(announce.c_str());
+
return true;
}
diff -r cb04a4a860fb5b33f03bb677ced3d0171efc33df -r 66812d47f6bcca7a5dd58ebfdb2d5472f77c2b00 src/server/game/Chat/Commands/Level3.cpp
--- a/src/server/game/Chat/Commands/Level3.cpp Sun Jan 01 21:00:11 2012 +0300
+++ b/src/server/game/Chat/Commands/Level3.cpp Sat Jan 14 18:19:54 2012 +0300
@@ -2919,6 +2919,8 @@
{
if (!*args)
return false;
+
+ std::string announce;
char* cnameOrIP = strtok ((char*)args, " ");
if (!cnameOrIP)
@@ -2984,6 +2986,21 @@
SetSentErrorMessage(true);
return false;
}
+
+ if (mode == BAN_CHARACTER)
+ announce = "The character '";
+ else if (mode == BAN_IP)
+ announce = "The IP '";
+ else
+ announce = "Account '";
+ announce += nameOrIP.c_str();
+ announce += "' was banned for ";
+ announce += duration;
+ announce += " by the character '";
+ announce += m_session->GetPlayerName();
+ announce += "'. The reason is: ";
+ announce += reason;
+ HandleAnnounceCommand(announce.c_str());
return true;
}