Merge branch 'master' into Playerbot

This commit is contained in:
Yunfan Li
2025-02-04 23:40:06 +08:00
81 changed files with 3144 additions and 611 deletions

View File

@@ -37,7 +37,7 @@ Player* ChatHandler::GetPlayer() const
return m_session ? m_session->GetPlayer() : nullptr;
}
char const* ChatHandler::GetAcoreString(uint32 entry) const
std::string ChatHandler::GetAcoreString(uint32 entry) const
{
return m_session->GetAcoreString(entry);
}
@@ -953,7 +953,7 @@ std::string ChatHandler::GetNameLink(Player* chr) const
return playerLink(chr->GetName());
}
char const* CliHandler::GetAcoreString(uint32 entry) const
std::string CliHandler::GetAcoreString(uint32 entry) const
{
return sObjectMgr->GetAcoreStringForDBCLocale(entry);
}

View File

@@ -148,7 +148,7 @@ public:
}
// function with different implementation for chat/console
virtual char const* GetAcoreString(uint32 entry) const;
virtual std::string GetAcoreString(uint32 entry) const;
virtual void SendSysMessage(std::string_view str, bool escapeCharacters = false);
void SendSysMessage(uint32 entry);
@@ -276,7 +276,7 @@ public:
explicit CliHandler(void* callbackArg, Print* zprint) : m_callbackArg(callbackArg), m_print(zprint) { }
// overwrite functions
char const* GetAcoreString(uint32 entry) const override;
std::string GetAcoreString(uint32 entry) const override;
void SendSysMessage(std::string_view, bool escapeCharacters) override;
bool ParseCommands(std::string_view str) override;
std::string GetNameLink() const override;

View File

@@ -24,7 +24,7 @@ void Acore::Impl::ChatCommands::SendErrorMessageToHandler(ChatHandler* handler,
handler->SetSentErrorMessage(true);
}
char const* Acore::Impl::ChatCommands::GetAcoreString(ChatHandler const* handler, AcoreStrings which)
std::string Acore::Impl::ChatCommands::GetAcoreString(ChatHandler const* handler, AcoreStrings which)
{
return handler->GetAcoreString(which);
}

View File

@@ -120,7 +120,7 @@ namespace Acore::Impl::ChatCommands
};
AC_GAME_API void SendErrorMessageToHandler(ChatHandler* handler, std::string_view str);
AC_GAME_API char const* GetAcoreString(ChatHandler const* handler, AcoreStrings which);
AC_GAME_API std::string GetAcoreString(ChatHandler const* handler, AcoreStrings which);
template <typename... Ts>
std::string FormatAcoreString(ChatHandler const* handler, AcoreStrings which, Ts&&... args)
{