[Patch] Ban/kick/mute

Hi All I Need Ban Kick/mute/Announcer For Last Rev

Thanx

I have no idea what you want.

What is the name of the public server you are working for? If we know what version they are running, maybe we can help you.

[SIZE=14px][FONT=‘comic sans ms’]My Server Name X-WoW[/FONT][/SIZE]

[SIZE=14px][FONT=‘comic sans ms’]And My Core Verison :77d4acc776a2+ 2013-05-07 19:55:16 +0200 (master branch)[/FONT][/SIZE]

[SIZE=14px][FONT=‘comic sans ms’]Last Updated[/FONT][/SIZE]

Sorry, but Trinity Core does not support public servers.

Totally contradicting answers (Essential right, but the question itself was useless.)

/swoosh?

diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index c29ccdf…42644fd 100644
— a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1169,6 +1169,8 @@ void World::LoadConfigSettings(bool reload)

 m_bool_configs[CONFIG_NO_RESET_TALENT_COST] = ConfigMgr::GetBoolDefault("NoResetTalentsCost", false);
 m_bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = ConfigMgr::GetBoolDefault("ShowKickInWorld", false);
  • m_bool_configs[CONFIG_SHOW_MUTE_IN_WORLD] = ConfigMgr::GetBoolDefault(“ShowMuteInWorld”, false);
  • m_bool_configs[CONFIG_SHOW_BAN_IN_WORLD] = ConfigMgr::GetBoolDefault(“ShowBanInWorld”, false);
    m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = ConfigMgr::GetIntDefault(“RecordUpdateTimeDiffInterval”, 60000);
    m_int_configs[CONFIG_MIN_LOG_UPDATE] = ConfigMgr::GetIntDefault(“MinRecordUpdateTimeDiff”, 100);
    m_int_configs[CONFIG_NUMTHREADS] = ConfigMgr::GetIntDefault(“MapUpdate.Threads”, 1);
    diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
    index 62886b9…c631eb4 100644
    — a/src/server/game/World/World.h
    +++ b/src/server/game/World/World.h
    @@ -145,6 +145,8 @@ enum WorldBoolConfigs
    CONFIG_PVP_TOKEN_ENABLE,
    CONFIG_NO_RESET_TALENT_COST,
    CONFIG_SHOW_KICK_IN_WORLD,
  • CONFIG_SHOW_BAN_IN_WORLD,
  • CONFIG_SHOW_MUTE_IN_WORLD,
    CONFIG_CHATLOG_CHANNEL,
    CONFIG_CHATLOG_WHISPER,
    CONFIG_CHATLOG_SYSCHAN,
    diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
    index 0ed19a7…2ddff10 100644
    — a/src/server/scripts/Commands/cs_ban.cpp
    +++ b/src/server/scripts/Commands/cs_ban.cpp
    @@ -146,6 +146,7 @@ public:
    {
    if (!*args)
    return false;
  •    std::string announce;
    
       char* cnameOrIP = strtok((char*)args, " ");
       if (!cnameOrIP)
    

@@ -212,6 +213,24 @@ public:
return false;
}

  •    if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD))
    
  •    {
    
  •  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 += durationStr;
    
  •                announce += " by the character ";
    
  •                announce +=  handler->GetSession()->GetPlayerName();
    
  •                announce += ". The reason is: ";
    
  •                announce += reasonStr;
    
  •                sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());
    
  •    }
    
  •    return true;
    
    }

diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 4cdc1e0…949a08f 100644
— a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -912,6 +912,7 @@ public:
{
Player* target = NULL;
std::string playerName;

  •   std::string announce;
       if (!handler->extractPlayerTarget((char*)args, &target, NULL, &playerName))
           return false;
    

@@ -933,6 +934,16 @@ public:

     target->GetSession()->KickPlayer();
  •    if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
    
  •    {
    
  •      announce = "The character ";
    
  •      announce += playerName.c_str();
    
  •      announce += " was kicked by the character ";
    
  •      announce += handler->GetSession()->GetPlayerName();
    
  •      announce += ".";
    
  •      sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());
    
  •    }
    
  •    return true;
    
    }

@@ -1793,6 +1804,8 @@ public:
// mute player for some times
static bool HandleMuteCommand(ChatHandler* handler, char const* args)
{
+

  •    std::string announce;
       char* nameStr;
       char* delayStr;
       handler->extractOptFirstArg((char*)args, &nameStr, &delayStr);
    

@@ -1804,6 +1817,13 @@ public:
if (muteReason != NULL)
muteReasonStr = muteReason;

  •    if(!muteReason)
    
  •    {
    
  •        handler->PSendSysMessage("You must enter a reason of mute");
    
  •        handler->SetSentErrorMessage(true);
    
  •        return false;
    
  •    }
    
  •    Player* target;
       uint64 targetGuid;
       std::string targetName;
    

@@ -1853,6 +1873,19 @@ public:

     handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str());
  •    if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD))
    
  •    {
    
  •        announce = "The character ";
    
  •        announce += nameLink.c_str();
    
  •        announce += " was muted for ";
    
  •        announce += delayStr;
    
  •        announce += " minutes by the character ";
    
  •        announce += handler->GetSession()->GetPlayerName();
    
  •        announce += ". The reason is: ";
    
  •        announce += muteReasonStr.c_str();
    
  •        sWorld->SendServerMessage(SERVER_MSG_STRING, announce.c_str());
    
  •    }
    
  •    return true;
    
    }

diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index cbd3342…12b68bf 100644
— a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -2564,7 +2564,24 @@ Guild.AllowMultipleGuildMaster = 0

Default: 0 - (Disabled)

1 - (Enabled)

-ShowKickInWorld = 0
+ShowKickInWorld = 1
+
+#
+# ShowMuteInWorld
+# Description: Determines whether a message is broadcasted to the entire server when a
+# player gets mute
+# Default: 0 - (Disabled)
+# 1 - (Enabled)
+
+ShowMuteInWorld = 1
+
+# ShowBanInWorld
+# Description: Determines whether a message is broadcasted to the entire server when a
+# player gets ban
+# Default: 0 - (Disabled)
+# 1 - (Enabled)
+
+ShowBanInWorld = 1

RecordUpdateTimeDiffInterval

enjoy /emoticons/default_smile.png

Characters Ban Announcer Not Work Please Fix It Thanx Men /emoticons/default_wub.png

works fine. I tested on my server.

kleuser, can you create PR for this patch with those settings disabled by default? thx.

Thanks For Release /emoticons/default_wink.png

Char Ban Announcer Dont Work /emoticons/default_sad.png

Yes Char ban announcer not work

New patch http://www.trinitycore.org/f/topic/9573-patch-show-kickmuteban-in-world/