aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-09-20 02:50:38 +0200
committerGitHub <noreply@github.com>2020-09-20 02:50:38 +0200
commit1eca51b417678b9a48b28552925d5694105f82bb (patch)
tree9ae5150e9efbd4f2ad2364922cab46093ee25419 /src/server/scripts/Commands
parenta724903b8b307516780474dd23977d2a9b502eb5 (diff)
[3.3.5] ChatCommands, the other half: chat command resolution refactor (PR #25463)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_account.cpp64
-rw-r--r--src/server/scripts/Commands/cs_achievement.cpp12
-rw-r--r--src/server/scripts/Commands/cs_ahbot.cpp68
-rw-r--r--src/server/scripts/Commands/cs_arena.cpp24
-rw-r--r--src/server/scripts/Commands/cs_ban.cpp54
-rw-r--r--src/server/scripts/Commands/cs_bf.cpp20
-rw-r--r--src/server/scripts/Commands/cs_cast.cpp21
-rw-r--r--src/server/scripts/Commands/cs_character.cpp53
-rw-r--r--src/server/scripts/Commands/cs_cheat.cpp26
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp133
-rw-r--r--src/server/scripts/Commands/cs_deserter.cpp26
-rw-r--r--src/server/scripts/Commands/cs_disable.cpp54
-rw-r--r--src/server/scripts/Commands/cs_event.cpp16
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp22
-rw-r--r--src/server/scripts/Commands/cs_go.cpp49
-rw-r--r--src/server/scripts/Commands/cs_gobject.cpp46
-rw-r--r--src/server/scripts/Commands/cs_group.cpp4
-rw-r--r--src/server/scripts/Commands/cs_guild.cpp4
-rw-r--r--src/server/scripts/Commands/cs_honor.cpp4
-rw-r--r--src/server/scripts/Commands/cs_instance.cpp4
-rw-r--r--src/server/scripts/Commands/cs_learn.cpp43
-rw-r--r--src/server/scripts/Commands/cs_lfg.cpp18
-rw-r--r--src/server/scripts/Commands/cs_list.cpp53
-rw-r--r--src/server/scripts/Commands/cs_lookup.cpp4
-rw-r--r--src/server/scripts/Commands/cs_message.cpp28
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp20
-rw-r--r--src/server/scripts/Commands/cs_mmaps.cpp4
-rw-r--r--src/server/scripts/Commands/cs_modify.cpp4
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp101
-rw-r--r--src/server/scripts/Commands/cs_pet.cpp4
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp4
-rw-r--r--src/server/scripts/Commands/cs_rbac.cpp4
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp14
-rw-r--r--src/server/scripts/Commands/cs_reset.cpp4
-rw-r--r--src/server/scripts/Commands/cs_send.cpp4
-rw-r--r--src/server/scripts/Commands/cs_server.cpp4
-rw-r--r--src/server/scripts/Commands/cs_tele.cpp18
-rw-r--r--src/server/scripts/Commands/cs_ticket.cpp4
-rw-r--r--src/server/scripts/Commands/cs_titles.cpp4
-rw-r--r--src/server/scripts/Commands/cs_wp.cpp4
40 files changed, 537 insertions, 510 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index aec025e0301..2f72cccf58b 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -48,48 +48,36 @@ class account_commandscript : public CommandScript
public:
account_commandscript() : CommandScript("account_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> accountSetSecTable =
- {
- { "regmail", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_REGMAIL, true, &HandleAccountSetRegEmailCommand, "" },
- { "email", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_EMAIL, true, &HandleAccountSetEmailCommand, "" },
- };
- static std::vector<ChatCommand> accountSetCommandTable =
- {
- { "addon", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_ADDON, true, &HandleAccountSetAddonCommand, "" },
- { "sec", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SEC, true, nullptr, "", accountSetSecTable },
- { "gmlevel", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SECLEVEL, true, &HandleAccountSetSecLevelCommand, "" }, // temp for a transition period
- { "seclevel", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SECLEVEL, true, &HandleAccountSetSecLevelCommand, "" },
- { "password", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_PASSWORD, true, &HandleAccountSetPasswordCommand, "" },
- { "2fa", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_2FA, true, &HandleAccountSet2FACommand, "" },
- };
- static std::vector<ChatCommand> account2FACommandTable =
- {
- { "setup", rbac::RBAC_PERM_COMMAND_ACCOUNT_2FA_SETUP, false, &HandleAccount2FASetupCommand, "" },
- { "remove", rbac::RBAC_PERM_COMMAND_ACCOUNT_2FA_REMOVE, false, &HandleAccount2FARemoveCommand, "" },
- };
- static std::vector<ChatCommand> accountLockCommandTable =
- {
- { "country", rbac::RBAC_PERM_COMMAND_ACCOUNT_LOCK_COUNTRY, false, &HandleAccountLockCountryCommand, "" },
- { "ip", rbac::RBAC_PERM_COMMAND_ACCOUNT_LOCK_IP, false, &HandleAccountLockIpCommand, "" },
+ static ChatCommandTable accountSetCommandTable =
+ {
+ { "addon", HandleAccountSetAddonCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_ADDON, Console::Yes },
+ { "sec regmail", HandleAccountSetRegEmailCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_REGMAIL, Console::Yes },
+ { "sec email", HandleAccountSetEmailCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_EMAIL, Console::Yes },
+ { "gmlevel", HandleAccountSetSecLevelCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SECLEVEL, Console::Yes }, // temp for a transition period
+ { "seclevel", HandleAccountSetSecLevelCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_SECLEVEL, Console::Yes },
+ { "password", HandleAccountSetPasswordCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_PASSWORD, Console::Yes },
+ { "2fa", HandleAccountSet2FACommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_SET_2FA, Console::Yes },
};
- static std::vector<ChatCommand> accountCommandTable =
- {
- { "2fa", rbac::RBAC_PERM_COMMAND_ACCOUNT_2FA, false, nullptr, "", account2FACommandTable },
- { "addon", rbac::RBAC_PERM_COMMAND_ACCOUNT_ADDON, false, &HandleAccountAddonCommand, "" },
- { "create", rbac::RBAC_PERM_COMMAND_ACCOUNT_CREATE, true, &HandleAccountCreateCommand, "" },
- { "delete", rbac::RBAC_PERM_COMMAND_ACCOUNT_DELETE, true, &HandleAccountDeleteCommand, "" },
- { "email", rbac::RBAC_PERM_COMMAND_ACCOUNT_EMAIL, false, &HandleAccountEmailCommand, "" },
- { "onlinelist", rbac::RBAC_PERM_COMMAND_ACCOUNT_ONLINE_LIST, true, &HandleAccountOnlineListCommand, "" },
- { "lock", rbac::RBAC_PERM_COMMAND_ACCOUNT_LOCK, false, nullptr, "", accountLockCommandTable },
- { "set", rbac::RBAC_PERM_COMMAND_ACCOUNT_SET, true, nullptr, "", accountSetCommandTable },
- { "password", rbac::RBAC_PERM_COMMAND_ACCOUNT_PASSWORD, false, &HandleAccountPasswordCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_ACCOUNT, false, &HandleAccountCommand, "" },
+ static ChatCommandTable accountCommandTable =
+ {
+ { "2fa setup", HandleAccount2FASetupCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_2FA_SETUP, Console::No },
+ { "2fa remove", HandleAccount2FARemoveCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_2FA_REMOVE, Console::No },
+ { "addon", HandleAccountAddonCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_ADDON, Console::No },
+ { "create", HandleAccountCreateCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_CREATE, Console::Yes },
+ { "delete", HandleAccountDeleteCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_DELETE, Console::Yes },
+ { "email", HandleAccountEmailCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_EMAIL, Console::No },
+ { "onlinelist", HandleAccountOnlineListCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_ONLINE_LIST, Console::Yes },
+ { "lock country", HandleAccountLockCountryCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_LOCK_COUNTRY, Console::No },
+ { "lock ip", HandleAccountLockIpCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_LOCK_IP, Console::No },
+ { "set", accountSetCommandTable },
+ { "password", HandleAccountPasswordCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT_PASSWORD, Console::No },
+ { "", HandleAccountCommand, rbac::RBAC_PERM_COMMAND_ACCOUNT, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "account", rbac::RBAC_PERM_COMMAND_ACCOUNT, true, nullptr, "", accountCommandTable },
+ { "account", accountCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_achievement.cpp b/src/server/scripts/Commands/cs_achievement.cpp
index 8f80436ee4b..18a51845f8d 100644
--- a/src/server/scripts/Commands/cs_achievement.cpp
+++ b/src/server/scripts/Commands/cs_achievement.cpp
@@ -29,20 +29,18 @@ EndScriptData */
#include "Player.h"
#include "RBAC.h"
+using namespace Trinity::ChatCommands;
+
class achievement_commandscript : public CommandScript
{
public:
achievement_commandscript() : CommandScript("achievement_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> achievementCommandTable =
- {
- { "add", rbac::RBAC_PERM_COMMAND_ACHIEVEMENT_ADD, false, &HandleAchievementAddCommand, "" },
- };
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "achievement", rbac::RBAC_PERM_COMMAND_ACHIEVEMENT, false, nullptr, "", achievementCommandTable },
+ { "achievement add", HandleAchievementAddCommand, rbac::RBAC_PERM_COMMAND_ACHIEVEMENT_ADD, Console::No },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_ahbot.cpp b/src/server/scripts/Commands/cs_ahbot.cpp
index d1885403e76..7dd5006dad6 100644
--- a/src/server/scripts/Commands/cs_ahbot.cpp
+++ b/src/server/scripts/Commands/cs_ahbot.cpp
@@ -21,58 +21,58 @@
#include "Language.h"
#include "RBAC.h"
-static std::unordered_map<AuctionQuality, uint32> const ahbotQualityLangIds =
- {
- { AUCTION_QUALITY_GRAY, LANG_AHBOT_QUALITY_GRAY },
- { AUCTION_QUALITY_WHITE, LANG_AHBOT_QUALITY_WHITE },
- { AUCTION_QUALITY_GREEN, LANG_AHBOT_QUALITY_GREEN },
- { AUCTION_QUALITY_BLUE, LANG_AHBOT_QUALITY_BLUE },
- { AUCTION_QUALITY_PURPLE, LANG_AHBOT_QUALITY_PURPLE },
- { AUCTION_QUALITY_ORANGE, LANG_AHBOT_QUALITY_ORANGE },
- { AUCTION_QUALITY_YELLOW, LANG_AHBOT_QUALITY_YELLOW }
- };
-
using namespace Trinity::ChatCommands;
+static std::unordered_map<AuctionQuality, uint32> const ahbotQualityLangIds =
+{
+ { AUCTION_QUALITY_GRAY, LANG_AHBOT_QUALITY_GRAY },
+ { AUCTION_QUALITY_WHITE, LANG_AHBOT_QUALITY_WHITE },
+ { AUCTION_QUALITY_GREEN, LANG_AHBOT_QUALITY_GREEN },
+ { AUCTION_QUALITY_BLUE, LANG_AHBOT_QUALITY_BLUE },
+ { AUCTION_QUALITY_PURPLE, LANG_AHBOT_QUALITY_PURPLE },
+ { AUCTION_QUALITY_ORANGE, LANG_AHBOT_QUALITY_ORANGE },
+ { AUCTION_QUALITY_YELLOW, LANG_AHBOT_QUALITY_YELLOW }
+};
+
class ahbot_commandscript : public CommandScript
{
public:
ahbot_commandscript(): CommandScript("ahbot_commandscript") {}
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> ahbotItemsAmountCommandTable =
+ static ChatCommandTable ahbotItemsAmountCommandTable =
{
- { "gray", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_GRAY, true, &HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GRAY>, "" },
- { "white", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_WHITE, true, &HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_WHITE>, "" },
- { "green", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_GREEN, true, &HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GREEN>, "" },
- { "blue", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_BLUE, true, &HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_BLUE>, "" },
- { "purple", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_PURPLE, true, &HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_PURPLE>, "" },
- { "orange", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_ORANGE, true, &HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_ORANGE>, "" },
- { "yellow", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_YELLOW, true, &HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_YELLOW>, "" },
- { "", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS, true, &HandleAHBotItemsAmountCommand, "" },
+ { "gray", HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GRAY>, rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_GRAY, Console::Yes },
+ { "white", HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_WHITE>, rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_WHITE, Console::Yes },
+ { "green", HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_GREEN>, rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_GREEN, Console::Yes },
+ { "blue", HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_BLUE>, rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_BLUE, Console::Yes },
+ { "purple", HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_PURPLE>, rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_PURPLE, Console::Yes },
+ { "orange", HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_ORANGE>, rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_ORANGE, Console::Yes },
+ { "yellow", HandleAHBotItemsAmountQualityCommand<AUCTION_QUALITY_YELLOW>, rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS_YELLOW, Console::Yes },
+ { "", HandleAHBotItemsAmountCommand, rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS, Console::Yes },
};
- static std::vector<ChatCommand> ahbotItemsRatioCommandTable =
+ static ChatCommandTable ahbotItemsRatioCommandTable =
{
- { "alliance", rbac::RBAC_PERM_COMMAND_AHBOT_RATIO_ALLIANCE, true, &HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_ALLIANCE>, "" },
- { "horde", rbac::RBAC_PERM_COMMAND_AHBOT_RATIO_HORDE, true, &HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_HORDE>, "" },
- { "neutral", rbac::RBAC_PERM_COMMAND_AHBOT_RATIO_NEUTRAL, true, &HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_NEUTRAL>, "" },
- { "", rbac::RBAC_PERM_COMMAND_AHBOT_RATIO, true, &HandleAHBotItemsRatioCommand, "" },
+ { "alliance", HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_ALLIANCE>, rbac::RBAC_PERM_COMMAND_AHBOT_RATIO_ALLIANCE, Console::Yes },
+ { "horde", HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_HORDE>, rbac::RBAC_PERM_COMMAND_AHBOT_RATIO_HORDE, Console::Yes },
+ { "neutral", HandleAHBotItemsRatioHouseCommand<AUCTION_HOUSE_NEUTRAL>, rbac::RBAC_PERM_COMMAND_AHBOT_RATIO_NEUTRAL, Console::Yes },
+ { "", HandleAHBotItemsRatioCommand, rbac::RBAC_PERM_COMMAND_AHBOT_RATIO, Console::Yes },
};
- static std::vector<ChatCommand> ahbotCommandTable =
+ static ChatCommandTable ahbotCommandTable =
{
- { "items", rbac::RBAC_PERM_COMMAND_AHBOT_ITEMS, true, nullptr, "", ahbotItemsAmountCommandTable },
- { "ratio", rbac::RBAC_PERM_COMMAND_AHBOT_RATIO, true, nullptr, "", ahbotItemsRatioCommandTable },
- { "rebuild", rbac::RBAC_PERM_COMMAND_AHBOT_REBUILD, true, &HandleAHBotRebuildCommand, "" },
- { "reload", rbac::RBAC_PERM_COMMAND_AHBOT_RELOAD, true, &HandleAHBotReloadCommand, "" },
- { "status", rbac::RBAC_PERM_COMMAND_AHBOT_STATUS, true, &HandleAHBotStatusCommand, "" },
+ { "items", ahbotItemsAmountCommandTable },
+ { "ratio", ahbotItemsRatioCommandTable },
+ { "rebuild", HandleAHBotRebuildCommand, rbac::RBAC_PERM_COMMAND_AHBOT_REBUILD, Console::Yes },
+ { "reload", HandleAHBotReloadCommand, rbac::RBAC_PERM_COMMAND_AHBOT_RELOAD, Console::Yes },
+ { "status", HandleAHBotStatusCommand, rbac::RBAC_PERM_COMMAND_AHBOT_STATUS, Console::Yes },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "ahbot", rbac::RBAC_PERM_COMMAND_AHBOT, false, nullptr, "", ahbotCommandTable },
+ { "ahbot", ahbotCommandTable },
};
return commandTable;
diff --git a/src/server/scripts/Commands/cs_arena.cpp b/src/server/scripts/Commands/cs_arena.cpp
index f84243498d4..dc7b5c329f8 100644
--- a/src/server/scripts/Commands/cs_arena.cpp
+++ b/src/server/scripts/Commands/cs_arena.cpp
@@ -33,27 +33,27 @@ EndScriptData */
#include "RBAC.h"
#include "WorldSession.h"
-
using namespace Trinity::ChatCommands;
+
class arena_commandscript : public CommandScript
{
public:
arena_commandscript() : CommandScript("arena_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> arenaCommandTable =
- {
- { "create", rbac::RBAC_PERM_COMMAND_ARENA_CREATE, true, &HandleArenaCreateCommand, "" },
- { "disband", rbac::RBAC_PERM_COMMAND_ARENA_DISBAND, true, &HandleArenaDisbandCommand, "" },
- { "rename", rbac::RBAC_PERM_COMMAND_ARENA_RENAME, true, &HandleArenaRenameCommand, "" },
- { "captain", rbac::RBAC_PERM_COMMAND_ARENA_CAPTAIN, false, &HandleArenaCaptainCommand, "" },
- { "info", rbac::RBAC_PERM_COMMAND_ARENA_INFO, true, &HandleArenaInfoCommand, "" },
- { "lookup", rbac::RBAC_PERM_COMMAND_ARENA_LOOKUP, false, &HandleArenaLookupCommand, "" },
+ static ChatCommandTable arenaCommandTable =
+ {
+ { "create", HandleArenaCreateCommand, rbac::RBAC_PERM_COMMAND_ARENA_CREATE, Console::Yes },
+ { "disband", HandleArenaDisbandCommand, rbac::RBAC_PERM_COMMAND_ARENA_DISBAND, Console::Yes },
+ { "rename", HandleArenaRenameCommand, rbac::RBAC_PERM_COMMAND_ARENA_RENAME, Console::Yes },
+ { "captain", HandleArenaCaptainCommand, rbac::RBAC_PERM_COMMAND_ARENA_CAPTAIN, Console::No },
+ { "info", HandleArenaInfoCommand, rbac::RBAC_PERM_COMMAND_ARENA_INFO, Console::Yes },
+ { "lookup", HandleArenaLookupCommand, rbac::RBAC_PERM_COMMAND_ARENA_LOOKUP, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "arena", rbac::RBAC_PERM_COMMAND_ARENA, false, nullptr, "", arenaCommandTable },
+ { "arena", arenaCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp
index f72fb715d04..7117df396dd 100644
--- a/src/server/scripts/Commands/cs_ban.cpp
+++ b/src/server/scripts/Commands/cs_ban.cpp
@@ -35,45 +35,51 @@ EndScriptData */
#include "World.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+using namespace Trinity::ChatCommands;
+
class ban_commandscript : public CommandScript
{
public:
ban_commandscript() : CommandScript("ban_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> unbanCommandTable =
+ static ChatCommandTable unbanCommandTable =
{
- { "account", rbac::RBAC_PERM_COMMAND_UNBAN_ACCOUNT, true, &HandleUnBanAccountCommand, "" },
- { "character", rbac::RBAC_PERM_COMMAND_UNBAN_CHARACTER, true, &HandleUnBanCharacterCommand, "" },
- { "playeraccount", rbac::RBAC_PERM_COMMAND_UNBAN_PLAYERACCOUNT, true, &HandleUnBanAccountByCharCommand, "" },
- { "ip", rbac::RBAC_PERM_COMMAND_UNBAN_IP, true, &HandleUnBanIPCommand, "" },
+ { "account", HandleUnBanAccountCommand, rbac::RBAC_PERM_COMMAND_UNBAN_ACCOUNT, Console::Yes },
+ { "character", HandleUnBanCharacterCommand, rbac::RBAC_PERM_COMMAND_UNBAN_CHARACTER, Console::Yes },
+ { "playeraccount", HandleUnBanAccountByCharCommand, rbac::RBAC_PERM_COMMAND_UNBAN_PLAYERACCOUNT, Console::Yes },
+ { "ip", HandleUnBanIPCommand, rbac::RBAC_PERM_COMMAND_UNBAN_IP, Console::Yes },
};
- static std::vector<ChatCommand> banlistCommandTable =
+ static ChatCommandTable banlistCommandTable =
{
- { "account", rbac::RBAC_PERM_COMMAND_BANLIST_ACCOUNT, true, &HandleBanListAccountCommand, "" },
- { "character", rbac::RBAC_PERM_COMMAND_BANLIST_CHARACTER, true, &HandleBanListCharacterCommand, "" },
- { "ip", rbac::RBAC_PERM_COMMAND_BANLIST_IP, true, &HandleBanListIPCommand, "" },
+ { "account", HandleBanListAccountCommand, rbac::RBAC_PERM_COMMAND_BANLIST_ACCOUNT, Console::Yes },
+ { "character", HandleBanListCharacterCommand, rbac::RBAC_PERM_COMMAND_BANLIST_CHARACTER, Console::Yes },
+ { "ip", HandleBanListIPCommand, rbac::RBAC_PERM_COMMAND_BANLIST_IP, Console::Yes },
};
- static std::vector<ChatCommand> baninfoCommandTable =
+ static ChatCommandTable baninfoCommandTable =
{
- { "account", rbac::RBAC_PERM_COMMAND_BANINFO_ACCOUNT, true, &HandleBanInfoAccountCommand, "" },
- { "character", rbac::RBAC_PERM_COMMAND_BANINFO_CHARACTER, true, &HandleBanInfoCharacterCommand, "" },
- { "ip", rbac::RBAC_PERM_COMMAND_BANINFO_IP, true, &HandleBanInfoIPCommand, "" },
+ { "account", HandleBanInfoAccountCommand, rbac::RBAC_PERM_COMMAND_BANINFO_ACCOUNT, Console::Yes },
+ { "character", HandleBanInfoCharacterCommand, rbac::RBAC_PERM_COMMAND_BANINFO_CHARACTER, Console::Yes },
+ { "ip", HandleBanInfoIPCommand, rbac::RBAC_PERM_COMMAND_BANINFO_IP, Console::Yes },
};
- static std::vector<ChatCommand> banCommandTable =
+ static ChatCommandTable banCommandTable =
{
- { "account", rbac::RBAC_PERM_COMMAND_BAN_ACCOUNT, true, &HandleBanAccountCommand, "" },
- { "character", rbac::RBAC_PERM_COMMAND_BAN_CHARACTER, true, &HandleBanCharacterCommand, "" },
- { "playeraccount", rbac::RBAC_PERM_COMMAND_BAN_PLAYERACCOUNT, true, &HandleBanAccountByCharCommand, "" },
- { "ip", rbac::RBAC_PERM_COMMAND_BAN_IP, true, &HandleBanIPCommand, "" },
+ { "account", HandleBanAccountCommand, rbac::RBAC_PERM_COMMAND_BAN_ACCOUNT, Console::Yes },
+ { "character", HandleBanCharacterCommand, rbac::RBAC_PERM_COMMAND_BAN_CHARACTER, Console::Yes },
+ { "playeraccount", HandleBanAccountByCharCommand, rbac::RBAC_PERM_COMMAND_BAN_PLAYERACCOUNT, Console::Yes },
+ { "ip", HandleBanIPCommand, rbac::RBAC_PERM_COMMAND_BAN_IP, Console::Yes },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "ban", rbac::RBAC_PERM_COMMAND_BAN, true, nullptr, "", banCommandTable },
- { "baninfo", rbac::RBAC_PERM_COMMAND_BANINFO, true, nullptr, "", baninfoCommandTable },
- { "banlist", rbac::RBAC_PERM_COMMAND_BANLIST, true, nullptr, "", banlistCommandTable },
- { "unban", rbac::RBAC_PERM_COMMAND_UNBAN, true, nullptr, "", unbanCommandTable },
+ { "ban", banCommandTable },
+ { "baninfo", baninfoCommandTable },
+ { "banlist", banlistCommandTable },
+ { "unban", unbanCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp
index f01aa611f7f..e98463c20c4 100644
--- a/src/server/scripts/Commands/cs_bf.cpp
+++ b/src/server/scripts/Commands/cs_bf.cpp
@@ -27,24 +27,26 @@ EndScriptData */
#include "Chat.h"
#include "RBAC.h"
+using namespace Trinity::ChatCommands;
+
class bf_commandscript : public CommandScript
{
public:
bf_commandscript() : CommandScript("bf_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> battlefieldcommandTable =
+ static ChatCommandTable battlefieldcommandTable =
{
- { "start", rbac::RBAC_PERM_COMMAND_BF_START, false, &HandleBattlefieldStart, "" },
- { "stop", rbac::RBAC_PERM_COMMAND_BF_STOP, false, &HandleBattlefieldEnd, "" },
- { "switch", rbac::RBAC_PERM_COMMAND_BF_SWITCH, false, &HandleBattlefieldSwitch, "" },
- { "timer", rbac::RBAC_PERM_COMMAND_BF_TIMER, false, &HandleBattlefieldTimer, "" },
- { "enable", rbac::RBAC_PERM_COMMAND_BF_ENABLE, false, &HandleBattlefieldEnable, "" },
+ { "start", HandleBattlefieldStart, rbac::RBAC_PERM_COMMAND_BF_START, Console::No },
+ { "stop", HandleBattlefieldEnd, rbac::RBAC_PERM_COMMAND_BF_STOP, Console::No },
+ { "switch", HandleBattlefieldSwitch, rbac::RBAC_PERM_COMMAND_BF_SWITCH, Console::No },
+ { "timer", HandleBattlefieldTimer, rbac::RBAC_PERM_COMMAND_BF_TIMER, Console::No },
+ { "enable", HandleBattlefieldEnable, rbac::RBAC_PERM_COMMAND_BF_ENABLE, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "bf", rbac::RBAC_PERM_COMMAND_BF, false, nullptr, "", battlefieldcommandTable },
+ { "bf", battlefieldcommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp
index e9f718f524f..1e4910bd75a 100644
--- a/src/server/scripts/Commands/cs_cast.cpp
+++ b/src/server/scripts/Commands/cs_cast.cpp
@@ -33,25 +33,26 @@ EndScriptData */
#include "WorldSession.h"
using namespace Trinity::ChatCommands;
+
class cast_commandscript : public CommandScript
{
public:
cast_commandscript() : CommandScript("cast_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> castCommandTable =
+ static ChatCommandTable castCommandTable =
{
- { "back", rbac::RBAC_PERM_COMMAND_CAST_BACK, false, &HandleCastBackCommand, "" },
- { "dist", rbac::RBAC_PERM_COMMAND_CAST_DIST, false, &HandleCastDistCommand, "" },
- { "self", rbac::RBAC_PERM_COMMAND_CAST_SELF, false, &HandleCastSelfCommand, "" },
- { "target", rbac::RBAC_PERM_COMMAND_CAST_TARGET, false, &HandleCastTargetCommad, "" },
- { "dest", rbac::RBAC_PERM_COMMAND_CAST_DEST, false, &HandleCastDestCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_CAST, false, &HandleCastCommand, "" },
+ { "back", HandleCastBackCommand, rbac::RBAC_PERM_COMMAND_CAST_BACK, Console::No },
+ { "dist", HandleCastDistCommand, rbac::RBAC_PERM_COMMAND_CAST_DIST, Console::No },
+ { "self", HandleCastSelfCommand, rbac::RBAC_PERM_COMMAND_CAST_SELF, Console::No },
+ { "target", HandleCastTargetCommad, rbac::RBAC_PERM_COMMAND_CAST_TARGET, Console::No },
+ { "dest", HandleCastDestCommand, rbac::RBAC_PERM_COMMAND_CAST_DEST, Console::No },
+ { "", HandleCastCommand, rbac::RBAC_PERM_COMMAND_CAST, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "cast", rbac::RBAC_PERM_COMMAND_CAST, false, nullptr, "", castCommandTable },
+ { "cast", castCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp
index c8c374b5f21..0b955f6ca4b 100644
--- a/src/server/scripts/Commands/cs_character.cpp
+++ b/src/server/scripts/Commands/cs_character.cpp
@@ -38,46 +38,47 @@ EndScriptData */
#include "WorldSession.h"
using namespace Trinity::ChatCommands;
+
class character_commandscript : public CommandScript
{
public:
character_commandscript() : CommandScript("character_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> pdumpCommandTable =
+ static ChatCommandTable pdumpCommandTable =
{
- { "copy", rbac::RBAC_PERM_COMMAND_PDUMP_COPY, true, &HandlePDumpCopyCommand, "" },
- { "load", rbac::RBAC_PERM_COMMAND_PDUMP_LOAD, true, &HandlePDumpLoadCommand, "" },
- { "write", rbac::RBAC_PERM_COMMAND_PDUMP_WRITE, true, &HandlePDumpWriteCommand, "" },
+ { "copy", HandlePDumpCopyCommand, rbac::RBAC_PERM_COMMAND_PDUMP_COPY, Console::Yes },
+ { "load", HandlePDumpLoadCommand, rbac::RBAC_PERM_COMMAND_PDUMP_LOAD, Console::Yes },
+ { "write", HandlePDumpWriteCommand, rbac::RBAC_PERM_COMMAND_PDUMP_WRITE, Console::Yes },
};
- static std::vector<ChatCommand> characterDeletedCommandTable =
+ static ChatCommandTable characterDeletedCommandTable =
{
- { "delete", rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED_DELETE, true, &HandleCharacterDeletedDeleteCommand, "" },
- { "list", rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED_LIST, true, &HandleCharacterDeletedListCommand, "" },
- { "restore", rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED_RESTORE, true, &HandleCharacterDeletedRestoreCommand, "" },
- { "old", rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED_OLD, true, &HandleCharacterDeletedOldCommand, "" },
+ { "delete", HandleCharacterDeletedDeleteCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED_DELETE, Console::Yes },
+ { "list", HandleCharacterDeletedListCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED_LIST, Console::Yes },
+ { "restore", HandleCharacterDeletedRestoreCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED_RESTORE, Console::Yes },
+ { "old", HandleCharacterDeletedOldCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED_OLD, Console::Yes },
};
- static std::vector<ChatCommand> characterCommandTable =
- {
- { "customize", rbac::RBAC_PERM_COMMAND_CHARACTER_CUSTOMIZE, true, &HandleCharacterCustomizeCommand, "", },
- { "changefaction", rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGEFACTION, true, &HandleCharacterChangeFactionCommand, "", },
- { "changerace", rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGERACE, true, &HandleCharacterChangeRaceCommand, "", },
- { "changeaccount", rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGEACCOUNT, true, &HandleCharacterChangeAccountCommand, "", },
- { "deleted", rbac::RBAC_PERM_COMMAND_CHARACTER_DELETED, true, nullptr, "", characterDeletedCommandTable },
- { "erase", rbac::RBAC_PERM_COMMAND_CHARACTER_ERASE, true, &HandleCharacterEraseCommand, "", },
- { "level", rbac::RBAC_PERM_COMMAND_CHARACTER_LEVEL, true, &HandleLevelUpCommand, "", },
- { "rename", rbac::RBAC_PERM_COMMAND_CHARACTER_RENAME, true, &HandleCharacterRenameCommand, "", },
- { "reputation", rbac::RBAC_PERM_COMMAND_CHARACTER_REPUTATION, true, &HandleCharacterReputationCommand, "", },
- { "titles", rbac::RBAC_PERM_COMMAND_CHARACTER_TITLES, true, &HandleCharacterTitlesCommand, "", },
+ static ChatCommandTable characterCommandTable =
+ {
+ { "customize", HandleCharacterCustomizeCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_CUSTOMIZE, Console::Yes },
+ { "changefaction", HandleCharacterChangeFactionCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGEFACTION, Console::Yes },
+ { "changerace", HandleCharacterChangeRaceCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGERACE, Console::Yes },
+ { "changeaccount", HandleCharacterChangeAccountCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_CHANGEACCOUNT, Console::Yes },
+ { "deleted", characterDeletedCommandTable },
+ { "erase", HandleCharacterEraseCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_ERASE, Console::Yes },
+ { "level", HandleLevelUpCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_LEVEL, Console::Yes },
+ { "rename", HandleCharacterRenameCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_RENAME, Console::Yes },
+ { "reputation", HandleCharacterReputationCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_REPUTATION, Console::Yes },
+ { "titles", HandleCharacterTitlesCommand, rbac::RBAC_PERM_COMMAND_CHARACTER_TITLES, Console::Yes },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "character", rbac::RBAC_PERM_COMMAND_CHARACTER, true, nullptr, "", characterCommandTable },
- { "levelup", rbac::RBAC_PERM_COMMAND_LEVELUP, false, &HandleLevelUpCommand, "" },
- { "pdump", rbac::RBAC_PERM_COMMAND_PDUMP, true, nullptr, "", pdumpCommandTable },
+ { "character", characterCommandTable },
+ { "levelup", HandleLevelUpCommand, rbac::RBAC_PERM_COMMAND_LEVELUP, Console::No },
+ { "pdump", pdumpCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp
index 912762c88d8..ca0066457be 100644
--- a/src/server/scripts/Commands/cs_cheat.cpp
+++ b/src/server/scripts/Commands/cs_cheat.cpp
@@ -29,29 +29,31 @@ EndScriptData */
#include "RBAC.h"
#include "WorldSession.h"
+using namespace Trinity::ChatCommands;
+
class cheat_commandscript : public CommandScript
{
public:
cheat_commandscript() : CommandScript("cheat_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> cheatCommandTable =
+ static ChatCommandTable cheatCommandTable =
{
- { "god", rbac::RBAC_PERM_COMMAND_CHEAT_GOD, false, &HandleGodModeCheatCommand, "" },
- { "casttime", rbac::RBAC_PERM_COMMAND_CHEAT_CASTTIME, false, &HandleCasttimeCheatCommand, "" },
- { "cooldown", rbac::RBAC_PERM_COMMAND_CHEAT_COOLDOWN, false, &HandleCoolDownCheatCommand, "" },
- { "power", rbac::RBAC_PERM_COMMAND_CHEAT_POWER, false, &HandlePowerCheatCommand, "" },
- { "waterwalk", rbac::RBAC_PERM_COMMAND_CHEAT_WATERWALK, false, &HandleWaterWalkCheatCommand, "" },
- { "status", rbac::RBAC_PERM_COMMAND_CHEAT_STATUS, false, &HandleCheatStatusCommand, "" },
- { "taxi", rbac::RBAC_PERM_COMMAND_CHEAT_TAXI, false, &HandleTaxiCheatCommand, "" },
- { "explore", rbac::RBAC_PERM_COMMAND_CHEAT_EXPLORE, false, &HandleExploreCheatCommand, "" },
+ { "god", HandleGodModeCheatCommand, rbac::RBAC_PERM_COMMAND_CHEAT_GOD, Console::No },
+ { "casttime", HandleCasttimeCheatCommand, rbac::RBAC_PERM_COMMAND_CHEAT_CASTTIME, Console::No },
+ { "cooldown", HandleCoolDownCheatCommand, rbac::RBAC_PERM_COMMAND_CHEAT_COOLDOWN, Console::No },
+ { "power", HandlePowerCheatCommand, rbac::RBAC_PERM_COMMAND_CHEAT_POWER, Console::No },
+ { "waterwalk", HandleWaterWalkCheatCommand, rbac::RBAC_PERM_COMMAND_CHEAT_WATERWALK, Console::No },
+ { "status", HandleCheatStatusCommand, rbac::RBAC_PERM_COMMAND_CHEAT_STATUS, Console::No },
+ { "taxi", HandleTaxiCheatCommand, rbac::RBAC_PERM_COMMAND_CHEAT_TAXI, Console::No },
+ { "explore", HandleExploreCheatCommand, rbac::RBAC_PERM_COMMAND_CHEAT_EXPLORE, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "cheat", rbac::RBAC_PERM_COMMAND_CHEAT, false, nullptr, "", cheatCommandTable },
+ { "cheat", cheatCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index aaef3a7f084..f92705ac92e 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -52,87 +52,80 @@ EndScriptData */
#include <set>
using namespace Trinity::ChatCommands;
+
class debug_commandscript : public CommandScript
{
public:
debug_commandscript() : CommandScript("debug_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> debugPlayCommandTable =
+ static ChatCommandTable debugPlayCommandTable =
{
- { "cinematic", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_CINEMATIC, false, &HandleDebugPlayCinematicCommand, "" },
- { "movie", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_MOVIE, false, &HandleDebugPlayMovieCommand, "" },
- { "sound", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_SOUND, false, &HandleDebugPlaySoundCommand, "" },
- { "music", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY_MUSIC, false, &HandleDebugPlayMusicCommand, "" },
- };
- static std::vector<ChatCommand> debugSendCommandTable =
- {
- { "buyerror", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_BUYERROR, false, &HandleDebugSendBuyErrorCommand, "" },
- { "channelnotify", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_CHANNELNOTIFY, false, &HandleDebugSendChannelNotifyCommand, "" },
- { "chatmessage", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_CHATMESSAGE, false, &HandleDebugSendChatMsgCommand, "" },
- { "equiperror", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_EQUIPERROR, false, &HandleDebugSendEquipErrorCommand, "" },
- { "largepacket", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_LARGEPACKET, false, &HandleDebugSendLargePacketCommand, "" },
- { "opcode", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_OPCODE, false, &HandleDebugSendOpcodeCommand, "" },
- { "qpartymsg", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_QPARTYMSG, false, &HandleDebugSendQuestPartyMsgCommand, "" },
- { "qinvalidmsg", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_QINVALIDMSG, false, &HandleDebugSendQuestInvalidMsgCommand, "" },
- { "sellerror", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_SELLERROR, false, &HandleDebugSendSellErrorCommand, "" },
- { "setphaseshift", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_SETPHASESHIFT, false, &HandleDebugSendSetPhaseShiftCommand, "" },
- { "spellfail", rbac::RBAC_PERM_COMMAND_DEBUG_SEND_SPELLFAIL, false, &HandleDebugSendSpellFailCommand, "" },
+ { "cinematic", HandleDebugPlayCinematicCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "movie", HandleDebugPlayMovieCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "sound", HandleDebugPlaySoundCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "music", HandleDebugPlayMusicCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
};
- static std::vector<ChatCommand> debugAsanCommandTable =
- {
- { "memoryleak", rbac::RBAC_PERM_COMMAND_DEBUG_ASAN, true, &HandleDebugMemoryLeak, "" },
- { "outofbounds", rbac::RBAC_PERM_COMMAND_DEBUG_ASAN, true, &HandleDebugOutOfBounds, "" },
- };
- static std::vector<ChatCommand> debugWardenCommandTable =
- {
- { "force", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugWardenForce, "" }
+ static ChatCommandTable debugSendCommandTable =
+ {
+ { "buyerror", HandleDebugSendBuyErrorCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "channelnotify", HandleDebugSendChannelNotifyCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "chatmessage", HandleDebugSendChatMsgCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "equiperror", HandleDebugSendEquipErrorCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "largepacket", HandleDebugSendLargePacketCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "opcode", HandleDebugSendOpcodeCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "qpartymsg", HandleDebugSendQuestPartyMsgCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "qinvalidmsg", HandleDebugSendQuestInvalidMsgCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "sellerror", HandleDebugSendSellErrorCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "setphaseshift", HandleDebugSendSetPhaseShiftCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "spellfail", HandleDebugSendSpellFailCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
};
- static std::vector<ChatCommand> debugCommandTable =
- {
- { "setbit", rbac::RBAC_PERM_COMMAND_DEBUG_SETBIT, false, &HandleDebugSet32BitCommand, "" },
- { "threat", rbac::RBAC_PERM_COMMAND_DEBUG_THREAT, false, &HandleDebugThreatListCommand, "" },
- { "threatinfo", rbac::RBAC_PERM_COMMAND_DEBUG_THREATINFO, false, &HandleDebugThreatInfoCommand, "" },
- { "combat", rbac::RBAC_PERM_COMMAND_DEBUG_COMBAT, false, &HandleDebugCombatListCommand, "" },
- { "anim", rbac::RBAC_PERM_COMMAND_DEBUG_ANIM, false, &HandleDebugAnimCommand, "" },
- { "arena", rbac::RBAC_PERM_COMMAND_DEBUG_ARENA, true, &HandleDebugArenaCommand, "" },
- { "bg", rbac::RBAC_PERM_COMMAND_DEBUG_BG, true, &HandleDebugBattlegroundCommand, "" },
- { "getitemstate", rbac::RBAC_PERM_COMMAND_DEBUG_GETITEMSTATE, false, &HandleDebugGetItemStateCommand, "" },
- { "lootrecipient", rbac::RBAC_PERM_COMMAND_DEBUG_LOOTRECIPIENT, false, &HandleDebugGetLootRecipientCommand, "" },
- { "getvalue", rbac::RBAC_PERM_COMMAND_DEBUG_GETVALUE, false, &HandleDebugGetValueCommand, "" },
- { "getitemvalue", rbac::RBAC_PERM_COMMAND_DEBUG_GETITEMVALUE, false, &HandleDebugGetItemValueCommand, "" },
- { "Mod32Value", rbac::RBAC_PERM_COMMAND_DEBUG_MOD32VALUE, false, &HandleDebugMod32ValueCommand, "" },
- { "play", rbac::RBAC_PERM_COMMAND_DEBUG_PLAY, false, nullptr, "", debugPlayCommandTable },
- { "send", rbac::RBAC_PERM_COMMAND_DEBUG_SEND, false, nullptr, "", debugSendCommandTable },
- { "setaurastate", rbac::RBAC_PERM_COMMAND_DEBUG_SETAURASTATE, false, &HandleDebugSetAuraStateCommand, "" },
- { "setitemvalue", rbac::RBAC_PERM_COMMAND_DEBUG_SETITEMVALUE, false, &HandleDebugSetItemValueCommand, "" },
- { "setvalue", rbac::RBAC_PERM_COMMAND_DEBUG_SETVALUE, false, &HandleDebugSetValueCommand, "" },
- { "spawnvehicle", rbac::RBAC_PERM_COMMAND_DEBUG_SPAWNVEHICLE, false, &HandleDebugSpawnVehicleCommand, "" },
- { "entervehicle", rbac::RBAC_PERM_COMMAND_DEBUG_ENTERVEHICLE, false, &HandleDebugEnterVehicleCommand, "" },
- { "worldstate", rbac::RBAC_PERM_COMMAND_DEBUG_WORLDSTATE, false, &HandleDebugUpdateWorldStateCommand, "" },
- { "update", rbac::RBAC_PERM_COMMAND_DEBUG_UPDATE, false, &HandleDebugUpdateCommand, "" },
- { "itemexpire", rbac::RBAC_PERM_COMMAND_DEBUG_ITEMEXPIRE, false, &HandleDebugItemExpireCommand, "" },
- { "areatriggers", rbac::RBAC_PERM_COMMAND_DEBUG_AREATRIGGERS, false, &HandleDebugAreaTriggersCommand, "" },
- { "los", rbac::RBAC_PERM_COMMAND_DEBUG_LOS, false, &HandleDebugLoSCommand, "" },
- { "moveflags", rbac::RBAC_PERM_COMMAND_DEBUG_MOVEFLAGS, false, &HandleDebugMoveflagsCommand, "" },
- { "transport", rbac::RBAC_PERM_COMMAND_DEBUG_TRANSPORT, false, &HandleDebugTransportCommand, "" },
- { "loadcells", rbac::RBAC_PERM_COMMAND_DEBUG_LOADCELLS, false, &HandleDebugLoadCellsCommand, "" },
- { "boundary", rbac::RBAC_PERM_COMMAND_DEBUG_BOUNDARY, false, &HandleDebugBoundaryCommand, "" },
- { "raidreset", rbac::RBAC_PERM_COMMAND_INSTANCE_UNBIND, false, &HandleDebugRaidResetCommand, "" },
- { "neargraveyard", rbac::RBAC_PERM_COMMAND_NEARGRAVEYARD, false, &HandleDebugNearGraveyard, "" },
- { "instancespawn", rbac::RBAC_PERM_COMMAND_DEBUG_INSTANCESPAWN, false, &HandleDebugInstanceSpawns, "" },
- { "dummy", rbac::RBAC_PERM_COMMAND_DEBUG_DUMMY, false, &HandleDebugDummyCommand, "" },
- { "asan", rbac::RBAC_PERM_COMMAND_DEBUG_ASAN, true, nullptr, "", debugAsanCommandTable },
- { "guidlimits", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugGuidLimitsCommand, "" },
- { "objectcount", rbac::RBAC_PERM_COMMAND_DEBUG, true, &HandleDebugObjectCountCommand, "" },
- { "questreset", rbac::RBAC_PERM_COMMAND_DEBUG_QUESTRESET, true, &HandleDebugQuestResetCommand, "" },
- { "warden", rbac::RBAC_PERM_COMMAND_DEBUG, true, nullptr, "", debugWardenCommandTable }
+ static ChatCommandTable debugCommandTable =
+ {
+ { "setbit", HandleDebugSet32BitCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "threat", HandleDebugThreatListCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "threatinfo", HandleDebugThreatInfoCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "combat", HandleDebugCombatListCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "anim", HandleDebugAnimCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "arena", HandleDebugArenaCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
+ { "bg", HandleDebugBattlegroundCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
+ { "getitemstate", HandleDebugGetItemStateCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "lootrecipient", HandleDebugGetLootRecipientCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "getvalue", HandleDebugGetValueCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "getitemvalue", HandleDebugGetItemValueCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "Mod32Value", HandleDebugMod32ValueCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "play", debugPlayCommandTable },
+ { "send", debugSendCommandTable },
+ { "setaurastate", HandleDebugSetAuraStateCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "setitemvalue", HandleDebugSetItemValueCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "setvalue", HandleDebugSetValueCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "spawnvehicle", HandleDebugSpawnVehicleCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "entervehicle", HandleDebugEnterVehicleCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "worldstate", HandleDebugUpdateWorldStateCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "update", HandleDebugUpdateCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "itemexpire", HandleDebugItemExpireCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "areatriggers", HandleDebugAreaTriggersCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "los", HandleDebugLoSCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "moveflags", HandleDebugMoveflagsCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "transport", HandleDebugTransportCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "loadcells", HandleDebugLoadCellsCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "boundary", HandleDebugBoundaryCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "raidreset", HandleDebugRaidResetCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "neargraveyard", HandleDebugNearGraveyard, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "instancespawn", HandleDebugInstanceSpawns, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "dummy", HandleDebugDummyCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
+ { "asan memoryleak", HandleDebugMemoryLeak, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
+ { "asan outofbounds", HandleDebugOutOfBounds, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
+ { "guidlimits", HandleDebugGuidLimitsCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
+ { "objectcount", HandleDebugObjectCountCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
+ { "questreset", HandleDebugQuestResetCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes },
+ { "warden force", HandleDebugWardenForce, rbac::RBAC_PERM_COMMAND_DEBUG, Console::Yes }
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "debug", rbac::RBAC_PERM_COMMAND_DEBUG, true, nullptr, "", debugCommandTable },
- { "wpgps", rbac::RBAC_PERM_COMMAND_WPGPS, false, &HandleWPGPSCommand, "" },
+ { "debug", debugCommandTable },
+ { "wpgps", HandleWPGPSCommand, rbac::RBAC_PERM_COMMAND_DEBUG, Console::No },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_deserter.cpp b/src/server/scripts/Commands/cs_deserter.cpp
index 32e2a296edb..e997c627404 100644
--- a/src/server/scripts/Commands/cs_deserter.cpp
+++ b/src/server/scripts/Commands/cs_deserter.cpp
@@ -29,6 +29,8 @@
#include "RBAC.h"
#include "SpellAuras.h"
+using namespace Trinity::ChatCommands;
+
enum Spells
{
LFG_SPELL_DUNGEON_DESERTER = 71041,
@@ -44,27 +46,27 @@ public:
* @brief Returns the command structure for the system.
*/
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> deserterInstanceCommandTable =
+ static ChatCommandTable deserterInstanceCommandTable =
{
- { "add", rbac::RBAC_PERM_COMMAND_DESERTER_INSTANCE_ADD, false, &HandleDeserterInstanceAdd, "" },
- { "remove", rbac::RBAC_PERM_COMMAND_DESERTER_INSTANCE_REMOVE, false, &HandleDeserterInstanceRemove, "" },
+ { "add", HandleDeserterInstanceAdd, rbac::RBAC_PERM_COMMAND_DESERTER_INSTANCE_ADD, Console::No },
+ { "remove", HandleDeserterInstanceRemove, rbac::RBAC_PERM_COMMAND_DESERTER_INSTANCE_REMOVE, Console::No },
};
- static std::vector<ChatCommand> deserterBGCommandTable =
+ static ChatCommandTable deserterBGCommandTable =
{
- { "add", rbac::RBAC_PERM_COMMAND_DESERTER_BG_ADD, false, &HandleDeserterBGAdd, "" },
- { "remove", rbac::RBAC_PERM_COMMAND_DESERTER_BG_REMOVE, false, &HandleDeserterBGRemove, "" },
+ { "add", HandleDeserterBGAdd, rbac::RBAC_PERM_COMMAND_DESERTER_BG_ADD, Console::No },
+ { "remove", HandleDeserterBGRemove, rbac::RBAC_PERM_COMMAND_DESERTER_BG_REMOVE, Console::No },
};
- static std::vector<ChatCommand> deserterCommandTable =
+ static ChatCommandTable deserterCommandTable =
{
- { "instance", rbac::RBAC_PERM_COMMAND_DESERTER_INSTANCE, false, nullptr, "", deserterInstanceCommandTable },
- { "bg", rbac::RBAC_PERM_COMMAND_DESERTER_BG, false, nullptr, "", deserterBGCommandTable },
+ { "instance", deserterInstanceCommandTable },
+ { "bg", deserterBGCommandTable },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "deserter", rbac::RBAC_PERM_COMMAND_DESERTER, false, nullptr, "", deserterCommandTable },
+ { "deserter", deserterCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp
index 7d310d4a167..132f7af3cc9 100644
--- a/src/server/scripts/Commands/cs_disable.cpp
+++ b/src/server/scripts/Commands/cs_disable.cpp
@@ -34,43 +34,49 @@ EndScriptData */
#include "RBAC.h"
#include "SpellMgr.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+using namespace Trinity::ChatCommands;
+
class disable_commandscript : public CommandScript
{
public:
disable_commandscript() : CommandScript("disable_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> removeDisableCommandTable =
+ static ChatCommandTable removeDisableCommandTable =
{
- { "spell", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_SPELL, true, &HandleRemoveDisableSpellCommand, "" },
- { "quest", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_QUEST, true, &HandleRemoveDisableQuestCommand, "" },
- { "map", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_MAP, true, &HandleRemoveDisableMapCommand, "" },
- { "battleground", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_BATTLEGROUND, true, &HandleRemoveDisableBattlegroundCommand, "" },
- { "achievement_criteria", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_ACHIEVEMENT_CRITERIA, true, &HandleRemoveDisableAchievementCriteriaCommand, "" },
- { "outdoorpvp", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_OUTDOORPVP, true, &HandleRemoveDisableOutdoorPvPCommand, "" },
- { "vmap", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_VMAP, true, &HandleRemoveDisableVmapCommand, "" },
- { "mmap", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_MMAP, true, &HandleRemoveDisableMMapCommand, "" },
+ { "spell", HandleRemoveDisableSpellCommand, rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_SPELL, Console::Yes },
+ { "quest", HandleRemoveDisableQuestCommand, rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_QUEST, Console::Yes },
+ { "map", HandleRemoveDisableMapCommand, rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_MAP, Console::Yes },
+ { "battleground", HandleRemoveDisableBattlegroundCommand, rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_BATTLEGROUND, Console::Yes },
+ { "achievement_criteria", HandleRemoveDisableAchievementCriteriaCommand, rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_ACHIEVEMENT_CRITERIA, Console::Yes },
+ { "outdoorpvp", HandleRemoveDisableOutdoorPvPCommand, rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_OUTDOORPVP, Console::Yes },
+ { "vmap", HandleRemoveDisableVmapCommand, rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_VMAP, Console::Yes },
+ { "mmap", HandleRemoveDisableMMapCommand, rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE_MMAP, Console::Yes },
};
- static std::vector<ChatCommand> addDisableCommandTable =
+ static ChatCommandTable addDisableCommandTable =
{
- { "spell", rbac::RBAC_PERM_COMMAND_DISABLE_ADD_SPELL, true, &HandleAddDisableSpellCommand, "" },
- { "quest", rbac::RBAC_PERM_COMMAND_DISABLE_ADD_QUEST, true, &HandleAddDisableQuestCommand, "" },
- { "map", rbac::RBAC_PERM_COMMAND_DISABLE_ADD_MAP, true, &HandleAddDisableMapCommand, "" },
- { "battleground", rbac::RBAC_PERM_COMMAND_DISABLE_ADD_BATTLEGROUND, true, &HandleAddDisableBattlegroundCommand, "" },
- { "achievement_criteria", rbac::RBAC_PERM_COMMAND_DISABLE_ADD_ACHIEVEMENT_CRITERIA, true, &HandleAddDisableAchievementCriteriaCommand, "" },
- { "outdoorpvp", rbac::RBAC_PERM_COMMAND_DISABLE_ADD_OUTDOORPVP, true, &HandleAddDisableOutdoorPvPCommand, "" },
- { "vmap", rbac::RBAC_PERM_COMMAND_DISABLE_ADD_VMAP, true, &HandleAddDisableVmapCommand, "" },
- { "mmap", rbac::RBAC_PERM_COMMAND_DISABLE_ADD_MMAP, true, &HandleAddDisableMMapCommand, "" },
+ { "spell", HandleAddDisableSpellCommand, rbac::RBAC_PERM_COMMAND_DISABLE_ADD_SPELL, Console::Yes },
+ { "quest", HandleAddDisableQuestCommand, rbac::RBAC_PERM_COMMAND_DISABLE_ADD_QUEST, Console::Yes },
+ { "map", HandleAddDisableMapCommand, rbac::RBAC_PERM_COMMAND_DISABLE_ADD_MAP, Console::Yes },
+ { "battleground", HandleAddDisableBattlegroundCommand, rbac::RBAC_PERM_COMMAND_DISABLE_ADD_BATTLEGROUND, Console::Yes },
+ { "achievement_criteria", HandleAddDisableAchievementCriteriaCommand, rbac::RBAC_PERM_COMMAND_DISABLE_ADD_ACHIEVEMENT_CRITERIA, Console::Yes },
+ { "outdoorpvp", HandleAddDisableOutdoorPvPCommand, rbac::RBAC_PERM_COMMAND_DISABLE_ADD_OUTDOORPVP, Console::Yes },
+ { "vmap", HandleAddDisableVmapCommand, rbac::RBAC_PERM_COMMAND_DISABLE_ADD_VMAP, Console::Yes },
+ { "mmap", HandleAddDisableMMapCommand, rbac::RBAC_PERM_COMMAND_DISABLE_ADD_MMAP, Console::Yes },
};
- static std::vector<ChatCommand> disableCommandTable =
+ static ChatCommandTable disableCommandTable =
{
- { "add", rbac::RBAC_PERM_COMMAND_DISABLE_ADD, true, nullptr, "", addDisableCommandTable },
- { "remove", rbac::RBAC_PERM_COMMAND_DISABLE_REMOVE, true, nullptr, "", removeDisableCommandTable },
+ { "add", addDisableCommandTable },
+ { "remove", removeDisableCommandTable },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "disable", rbac::RBAC_PERM_COMMAND_DISABLE, false, nullptr, "", disableCommandTable },
+ { "disable", disableCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_event.cpp b/src/server/scripts/Commands/cs_event.cpp
index 17bfa0df4ca..f13592aa3aa 100644
--- a/src/server/scripts/Commands/cs_event.cpp
+++ b/src/server/scripts/Commands/cs_event.cpp
@@ -37,18 +37,18 @@ class event_commandscript : public CommandScript
public:
event_commandscript() : CommandScript("event_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> eventCommandTable =
+ static ChatCommandTable eventCommandTable =
{
- { "activelist", rbac::RBAC_PERM_COMMAND_EVENT_ACTIVELIST, true, &HandleEventActiveListCommand, "" },
- { "start", rbac::RBAC_PERM_COMMAND_EVENT_START, true, &HandleEventStartCommand, "" },
- { "stop", rbac::RBAC_PERM_COMMAND_EVENT_STOP, true, &HandleEventStopCommand, "" },
- { "info", rbac::RBAC_PERM_COMMAND_EVENT, true, &HandleEventInfoCommand, "" },
+ { "activelist", HandleEventActiveListCommand, rbac::RBAC_PERM_COMMAND_EVENT_ACTIVELIST, Console::Yes },
+ { "start", HandleEventStartCommand, rbac::RBAC_PERM_COMMAND_EVENT_START, Console::Yes },
+ { "stop", HandleEventStopCommand, rbac::RBAC_PERM_COMMAND_EVENT_STOP, Console::Yes },
+ { "info", HandleEventInfoCommand, rbac::RBAC_PERM_COMMAND_EVENT_INFO, Console::Yes },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "event", rbac::RBAC_PERM_COMMAND_EVENT, false, nullptr, "", eventCommandTable },
+ { "event", eventCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 1f6f70ecc3a..a2206d37737 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -34,25 +34,27 @@ EndScriptData */
#include "World.h"
#include "WorldSession.h"
+using namespace Trinity::ChatCommands;
+
class gm_commandscript : public CommandScript
{
public:
gm_commandscript() : CommandScript("gm_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> gmCommandTable =
+ static ChatCommandTable gmCommandTable =
{
- { "chat", rbac::RBAC_PERM_COMMAND_GM_CHAT, false, &HandleGMChatCommand, "" },
- { "fly", rbac::RBAC_PERM_COMMAND_GM_FLY, false, &HandleGMFlyCommand, "" },
- { "ingame", rbac::RBAC_PERM_COMMAND_GM_INGAME, true, &HandleGMListIngameCommand, "" },
- { "list", rbac::RBAC_PERM_COMMAND_GM_LIST, true, &HandleGMListFullCommand, "" },
- { "visible", rbac::RBAC_PERM_COMMAND_GM_VISIBLE, false, &HandleGMVisibleCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_GM, false, &HandleGMCommand, "" },
+ { "chat", HandleGMChatCommand, rbac::RBAC_PERM_COMMAND_GM_CHAT, Console::No },
+ { "fly", HandleGMFlyCommand, rbac::RBAC_PERM_COMMAND_GM_FLY, Console::No },
+ { "ingame", HandleGMListIngameCommand, rbac::RBAC_PERM_COMMAND_GM_INGAME, Console::Yes },
+ { "list", HandleGMListFullCommand, rbac::RBAC_PERM_COMMAND_GM_LIST, Console::Yes },
+ { "visible", HandleGMVisibleCommand, rbac::RBAC_PERM_COMMAND_GM_VISIBLE, Console::No },
+ { "", HandleGMCommand, rbac::RBAC_PERM_COMMAND_GM, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "gm", rbac::RBAC_PERM_COMMAND_GM, false, nullptr, "", gmCommandTable },
+ { "gm", gmCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp
index f782a972180..22cf5b2e360 100644
--- a/src/server/scripts/Commands/cs_go.cpp
+++ b/src/server/scripts/Commands/cs_go.cpp
@@ -37,44 +37,35 @@ EndScriptData */
#include "WorldSession.h"
using namespace Trinity::ChatCommands;
+
class go_commandscript : public CommandScript
{
public:
go_commandscript() : CommandScript("go_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> goCreatureCommandTable =
- {
- { "id", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoCreatureCIdCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoCreatureSpawnIdCommand, "" }
- };
-
- static std::vector<ChatCommand> goGameObjectCommandTable =
- {
- { "id", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoGameObjectGOIdCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoGameObjectSpawnIdCommand, "" }
- };
-
- static std::vector<ChatCommand> goCommandTable =
- {
- { "creature", rbac::RBAC_PERM_COMMAND_GO, false, nullptr, "", goCreatureCommandTable },
- { "gameobject", rbac::RBAC_PERM_COMMAND_GO, false, nullptr, "", goGameObjectCommandTable },
- { "graveyard", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoGraveyardCommand, "" },
- { "grid", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoGridCommand, "" },
- { "taxinode", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoTaxinodeCommand, "" },
- { "areatrigger", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoAreaTriggerCommand, "" },
- { "zonexy", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoZoneXYCommand, "" },
- { "xyz", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoXYZCommand, "" },
- { "ticket", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoTicketCommand, "" },
- { "offset", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoOffsetCommand, "" },
- { "instance", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoInstanceCommand, "" },
- { "boss", rbac::RBAC_PERM_COMMAND_GO, false, &HandleGoBossCommand, "" }
+ static ChatCommandTable goCommandTable =
+ {
+ { "creature", HandleGoCreatureSpawnIdCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "creature id", HandleGoCreatureCIdCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "gameobject", HandleGoGameObjectSpawnIdCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "gameobject id", HandleGoGameObjectGOIdCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "graveyard", HandleGoGraveyardCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "grid", HandleGoGridCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "taxinode", HandleGoTaxinodeCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "areatrigger", HandleGoAreaTriggerCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "zonexy", HandleGoZoneXYCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "xyz", HandleGoXYZCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "ticket", HandleGoTicketCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "offset", HandleGoOffsetCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "instance", HandleGoInstanceCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No },
+ { "boss", HandleGoBossCommand, rbac::RBAC_PERM_COMMAND_GO, Console::No }
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "go", rbac::RBAC_PERM_COMMAND_GO, false, nullptr, "", goCommandTable },
+ { "go", goCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_gobject.cpp b/src/server/scripts/Commands/cs_gobject.cpp
index 0dce1f2ede3..5fd73e20f6b 100644
--- a/src/server/scripts/Commands/cs_gobject.cpp
+++ b/src/server/scripts/Commands/cs_gobject.cpp
@@ -41,8 +41,8 @@ EndScriptData */
#include "RBAC.h"
#include "WorldSession.h"
-
using namespace Trinity::ChatCommands;
+
using GameObjectSpawnId = Variant<Hyperlink<gameobject>, ObjectGuid::LowType>;
using GameObjectEntry = Variant<Hyperlink<gameobject_entry>, uint32>;
@@ -55,35 +55,27 @@ class gobject_commandscript : public CommandScript
public:
gobject_commandscript() : CommandScript("gobject_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> gobjectAddCommandTable =
- {
- { "temp", rbac::RBAC_PERM_COMMAND_GOBJECT_ADD_TEMP, false, &HandleGameObjectAddTempCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_GOBJECT_ADD, false, &HandleGameObjectAddCommand, "" },
- };
- static std::vector<ChatCommand> gobjectSetCommandTable =
- {
- { "phase", rbac::RBAC_PERM_COMMAND_GOBJECT_SET_PHASE, false, &HandleGameObjectSetPhaseCommand, "" },
- { "state", rbac::RBAC_PERM_COMMAND_GOBJECT_SET_STATE, false, &HandleGameObjectSetStateCommand, "" },
- };
- static std::vector<ChatCommand> gobjectCommandTable =
- {
- { "activate", rbac::RBAC_PERM_COMMAND_GOBJECT_ACTIVATE, false, &HandleGameObjectActivateCommand, "" },
- { "delete", rbac::RBAC_PERM_COMMAND_GOBJECT_DELETE, false, &HandleGameObjectDeleteCommand, "" },
- { "info", rbac::RBAC_PERM_COMMAND_GOBJECT_INFO, false, &HandleGameObjectInfoCommand, "" },
- { "move", rbac::RBAC_PERM_COMMAND_GOBJECT_MOVE, false, &HandleGameObjectMoveCommand, "" },
- { "near", rbac::RBAC_PERM_COMMAND_GOBJECT_NEAR, false, &HandleGameObjectNearCommand, "" },
- { "target", rbac::RBAC_PERM_COMMAND_GOBJECT_TARGET, false, &HandleGameObjectTargetCommand, "" },
- { "turn", rbac::RBAC_PERM_COMMAND_GOBJECT_TURN, false, &HandleGameObjectTurnCommand, "" },
- { "spawngroup", rbac::RBAC_PERM_COMMAND_GOBJECT_SPAWNGROUP, false, &HandleNpcSpawnGroup, "" },
- { "despawngroup", rbac::RBAC_PERM_COMMAND_GOBJECT_DESPAWNGROUP, false, &HandleNpcDespawnGroup,""},
- { "add", rbac::RBAC_PERM_COMMAND_GOBJECT_ADD, false, nullptr, "", gobjectAddCommandTable },
- { "set", rbac::RBAC_PERM_COMMAND_GOBJECT_SET, false, nullptr, "", gobjectSetCommandTable },
+ static ChatCommandTable gobjectCommandTable =
+ {
+ { "activate", HandleGameObjectActivateCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_ACTIVATE, Console::No },
+ { "delete", HandleGameObjectDeleteCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_DELETE, Console::No },
+ { "info", HandleGameObjectInfoCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_INFO, Console::No },
+ { "move", HandleGameObjectMoveCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_MOVE, Console::No },
+ { "near", HandleGameObjectNearCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_NEAR, Console::No },
+ { "target", HandleGameObjectTargetCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_TARGET, Console::No },
+ { "turn", HandleGameObjectTurnCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_TURN, Console::No },
+ { "spawngroup", HandleNpcSpawnGroup, rbac::RBAC_PERM_COMMAND_GOBJECT_SPAWNGROUP, Console::No },
+ { "despawngroup", HandleNpcDespawnGroup, rbac::RBAC_PERM_COMMAND_GOBJECT_DESPAWNGROUP, Console::No },
+ { "add temp", HandleGameObjectAddTempCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_ADD_TEMP, Console::No },
+ { "add", HandleGameObjectAddCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_ADD, Console::No },
+ { "set phase", HandleGameObjectSetPhaseCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_SET_PHASE, Console::No },
+ { "set state", HandleGameObjectSetStateCommand, rbac::RBAC_PERM_COMMAND_GOBJECT_SET_STATE, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "gobject", rbac::RBAC_PERM_COMMAND_GOBJECT, false, nullptr, "", gobjectCommandTable },
+ { "gobject", gobjectCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_group.cpp b/src/server/scripts/Commands/cs_group.cpp
index ae0c2d302e8..de36395cba3 100644
--- a/src/server/scripts/Commands/cs_group.cpp
+++ b/src/server/scripts/Commands/cs_group.cpp
@@ -29,6 +29,10 @@
#include "RBAC.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class group_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp
index 9cc03aa5e2a..cfe09772caf 100644
--- a/src/server/scripts/Commands/cs_guild.cpp
+++ b/src/server/scripts/Commands/cs_guild.cpp
@@ -33,6 +33,10 @@ EndScriptData */
#include "Player.h"
#include "RBAC.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
using namespace Trinity::ChatCommands;
class guild_commandscript : public CommandScript
{
diff --git a/src/server/scripts/Commands/cs_honor.cpp b/src/server/scripts/Commands/cs_honor.cpp
index 95f7834bd1e..2e06b3b0fe8 100644
--- a/src/server/scripts/Commands/cs_honor.cpp
+++ b/src/server/scripts/Commands/cs_honor.cpp
@@ -29,6 +29,10 @@ EndScriptData */
#include "RBAC.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class honor_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp
index 6e4f8765bc8..2d7c95db652 100644
--- a/src/server/scripts/Commands/cs_instance.cpp
+++ b/src/server/scripts/Commands/cs_instance.cpp
@@ -36,6 +36,10 @@ EndScriptData */
#include "RBAC.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class instance_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_learn.cpp b/src/server/scripts/Commands/cs_learn.cpp
index ff081b71ab7..b91e2052692 100644
--- a/src/server/scripts/Commands/cs_learn.cpp
+++ b/src/server/scripts/Commands/cs_learn.cpp
@@ -34,41 +34,46 @@ EndScriptData */
#include "SpellMgr.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
+using namespace Trinity::ChatCommands;
class learn_commandscript : public CommandScript
{
public:
learn_commandscript() : CommandScript("learn_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> learnAllMyCommandTable =
+ static ChatCommandTable learnAllMyCommandTable =
{
- { "class", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY_CLASS, false, &HandleLearnAllMyClassCommand, "" },
- { "pettalents", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY_PETTALENTS, false, &HandleLearnAllMyPetTalentsCommand, "" },
- { "spells", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY_SPELLS, false, &HandleLearnAllMySpellsCommand, "" },
- { "talents", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY_TALENTS, false, &HandleLearnAllMyTalentsCommand, "" },
+ { "class", HandleLearnAllMyClassCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY_CLASS, Console::No },
+ { "pettalents", HandleLearnAllMyPetTalentsCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY_PETTALENTS, Console::No },
+ { "spells", HandleLearnAllMySpellsCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY_SPELLS, Console::No },
+ { "talents", HandleLearnAllMyTalentsCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY_TALENTS, Console::No },
};
- static std::vector<ChatCommand> learnAllCommandTable =
+ static ChatCommandTable learnAllCommandTable =
{
- { "my", rbac::RBAC_PERM_COMMAND_LEARN_ALL_MY, false, nullptr, "", learnAllMyCommandTable },
- { "gm", rbac::RBAC_PERM_COMMAND_LEARN_ALL_GM, false, &HandleLearnAllGMCommand, "" },
- { "crafts", rbac::RBAC_PERM_COMMAND_LEARN_ALL_CRAFTS, false, &HandleLearnAllCraftsCommand, "" },
- { "default", rbac::RBAC_PERM_COMMAND_LEARN_ALL_DEFAULT, false, &HandleLearnAllDefaultCommand, "" },
- { "lang", rbac::RBAC_PERM_COMMAND_LEARN_ALL_LANG, false, &HandleLearnAllLangCommand, "" },
- { "recipes", rbac::RBAC_PERM_COMMAND_LEARN_ALL_RECIPES, false, &HandleLearnAllRecipesCommand, "" },
+ { "my", learnAllMyCommandTable },
+ { "gm", HandleLearnAllGMCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_GM, Console::No },
+ { "crafts", HandleLearnAllCraftsCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_CRAFTS, Console::No },
+ { "default", HandleLearnAllDefaultCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_DEFAULT, Console::No },
+ { "lang", HandleLearnAllLangCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_LANG, Console::No },
+ { "recipes", HandleLearnAllRecipesCommand, rbac::RBAC_PERM_COMMAND_LEARN_ALL_RECIPES, Console::No },
};
- static std::vector<ChatCommand> learnCommandTable =
+ static ChatCommandTable learnCommandTable =
{
- { "all", rbac::RBAC_PERM_COMMAND_LEARN_ALL, false, nullptr, "", learnAllCommandTable },
- { "", rbac::RBAC_PERM_COMMAND_LEARN, false, &HandleLearnCommand, "" },
+ { "", HandleLearnCommand, rbac::RBAC_PERM_COMMAND_LEARN, Console::No },
+ { "all", learnAllCommandTable },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "learn", rbac::RBAC_PERM_COMMAND_LEARN, false, nullptr, "", learnCommandTable },
- { "unlearn", rbac::RBAC_PERM_COMMAND_UNLEARN, false, &HandleUnLearnCommand, "" },
+ { "learn", learnCommandTable },
+ { "unlearn", HandleUnLearnCommand, rbac::RBAC_PERM_COMMAND_UNLEARN, Console::No },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_lfg.cpp b/src/server/scripts/Commands/cs_lfg.cpp
index 7e0c79862ff..38d47c38344 100644
--- a/src/server/scripts/Commands/cs_lfg.cpp
+++ b/src/server/scripts/Commands/cs_lfg.cpp
@@ -48,20 +48,20 @@ class lfg_commandscript : public CommandScript
public:
lfg_commandscript() : CommandScript("lfg_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> lfgCommandTable =
+ static ChatCommandTable lfgCommandTable =
{
- { "player", rbac::RBAC_PERM_COMMAND_LFG_PLAYER, false, &HandleLfgPlayerInfoCommand, "" },
- { "group", rbac::RBAC_PERM_COMMAND_LFG_GROUP, false, &HandleLfgGroupInfoCommand, "" },
- { "queue", rbac::RBAC_PERM_COMMAND_LFG_QUEUE, true, &HandleLfgQueueInfoCommand, "" },
- { "clean", rbac::RBAC_PERM_COMMAND_LFG_CLEAN, true, &HandleLfgCleanCommand, "" },
- { "options", rbac::RBAC_PERM_COMMAND_LFG_OPTIONS, true, &HandleLfgOptionsCommand, "" },
+ { "player", HandleLfgPlayerInfoCommand, rbac::RBAC_PERM_COMMAND_LFG_PLAYER, Console::No },
+ { "group", HandleLfgGroupInfoCommand, rbac::RBAC_PERM_COMMAND_LFG_GROUP, Console::No },
+ { "queue", HandleLfgQueueInfoCommand, rbac::RBAC_PERM_COMMAND_LFG_QUEUE, Console::Yes },
+ { "clean", HandleLfgCleanCommand, rbac::RBAC_PERM_COMMAND_LFG_CLEAN, Console::Yes },
+ { "options", HandleLfgOptionsCommand, rbac::RBAC_PERM_COMMAND_LFG_OPTIONS, Console::Yes },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "lfg", rbac::RBAC_PERM_COMMAND_LFG, true, nullptr, "", lfgCommandTable },
+ { "lfg", lfgCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 8f9b86b415f..72cff2f033f 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -47,21 +47,21 @@ class list_commandscript : public CommandScript
public:
list_commandscript() : CommandScript("list_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> listCommandTable =
+ static ChatCommandTable listCommandTable =
{
- { "creature", rbac::RBAC_PERM_COMMAND_LIST_CREATURE, true, &HandleListCreatureCommand, "" },
- { "item", rbac::RBAC_PERM_COMMAND_LIST_ITEM, true, &HandleListItemCommand, "" },
- { "object", rbac::RBAC_PERM_COMMAND_LIST_OBJECT, true, &HandleListObjectCommand, "" },
- { "auras", rbac::RBAC_PERM_COMMAND_LIST_AURAS, false, &HandleListAurasCommand, "" },
- { "mail", rbac::RBAC_PERM_COMMAND_LIST_MAIL, true, &HandleListMailCommand, "" },
- { "spawnpoints", rbac::RBAC_PERM_COMMAND_LIST_SPAWNPOINTS, false, &HandleListSpawnPointsCommand, "" },
- { "respawns", rbac::RBAC_PERM_COMMAND_LIST_RESPAWNS, false, &HandleListRespawnsCommand, "" },
+ { "creature", HandleListCreatureCommand, rbac::RBAC_PERM_COMMAND_LIST_CREATURE, Console::Yes },
+ { "item", HandleListItemCommand, rbac::RBAC_PERM_COMMAND_LIST_ITEM, Console::Yes },
+ { "object", HandleListObjectCommand, rbac::RBAC_PERM_COMMAND_LIST_OBJECT, Console::Yes },
+ { "auras", HandleListAurasCommand, rbac::RBAC_PERM_COMMAND_LIST_AURAS, Console::No },
+ { "mail", HandleListMailCommand, rbac::RBAC_PERM_COMMAND_LIST_MAIL, Console::Yes },
+ { "spawnpoints", HandleListSpawnPointsCommand, rbac::RBAC_PERM_COMMAND_LIST_SPAWNPOINTS, Console::No },
+ { "respawns", HandleListRespawnsCommand, rbac::RBAC_PERM_COMMAND_LIST_RESPAWNS, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "list", rbac::RBAC_PERM_COMMAND_LIST,true, nullptr, "", listCommandTable },
+ { "list", listCommandTable },
};
return commandTable;
}
@@ -477,40 +477,27 @@ public:
return true;
}
// handle list mail command
- static bool HandleListMailCommand(ChatHandler* handler, char const* args)
+ static bool HandleListMailCommand(ChatHandler* handler, Optional<PlayerIdentifier> player)
{
- Player* target;
- ObjectGuid targetGuid;
- std::string targetName;
- CharacterDatabasePreparedStatement* stmt = nullptr;
-
- if (!*args)
- return false;
-
- ObjectGuid parseGUID(HighGuid::Player, uint32(atoul(args)));
-
- if (sCharacterCache->GetCharacterNameByGuid(parseGUID, targetName))
- {
- target = ObjectAccessor::FindPlayer(parseGUID);
- targetGuid = parseGUID;
- }
- else if (!handler->extractPlayerTarget((char*)args, &target, &targetGuid, &targetName))
+ if (!player)
+ player = PlayerIdentifier::FromTargetOrSelf(handler);
+ if (!player)
return false;
- stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_LIST_COUNT);
- stmt->setUInt32(0, targetGuid.GetCounter());
+ CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_LIST_COUNT);
+ stmt->setUInt32(0, player->GetGUID().GetCounter());
PreparedQueryResult queryResult = CharacterDatabase.Query(stmt);
if (queryResult)
{
Field* fields = queryResult->Fetch();
uint32 countMail = fields[0].GetUInt64();
- std::string nameLink = handler->playerLink(targetName);
- handler->PSendSysMessage(LANG_LIST_MAIL_HEADER, countMail, nameLink.c_str(), targetGuid.GetCounter());
+ std::string nameLink = handler->playerLink(player->GetName());
+ handler->PSendSysMessage(LANG_LIST_MAIL_HEADER, countMail, nameLink.c_str(), player->GetGUID().GetCounter());
handler->PSendSysMessage(LANG_ACCOUNT_LIST_BAR);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_MAIL_LIST_INFO);
- stmt->setUInt32(0, targetGuid.GetCounter());
+ stmt->setUInt32(0, player->GetGUID().GetCounter());
queryResult = CharacterDatabase.Query(stmt);
if (queryResult)
diff --git a/src/server/scripts/Commands/cs_lookup.cpp b/src/server/scripts/Commands/cs_lookup.cpp
index 21894752ac7..6b8b25bab4d 100644
--- a/src/server/scripts/Commands/cs_lookup.cpp
+++ b/src/server/scripts/Commands/cs_lookup.cpp
@@ -37,6 +37,10 @@ EndScriptData */
#include "World.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class lookup_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_message.cpp b/src/server/scripts/Commands/cs_message.cpp
index 978165b90b7..1cd21ab021e 100644
--- a/src/server/scripts/Commands/cs_message.cpp
+++ b/src/server/scripts/Commands/cs_message.cpp
@@ -43,26 +43,18 @@ class message_commandscript : public CommandScript
public:
message_commandscript() : CommandScript("message_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> channelSetCommandTable =
+ static ChatCommandTable commandTable =
{
- { "ownership", rbac::RBAC_PERM_COMMAND_CHANNEL_SET_OWNERSHIP, false, &HandleChannelSetOwnership, "" },
- };
- static std::vector<ChatCommand> channelCommandTable =
- {
- { "set", rbac::RBAC_PERM_COMMAND_CHANNEL_SET, true, nullptr, "", channelSetCommandTable },
- };
- static std::vector<ChatCommand> commandTable =
- {
- { "channel", rbac::RBAC_PERM_COMMAND_CHANNEL, true, nullptr, "", channelCommandTable },
- { "nameannounce", rbac::RBAC_PERM_COMMAND_NAMEANNOUNCE, true, &HandleNameAnnounceCommand, "" },
- { "gmnameannounce", rbac::RBAC_PERM_COMMAND_GMNAMEANNOUNCE, true, &HandleGMNameAnnounceCommand, "" },
- { "announce", rbac::RBAC_PERM_COMMAND_ANNOUNCE, true, &HandleAnnounceCommand, "" },
- { "gmannounce", rbac::RBAC_PERM_COMMAND_GMANNOUNCE, true, &HandleGMAnnounceCommand, "" },
- { "notify", rbac::RBAC_PERM_COMMAND_NOTIFY, true, &HandleNotifyCommand, "" },
- { "gmnotify", rbac::RBAC_PERM_COMMAND_GMNOTIFY, true, &HandleGMNotifyCommand, "" },
- { "whispers", rbac::RBAC_PERM_COMMAND_WHISPERS, false, &HandleWhispersCommand, "" },
+ { "channel set ownership", HandleChannelSetOwnership, rbac::RBAC_PERM_COMMAND_CHANNEL_SET_OWNERSHIP, Console::No },
+ { "nameannounce", HandleNameAnnounceCommand, rbac::RBAC_PERM_COMMAND_NAMEANNOUNCE, Console::Yes },
+ { "gmnameannounce", HandleGMNameAnnounceCommand, rbac::RBAC_PERM_COMMAND_GMNAMEANNOUNCE, Console::Yes },
+ { "announce", HandleAnnounceCommand, rbac::RBAC_PERM_COMMAND_ANNOUNCE, Console::Yes },
+ { "gmannounce", HandleGMAnnounceCommand, rbac::RBAC_PERM_COMMAND_GMANNOUNCE, Console::Yes },
+ { "notify", HandleNotifyCommand, rbac::RBAC_PERM_COMMAND_NOTIFY, Console::Yes },
+ { "gmnotify", HandleGMNotifyCommand, rbac::RBAC_PERM_COMMAND_GMNOTIFY, Console::Yes },
+ { "whispers", HandleWhispersCommand, rbac::RBAC_PERM_COMMAND_WHISPERS, Console::No },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 38629af1b49..c4bad133ddf 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -57,6 +57,10 @@
#undef GetClassName
#endif
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
using namespace Trinity::ChatCommands;
class misc_commandscript : public CommandScript
@@ -597,7 +601,7 @@ public:
static bool HandleCommandsCommand(ChatHandler* handler)
{
- handler->ShowHelpForCommand(ChatHandler::getCommandTable(), "");
+ Trinity::ChatCommands::SendCommandHelpFor(*handler, "");
return true;
}
@@ -688,19 +692,9 @@ public:
return true;
}
- static bool HandleHelpCommand(ChatHandler* handler, Tail cmdArg)
+ static bool HandleHelpCommand(ChatHandler* handler, Tail cmd)
{
- if (cmdArg.empty())
- {
- handler->ShowHelpForCommand(ChatHandler::getCommandTable(), "help");
- handler->ShowHelpForCommand(ChatHandler::getCommandTable(), "");
- }
- else
- {
- if (!handler->ShowHelpForCommand(ChatHandler::getCommandTable(), std::string(cmdArg).c_str()))
- handler->SendSysMessage(LANG_NO_HELP_CMD);
- }
-
+ Trinity::ChatCommands::SendCommandHelpFor(*handler, cmd);
return true;
}
diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp
index a9a5185a920..adde103f0f2 100644
--- a/src/server/scripts/Commands/cs_mmaps.cpp
+++ b/src/server/scripts/Commands/cs_mmaps.cpp
@@ -35,6 +35,10 @@
#include "PointMovementGenerator.h"
#include "RBAC.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class mmaps_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp
index 7a0f9522ad3..d2bd8f3e824 100644
--- a/src/server/scripts/Commands/cs_modify.cpp
+++ b/src/server/scripts/Commands/cs_modify.cpp
@@ -34,6 +34,10 @@ EndScriptData */
#include "ReputationMgr.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class modify_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index bb6b70c1917..d0c2f87f3fd 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -45,6 +45,7 @@ EndScriptData */
#include "WorldSession.h"
using namespace Trinity::ChatCommands;
+
using CreatureSpawnId = Variant<Hyperlink<creature>, ObjectGuid::LowType>;
using CreatureEntry = Variant<Hyperlink<creature_entry>, uint32>;
@@ -57,65 +58,57 @@ class npc_commandscript : public CommandScript
public:
npc_commandscript() : CommandScript("npc_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> npcAddCommandTable =
- {
- { "formation", rbac::RBAC_PERM_COMMAND_NPC_ADD_FORMATION, false, &HandleNpcAddFormationCommand, "" },
- { "item", rbac::RBAC_PERM_COMMAND_NPC_ADD_ITEM, false, &HandleNpcAddVendorItemCommand, "" },
- { "move", rbac::RBAC_PERM_COMMAND_NPC_ADD_MOVE, false, &HandleNpcAddMoveCommand, "" },
- { "temp", rbac::RBAC_PERM_COMMAND_NPC_ADD_TEMP, false, &HandleNpcAddTempSpawnCommand, "" },
- //{ "weapon", rbac::RBAC_PERM_COMMAND_NPC_ADD_WEAPON, false, &HandleNpcAddWeaponCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_NPC_ADD, false, &HandleNpcAddCommand, "" },
- };
- static std::vector<ChatCommand> npcDeleteCommandTable =
- {
- { "item", rbac::RBAC_PERM_COMMAND_NPC_DELETE_ITEM, false, &HandleNpcDeleteVendorItemCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_NPC_DELETE, false, &HandleNpcDeleteCommand, "" },
- };
- static std::vector<ChatCommand> npcFollowCommandTable =
- {
- { "stop", rbac::RBAC_PERM_COMMAND_NPC_FOLLOW_STOP, false, &HandleNpcUnFollowCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_NPC_FOLLOW, false, &HandleNpcFollowCommand, "" },
+ static ChatCommandTable npcAddCommandTable =
+ {
+ { "formation", HandleNpcAddFormationCommand, rbac::RBAC_PERM_COMMAND_NPC_ADD_FORMATION, Console::No },
+ { "item", HandleNpcAddVendorItemCommand, rbac::RBAC_PERM_COMMAND_NPC_ADD_ITEM, Console::No },
+ { "move", HandleNpcAddMoveCommand, rbac::RBAC_PERM_COMMAND_NPC_ADD_MOVE, Console::No },
+ { "temp", HandleNpcAddTempSpawnCommand, rbac::RBAC_PERM_COMMAND_NPC_ADD_TEMP, Console::No },
+// { "weapon", HandleNpcAddWeaponCommand, rbac::RBAC_PERM_COMMAND_NPC_ADD_WEAPON, Console::No },
+ { "", HandleNpcAddCommand, rbac::RBAC_PERM_COMMAND_NPC_ADD, Console::No },
};
- static std::vector<ChatCommand> npcSetCommandTable =
- {
- { "allowmove", rbac::RBAC_PERM_COMMAND_NPC_SET_ALLOWMOVE, false, &HandleNpcSetAllowMovementCommand, "" },
- { "entry", rbac::RBAC_PERM_COMMAND_NPC_SET_ENTRY, false, &HandleNpcSetEntryCommand, "" },
- { "factionid", rbac::RBAC_PERM_COMMAND_NPC_SET_FACTIONID, false, &HandleNpcSetFactionIdCommand, "" },
- { "flag", rbac::RBAC_PERM_COMMAND_NPC_SET_FLAG, false, &HandleNpcSetFlagCommand, "" },
- { "level", rbac::RBAC_PERM_COMMAND_NPC_SET_LEVEL, false, &HandleNpcSetLevelCommand, "" },
- { "link", rbac::RBAC_PERM_COMMAND_NPC_SET_LINK, false, &HandleNpcSetLinkCommand, "" },
- { "model", rbac::RBAC_PERM_COMMAND_NPC_SET_MODEL, false, &HandleNpcSetModelCommand, "" },
- { "movetype", rbac::RBAC_PERM_COMMAND_NPC_SET_MOVETYPE, false, &HandleNpcSetMoveTypeCommand, "" },
- { "phase", rbac::RBAC_PERM_COMMAND_NPC_SET_PHASE, false, &HandleNpcSetPhaseCommand, "" },
- { "wanderdistance", rbac::RBAC_PERM_COMMAND_NPC_SET_SPAWNDIST, false, &HandleNpcSetWanderDistanceCommand, "" },
- { "spawntime", rbac::RBAC_PERM_COMMAND_NPC_SET_SPAWNTIME, false, &HandleNpcSetSpawnTimeCommand, "" },
- { "data", rbac::RBAC_PERM_COMMAND_NPC_SET_DATA, false, &HandleNpcSetDataCommand, "" },
+ static ChatCommandTable npcSetCommandTable =
+ {
+ { "allowmove", HandleNpcSetAllowMovementCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_ALLOWMOVE, Console::No },
+ { "entry", HandleNpcSetEntryCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_ENTRY, Console::No },
+ { "factionid", HandleNpcSetFactionIdCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_FACTIONID, Console::No },
+ { "flag", HandleNpcSetFlagCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_FLAG, Console::No },
+ { "level", HandleNpcSetLevelCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_LEVEL, Console::No },
+ { "link", HandleNpcSetLinkCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_LINK, Console::No },
+ { "model", HandleNpcSetModelCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_MODEL, Console::No },
+ { "movetype", HandleNpcSetMoveTypeCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_MOVETYPE, Console::No },
+ { "phase", HandleNpcSetPhaseCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_PHASE, Console::No },
+ { "wanderdistance", HandleNpcSetWanderDistanceCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_SPAWNDIST, Console::No },
+ { "spawntime", HandleNpcSetSpawnTimeCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_SPAWNTIME, Console::No },
+ { "data", HandleNpcSetDataCommand, rbac::RBAC_PERM_COMMAND_NPC_SET_DATA, Console::No },
};
- static std::vector<ChatCommand> npcCommandTable =
- {
- { "info", rbac::RBAC_PERM_COMMAND_NPC_INFO, false, &HandleNpcInfoCommand, "" },
- { "near", rbac::RBAC_PERM_COMMAND_NPC_NEAR, false, &HandleNpcNearCommand, "" },
- { "move", rbac::RBAC_PERM_COMMAND_NPC_MOVE, false, &HandleNpcMoveCommand, "" },
- { "playemote", rbac::RBAC_PERM_COMMAND_NPC_PLAYEMOTE, false, &HandleNpcPlayEmoteCommand, "" },
- { "say", rbac::RBAC_PERM_COMMAND_NPC_SAY, false, &HandleNpcSayCommand, "" },
- { "textemote", rbac::RBAC_PERM_COMMAND_NPC_TEXTEMOTE, false, &HandleNpcTextEmoteCommand, "" },
- { "whisper", rbac::RBAC_PERM_COMMAND_NPC_WHISPER, false, &HandleNpcWhisperCommand, "" },
- { "yell", rbac::RBAC_PERM_COMMAND_NPC_YELL, false, &HandleNpcYellCommand, "" },
- { "tame", rbac::RBAC_PERM_COMMAND_NPC_TAME, false, &HandleNpcTameCommand, "" },
- { "spawngroup", rbac::RBAC_PERM_COMMAND_NPC_SPAWNGROUP, false, &HandleNpcSpawnGroup, "" },
- { "despawngroup", rbac::RBAC_PERM_COMMAND_NPC_DESPAWNGROUP, false, &HandleNpcDespawnGroup, "" },
- { "add", rbac::RBAC_PERM_COMMAND_NPC_ADD, false, nullptr, "", npcAddCommandTable },
- { "delete", rbac::RBAC_PERM_COMMAND_NPC_DELETE, false, nullptr, "", npcDeleteCommandTable },
- { "follow", rbac::RBAC_PERM_COMMAND_NPC_FOLLOW, false, nullptr, "", npcFollowCommandTable },
- { "set", rbac::RBAC_PERM_COMMAND_NPC_SET, false, nullptr, "", npcSetCommandTable },
- { "evade", rbac::RBAC_PERM_COMMAND_NPC_EVADE, false, &HandleNpcEvadeCommand, "" },
- { "showloot", rbac::RBAC_PERM_COMMAND_NPC_SHOWLOOT, false, &HandleNpcShowLootCommand, "" },
+ static ChatCommandTable npcCommandTable =
+ {
+ { "add", npcAddCommandTable },
+ { "set", npcSetCommandTable },
+ { "info", HandleNpcInfoCommand, rbac::RBAC_PERM_COMMAND_NPC_INFO, Console::No },
+ { "near", HandleNpcNearCommand, rbac::RBAC_PERM_COMMAND_NPC_NEAR, Console::No },
+ { "move", HandleNpcMoveCommand, rbac::RBAC_PERM_COMMAND_NPC_MOVE, Console::No },
+ { "playemote", HandleNpcPlayEmoteCommand, rbac::RBAC_PERM_COMMAND_NPC_PLAYEMOTE, Console::No },
+ { "say", HandleNpcSayCommand, rbac::RBAC_PERM_COMMAND_NPC_SAY, Console::No },
+ { "textemote", HandleNpcTextEmoteCommand, rbac::RBAC_PERM_COMMAND_NPC_TEXTEMOTE, Console::No },
+ { "whisper", HandleNpcWhisperCommand, rbac::RBAC_PERM_COMMAND_NPC_WHISPER, Console::No },
+ { "yell", HandleNpcYellCommand, rbac::RBAC_PERM_COMMAND_NPC_YELL, Console::No },
+ { "tame", HandleNpcTameCommand, rbac::RBAC_PERM_COMMAND_NPC_TAME, Console::No },
+ { "spawngroup", HandleNpcSpawnGroup, rbac::RBAC_PERM_COMMAND_NPC_SPAWNGROUP, Console::No },
+ { "despawngroup", HandleNpcDespawnGroup, rbac::RBAC_PERM_COMMAND_NPC_DESPAWNGROUP, Console::No },
+ { "delete", HandleNpcDeleteCommand, rbac::RBAC_PERM_COMMAND_NPC_DELETE, Console::No },
+ { "delete item", HandleNpcDeleteVendorItemCommand, rbac::RBAC_PERM_COMMAND_NPC_DELETE_ITEM, Console::No },
+ { "follow", HandleNpcFollowCommand, rbac::RBAC_PERM_COMMAND_NPC_FOLLOW, Console::No },
+ { "follow stop", HandleNpcUnFollowCommand, rbac::RBAC_PERM_COMMAND_NPC_FOLLOW, Console::No },
+ { "evade", HandleNpcEvadeCommand, rbac::RBAC_PERM_COMMAND_NPC_EVADE, Console::No },
+ { "showloot", HandleNpcShowLootCommand, rbac::RBAC_PERM_COMMAND_NPC_SHOWLOOT, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "npc", rbac::RBAC_PERM_COMMAND_NPC, false, nullptr, "", npcCommandTable },
+ { "npc", npcCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_pet.cpp b/src/server/scripts/Commands/cs_pet.cpp
index 417eaebfffa..a8c71b6b380 100644
--- a/src/server/scripts/Commands/cs_pet.cpp
+++ b/src/server/scripts/Commands/cs_pet.cpp
@@ -27,6 +27,10 @@
#include "SpellMgr.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
inline Pet* GetSelectedPlayerPetOrOwn(ChatHandler* handler)
{
if (Unit* target = handler->getSelectedUnit())
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 935bcf23807..4c090a5f836 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -33,6 +33,10 @@ EndScriptData */
#include "ReputationMgr.h"
#include "World.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class quest_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_rbac.cpp b/src/server/scripts/Commands/cs_rbac.cpp
index 93bf814600b..ea1547f40c7 100644
--- a/src/server/scripts/Commands/cs_rbac.cpp
+++ b/src/server/scripts/Commands/cs_rbac.cpp
@@ -32,6 +32,10 @@ EndScriptData */
#include "World.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
struct RBACCommandData
{
RBACCommandData(): id(0), realmId(0), rbac(nullptr), needDelete(false) { }
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 7804cac952a..5b7dc280a56 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -47,6 +47,10 @@ EndScriptData */
#include "WaypointManager.h"
#include "World.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class reload_commandscript : public CommandScript
{
public:
@@ -403,9 +407,13 @@ public:
static bool HandleReloadCommandCommand(ChatHandler* handler, char const* /*args*/)
{
- ChatHandler::invalidateCommandTable();
- handler->SendGlobalGMSysMessage("DB table `command` will be reloaded at next chat command use.");
- return true;
+ TC_LOG_INFO("misc", "Reloading .command information...");
+ Trinity::ChatCommands::LoadCommandMap();
+ handler->SendGlobalGMSysMessage("DB table `command` reloaded.");
+
+ // do not log this invocation, otherwise we might crash (the command table we used to get here is no longer valid!)
+ handler->SetSentErrorMessage(true);
+ return false;
}
static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, char const* /*args*/)
diff --git a/src/server/scripts/Commands/cs_reset.cpp b/src/server/scripts/Commands/cs_reset.cpp
index 06fb01f2ba9..604e9cc5aed 100644
--- a/src/server/scripts/Commands/cs_reset.cpp
+++ b/src/server/scripts/Commands/cs_reset.cpp
@@ -35,6 +35,10 @@ EndScriptData */
#include "World.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class reset_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_send.cpp b/src/server/scripts/Commands/cs_send.cpp
index b691f3760f0..8b44a4a7677 100644
--- a/src/server/scripts/Commands/cs_send.cpp
+++ b/src/server/scripts/Commands/cs_send.cpp
@@ -27,6 +27,10 @@
#include "RBAC.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class send_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
index 28db40209cf..d9ed45e43f0 100644
--- a/src/server/scripts/Commands/cs_server.cpp
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -50,6 +50,10 @@ EndScriptData */
#include <openssl/crypto.h>
#include <openssl/opensslv.h>
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class server_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_tele.cpp b/src/server/scripts/Commands/cs_tele.cpp
index 4857e3641a0..38cba116284 100644
--- a/src/server/scripts/Commands/cs_tele.cpp
+++ b/src/server/scripts/Commands/cs_tele.cpp
@@ -41,19 +41,19 @@ class tele_commandscript : public CommandScript
public:
tele_commandscript() : CommandScript("tele_commandscript") { }
- std::vector<ChatCommand> GetCommands() const override
+ ChatCommandTable GetCommands() const override
{
- static std::vector<ChatCommand> teleCommandTable =
+ static ChatCommandTable teleCommandTable =
{
- { "add", rbac::RBAC_PERM_COMMAND_TELE_ADD, false, &HandleTeleAddCommand, "" },
- { "del", rbac::RBAC_PERM_COMMAND_TELE_DEL, true, &HandleTeleDelCommand, "" },
- { "name", rbac::RBAC_PERM_COMMAND_TELE_NAME, true, &HandleTeleNameCommand, "" },
- { "group", rbac::RBAC_PERM_COMMAND_TELE_GROUP, false, &HandleTeleGroupCommand, "" },
- { "", rbac::RBAC_PERM_COMMAND_TELE, false, &HandleTeleCommand, "" },
+ { "add", HandleTeleAddCommand, rbac::RBAC_PERM_COMMAND_TELE_ADD, Console::No },
+ { "del", HandleTeleDelCommand, rbac::RBAC_PERM_COMMAND_TELE_DEL, Console::Yes },
+ { "name", HandleTeleNameCommand, rbac::RBAC_PERM_COMMAND_TELE_NAME, Console::Yes },
+ { "group", HandleTeleGroupCommand, rbac::RBAC_PERM_COMMAND_TELE_GROUP, Console::No },
+ { "", HandleTeleCommand, rbac::RBAC_PERM_COMMAND_TELE, Console::No },
};
- static std::vector<ChatCommand> commandTable =
+ static ChatCommandTable commandTable =
{
- { "tele", rbac::RBAC_PERM_COMMAND_TELE, false, nullptr, "", teleCommandTable },
+ { "tele", teleCommandTable },
};
return commandTable;
}
diff --git a/src/server/scripts/Commands/cs_ticket.cpp b/src/server/scripts/Commands/cs_ticket.cpp
index 1907226f791..80d7f6f576f 100644
--- a/src/server/scripts/Commands/cs_ticket.cpp
+++ b/src/server/scripts/Commands/cs_ticket.cpp
@@ -36,6 +36,10 @@ EndScriptData */
#include "World.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class ticket_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_titles.cpp b/src/server/scripts/Commands/cs_titles.cpp
index d5ea0c3bb93..86eff95c1f8 100644
--- a/src/server/scripts/Commands/cs_titles.cpp
+++ b/src/server/scripts/Commands/cs_titles.cpp
@@ -29,6 +29,10 @@ EndScriptData */
#include "Player.h"
#include "RBAC.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class titles_commandscript : public CommandScript
{
public:
diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp
index 5760117122d..0e0c0498e33 100644
--- a/src/server/scripts/Commands/cs_wp.cpp
+++ b/src/server/scripts/Commands/cs_wp.cpp
@@ -35,6 +35,10 @@ EndScriptData */
#include "WaypointManager.h"
#include "WorldSession.h"
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+
class wp_commandscript : public CommandScript
{
public: