Here is a patch from Darky88 which allows you to send an announce to the server if you kick someone with the GM's name and a reason
Language.h :
-// Room for more level 2 348-399 not used
+ LANG_KICK_WORLD_ANNOUNCE = 348,
+// Room for more level 2
Level2.cpp :
#include <fstream>
#include <map>
#include "GlobalEvents.h"
+#include "WorldPacket.h"
+#include "WorldSession.h"
+#include "PlayerDump.h"
+#include "Log.h"
+#include "Guild.h"
+#include "ScriptCalls.h"
+#include "GridNotifiersImpl.h"
+#include "CellImpl.h"
+#include "Weather.h"
+#include "PointMovementGenerator.h"
+#include "SkillDiscovery.h"
+#include "SkillExtraItems.h"
+#include "SystemConfig.h"
+#include "Config/ConfigEnv.h"
+#include "ItemEnchantmentMgr.h"
+#include "BattleGroundMgr.h"
+#include "InstanceSaveMgr.h"
+#include "InstanceData.h"
+#include "CreatureEventAIMgr.h"
Level2.cpp
//kick player
bool ChatHandler::HandleKickPlayerCommand(const char *args)
{
+ if (!*args)
+ return false;
+
+ char* cnameOrIP = strtok ((char*)args, " ");
+ if (!cnameOrIP)
+ return false;
+
+ std::string nameOrIP = cnameOrIP;
+
+ char* reason = strtok (NULL,"");
+ if(!reason)
+ return false;
+
Player* target;
if(!extractPlayerTarget((char*)args,&target))
return false;
if (m_session && target==m_session->GetPlayer())
{
SendSysMessage(LANG_COMMAND_KICKSELF);
SetSentErrorMessage(true);
return false;
}
// check online security
if (HasLowerSecurity(target, 0))
return false;
// send before target pointer invalidate
PSendSysMessage(LANG_COMMAND_KICKMESSAGE,GetNameLink(target).c_str());
+ sWorld.SendWorldText(LANG_KICK_WORLD_ANNOUNCE,nameOrIP.c_str(),m_session ? m_session->GetPlayerName() : "CONSOLE",reason);
target->GetSession()->KickPlayer();
return true;
}
SQL Code :
DELETE FROM `mangos_string` WHERE `entry`='348';
INSERT INTO `mangos_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) values('348','|cffffffff%s |cffffffffwas kicked by %s. (%s)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
Ingame command :
.kick PLAYERNAME REASON