aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Chat/Chat.cpp
diff options
context:
space:
mode:
authorariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
committerariel- <ariel-@users.noreply.github.com>2017-06-19 23:20:06 -0300
commit85a7d5ce9ac68b30da2277cc91d4b70358f1880d (patch)
treedf3d2084ee2e35008903c03178039b9c986e2d08 /src/server/game/Chat/Chat.cpp
parent052fc24315ace866ea1cf610e85df119b68100c9 (diff)
Core: ported headers cleanup from master branch
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;