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:
committed by
GitHub
parent
fe5b46f331
commit
30dceb3fa6
@@ -1129,8 +1129,16 @@ public:
|
|||||||
if (handler->HasLowerSecurity(target, 0))
|
if (handler->HasLowerSecurity(target, 0))
|
||||||
return false;
|
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))
|
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
|
else
|
||||||
handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
|
handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user