Provide and use universal way for get locale and locale index for chat/console command use.

This commit is contained in:
VladimirMangos 2009-05-19 00:45:48 +04:00
parent 695d83568a
commit fdbc22ac93
6 changed files with 56 additions and 30 deletions

View file

@ -1578,6 +1578,16 @@ bool ChatHandler::needReportToTarget(Player* chr) const
return pl != chr && pl->IsVisibleGloballyFor(chr);
}
LocaleConstant ChatHandler::GetSessionDbcLocale() const
{
return m_session->GetSessionDbcLocale();
}
int ChatHandler::GetSessionDbLocaleIndex() const
{
return m_session->GetSessionDbLocaleIndex();
}
const char *CliHandler::GetMangosString(int32 entry) const
{
return objmgr.GetMangosStringForDBCLocale(entry);
@ -1605,3 +1615,12 @@ bool CliHandler::needReportToTarget(Player* /*chr*/) const
return true;
}
LocaleConstant CliHandler::GetSessionDbcLocale() const
{
return sWorld.GetDefaultDbcLocale();
}
int CliHandler::GetSessionDbLocaleIndex() const
{
return objmgr.GetDBCLocaleIndex();
}