fix(Core/Chat): Correct misstake in b81bcfbfea causing outputs to CLI not working properly
* closes https://github.com/azerothcore/azerothcore-wotlk/issues/19592
This commit is contained in:
@@ -430,7 +430,7 @@ Player* ChatHandler::getSelectedPlayerOrSelf() const
|
|||||||
return targetPlayer;
|
return targetPlayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ChatHandler::HasSession()
|
bool ChatHandler::HasSession() const
|
||||||
{
|
{
|
||||||
if (!m_session)
|
if (!m_session)
|
||||||
return false;
|
return false;
|
||||||
@@ -967,6 +967,11 @@ int CliHandler::GetSessionDbLocaleIndex() const
|
|||||||
return sObjectMgr->GetDBCLocaleIndex();
|
return sObjectMgr->GetDBCLocaleIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CliHandler::HasSession() const
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool AddonChannelCommandHandler::ParseCommands(std::string_view str)
|
bool AddonChannelCommandHandler::ParseCommands(std::string_view str)
|
||||||
{
|
{
|
||||||
if (memcmp(str.data(), "AzerothCore\t", 12))
|
if (memcmp(str.data(), "AzerothCore\t", 12))
|
||||||
|
|||||||
@@ -198,7 +198,8 @@ public:
|
|||||||
// Returns either the selected player or self if there is no selected player
|
// Returns either the selected player or self if there is no selected player
|
||||||
Player* getSelectedPlayerOrSelf() const;
|
Player* getSelectedPlayerOrSelf() const;
|
||||||
|
|
||||||
bool HasSession();
|
// Has different implementation for console
|
||||||
|
virtual bool HasSession() const;
|
||||||
// Do whatever you want to all the players with a valid session [including GameMasters], i.e.: param exec = [&](Player* p) { p->Whatever(); }
|
// Do whatever you want to all the players with a valid session [including GameMasters], i.e.: param exec = [&](Player* p) { p->Whatever(); }
|
||||||
// A "valid" session requires player->IsInWorld() to be true
|
// A "valid" session requires player->IsInWorld() to be true
|
||||||
void DoForAllValidSessions(std::function<void(Player*)> exec);
|
void DoForAllValidSessions(std::function<void(Player*)> exec);
|
||||||
@@ -252,6 +253,9 @@ public:
|
|||||||
LocaleConstant GetSessionDbcLocale() const override;
|
LocaleConstant GetSessionDbcLocale() const override;
|
||||||
int GetSessionDbLocaleIndex() const override;
|
int GetSessionDbLocaleIndex() const override;
|
||||||
|
|
||||||
|
// CLI does not have a session, so we override it to always be true to output SendNotification and PSendSysMessage to console
|
||||||
|
bool HasSession() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void* m_callbackArg;
|
void* m_callbackArg;
|
||||||
Print* m_print;
|
Print* m_print;
|
||||||
|
|||||||
Reference in New Issue
Block a user