mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 07:37:01 +00:00
Simplify check requirement report command results to target and output command user name.
* Provided ChatHandler::GetName for player name/"console command" output dependent from chat/console command call. * New function for check when command work result send to command target. * Remove unrequired complexy in mangos string usage in some commands.
This commit is contained in:
parent
58bc947ef9
commit
6169f57ab9
7 changed files with 84 additions and 73 deletions
|
|
@ -1194,6 +1194,17 @@ GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
|
|||
return objmgr.GetGameTele(cId);
|
||||
}
|
||||
|
||||
const char *ChatHandler::GetName() const
|
||||
{
|
||||
return m_session->GetPlayer()->GetName();
|
||||
}
|
||||
|
||||
bool ChatHandler::needReportToTarget(Player* chr) const
|
||||
{
|
||||
Player* pl = m_session->GetPlayer();
|
||||
return pl != chr && pl->IsVisibleGloballyFor(chr);
|
||||
}
|
||||
|
||||
const char *CliHandler::GetMangosString(int32 entry) const
|
||||
{
|
||||
return objmgr.GetMangosStringForDBCLocale(entry);
|
||||
|
|
@ -1210,3 +1221,14 @@ void CliHandler::SendSysMessage(const char *str)
|
|||
m_print(str);
|
||||
m_print("\r\n");
|
||||
}
|
||||
|
||||
const char *CliHandler::GetName() const
|
||||
{
|
||||
return GetMangosString(LANG_CONSOLE_COMMAND);
|
||||
}
|
||||
|
||||
bool CliHandler::needReportToTarget(Player* /*chr*/) const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue