feat(CORE/command): .kick will now display the kick reason (#2779)

- If ShowKickInWorld is enabled, kick will now display the kick reason to all the players
This commit is contained in:
IntelligentQuantum
2020-04-22 02:56:47 +04:30
committed by GitHub
parent fe5b46f331
commit 30dceb3fa6

View File

@@ -1129,8 +1129,16 @@ public:
if (handler->HasLowerSecurity(target, 0))
return false;
std::string kickReasonStr = handler->GetAcoreString(LANG_NO_REASON);
if (*args != '\0')
{
char const* kickReason = strtok(nullptr, "\r");
if (kickReason != nullptr)
kickReasonStr = kickReason;
}
if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), playerName.c_str(), kickReasonStr.c_str());
else
handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());