aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat/Chat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Chat/Chat.cpp')
-rw-r--r--src/server/game/Chat/Chat.cpp32
1 files changed, 24 insertions, 8 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp
index 3926dda13f5..3e15ecc9319 100644
--- a/src/server/game/Chat/Chat.cpp
+++ b/src/server/game/Chat/Chat.cpp
@@ -16,22 +16,28 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "Common.h"
-#include "ObjectMgr.h"
-#include "World.h"
-#include "WorldSession.h"
-#include "DatabaseEnv.h"
-
+#include "Chat.h"
#include "AccountMgr.h"
#include "CellImpl.h"
#include "CharacterCache.h"
-#include "Chat.h"
+#include "ChatLink.h"
+#include "DatabaseEnv.h"
+#include "DBCStores.h"
#include "GridNotifiersImpl.h"
#include "Language.h"
#include "Log.h"
+#include "ObjectAccessor.h"
+#include "ObjectMgr.h"
+#include "Optional.h"
#include "Player.h"
+#include "Realm.h"
#include "ScriptMgr.h"
-#include "ChatLink.h"
+#include "World.h"
+
+ChatCommand::ChatCommand(char const* name, uint32 permission, bool allowConsole, pHandler handler, std::string help, std::vector<ChatCommand> childCommands /*= std::vector<ChatCommand>()*/)
+ : Name(ASSERT_NOTNULL(name)), Permission(permission), AllowConsole(allowConsole), Handler(handler), Help(std::move(help)), ChildCommands(std::move(childCommands))
+{
+}
// Lazy loading of the command table cache from commands and the
// ScriptMgr should be thread safe since the player commands,
@@ -80,6 +86,16 @@ bool ChatHandler::isAvailable(ChatCommand const& cmd) const
return HasPermission(cmd.Permission);
}
+bool ChatHandler::HasPermission(uint32 permission) const
+{
+ return m_session->HasPermission(permission);
+}
+
+std::string ChatHandler::GetNameLink() const
+{
+ return GetNameLink(m_session->GetPlayer());
+}
+
bool ChatHandler::HasLowerSecurity(Player* target, ObjectGuid guid, bool strong)
{
WorldSession* target_session = nullptr;