Merge branch 'threading_rewrite' of https://github.com/ShinDarth/azerothcore-wotlk into threading_rewrite

This commit is contained in:
Yehonal
2016-08-19 23:54:55 +02:00
36 changed files with 751 additions and 781 deletions

View File

@@ -26,53 +26,16 @@
bool ChatHandler::load_command_table = true; bool ChatHandler::load_command_table = true;
// get number of commands in table std::vector<ChatCommand> const& ChatHandler::getCommandTable()
static size_t getCommandTableSize(const ChatCommand* commands)
{ {
if (!commands) static std::vector<ChatCommand> commandTableCache;
return 0;
size_t count = 0;
while (commands[count].Name != NULL)
count++;
return count;
}
// append source command table to target, return number of appended commands
static size_t appendCommandTable(ChatCommand* target, const ChatCommand* source)
{
const size_t count = getCommandTableSize(source);
if (count)
memcpy(target, source, count * sizeof(ChatCommand));
return count;
}
ChatCommand* ChatHandler::getCommandTable()
{
// cache for commands, needed because some commands are loaded dynamically through ScriptMgr
// cache is never freed and will show as a memory leak in diagnostic tools
// can't use vector as vector storage is implementation-dependent, eg, there can be alignment gaps between elements
static ChatCommand* commandTableCache = NULL;
if (LoadCommandTable()) if (LoadCommandTable())
{ {
SetLoadCommandTable(false); SetLoadCommandTable(false);
{ std::vector<ChatCommand> cmds = sScriptMgr->GetChatCommands();
// count total number of top-level commands commandTableCache.swap(cmds);
size_t total = 0;
std::vector<ChatCommand*> const& dynamic = sScriptMgr->GetChatCommands();
for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it)
total += getCommandTableSize(*it);
total += 1; // ending zero
// cache top-level commands
size_t added = 0;
commandTableCache = (ChatCommand*)malloc(sizeof(ChatCommand) * total);
memset(commandTableCache, 0, sizeof(ChatCommand) * total);
ACE_ASSERT(commandTableCache);
for (std::vector<ChatCommand*>::const_iterator it = dynamic.begin(); it != dynamic.end(); ++it)
added += appendCommandTable(commandTableCache + added, *it);
}
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS); PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_SEL_COMMANDS);
PreparedQueryResult result = WorldDatabase.Query(stmt); PreparedQueryResult result = WorldDatabase.Query(stmt);
@@ -268,7 +231,7 @@ void ChatHandler::PSendSysMessage(const char *format, ...)
SendSysMessage(str); SendSysMessage(str);
} }
bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, std::string& fullcmd) bool ChatHandler::ExecuteCommandInTable(std::vector<ChatCommand> const& table, const char* text, std::string const& fullcmd)
{ {
char const* oldtext = text; char const* oldtext = text;
std::string cmd = ""; std::string cmd = "";
@@ -281,7 +244,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st
while (*text == ' ') ++text; while (*text == ' ') ++text;
for (uint32 i = 0; table[i].Name != NULL; ++i) for (uint32 i = 0; i < table.size(); ++i)
{ {
if (!hasStringAbbr(table[i].Name, cmd.c_str())) if (!hasStringAbbr(table[i].Name, cmd.c_str()))
continue; continue;
@@ -289,7 +252,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st
bool match = false; bool match = false;
if (strlen(table[i].Name) > cmd.length()) if (strlen(table[i].Name) > cmd.length())
{ {
for (uint32 j = 0; table[j].Name != NULL; ++j) for (uint32 j = 0; j < table.size(); ++j)
{ {
if (!hasStringAbbr(table[j].Name, cmd.c_str())) if (!hasStringAbbr(table[j].Name, cmd.c_str()))
continue; continue;
@@ -306,14 +269,8 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st
if (match) if (match)
continue; continue;
if (table[i].Name[0] != '\0' && table[i].Name)
{
fullcmd += table[i].Name;
fullcmd += " ";
}
// select subcommand from child commands list // select subcommand from child commands list
if (table[i].ChildCommands != NULL) if (!table[i].ChildCommands.empty())
{ {
if (!ExecuteCommandInTable(table[i].ChildCommands, text, fullcmd)) if (!ExecuteCommandInTable(table[i].ChildCommands, text, fullcmd))
{ {
@@ -334,28 +291,34 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st
SetSentErrorMessage(false); SetSentErrorMessage(false);
// table[i].Name == "" is special case: send original command to handler // table[i].Name == "" is special case: send original command to handler
const char* aText = table[i].Name[0] != '\0' ? text : oldtext; if ((table[i].Handler)(this, table[i].Name[0] != '\0' ? text : oldtext))
if (aText)
fullcmd += aText;
if ((table[i].Handler)(this, aText))
{ {
// pussywizard: ignore logging spect command if (!m_session) // ignore console
std::string fc = fullcmd; return true;
if (fc.size() >= 5)
std::transform(fc.begin(), fc.end(), fc.begin(), ::tolower);
bool ignore = fc.size() >= 5 && fc.substr(0,5) == "spect";
if (!AccountMgr::IsPlayerAccount(table[i].SecurityLevel) && !ignore) Player* player = m_session->GetPlayer();
if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
{ {
// chat case uint64 guid = player->GetTarget();
if (m_session) uint32 areaId = player->GetAreaId();
std::string areaName = "Unknown";
std::string zoneName = "Unknown";
if (AreaTableEntry const* area = GetAreaEntryByAreaID(areaId))
{ {
Player* p = m_session->GetPlayer(); int locale = GetSessionDbcLocale();
uint64 sel_guid = p->GetTarget(); areaName = area->area_name[locale];
sLog->outCommand(m_session->GetAccountId(), "Command: .%s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]", if (AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone))
fullcmd.c_str(), p->GetName().c_str(), m_session->GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(), zoneName = zone->area_name[locale];
GetLogNameForGuid(sel_guid), (p->GetSelectedUnit()) ? p->GetSelectedUnit()->GetName().c_str() : "", GUID_LOPART(sel_guid));
} }
sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (%ul) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected: %s (%ul)]",
fullcmd.c_str(), player->GetName().c_str(), player->GetGUID(),
m_session->GetAccountId(), player->GetPositionX(), player->GetPositionY(),
player->GetPositionZ(), player->GetMapId(),
player->GetMap() ? player->GetMap()->GetMapName() : "Unknown",
areaId, areaName.c_str(), zoneName.c_str(),
(player->GetSelectedUnit()) ? player->GetSelectedUnit()->GetName().c_str() : "",
guid);
} }
} }
// some commands have custom error messages. Don't send the default one in these cases. // some commands have custom error messages. Don't send the default one in these cases.
@@ -373,7 +336,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, st
return false; return false;
} }
bool ChatHandler::SetDataForCommandInTable(ChatCommand* table, char const* text, uint32 security, std::string const& help, std::string const& fullcommand) bool ChatHandler::SetDataForCommandInTable(std::vector<ChatCommand>& table, char const* text, uint32 security, std::string const& help, std::string const& fullcommand)
{ {
std::string cmd = ""; std::string cmd = "";
@@ -385,14 +348,14 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand* table, char const* text,
while (*text == ' ') ++text; while (*text == ' ') ++text;
for (uint32 i = 0; table[i].Name != NULL; i++) for (uint32 i = 0; i < table.size(); i++)
{ {
// for data fill use full explicit command names // for data fill use full explicit command names
if (table[i].Name != cmd) if (table[i].Name != cmd)
continue; continue;
// select subcommand from child commands list (including "") // select subcommand from child commands list (including "")
if (table[i].ChildCommands != NULL) if (!table[i].ChildCommands.empty())
{ {
if (SetDataForCommandInTable(table[i].ChildCommands, text, security, help, fullcommand)) if (SetDataForCommandInTable(table[i].ChildCommands, text, security, help, fullcommand))
return true; return true;
@@ -419,7 +382,7 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand* table, char const* text,
// in case "" command let process by caller // in case "" command let process by caller
if (!cmd.empty()) if (!cmd.empty())
{ {
if (table == getCommandTable()) if (&table == &getCommandTable())
sLog->outError("Table `command` have not existed command '%s', skip.", cmd.c_str()); sLog->outError("Table `command` have not existed command '%s', skip.", cmd.c_str());
else else
sLog->outError("Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str()); sLog->outError("Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
@@ -528,10 +491,10 @@ Valid examples:
return LinkExtractor(message).IsValidMessage(); return LinkExtractor(message).IsValidMessage();
} }
bool ChatHandler::ShowHelpForSubCommands(ChatCommand* table, char const* cmd, char const* subcmd) bool ChatHandler::ShowHelpForSubCommands(std::vector<ChatCommand> const& table, char const* cmd, char const* subcmd)
{ {
std::string list; std::string list;
for (uint32 i = 0; table[i].Name != NULL; ++i) for (uint32 i = 0; i < table.size(); ++i)
{ {
// must be available (ignore handler existence for show command with possible available subcommands) // must be available (ignore handler existence for show command with possible available subcommands)
if (!isAvailable(table[i])) if (!isAvailable(table[i]))
@@ -548,14 +511,14 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand* table, char const* cmd, ch
list += table[i].Name; list += table[i].Name;
if (table[i].ChildCommands) if (!table[i].ChildCommands.empty())
list += " ..."; list += " ...";
} }
if (list.empty()) if (list.empty())
return false; return false;
if (table == getCommandTable()) if (&table == &getCommandTable())
{ {
SendSysMessage(LANG_AVIABLE_CMD); SendSysMessage(LANG_AVIABLE_CMD);
PSendSysMessage("%s", list.c_str()); PSendSysMessage("%s", list.c_str());
@@ -566,11 +529,11 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand* table, char const* cmd, ch
return true; return true;
} }
bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd) bool ChatHandler::ShowHelpForCommand(std::vector<ChatCommand> const& table, const char* cmd)
{ {
if (*cmd) if (*cmd)
{ {
for (uint32 i = 0; table[i].Name != NULL; ++i) for (uint32 i = 0; i < table.size(); ++i)
{ {
// must be available (ignore handler existence for show command with possible available subcommands) // must be available (ignore handler existence for show command with possible available subcommands)
if (!isAvailable(table[i])) if (!isAvailable(table[i]))
@@ -582,7 +545,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
// have subcommand // have subcommand
char const* subcmd = (*cmd) ? strtok(NULL, " ") : ""; char const* subcmd = (*cmd) ? strtok(NULL, " ") : "";
if (table[i].ChildCommands && subcmd && *subcmd) if (!table[i].ChildCommands.empty() && subcmd && *subcmd)
{ {
if (ShowHelpForCommand(table[i].ChildCommands, subcmd)) if (ShowHelpForCommand(table[i].ChildCommands, subcmd))
return true; return true;
@@ -591,7 +554,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
if (!table[i].Help.empty()) if (!table[i].Help.empty())
SendSysMessage(table[i].Help.c_str()); SendSysMessage(table[i].Help.c_str());
if (table[i].ChildCommands) if (!table[i].ChildCommands.empty())
if (ShowHelpForSubCommands(table[i].ChildCommands, table[i].Name, subcmd ? subcmd : "")) if (ShowHelpForSubCommands(table[i].ChildCommands, table[i].Name, subcmd ? subcmd : ""))
return true; return true;
@@ -600,7 +563,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
} }
else else
{ {
for (uint32 i = 0; table[i].Name != NULL; ++i) for (uint32 i = 0; i < table.size(); ++i)
{ {
// must be available (ignore handler existence for show command with possible available subcommands) // must be available (ignore handler existence for show command with possible available subcommands)
if (!isAvailable(table[i])) if (!isAvailable(table[i]))
@@ -612,7 +575,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand* table, const char* cmd)
if (!table[i].Help.empty()) if (!table[i].Help.empty())
SendSysMessage(table[i].Help.c_str()); SendSysMessage(table[i].Help.c_str());
if (table[i].ChildCommands) if (!table[i].ChildCommands.empty())
if (ShowHelpForSubCommands(table[i].ChildCommands, "", "")) if (ShowHelpForSubCommands(table[i].ChildCommands, "", ""))
return true; return true;

View File

@@ -24,13 +24,18 @@ struct GameTele;
class ChatCommand class ChatCommand
{ {
typedef bool(*pHandler)(ChatHandler*, char const*);
public: public:
const char * Name; ChatCommand(char const* name, uint32 securityLevel, bool allowConsole, pHandler handler, std::string help, std::vector<ChatCommand> childCommands = std::vector<ChatCommand>())
uint32 SecurityLevel; // function pointer required correct align (use uint32) : Name(name), SecurityLevel(securityLevel), AllowConsole(allowConsole), Handler(handler), Help(std::move(help)), ChildCommands(std::move(childCommands)) { }
bool AllowConsole;
bool (*Handler)(ChatHandler*, const char* args); char const* Name;
std::string Help; uint32 SecurityLevel;
ChatCommand* ChildCommands; bool AllowConsole;
pHandler Handler;
std::string Help;
std::vector<ChatCommand> ChildCommands;
}; };
class ChatHandler class ChatHandler
@@ -61,7 +66,7 @@ class ChatHandler
bool ParseCommands(const char* text); bool ParseCommands(const char* text);
static ChatCommand* getCommandTable(); static std::vector<ChatCommand> const& getCommandTable();
bool isValidChatMessage(const char* msg); bool isValidChatMessage(const char* msg);
void SendGlobalSysMessage(const char *str); void SendGlobalSysMessage(const char *str);
@@ -111,12 +116,12 @@ class ChatHandler
static bool LoadCommandTable() { return load_command_table; } static bool LoadCommandTable() { return load_command_table; }
static void SetLoadCommandTable(bool val) { load_command_table = val; } static void SetLoadCommandTable(bool val) { load_command_table = val; }
bool ShowHelpForCommand(ChatCommand* table, const char* cmd); bool ShowHelpForCommand(std::vector<ChatCommand> const& table, const char* cmd);
protected: protected:
explicit ChatHandler() : m_session(NULL), sentErrorMessage(false) {} // for CLI subclass explicit ChatHandler() : m_session(NULL), sentErrorMessage(false) {} // for CLI subclass
static bool SetDataForCommandInTable(ChatCommand* table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand); static bool SetDataForCommandInTable(std::vector<ChatCommand>& table, const char* text, uint32 securityLevel, std::string const& help, std::string const& fullcommand);
bool ExecuteCommandInTable(ChatCommand* table, const char* text, std::string& fullcmd); bool ExecuteCommandInTable(std::vector<ChatCommand> const& table, const char* text, std::string const& fullcmd);
bool ShowHelpForSubCommands(ChatCommand* table, char const* cmd, char const* subcmd); bool ShowHelpForSubCommands(std::vector<ChatCommand> const& table, char const* cmd, char const* subcmd);
private: private:

View File

@@ -20,6 +20,7 @@
#include "CreatureAI.h" #include "CreatureAI.h"
#include "Player.h" #include "Player.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "Chat.h"
// This is the global static registry of scripts. // This is the global static registry of scripts.
/*template<class TScript> /*template<class TScript>
@@ -951,12 +952,15 @@ OutdoorPvP* ScriptMgr::CreateOutdoorPvP(OutdoorPvPData const* data)
return tmpscript->GetOutdoorPvP(); return tmpscript->GetOutdoorPvP();
} }
std::vector<ChatCommand*> ScriptMgr::GetChatCommands() std::vector<ChatCommand> ScriptMgr::GetChatCommands()
{ {
std::vector<ChatCommand*> table; std::vector<ChatCommand> table;
FOR_SCRIPTS_RET(CommandScript, itr, end, table) FOR_SCRIPTS_RET(CommandScript, itr, end, table)
table.push_back(itr->second->GetCommands()); {
std::vector<ChatCommand> cmds = itr->second->GetCommands();
table.insert(table.end(), cmds.begin(), cmds.end());
}
return table; return table;
} }

View File

@@ -549,7 +549,7 @@ class CommandScript : public ScriptObject
public: public:
// Should return a pointer to a valid command table (ChatCommand array) to be used by ChatHandler. // Should return a pointer to a valid command table (ChatCommand array) to be used by ChatHandler.
virtual ChatCommand* GetCommands() const = 0; virtual std::vector<ChatCommand> GetCommands() const = 0;
}; };
class WeatherScript : public ScriptObject, public UpdatableScript<Weather> class WeatherScript : public ScriptObject, public UpdatableScript<Weather>
@@ -969,7 +969,7 @@ class ScriptMgr
public: /* CommandScript */ public: /* CommandScript */
std::vector<ChatCommand*> GetChatCommands(); std::vector<ChatCommand> GetChatCommands();
public: /* WeatherScript */ public: /* WeatherScript */

View File

@@ -23,31 +23,31 @@ class account_commandscript : public CommandScript
public: public:
account_commandscript() : CommandScript("account_commandscript") { } account_commandscript() : CommandScript("account_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand accountSetCommandTable[] = static std::vector<ChatCommand> accountSetCommandTable =
{ {
{ "addon", SEC_ADMINISTRATOR, true, &HandleAccountSetAddonCommand, "", NULL }, { "addon", SEC_ADMINISTRATOR, true, &HandleAccountSetAddonCommand, "" },
{ "gmlevel", SEC_CONSOLE, true, &HandleAccountSetGmLevelCommand, "", NULL }, { "gmlevel", SEC_CONSOLE, true, &HandleAccountSetGmLevelCommand, "" },
{ "password", SEC_CONSOLE, true, &HandleAccountSetPasswordCommand, "", NULL }, { "password", SEC_CONSOLE, true, &HandleAccountSetPasswordCommand, "" },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
static ChatCommand accountCommandTable[] = static std::vector<ChatCommand> accountCommandTable =
{ {
{ "addon", SEC_MODERATOR, false, &HandleAccountAddonCommand, "", NULL }, { "addon", SEC_MODERATOR, false, &HandleAccountAddonCommand, "" },
{ "create", SEC_CONSOLE, true, &HandleAccountCreateCommand, "", NULL }, { "create", SEC_CONSOLE, true, &HandleAccountCreateCommand, "" },
{ "delete", SEC_CONSOLE, true, &HandleAccountDeleteCommand, "", NULL }, { "delete", SEC_CONSOLE, true, &HandleAccountDeleteCommand, "" },
{ "onlinelist", SEC_CONSOLE, true, &HandleAccountOnlineListCommand, "", NULL }, { "onlinelist", SEC_CONSOLE, true, &HandleAccountOnlineListCommand, "" },
{ "lock", SEC_PLAYER, false, &HandleAccountLockCommand, "", NULL }, { "lock", SEC_PLAYER, false, &HandleAccountLockCommand, "" },
{ "set", SEC_ADMINISTRATOR, true, NULL, "", accountSetCommandTable }, { "set", SEC_ADMINISTRATOR, true, NULL, "", accountSetCommandTable },
{ "password", SEC_PLAYER, false, &HandleAccountPasswordCommand, "", NULL }, { "password", SEC_PLAYER, false, &HandleAccountPasswordCommand, "" },
{ "", SEC_PLAYER, false, &HandleAccountCommand, "", NULL }, { "", SEC_PLAYER, false, &HandleAccountCommand, "" },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "account", SEC_PLAYER, true, NULL, "", accountCommandTable }, { "account", SEC_PLAYER, true, NULL, "", accountCommandTable },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -21,18 +21,18 @@ class achievement_commandscript : public CommandScript
public: public:
achievement_commandscript() : CommandScript("achievement_commandscript") { } achievement_commandscript() : CommandScript("achievement_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand achievementCommandTable[] = static std::vector<ChatCommand> achievementCommandTable =
{ {
{ "add", SEC_ADMINISTRATOR, false, &HandleAchievementAddCommand, "", NULL }, { "add", SEC_ADMINISTRATOR, false, &HandleAchievementAddCommand, "" },
{ "checkall", SEC_ADMINISTRATOR, false, &HandleAchievementCheckAllCommand, "", NULL }, { "checkall", SEC_ADMINISTRATOR, false, &HandleAchievementCheckAllCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "achievement", SEC_ADMINISTRATOR, false, NULL, "", achievementCommandTable }, { "achievement", SEC_ADMINISTRATOR, false, NULL, "", achievementCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -24,45 +24,45 @@ class ban_commandscript : public CommandScript
public: public:
ban_commandscript() : CommandScript("ban_commandscript") { } ban_commandscript() : CommandScript("ban_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand unbanCommandTable[] = static std::vector<ChatCommand> unbanCommandTable =
{ {
{ "account", SEC_ADMINISTRATOR, true, &HandleUnBanAccountCommand, "", NULL }, { "account", SEC_ADMINISTRATOR, true, &HandleUnBanAccountCommand, "" },
{ "character", SEC_ADMINISTRATOR, true, &HandleUnBanCharacterCommand, "", NULL }, { "character", SEC_ADMINISTRATOR, true, &HandleUnBanCharacterCommand, "" },
{ "playeraccount", SEC_ADMINISTRATOR, true, &HandleUnBanAccountByCharCommand, "", NULL }, { "playeraccount", SEC_ADMINISTRATOR, true, &HandleUnBanAccountByCharCommand, "" },
{ "ip", SEC_ADMINISTRATOR, true, &HandleUnBanIPCommand, "", NULL }, { "ip", SEC_ADMINISTRATOR, true, &HandleUnBanIPCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand banlistCommandTable[] = static std::vector<ChatCommand> banlistCommandTable =
{ {
{ "account", SEC_ADMINISTRATOR, true, &HandleBanListAccountCommand, "", NULL }, { "account", SEC_ADMINISTRATOR, true, &HandleBanListAccountCommand, "" },
{ "character", SEC_ADMINISTRATOR, true, &HandleBanListCharacterCommand, "", NULL }, { "character", SEC_ADMINISTRATOR, true, &HandleBanListCharacterCommand, "" },
{ "ip", SEC_ADMINISTRATOR, true, &HandleBanListIPCommand, "", NULL }, { "ip", SEC_ADMINISTRATOR, true, &HandleBanListIPCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand baninfoCommandTable[] = static std::vector<ChatCommand> baninfoCommandTable =
{ {
{ "account", SEC_ADMINISTRATOR, true, &HandleBanInfoAccountCommand, "", NULL }, { "account", SEC_ADMINISTRATOR, true, &HandleBanInfoAccountCommand, "" },
{ "character", SEC_ADMINISTRATOR, true, &HandleBanInfoCharacterCommand, "", NULL }, { "character", SEC_ADMINISTRATOR, true, &HandleBanInfoCharacterCommand, "" },
{ "ip", SEC_ADMINISTRATOR, true, &HandleBanInfoIPCommand, "", NULL }, { "ip", SEC_ADMINISTRATOR, true, &HandleBanInfoIPCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand banCommandTable[] = static std::vector<ChatCommand> banCommandTable =
{ {
{ "account", SEC_ADMINISTRATOR, true, &HandleBanAccountCommand, "", NULL }, { "account", SEC_ADMINISTRATOR, true, &HandleBanAccountCommand, "" },
{ "character", SEC_ADMINISTRATOR, true, &HandleBanCharacterCommand, "", NULL }, { "character", SEC_ADMINISTRATOR, true, &HandleBanCharacterCommand, "" },
{ "playeraccount", SEC_ADMINISTRATOR, true, &HandleBanAccountByCharCommand, "", NULL }, { "playeraccount", SEC_ADMINISTRATOR, true, &HandleBanAccountByCharCommand, "" },
{ "ip", SEC_ADMINISTRATOR, true, &HandleBanIPCommand, "", NULL }, { "ip", SEC_ADMINISTRATOR, true, &HandleBanIPCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "ban", SEC_ADMINISTRATOR, true, NULL, "", banCommandTable }, { "ban", SEC_ADMINISTRATOR, true, NULL, "", banCommandTable },
{ "baninfo", SEC_ADMINISTRATOR, true, NULL, "", baninfoCommandTable }, { "baninfo", SEC_ADMINISTRATOR, true, NULL, "", baninfoCommandTable },
{ "banlist", SEC_ADMINISTRATOR, true, NULL, "", banlistCommandTable }, { "banlist", SEC_ADMINISTRATOR, true, NULL, "", banlistCommandTable },
{ "unban", SEC_ADMINISTRATOR, true, NULL, "", unbanCommandTable }, { "unban", SEC_ADMINISTRATOR, true, NULL, "", unbanCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -20,21 +20,21 @@ class bf_commandscript : public CommandScript
public: public:
bf_commandscript() : CommandScript("bf_commandscript") { } bf_commandscript() : CommandScript("bf_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand battlefieldcommandTable[] = static std::vector<ChatCommand> battlefieldcommandTable =
{ {
{ "start", SEC_ADMINISTRATOR, false, &HandleBattlefieldStart, "", NULL }, { "start", SEC_ADMINISTRATOR, false, &HandleBattlefieldStart, "" },
{ "stop", SEC_ADMINISTRATOR, false, &HandleBattlefieldEnd, "", NULL }, { "stop", SEC_ADMINISTRATOR, false, &HandleBattlefieldEnd, "" },
{ "switch", SEC_ADMINISTRATOR, false, &HandleBattlefieldSwitch, "", NULL }, { "switch", SEC_ADMINISTRATOR, false, &HandleBattlefieldSwitch, "" },
{ "timer", SEC_ADMINISTRATOR, false, &HandleBattlefieldTimer, "", NULL }, { "timer", SEC_ADMINISTRATOR, false, &HandleBattlefieldTimer, "" },
{ "enable", SEC_ADMINISTRATOR, false, &HandleBattlefieldEnable, "", NULL }, { "enable", SEC_ADMINISTRATOR, false, &HandleBattlefieldEnable, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "bf", SEC_ADMINISTRATOR, false, NULL, "", battlefieldcommandTable }, { "bf", SEC_ADMINISTRATOR, false, NULL, "", battlefieldcommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -23,22 +23,22 @@ class cast_commandscript : public CommandScript
public: public:
cast_commandscript() : CommandScript("cast_commandscript") { } cast_commandscript() : CommandScript("cast_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand castCommandTable[] = static std::vector<ChatCommand> castCommandTable =
{ {
{ "back", SEC_ADMINISTRATOR, false, &HandleCastBackCommand, "", NULL }, { "back", SEC_ADMINISTRATOR, false, &HandleCastBackCommand, "" },
{ "dist", SEC_ADMINISTRATOR, false, &HandleCastDistCommand, "", NULL }, { "dist", SEC_ADMINISTRATOR, false, &HandleCastDistCommand, "" },
{ "self", SEC_ADMINISTRATOR, false, &HandleCastSelfCommand, "", NULL }, { "self", SEC_ADMINISTRATOR, false, &HandleCastSelfCommand, "" },
{ "target", SEC_ADMINISTRATOR, false, &HandleCastTargetCommad, "", NULL }, { "target", SEC_ADMINISTRATOR, false, &HandleCastTargetCommad, "" },
{ "dest", SEC_ADMINISTRATOR, false, &HandleCastDestCommand, "", NULL }, { "dest", SEC_ADMINISTRATOR, false, &HandleCastDestCommand, "" },
{ "", SEC_ADMINISTRATOR, false, &HandleCastCommand, "", NULL }, { "", SEC_ADMINISTRATOR, false, &HandleCastCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable }, { "cast", SEC_ADMINISTRATOR, false, NULL, "", castCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -24,33 +24,33 @@ class character_commandscript : public CommandScript
public: public:
character_commandscript() : CommandScript("character_commandscript") { } character_commandscript() : CommandScript("character_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand pdumpCommandTable[] = static std::vector<ChatCommand> pdumpCommandTable =
{ {
{ "load", SEC_ADMINISTRATOR, true, &HandlePDumpLoadCommand, "", NULL }, { "load", SEC_ADMINISTRATOR, true, &HandlePDumpLoadCommand, "" },
{ "write", SEC_ADMINISTRATOR, true, &HandlePDumpWriteCommand, "", NULL }, { "write", SEC_ADMINISTRATOR, true, &HandlePDumpWriteCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand characterCommandTable[] = static std::vector<ChatCommand> characterCommandTable =
{ {
{ "customize", SEC_GAMEMASTER, true, &HandleCharacterCustomizeCommand, "", NULL }, { "customize", SEC_GAMEMASTER, true, &HandleCharacterCustomizeCommand, "" },
{ "changefaction", SEC_GAMEMASTER, true, &HandleCharacterChangeFactionCommand, "", NULL }, { "changefaction", SEC_GAMEMASTER, true, &HandleCharacterChangeFactionCommand, "" },
{ "changerace", SEC_GAMEMASTER, true, &HandleCharacterChangeRaceCommand, "", NULL }, { "changerace", SEC_GAMEMASTER, true, &HandleCharacterChangeRaceCommand, "" },
{ "level", SEC_ADMINISTRATOR, true, &HandleCharacterLevelCommand, "", NULL }, { "level", SEC_ADMINISTRATOR, true, &HandleCharacterLevelCommand, "" },
{ "rename", SEC_GAMEMASTER, true, &HandleCharacterRenameCommand, "", NULL }, { "rename", SEC_GAMEMASTER, true, &HandleCharacterRenameCommand, "" },
{ "reputation", SEC_GAMEMASTER, true, &HandleCharacterReputationCommand, "", NULL }, { "reputation", SEC_GAMEMASTER, true, &HandleCharacterReputationCommand, "" },
{ "titles", SEC_GAMEMASTER, true, &HandleCharacterTitlesCommand, "", NULL }, { "titles", SEC_GAMEMASTER, true, &HandleCharacterTitlesCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable }, { "character", SEC_GAMEMASTER, true, NULL, "", characterCommandTable },
{ "levelup", SEC_ADMINISTRATOR, false, &HandleLevelUpCommand, "", NULL }, { "levelup", SEC_ADMINISTRATOR, false, &HandleLevelUpCommand, "" },
{ "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable }, { "pdump", SEC_ADMINISTRATOR, true, NULL, "", pdumpCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -29,65 +29,65 @@ class debug_commandscript : public CommandScript
public: public:
debug_commandscript() : CommandScript("debug_commandscript") { } debug_commandscript() : CommandScript("debug_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand debugPlayCommandTable[] = static std::vector<ChatCommand> debugPlayCommandTable =
{ {
{ "cinematic", SEC_GAMEMASTER, false, &HandleDebugPlayCinematicCommand, "", NULL }, { "cinematic", SEC_GAMEMASTER, false, &HandleDebugPlayCinematicCommand, "" },
{ "movie", SEC_GAMEMASTER, false, &HandleDebugPlayMovieCommand, "", NULL }, { "movie", SEC_GAMEMASTER, false, &HandleDebugPlayMovieCommand, "" },
{ "sound", SEC_GAMEMASTER, false, &HandleDebugPlaySoundCommand, "", NULL }, { "sound", SEC_GAMEMASTER, false, &HandleDebugPlaySoundCommand, "" },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
static ChatCommand debugSendCommandTable[] = static std::vector<ChatCommand> debugSendCommandTable =
{ {
{ "buyerror", SEC_ADMINISTRATOR, false, &HandleDebugSendBuyErrorCommand, "", NULL }, { "buyerror", SEC_ADMINISTRATOR, false, &HandleDebugSendBuyErrorCommand, "" },
{ "channelnotify", SEC_ADMINISTRATOR, false, &HandleDebugSendChannelNotifyCommand, "", NULL }, { "channelnotify", SEC_ADMINISTRATOR, false, &HandleDebugSendChannelNotifyCommand, "" },
{ "chatmmessage", SEC_ADMINISTRATOR, false, &HandleDebugSendChatMsgCommand, "", NULL }, { "chatmmessage", SEC_ADMINISTRATOR, false, &HandleDebugSendChatMsgCommand, "" },
{ "equiperror", SEC_ADMINISTRATOR, false, &HandleDebugSendEquipErrorCommand, "", NULL }, { "equiperror", SEC_ADMINISTRATOR, false, &HandleDebugSendEquipErrorCommand, "" },
{ "largepacket", SEC_ADMINISTRATOR, false, &HandleDebugSendLargePacketCommand, "", NULL }, { "largepacket", SEC_ADMINISTRATOR, false, &HandleDebugSendLargePacketCommand, "" },
{ "opcode", SEC_ADMINISTRATOR, false, &HandleDebugSendOpcodeCommand, "", NULL }, { "opcode", SEC_ADMINISTRATOR, false, &HandleDebugSendOpcodeCommand, "" },
{ "qpartymsg", SEC_ADMINISTRATOR, false, &HandleDebugSendQuestPartyMsgCommand, "", NULL }, { "qpartymsg", SEC_ADMINISTRATOR, false, &HandleDebugSendQuestPartyMsgCommand, "" },
{ "qinvalidmsg", SEC_ADMINISTRATOR, false, &HandleDebugSendQuestInvalidMsgCommand, "", NULL }, { "qinvalidmsg", SEC_ADMINISTRATOR, false, &HandleDebugSendQuestInvalidMsgCommand, "" },
{ "sellerror", SEC_ADMINISTRATOR, false, &HandleDebugSendSellErrorCommand, "", NULL }, { "sellerror", SEC_ADMINISTRATOR, false, &HandleDebugSendSellErrorCommand, "" },
{ "setphaseshift", SEC_ADMINISTRATOR, false, &HandleDebugSendSetPhaseShiftCommand, "", NULL }, { "setphaseshift", SEC_ADMINISTRATOR, false, &HandleDebugSendSetPhaseShiftCommand, "" },
{ "spellfail", SEC_ADMINISTRATOR, false, &HandleDebugSendSpellFailCommand, "", NULL }, { "spellfail", SEC_ADMINISTRATOR, false, &HandleDebugSendSpellFailCommand, "" },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
static ChatCommand debugCommandTable[] = static std::vector<ChatCommand> debugCommandTable =
{ {
{ "setbit", SEC_ADMINISTRATOR, false, &HandleDebugSet32BitCommand, "", NULL }, { "setbit", SEC_ADMINISTRATOR, false, &HandleDebugSet32BitCommand, "" },
{ "threat", SEC_ADMINISTRATOR, false, &HandleDebugThreatListCommand, "", NULL }, { "threat", SEC_ADMINISTRATOR, false, &HandleDebugThreatListCommand, "" },
{ "hostil", SEC_ADMINISTRATOR, false, &HandleDebugHostileRefListCommand, "", NULL }, { "hostil", SEC_ADMINISTRATOR, false, &HandleDebugHostileRefListCommand, "" },
{ "anim", SEC_GAMEMASTER, false, &HandleDebugAnimCommand, "", NULL }, { "anim", SEC_GAMEMASTER, false, &HandleDebugAnimCommand, "" },
{ "arena", SEC_ADMINISTRATOR, false, &HandleDebugArenaCommand, "", NULL }, { "arena", SEC_ADMINISTRATOR, false, &HandleDebugArenaCommand, "" },
{ "bg", SEC_ADMINISTRATOR, false, &HandleDebugBattlegroundCommand, "", NULL }, { "bg", SEC_ADMINISTRATOR, false, &HandleDebugBattlegroundCommand, "" },
{ "getitemstate", SEC_ADMINISTRATOR, false, &HandleDebugGetItemStateCommand, "", NULL }, { "getitemstate", SEC_ADMINISTRATOR, false, &HandleDebugGetItemStateCommand, "" },
{ "lootrecipient", SEC_GAMEMASTER, false, &HandleDebugGetLootRecipientCommand, "", NULL }, { "lootrecipient", SEC_GAMEMASTER, false, &HandleDebugGetLootRecipientCommand, "" },
{ "getvalue", SEC_ADMINISTRATOR, false, &HandleDebugGetValueCommand, "", NULL }, { "getvalue", SEC_ADMINISTRATOR, false, &HandleDebugGetValueCommand, "" },
{ "getitemvalue", SEC_ADMINISTRATOR, false, &HandleDebugGetItemValueCommand, "", NULL }, { "getitemvalue", SEC_ADMINISTRATOR, false, &HandleDebugGetItemValueCommand, "" },
{ "Mod32Value", SEC_ADMINISTRATOR, false, &HandleDebugMod32ValueCommand, "", NULL }, { "Mod32Value", SEC_ADMINISTRATOR, false, &HandleDebugMod32ValueCommand, "" },
{ "play", SEC_GAMEMASTER, false, NULL, "", debugPlayCommandTable }, { "play", SEC_GAMEMASTER, false, NULL, "", debugPlayCommandTable },
{ "send", SEC_ADMINISTRATOR, false, NULL, "", debugSendCommandTable }, { "send", SEC_ADMINISTRATOR, false, NULL, "", debugSendCommandTable },
{ "setaurastate", SEC_ADMINISTRATOR, false, &HandleDebugSetAuraStateCommand, "", NULL }, { "setaurastate", SEC_ADMINISTRATOR, false, &HandleDebugSetAuraStateCommand, "" },
{ "setitemvalue", SEC_ADMINISTRATOR, false, &HandleDebugSetItemValueCommand, "", NULL }, { "setitemvalue", SEC_ADMINISTRATOR, false, &HandleDebugSetItemValueCommand, "" },
{ "setvalue", SEC_ADMINISTRATOR, false, &HandleDebugSetValueCommand, "", NULL }, { "setvalue", SEC_ADMINISTRATOR, false, &HandleDebugSetValueCommand, "" },
{ "spawnvehicle", SEC_ADMINISTRATOR, false, &HandleDebugSpawnVehicleCommand, "", NULL }, { "spawnvehicle", SEC_ADMINISTRATOR, false, &HandleDebugSpawnVehicleCommand, "" },
{ "setvid", SEC_ADMINISTRATOR, false, &HandleDebugSetVehicleIdCommand, "", NULL }, { "setvid", SEC_ADMINISTRATOR, false, &HandleDebugSetVehicleIdCommand, "" },
{ "entervehicle", SEC_ADMINISTRATOR, false, &HandleDebugEnterVehicleCommand, "", NULL }, { "entervehicle", SEC_ADMINISTRATOR, false, &HandleDebugEnterVehicleCommand, "" },
{ "uws", SEC_ADMINISTRATOR, false, &HandleDebugUpdateWorldStateCommand, "", NULL }, { "uws", SEC_ADMINISTRATOR, false, &HandleDebugUpdateWorldStateCommand, "" },
{ "update", SEC_ADMINISTRATOR, false, &HandleDebugUpdateCommand, "", NULL }, { "update", SEC_ADMINISTRATOR, false, &HandleDebugUpdateCommand, "" },
{ "itemexpire", SEC_ADMINISTRATOR, false, &HandleDebugItemExpireCommand, "", NULL }, { "itemexpire", SEC_ADMINISTRATOR, false, &HandleDebugItemExpireCommand, "" },
{ "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "", NULL }, { "areatriggers", SEC_ADMINISTRATOR, false, &HandleDebugAreaTriggersCommand, "" },
{ "los", SEC_GAMEMASTER, false, &HandleDebugLoSCommand, "", NULL }, { "los", SEC_GAMEMASTER, false, &HandleDebugLoSCommand, "" },
{ "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "", NULL }, { "moveflags", SEC_ADMINISTRATOR, false, &HandleDebugMoveflagsCommand, "" },
{ "unitstate", SEC_ADMINISTRATOR, false, &HandleDebugUnitStateCommand, "", NULL }, { "unitstate", SEC_ADMINISTRATOR, false, &HandleDebugUnitStateCommand, "" },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "debug", SEC_GAMEMASTER, true, NULL, "", debugCommandTable }, { "debug", SEC_GAMEMASTER, true, NULL, "", debugCommandTable },
{ "wpgps", SEC_ADMINISTRATOR, false, &HandleWPGPSCommand, "", NULL }, { "wpgps", SEC_ADMINISTRATOR, false, &HandleWPGPSCommand, "", },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "", }
}; };
return commandTable; return commandTable;
} }

View File

@@ -22,20 +22,20 @@ class event_commandscript : public CommandScript
public: public:
event_commandscript() : CommandScript("event_commandscript") { } event_commandscript() : CommandScript("event_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand eventCommandTable[] = static std::vector<ChatCommand> eventCommandTable =
{ {
{ "activelist", SEC_GAMEMASTER, true, &HandleEventActiveListCommand, "", NULL }, { "activelist", SEC_GAMEMASTER, true, &HandleEventActiveListCommand, "" },
{ "start", SEC_GAMEMASTER, true, &HandleEventStartCommand, "", NULL }, { "start", SEC_GAMEMASTER, true, &HandleEventStartCommand, "" },
{ "stop", SEC_GAMEMASTER, true, &HandleEventStopCommand, "", NULL }, { "stop", SEC_GAMEMASTER, true, &HandleEventStopCommand, "" },
{ "", SEC_GAMEMASTER, true, &HandleEventInfoCommand, "", NULL }, { "", SEC_GAMEMASTER, true, &HandleEventInfoCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "event", SEC_GAMEMASTER, false, NULL, "", eventCommandTable }, { "event", SEC_GAMEMASTER, false, NULL, "", eventCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -25,22 +25,22 @@ class gm_commandscript : public CommandScript
public: public:
gm_commandscript() : CommandScript("gm_commandscript") { } gm_commandscript() : CommandScript("gm_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand gmCommandTable[] = static std::vector<ChatCommand> gmCommandTable =
{ {
{ "chat", SEC_GAMEMASTER, false, &HandleGMChatCommand, "", NULL }, { "chat", SEC_GAMEMASTER, false, &HandleGMChatCommand, "" },
{ "fly", SEC_ADMINISTRATOR, false, &HandleGMFlyCommand, "", NULL }, { "fly", SEC_ADMINISTRATOR, false, &HandleGMFlyCommand, "" },
//{ "ingame", SEC_PLAYER, true, &HandleGMListIngameCommand, "", NULL }, //{ "ingame", SEC_PLAYER, true, &HandleGMListIngameCommand, "" },
{ "list", SEC_ADMINISTRATOR, true, &HandleGMListFullCommand, "", NULL }, { "list", SEC_ADMINISTRATOR, true, &HandleGMListFullCommand, "" },
{ "visible", SEC_GAMEMASTER, false, &HandleGMVisibleCommand, "", NULL }, { "visible", SEC_GAMEMASTER, false, &HandleGMVisibleCommand, "" },
{ "", SEC_GAMEMASTER, false, &HandleGMCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleGMCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "gm", SEC_GAMEMASTER, false, NULL, "", gmCommandTable }, { "gm", SEC_GAMEMASTER, false, NULL, "", gmCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -24,27 +24,27 @@ class go_commandscript : public CommandScript
public: public:
go_commandscript() : CommandScript("go_commandscript") { } go_commandscript() : CommandScript("go_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand goCommandTable[] = static std::vector<ChatCommand> goCommandTable =
{ {
{ "creature", SEC_GAMEMASTER, false, &HandleGoCreatureCommand, "", NULL }, { "creature", SEC_GAMEMASTER, false, &HandleGoCreatureCommand, "" },
{ "graveyard", SEC_GAMEMASTER, false, &HandleGoGraveyardCommand, "", NULL }, { "graveyard", SEC_GAMEMASTER, false, &HandleGoGraveyardCommand, "" },
{ "grid", SEC_GAMEMASTER, false, &HandleGoGridCommand, "", NULL }, { "grid", SEC_GAMEMASTER, false, &HandleGoGridCommand, "" },
{ "object", SEC_GAMEMASTER, false, &HandleGoObjectCommand, "", NULL }, { "object", SEC_GAMEMASTER, false, &HandleGoObjectCommand, "" },
{ "taxinode", SEC_GAMEMASTER, false, &HandleGoTaxinodeCommand, "", NULL }, { "taxinode", SEC_GAMEMASTER, false, &HandleGoTaxinodeCommand, "" },
{ "trigger", SEC_GAMEMASTER, false, &HandleGoTriggerCommand, "", NULL }, { "trigger", SEC_GAMEMASTER, false, &HandleGoTriggerCommand, "" },
{ "zonexy", SEC_GAMEMASTER, false, &HandleGoZoneXYCommand, "", NULL }, { "zonexy", SEC_GAMEMASTER, false, &HandleGoZoneXYCommand, "" },
{ "xyz", SEC_GAMEMASTER, false, &HandleGoXYZCommand, "", NULL }, { "xyz", SEC_GAMEMASTER, false, &HandleGoXYZCommand, "" },
{ "ticket", SEC_GAMEMASTER, false, &HandleGoTicketCommand, "", NULL }, { "ticket", SEC_GAMEMASTER, false, &HandleGoTicketCommand, "" },
{ "", SEC_GAMEMASTER, false, &HandleGoXYZCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleGoXYZCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "go", SEC_GAMEMASTER, false, NULL, "", goCommandTable }, { "go", SEC_GAMEMASTER, false, NULL, "", goCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -28,37 +28,37 @@ class gobject_commandscript : public CommandScript
public: public:
gobject_commandscript() : CommandScript("gobject_commandscript") { } gobject_commandscript() : CommandScript("gobject_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand gobjectAddCommandTable[] = static std::vector<ChatCommand> gobjectAddCommandTable =
{ {
{ "temp", SEC_GAMEMASTER, false, &HandleGameObjectAddTempCommand, "", NULL }, { "temp", SEC_GAMEMASTER, false, &HandleGameObjectAddTempCommand, "" },
{ "", SEC_GAMEMASTER, false, &HandleGameObjectAddCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleGameObjectAddCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand gobjectSetCommandTable[] = static std::vector<ChatCommand> gobjectSetCommandTable =
{ {
{ "phase", SEC_GAMEMASTER, false, &HandleGameObjectSetPhaseCommand, "", NULL }, { "phase", SEC_GAMEMASTER, false, &HandleGameObjectSetPhaseCommand, "" },
{ "state", SEC_GAMEMASTER, false, &HandleGameObjectSetStateCommand, "", NULL }, { "state", SEC_GAMEMASTER, false, &HandleGameObjectSetStateCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand gobjectCommandTable[] = static std::vector<ChatCommand> gobjectCommandTable =
{ {
{ "activate", SEC_GAMEMASTER, false, &HandleGameObjectActivateCommand, "", NULL }, { "activate", SEC_GAMEMASTER, false, &HandleGameObjectActivateCommand, "" },
{ "delete", SEC_GAMEMASTER, false, &HandleGameObjectDeleteCommand, "", NULL }, { "delete", SEC_GAMEMASTER, false, &HandleGameObjectDeleteCommand, "" },
{ "info", SEC_GAMEMASTER, false, &HandleGameObjectInfoCommand, "", NULL }, { "info", SEC_GAMEMASTER, false, &HandleGameObjectInfoCommand, "" },
{ "move", SEC_GAMEMASTER, false, &HandleGameObjectMoveCommand, "", NULL }, { "move", SEC_GAMEMASTER, false, &HandleGameObjectMoveCommand, "" },
{ "near", SEC_GAMEMASTER, false, &HandleGameObjectNearCommand, "", NULL }, { "near", SEC_GAMEMASTER, false, &HandleGameObjectNearCommand, "" },
{ "target", SEC_GAMEMASTER, false, &HandleGameObjectTargetCommand, "", NULL }, { "target", SEC_GAMEMASTER, false, &HandleGameObjectTargetCommand, "" },
{ "turn", SEC_GAMEMASTER, false, &HandleGameObjectTurnCommand, "", NULL }, { "turn", SEC_GAMEMASTER, false, &HandleGameObjectTurnCommand, "" },
{ "add", SEC_GAMEMASTER, false, NULL, "", gobjectAddCommandTable }, { "add", SEC_GAMEMASTER, false, NULL, "", gobjectAddCommandTable },
{ "set", SEC_GAMEMASTER, false, NULL, "", gobjectSetCommandTable }, { "set", SEC_GAMEMASTER, false, NULL, "", gobjectSetCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable }, { "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -23,21 +23,21 @@ class guild_commandscript : public CommandScript
public: public:
guild_commandscript() : CommandScript("guild_commandscript") { } guild_commandscript() : CommandScript("guild_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand guildCommandTable[] = static std::vector<ChatCommand> guildCommandTable =
{ {
{ "create", SEC_GAMEMASTER, true, &HandleGuildCreateCommand, "", NULL }, { "create", SEC_GAMEMASTER, true, &HandleGuildCreateCommand, "" },
{ "delete", SEC_GAMEMASTER, true, &HandleGuildDeleteCommand, "", NULL }, { "delete", SEC_GAMEMASTER, true, &HandleGuildDeleteCommand, "" },
{ "invite", SEC_GAMEMASTER, true, &HandleGuildInviteCommand, "", NULL }, { "invite", SEC_GAMEMASTER, true, &HandleGuildInviteCommand, "" },
{ "uninvite", SEC_GAMEMASTER, true, &HandleGuildUninviteCommand, "", NULL }, { "uninvite", SEC_GAMEMASTER, true, &HandleGuildUninviteCommand, "" },
{ "rank", SEC_GAMEMASTER, true, &HandleGuildRankCommand, "", NULL }, { "rank", SEC_GAMEMASTER, true, &HandleGuildRankCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable }, { "guild", SEC_ADMINISTRATOR, true, NULL, "", guildCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -22,26 +22,26 @@ class honor_commandscript : public CommandScript
public: public:
honor_commandscript() : CommandScript("honor_commandscript") { } honor_commandscript() : CommandScript("honor_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand honorAddCommandTable[] = static std::vector<ChatCommand> honorAddCommandTable =
{ {
{ "kill", SEC_GAMEMASTER, false, &HandleHonorAddKillCommand, "", NULL }, { "kill", SEC_GAMEMASTER, false, &HandleHonorAddKillCommand, "" },
{ "", SEC_GAMEMASTER, false, &HandleHonorAddCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleHonorAddCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand honorCommandTable[] = static std::vector<ChatCommand> honorCommandTable =
{ {
{ "add", SEC_GAMEMASTER, false, NULL, "", honorAddCommandTable }, { "add", SEC_GAMEMASTER, false, NULL, "", honorAddCommandTable },
{ "update", SEC_GAMEMASTER, false, &HandleHonorUpdateCommand, "", NULL }, { "update", SEC_GAMEMASTER, false, &HandleHonorUpdateCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable }, { "honor", SEC_GAMEMASTER, false, NULL, "", honorCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -25,23 +25,23 @@ class instance_commandscript : public CommandScript
public: public:
instance_commandscript() : CommandScript("instance_commandscript") { } instance_commandscript() : CommandScript("instance_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand instanceCommandTable[] = static std::vector<ChatCommand> instanceCommandTable =
{ {
{ "listbinds", SEC_ADMINISTRATOR, false, &HandleInstanceListBindsCommand, "", NULL }, { "listbinds", SEC_ADMINISTRATOR, false, &HandleInstanceListBindsCommand, "" },
{ "unbind", SEC_ADMINISTRATOR, false, &HandleInstanceUnbindCommand, "", NULL }, { "unbind", SEC_ADMINISTRATOR, false, &HandleInstanceUnbindCommand, "" },
{ "stats", SEC_ADMINISTRATOR, true, &HandleInstanceStatsCommand, "", NULL }, { "stats", SEC_ADMINISTRATOR, true, &HandleInstanceStatsCommand, "" },
{ "savedata", SEC_ADMINISTRATOR, false, &HandleInstanceSaveDataCommand, "", NULL }, { "savedata", SEC_ADMINISTRATOR, false, &HandleInstanceSaveDataCommand, "" },
{ "setbossstate", SEC_GAMEMASTER, true, &HandleInstanceSetBossStateCommand, "", NULL }, { "setbossstate", SEC_GAMEMASTER, true, &HandleInstanceSetBossStateCommand, "" },
{ "getbossstate", SEC_GAMEMASTER, true, &HandleInstanceGetBossStateCommand, "", NULL }, { "getbossstate", SEC_GAMEMASTER, true, &HandleInstanceGetBossStateCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable }, { "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;

View File

@@ -25,40 +25,40 @@ class learn_commandscript : public CommandScript
public: public:
learn_commandscript() : CommandScript("learn_commandscript") { } learn_commandscript() : CommandScript("learn_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand learnAllMyCommandTable[] = static std::vector<ChatCommand> learnAllMyCommandTable =
{ {
{ "class", SEC_ADMINISTRATOR, false, &HandleLearnAllMyClassCommand, "", NULL }, { "class", SEC_ADMINISTRATOR, false, &HandleLearnAllMyClassCommand, "" },
{ "pettalents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyPetTalentsCommand, "", NULL }, { "pettalents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyPetTalentsCommand, "" },
{ "spells", SEC_ADMINISTRATOR, false, &HandleLearnAllMySpellsCommand, "", NULL }, { "spells", SEC_ADMINISTRATOR, false, &HandleLearnAllMySpellsCommand, "" },
{ "talents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyTalentsCommand, "", NULL }, { "talents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyTalentsCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand learnAllCommandTable[] = static std::vector<ChatCommand> learnAllCommandTable =
{ {
{ "my", SEC_ADMINISTRATOR, false, NULL, "", learnAllMyCommandTable }, { "my", SEC_ADMINISTRATOR, false, NULL, "", learnAllMyCommandTable },
{ "gm", SEC_GAMEMASTER, false, &HandleLearnAllGMCommand, "", NULL }, { "gm", SEC_GAMEMASTER, false, &HandleLearnAllGMCommand, "" },
{ "crafts", SEC_GAMEMASTER, false, &HandleLearnAllCraftsCommand, "", NULL }, { "crafts", SEC_GAMEMASTER, false, &HandleLearnAllCraftsCommand, "" },
{ "default", SEC_GAMEMASTER, false, &HandleLearnAllDefaultCommand, "", NULL }, { "default", SEC_GAMEMASTER, false, &HandleLearnAllDefaultCommand, "" },
{ "lang", SEC_GAMEMASTER, false, &HandleLearnAllLangCommand, "", NULL }, { "lang", SEC_GAMEMASTER, false, &HandleLearnAllLangCommand, "" },
{ "recipes", SEC_GAMEMASTER, false, &HandleLearnAllRecipesCommand, "", NULL }, { "recipes", SEC_GAMEMASTER, false, &HandleLearnAllRecipesCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand learnCommandTable[] = static std::vector<ChatCommand> learnCommandTable =
{ {
{ "all", SEC_ADMINISTRATOR, false, NULL, "", learnAllCommandTable }, { "all", SEC_ADMINISTRATOR, false, NULL, "", learnAllCommandTable },
{ "", SEC_ADMINISTRATOR, false, &HandleLearnCommand, "", NULL }, { "", SEC_ADMINISTRATOR, false, &HandleLearnCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "learn", SEC_GAMEMASTER, false, NULL, "", learnCommandTable }, { "learn", SEC_GAMEMASTER, false, NULL, "", learnCommandTable },
{ "unlearn", SEC_ADMINISTRATOR, false, &HandleUnLearnCommand, "", NULL }, { "unlearn", SEC_ADMINISTRATOR, false, &HandleUnLearnCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -30,22 +30,22 @@ class lfg_commandscript : public CommandScript
public: public:
lfg_commandscript() : CommandScript("lfg_commandscript") { } lfg_commandscript() : CommandScript("lfg_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand lfgCommandTable[] = static std::vector<ChatCommand> lfgCommandTable =
{ {
{ "player", SEC_GAMEMASTER, false, &HandleLfgPlayerInfoCommand, "", NULL }, { "player", SEC_GAMEMASTER, false, &HandleLfgPlayerInfoCommand, "" },
{ "group", SEC_GAMEMASTER, false, &HandleLfgGroupInfoCommand, "", NULL }, { "group", SEC_GAMEMASTER, false, &HandleLfgGroupInfoCommand, "" },
{ "queue", SEC_GAMEMASTER, false, &HandleLfgQueueInfoCommand, "", NULL }, { "queue", SEC_GAMEMASTER, false, &HandleLfgQueueInfoCommand, "" },
{ "clean", SEC_ADMINISTRATOR, false, &HandleLfgCleanCommand, "", NULL }, { "clean", SEC_ADMINISTRATOR, false, &HandleLfgCleanCommand, "" },
{ "options", SEC_ADMINISTRATOR, false, &HandleLfgOptionsCommand, "", NULL }, { "options", SEC_ADMINISTRATOR, false, &HandleLfgOptionsCommand, "" },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "lfg", SEC_GAMEMASTER, false, NULL, "", lfgCommandTable }, { "lfg", SEC_GAMEMASTER, false, NULL, "", lfgCommandTable },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -24,20 +24,20 @@ class list_commandscript : public CommandScript
public: public:
list_commandscript() : CommandScript("list_commandscript") { } list_commandscript() : CommandScript("list_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand listCommandTable[] = static std::vector<ChatCommand> listCommandTable =
{ {
{ "creature", SEC_ADMINISTRATOR, true, &HandleListCreatureCommand, "", NULL }, { "creature", SEC_ADMINISTRATOR, true, &HandleListCreatureCommand, "" },
{ "item", SEC_ADMINISTRATOR, true, &HandleListItemCommand, "", NULL }, { "item", SEC_ADMINISTRATOR, true, &HandleListItemCommand, "" },
{ "object", SEC_ADMINISTRATOR, true, &HandleListObjectCommand, "", NULL }, { "object", SEC_ADMINISTRATOR, true, &HandleListObjectCommand, "" },
{ "auras", SEC_ADMINISTRATOR, false, &HandleListAurasCommand, "", NULL }, { "auras", SEC_ADMINISTRATOR, false, &HandleListAurasCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable }, { "list", SEC_ADMINISTRATOR, true, NULL, "", listCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -26,47 +26,47 @@ class lookup_commandscript : public CommandScript
public: public:
lookup_commandscript() : CommandScript("lookup_commandscript") { } lookup_commandscript() : CommandScript("lookup_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand lookupPlayerCommandTable[] = static std::vector<ChatCommand> lookupPlayerCommandTable =
{ {
{ "ip", SEC_GAMEMASTER, true, &HandleLookupPlayerIpCommand, "", NULL }, { "ip", SEC_GAMEMASTER, true, &HandleLookupPlayerIpCommand, "" },
{ "account", SEC_GAMEMASTER, true, &HandleLookupPlayerAccountCommand, "", NULL }, { "account", SEC_GAMEMASTER, true, &HandleLookupPlayerAccountCommand, "" },
{ "email", SEC_GAMEMASTER, true, &HandleLookupPlayerEmailCommand, "", NULL }, { "email", SEC_GAMEMASTER, true, &HandleLookupPlayerEmailCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand lookupSpellCommandTable[] = static std::vector<ChatCommand> lookupSpellCommandTable =
{ {
{ "id", SEC_ADMINISTRATOR, true, &HandleLookupSpellIdCommand, "", NULL }, { "id", SEC_ADMINISTRATOR, true, &HandleLookupSpellIdCommand, "" },
{ "", SEC_ADMINISTRATOR, true, &HandleLookupSpellCommand, "", NULL }, { "", SEC_ADMINISTRATOR, true, &HandleLookupSpellCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand lookupCommandTable[] = static std::vector<ChatCommand> lookupCommandTable =
{ {
{ "area", SEC_GAMEMASTER, true, &HandleLookupAreaCommand, "", NULL }, { "area", SEC_GAMEMASTER, true, &HandleLookupAreaCommand, "" },
{ "creature", SEC_ADMINISTRATOR, true, &HandleLookupCreatureCommand, "", NULL }, { "creature", SEC_ADMINISTRATOR, true, &HandleLookupCreatureCommand, "" },
{ "event", SEC_GAMEMASTER, true, &HandleLookupEventCommand, "", NULL }, { "event", SEC_GAMEMASTER, true, &HandleLookupEventCommand, "" },
{ "faction", SEC_ADMINISTRATOR, true, &HandleLookupFactionCommand, "", NULL }, { "faction", SEC_ADMINISTRATOR, true, &HandleLookupFactionCommand, "" },
{ "item", SEC_ADMINISTRATOR, true, &HandleLookupItemCommand, "", NULL }, { "item", SEC_ADMINISTRATOR, true, &HandleLookupItemCommand, "" },
{ "itemset", SEC_ADMINISTRATOR, true, &HandleLookupItemSetCommand, "", NULL }, { "itemset", SEC_ADMINISTRATOR, true, &HandleLookupItemSetCommand, "" },
{ "object", SEC_ADMINISTRATOR, true, &HandleLookupObjectCommand, "", NULL }, { "object", SEC_ADMINISTRATOR, true, &HandleLookupObjectCommand, "" },
{ "quest", SEC_ADMINISTRATOR, true, &HandleLookupQuestCommand, "", NULL }, { "quest", SEC_ADMINISTRATOR, true, &HandleLookupQuestCommand, "" },
{ "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable }, { "player", SEC_GAMEMASTER, true, NULL, "", lookupPlayerCommandTable },
{ "skill", SEC_ADMINISTRATOR, true, &HandleLookupSkillCommand, "", NULL }, { "skill", SEC_ADMINISTRATOR, true, &HandleLookupSkillCommand, "" },
{ "spell", SEC_ADMINISTRATOR, true, NULL, "", lookupSpellCommandTable }, { "spell", SEC_ADMINISTRATOR, true, NULL, "", lookupSpellCommandTable },
{ "taxinode", SEC_ADMINISTRATOR, true, &HandleLookupTaxiNodeCommand, "", NULL }, { "taxinode", SEC_ADMINISTRATOR, true, &HandleLookupTaxiNodeCommand, "" },
{ "tele", SEC_GAMEMASTER, true, &HandleLookupTeleCommand, "", NULL }, { "tele", SEC_GAMEMASTER, true, &HandleLookupTeleCommand, "" },
{ "title", SEC_GAMEMASTER, true, &HandleLookupTitleCommand, "", NULL }, { "title", SEC_GAMEMASTER, true, &HandleLookupTitleCommand, "" },
{ "map", SEC_ADMINISTRATOR, true, &HandleLookupMapCommand, "", NULL }, { "map", SEC_ADMINISTRATOR, true, &HandleLookupMapCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable }, { "lookup", SEC_ADMINISTRATOR, true, NULL, "", lookupCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -22,18 +22,18 @@ class message_commandscript : public CommandScript
public: public:
message_commandscript() : CommandScript("message_commandscript") { } message_commandscript() : CommandScript("message_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "nameannounce", SEC_GAMEMASTER, true, &HandleNameAnnounceCommand, "", NULL }, { "nameannounce", SEC_GAMEMASTER, true, &HandleNameAnnounceCommand, "" },
{ "gmnameannounce", SEC_GAMEMASTER, true, &HandleGMNameAnnounceCommand, "", NULL }, { "gmnameannounce", SEC_GAMEMASTER, true, &HandleGMNameAnnounceCommand, "" },
{ "announce", SEC_GAMEMASTER, true, &HandleAnnounceCommand, "", NULL }, { "announce", SEC_GAMEMASTER, true, &HandleAnnounceCommand, "" },
{ "gmannounce", SEC_GAMEMASTER, true, &HandleGMAnnounceCommand, "", NULL }, { "gmannounce", SEC_GAMEMASTER, true, &HandleGMAnnounceCommand, "" },
{ "notify", SEC_GAMEMASTER, true, &HandleNotifyCommand, "", NULL }, { "notify", SEC_GAMEMASTER, true, &HandleNotifyCommand, "" },
{ "gmnotify", SEC_GAMEMASTER, true, &HandleGMNotifyCommand, "", NULL }, { "gmnotify", SEC_GAMEMASTER, true, &HandleGMNotifyCommand, "" },
{ "whispers", SEC_GAMEMASTER, false, &HandleWhispersCommand, "", NULL }, { "whispers", SEC_GAMEMASTER, false, &HandleWhispersCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -33,91 +33,91 @@ class misc_commandscript : public CommandScript
public: public:
misc_commandscript() : CommandScript("misc_commandscript") { } misc_commandscript() : CommandScript("misc_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand groupCommandTable[] = static std::vector<ChatCommand> groupCommandTable =
{ {
{ "leader", SEC_ADMINISTRATOR, false, &HandleGroupLeaderCommand, "", NULL }, { "leader", SEC_ADMINISTRATOR, false, &HandleGroupLeaderCommand, "" },
{ "disband", SEC_ADMINISTRATOR, false, &HandleGroupDisbandCommand, "", NULL }, { "disband", SEC_ADMINISTRATOR, false, &HandleGroupDisbandCommand, "" },
{ "remove", SEC_ADMINISTRATOR, false, &HandleGroupRemoveCommand, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &HandleGroupRemoveCommand, "" },
{ "join", SEC_ADMINISTRATOR, false, &HandleGroupJoinCommand, "", NULL }, { "join", SEC_ADMINISTRATOR, false, &HandleGroupJoinCommand, "" },
{ "list", SEC_ADMINISTRATOR, false, &HandleGroupListCommand, "", NULL }, { "list", SEC_ADMINISTRATOR, false, &HandleGroupListCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand petCommandTable[] = static std::vector<ChatCommand> petCommandTable =
{ {
{ "create", SEC_GAMEMASTER, false, &HandleCreatePetCommand, "", NULL }, { "create", SEC_GAMEMASTER, false, &HandleCreatePetCommand, "" },
{ "learn", SEC_GAMEMASTER, false, &HandlePetLearnCommand, "", NULL }, { "learn", SEC_GAMEMASTER, false, &HandlePetLearnCommand, "" },
{ "unlearn", SEC_GAMEMASTER, false, &HandlePetUnlearnCommand, "", NULL }, { "unlearn", SEC_GAMEMASTER, false, &HandlePetUnlearnCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand sendCommandTable[] = static std::vector<ChatCommand> sendCommandTable =
{ {
{ "items", SEC_ADMINISTRATOR, true, &HandleSendItemsCommand, "", NULL }, { "items", SEC_ADMINISTRATOR, true, &HandleSendItemsCommand, "" },
{ "mail", SEC_GAMEMASTER, true, &HandleSendMailCommand, "", NULL }, { "mail", SEC_GAMEMASTER, true, &HandleSendMailCommand, "" },
{ "message", SEC_ADMINISTRATOR, true, &HandleSendMessageCommand, "", NULL }, { "message", SEC_ADMINISTRATOR, true, &HandleSendMessageCommand, "" },
{ "money", SEC_ADMINISTRATOR, true, &HandleSendMoneyCommand, "", NULL }, { "money", SEC_ADMINISTRATOR, true, &HandleSendMoneyCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "", NULL }, { "dev", SEC_ADMINISTRATOR, false, &HandleDevCommand, "" },
{ "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "", NULL }, { "gps", SEC_ADMINISTRATOR, false, &HandleGPSCommand, "" },
{ "aura", SEC_ADMINISTRATOR, false, &HandleAuraCommand, "", NULL }, { "aura", SEC_ADMINISTRATOR, false, &HandleAuraCommand, "" },
{ "unaura", SEC_ADMINISTRATOR, false, &HandleUnAuraCommand, "", NULL }, { "unaura", SEC_ADMINISTRATOR, false, &HandleUnAuraCommand, "" },
{ "appear", SEC_GAMEMASTER, false, &HandleAppearCommand, "", NULL }, { "appear", SEC_GAMEMASTER, false, &HandleAppearCommand, "" },
{ "summon", SEC_GAMEMASTER, false, &HandleSummonCommand, "", NULL }, { "summon", SEC_GAMEMASTER, false, &HandleSummonCommand, "" },
{ "groupsummon", SEC_GAMEMASTER, false, &HandleGroupSummonCommand, "", NULL }, { "groupsummon", SEC_GAMEMASTER, false, &HandleGroupSummonCommand, "" },
{ "commands", SEC_PLAYER, true, &HandleCommandsCommand, "", NULL }, { "commands", SEC_PLAYER, true, &HandleCommandsCommand, "" },
{ "die", SEC_ADMINISTRATOR, false, &HandleDieCommand, "", NULL }, { "die", SEC_ADMINISTRATOR, false, &HandleDieCommand, "" },
{ "revive", SEC_ADMINISTRATOR, true, &HandleReviveCommand, "", NULL }, { "revive", SEC_ADMINISTRATOR, true, &HandleReviveCommand, "" },
{ "dismount", SEC_PLAYER, false, &HandleDismountCommand, "", NULL }, { "dismount", SEC_PLAYER, false, &HandleDismountCommand, "" },
{ "guid", SEC_GAMEMASTER, false, &HandleGUIDCommand, "", NULL }, { "guid", SEC_GAMEMASTER, false, &HandleGUIDCommand, "" },
{ "help", SEC_PLAYER, true, &HandleHelpCommand, "", NULL }, { "help", SEC_PLAYER, true, &HandleHelpCommand, "" },
{ "itemmove", SEC_GAMEMASTER, false, &HandleItemMoveCommand, "", NULL }, { "itemmove", SEC_GAMEMASTER, false, &HandleItemMoveCommand, "" },
{ "cooldown", SEC_ADMINISTRATOR, false, &HandleCooldownCommand, "", NULL }, { "cooldown", SEC_ADMINISTRATOR, false, &HandleCooldownCommand, "" },
{ "distance", SEC_ADMINISTRATOR, false, &HandleGetDistanceCommand, "", NULL }, { "distance", SEC_ADMINISTRATOR, false, &HandleGetDistanceCommand, "" },
{ "recall", SEC_GAMEMASTER, false, &HandleRecallCommand, "", NULL }, { "recall", SEC_GAMEMASTER, false, &HandleRecallCommand, "" },
{ "save", SEC_PLAYER, false, &HandleSaveCommand, "", NULL }, { "save", SEC_PLAYER, false, &HandleSaveCommand, "" },
{ "saveall", SEC_GAMEMASTER, true, &HandleSaveAllCommand, "", NULL }, { "saveall", SEC_GAMEMASTER, true, &HandleSaveAllCommand, "" },
{ "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL }, { "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "" },
{ "unstuck", SEC_GAMEMASTER, true, &HandleUnstuckCommand, "", NULL }, { "unstuck", SEC_GAMEMASTER, true, &HandleUnstuckCommand, "" },
{ "taxicheat", SEC_GAMEMASTER, false, &HandleTaxiCheatCommand, "", NULL }, { "taxicheat", SEC_GAMEMASTER, false, &HandleTaxiCheatCommand, "" },
{ "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL }, { "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "" },
{ "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL }, { "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "" },
{ "explorecheat", SEC_ADMINISTRATOR, false, &HandleExploreCheatCommand, "", NULL }, { "explorecheat", SEC_ADMINISTRATOR, false, &HandleExploreCheatCommand, "" },
{ "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL }, { "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "" },
{ "hidearea", SEC_ADMINISTRATOR, false, &HandleHideAreaCommand, "", NULL }, { "hidearea", SEC_ADMINISTRATOR, false, &HandleHideAreaCommand, "" },
{ "additem", SEC_ADMINISTRATOR, false, &HandleAddItemCommand, "", NULL }, { "additem", SEC_ADMINISTRATOR, false, &HandleAddItemCommand, "" },
{ "additemset", SEC_ADMINISTRATOR, false, &HandleAddItemSetCommand, "", NULL }, { "additemset", SEC_ADMINISTRATOR, false, &HandleAddItemSetCommand, "" },
{ "bank", SEC_ADMINISTRATOR, false, &HandleBankCommand, "", NULL }, { "bank", SEC_ADMINISTRATOR, false, &HandleBankCommand, "" },
{ "wchange", SEC_ADMINISTRATOR, false, &HandleChangeWeather, "", NULL }, { "wchange", SEC_ADMINISTRATOR, false, &HandleChangeWeather, "" },
{ "maxskill", SEC_ADMINISTRATOR, false, &HandleMaxSkillCommand, "", NULL }, { "maxskill", SEC_ADMINISTRATOR, false, &HandleMaxSkillCommand, "" },
{ "setskill", SEC_ADMINISTRATOR, false, &HandleSetSkillCommand, "", NULL }, { "setskill", SEC_ADMINISTRATOR, false, &HandleSetSkillCommand, "" },
{ "pinfo", SEC_GAMEMASTER, true, &HandlePInfoCommand, "", NULL }, { "pinfo", SEC_GAMEMASTER, true, &HandlePInfoCommand, "" },
{ "respawn", SEC_ADMINISTRATOR, false, &HandleRespawnCommand, "", NULL }, { "respawn", SEC_ADMINISTRATOR, false, &HandleRespawnCommand, "" },
{ "send", SEC_GAMEMASTER, true, NULL, "", sendCommandTable }, { "send", SEC_GAMEMASTER, true, NULL, "", sendCommandTable },
{ "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable }, { "pet", SEC_GAMEMASTER, false, NULL, "", petCommandTable },
{ "mute", SEC_GAMEMASTER, true, &HandleMuteCommand, "", NULL }, { "mute", SEC_GAMEMASTER, true, &HandleMuteCommand, "" },
{ "unmute", SEC_GAMEMASTER, true, &HandleUnmuteCommand, "", NULL }, { "unmute", SEC_GAMEMASTER, true, &HandleUnmuteCommand, "" },
{ "movegens", SEC_ADMINISTRATOR, false, &HandleMovegensCommand, "", NULL }, { "movegens", SEC_ADMINISTRATOR, false, &HandleMovegensCommand, "" },
{ "cometome", SEC_ADMINISTRATOR, false, &HandleComeToMeCommand, "", NULL }, { "cometome", SEC_ADMINISTRATOR, false, &HandleComeToMeCommand, "" },
{ "damage", SEC_ADMINISTRATOR, false, &HandleDamageCommand, "", NULL }, { "damage", SEC_ADMINISTRATOR, false, &HandleDamageCommand, "" },
{ "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "", NULL }, { "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "" },
{ "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "", NULL }, { "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "" },
{ "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "", NULL }, { "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "" },
{ "waterwalk", SEC_GAMEMASTER, false, &HandleWaterwalkCommand, "", NULL }, { "waterwalk", SEC_GAMEMASTER, false, &HandleWaterwalkCommand, "" },
{ "freeze", SEC_GAMEMASTER, false, &HandleFreezeCommand, "", NULL }, { "freeze", SEC_GAMEMASTER, false, &HandleFreezeCommand, "" },
{ "unfreeze", SEC_GAMEMASTER, false, &HandleUnFreezeCommand, "", NULL }, { "unfreeze", SEC_GAMEMASTER, false, &HandleUnFreezeCommand, "" },
{ "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable }, { "group", SEC_ADMINISTRATOR, false, NULL, "", groupCommandTable },
{ "possess", SEC_ADMINISTRATOR, false, HandlePossessCommand, "", NULL }, { "possess", SEC_ADMINISTRATOR, false, HandlePossessCommand, "" },
{ "unpossess", SEC_ADMINISTRATOR, false, HandleUnPossessCommand, "", NULL }, { "unpossess", SEC_ADMINISTRATOR, false, HandleUnPossessCommand, "" },
{ "bindsight", SEC_ADMINISTRATOR, false, HandleBindSightCommand, "", NULL }, { "bindsight", SEC_ADMINISTRATOR, false, HandleBindSightCommand, "" },
{ "unbindsight", SEC_ADMINISTRATOR, false, HandleUnbindSightCommand, "", NULL }, { "unbindsight", SEC_ADMINISTRATOR, false, HandleUnbindSightCommand, "" },
{ "playall", SEC_GAMEMASTER, false, HandlePlayAllCommand, "", NULL }, { "playall", SEC_GAMEMASTER, false, HandlePlayAllCommand, "" },
{ "skirmish", SEC_ADMINISTRATOR, false, HandleSkirmishCommand, "", NULL }, { "skirmish", SEC_ADMINISTRATOR, false, HandleSkirmishCommand, "" },
{ "mailbox", SEC_ADMINISTRATOR, false, &HandleMailBoxCommand, "", NULL }, { "mailbox", SEC_ADMINISTRATOR, false, &HandleMailBoxCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -24,49 +24,49 @@ class modify_commandscript : public CommandScript
public: public:
modify_commandscript() : CommandScript("modify_commandscript") { } modify_commandscript() : CommandScript("modify_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand modifyspeedCommandTable[] = static std::vector<ChatCommand> modifyspeedCommandTable =
{ {
{ "fly", SEC_GAMEMASTER, false, &HandleModifyFlyCommand, "", NULL }, { "fly", SEC_GAMEMASTER, false, &HandleModifyFlyCommand, "" },
{ "all", SEC_GAMEMASTER, false, &HandleModifyASpeedCommand, "", NULL }, { "all", SEC_GAMEMASTER, false, &HandleModifyASpeedCommand, "" },
{ "walk", SEC_GAMEMASTER, false, &HandleModifySpeedCommand, "", NULL }, { "walk", SEC_GAMEMASTER, false, &HandleModifySpeedCommand, "" },
{ "backwalk", SEC_GAMEMASTER, false, &HandleModifyBWalkCommand, "", NULL }, { "backwalk", SEC_GAMEMASTER, false, &HandleModifyBWalkCommand, "" },
{ "swim", SEC_GAMEMASTER, false, &HandleModifySwimCommand, "", NULL }, { "swim", SEC_GAMEMASTER, false, &HandleModifySwimCommand, "" },
{ "", SEC_GAMEMASTER, false, &HandleModifyASpeedCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleModifyASpeedCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand modifyCommandTable[] = static std::vector<ChatCommand> modifyCommandTable =
{ {
{ "hp", SEC_GAMEMASTER, false, &HandleModifyHPCommand, "", NULL }, { "hp", SEC_GAMEMASTER, false, &HandleModifyHPCommand, "" },
{ "mana", SEC_GAMEMASTER, false, &HandleModifyManaCommand, "", NULL }, { "mana", SEC_GAMEMASTER, false, &HandleModifyManaCommand, "" },
{ "rage", SEC_GAMEMASTER, false, &HandleModifyRageCommand, "", NULL }, { "rage", SEC_GAMEMASTER, false, &HandleModifyRageCommand, "" },
{ "runicpower", SEC_GAMEMASTER, false, &HandleModifyRunicPowerCommand, "", NULL }, { "runicpower", SEC_GAMEMASTER, false, &HandleModifyRunicPowerCommand, "" },
{ "energy", SEC_GAMEMASTER, false, &HandleModifyEnergyCommand, "", NULL }, { "energy", SEC_GAMEMASTER, false, &HandleModifyEnergyCommand, "" },
{ "money", SEC_GAMEMASTER, false, &HandleModifyMoneyCommand, "", NULL }, { "money", SEC_GAMEMASTER, false, &HandleModifyMoneyCommand, "" },
{ "scale", SEC_GAMEMASTER, false, &HandleModifyScaleCommand, "", NULL }, { "scale", SEC_GAMEMASTER, false, &HandleModifyScaleCommand, "" },
{ "bit", SEC_GAMEMASTER, false, &HandleModifyBitCommand, "", NULL }, { "bit", SEC_GAMEMASTER, false, &HandleModifyBitCommand, "" },
{ "faction", SEC_GAMEMASTER, false, &HandleModifyFactionCommand, "", NULL }, { "faction", SEC_GAMEMASTER, false, &HandleModifyFactionCommand, "" },
{ "spell", SEC_GAMEMASTER, false, &HandleModifySpellCommand, "", NULL }, { "spell", SEC_GAMEMASTER, false, &HandleModifySpellCommand, "" },
{ "talentpoints", SEC_GAMEMASTER, false, &HandleModifyTalentCommand, "", NULL }, { "talentpoints", SEC_GAMEMASTER, false, &HandleModifyTalentCommand, "" },
{ "mount", SEC_GAMEMASTER, false, &HandleModifyMountCommand, "", NULL }, { "mount", SEC_GAMEMASTER, false, &HandleModifyMountCommand, "" },
{ "honor", SEC_GAMEMASTER, false, &HandleModifyHonorCommand, "", NULL }, { "honor", SEC_GAMEMASTER, false, &HandleModifyHonorCommand, "" },
{ "reputation", SEC_GAMEMASTER, false, &HandleModifyRepCommand, "", NULL }, { "reputation", SEC_GAMEMASTER, false, &HandleModifyRepCommand, "" },
{ "arenapoints", SEC_GAMEMASTER, false, &HandleModifyArenaCommand, "", NULL }, { "arenapoints", SEC_GAMEMASTER, false, &HandleModifyArenaCommand, "" },
{ "drunk", SEC_GAMEMASTER, false, &HandleModifyDrunkCommand, "", NULL }, { "drunk", SEC_GAMEMASTER, false, &HandleModifyDrunkCommand, "" },
{ "standstate", SEC_GAMEMASTER, false, &HandleModifyStandStateCommand, "", NULL }, { "standstate", SEC_GAMEMASTER, false, &HandleModifyStandStateCommand, "" },
{ "phase", SEC_ADMINISTRATOR, false, &HandleModifyPhaseCommand, "", NULL }, { "phase", SEC_ADMINISTRATOR, false, &HandleModifyPhaseCommand, "" },
{ "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "", NULL }, { "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "" },
{ "speed", SEC_GAMEMASTER, false, NULL, "", modifyspeedCommandTable }, { "speed", SEC_GAMEMASTER, false, NULL, "", modifyspeedCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "", NULL }, { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "" },
{ "demorph", SEC_GAMEMASTER, false, &HandleDeMorphCommand, "", NULL }, { "demorph", SEC_GAMEMASTER, false, &HandleDeMorphCommand, "" },
{ "modify", SEC_GAMEMASTER, false, NULL, "", modifyCommandTable }, { "modify", SEC_GAMEMASTER, false, NULL, "", modifyCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -63,73 +63,73 @@ class npc_commandscript : public CommandScript
public: public:
npc_commandscript() : CommandScript("npc_commandscript") { } npc_commandscript() : CommandScript("npc_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand npcAddCommandTable[] = static std::vector<ChatCommand> npcAddCommandTable =
{ {
{ "formation", SEC_GAMEMASTER, false, &HandleNpcAddFormationCommand, "", NULL }, { "formation", SEC_GAMEMASTER, false, &HandleNpcAddFormationCommand, "" },
{ "item", SEC_GAMEMASTER, false, &HandleNpcAddVendorItemCommand, "", NULL }, { "item", SEC_GAMEMASTER, false, &HandleNpcAddVendorItemCommand, "" },
{ "move", SEC_GAMEMASTER, false, &HandleNpcAddMoveCommand, "", NULL }, { "move", SEC_GAMEMASTER, false, &HandleNpcAddMoveCommand, "" },
{ "temp", SEC_GAMEMASTER, false, &HandleNpcAddTempSpawnCommand, "", NULL }, { "temp", SEC_GAMEMASTER, false, &HandleNpcAddTempSpawnCommand, "" },
//{ TODO: fix or remove this command //{ TODO: fix or remove this command
{ "weapon", SEC_ADMINISTRATOR, false, &HandleNpcAddWeaponCommand, "", NULL }, { "weapon", SEC_ADMINISTRATOR, false, &HandleNpcAddWeaponCommand, "" },
//} //}
{ "", SEC_GAMEMASTER, false, &HandleNpcAddCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleNpcAddCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand npcDeleteCommandTable[] = static std::vector<ChatCommand> npcDeleteCommandTable =
{ {
{ "item", SEC_GAMEMASTER, false, &HandleNpcDeleteVendorItemCommand, "", NULL }, { "item", SEC_GAMEMASTER, false, &HandleNpcDeleteVendorItemCommand, "" },
{ "", SEC_GAMEMASTER, false, &HandleNpcDeleteCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleNpcDeleteCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand npcFollowCommandTable[] = static std::vector<ChatCommand> npcFollowCommandTable =
{ {
{ "stop", SEC_GAMEMASTER, false, &HandleNpcUnFollowCommand, "", NULL }, { "stop", SEC_GAMEMASTER, false, &HandleNpcUnFollowCommand, "" },
{ "", SEC_GAMEMASTER, false, &HandleNpcFollowCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleNpcFollowCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand npcSetCommandTable[] = static std::vector<ChatCommand> npcSetCommandTable =
{ {
{ "allowmove", SEC_ADMINISTRATOR, false, &HandleNpcSetAllowMovementCommand, "", NULL }, { "allowmove", SEC_ADMINISTRATOR, false, &HandleNpcSetAllowMovementCommand, "" },
{ "entry", SEC_ADMINISTRATOR, false, &HandleNpcSetEntryCommand, "", NULL }, { "entry", SEC_ADMINISTRATOR, false, &HandleNpcSetEntryCommand, "" },
{ "factionid", SEC_GAMEMASTER, false, &HandleNpcSetFactionIdCommand, "", NULL }, { "factionid", SEC_GAMEMASTER, false, &HandleNpcSetFactionIdCommand, "" },
{ "flag", SEC_GAMEMASTER, false, &HandleNpcSetFlagCommand, "", NULL }, { "flag", SEC_GAMEMASTER, false, &HandleNpcSetFlagCommand, "" },
{ "level", SEC_GAMEMASTER, false, &HandleNpcSetLevelCommand, "", NULL }, { "level", SEC_GAMEMASTER, false, &HandleNpcSetLevelCommand, "" },
{ "link", SEC_GAMEMASTER, false, &HandleNpcSetLinkCommand, "", NULL }, { "link", SEC_GAMEMASTER, false, &HandleNpcSetLinkCommand, "" },
{ "model", SEC_GAMEMASTER, false, &HandleNpcSetModelCommand, "", NULL }, { "model", SEC_GAMEMASTER, false, &HandleNpcSetModelCommand, "" },
{ "movetype", SEC_GAMEMASTER, false, &HandleNpcSetMoveTypeCommand, "", NULL }, { "movetype", SEC_GAMEMASTER, false, &HandleNpcSetMoveTypeCommand, "" },
{ "phase", SEC_GAMEMASTER, false, &HandleNpcSetPhaseCommand, "", NULL }, { "phase", SEC_GAMEMASTER, false, &HandleNpcSetPhaseCommand, "" },
{ "spawndist", SEC_GAMEMASTER, false, &HandleNpcSetSpawnDistCommand, "", NULL }, { "spawndist", SEC_GAMEMASTER, false, &HandleNpcSetSpawnDistCommand, "" },
{ "spawntime", SEC_GAMEMASTER, false, &HandleNpcSetSpawnTimeCommand, "", NULL }, { "spawntime", SEC_GAMEMASTER, false, &HandleNpcSetSpawnTimeCommand, "" },
{ "data", SEC_ADMINISTRATOR, false, &HandleNpcSetDataCommand, "", NULL }, { "data", SEC_ADMINISTRATOR, false, &HandleNpcSetDataCommand, "" },
//{ TODO: fix or remove these commands //{ TODO: fix or remove these commands
{ "name", SEC_GAMEMASTER, false, &HandleNpcSetNameCommand, "", NULL }, { "name", SEC_GAMEMASTER, false, &HandleNpcSetNameCommand, "" },
{ "subname", SEC_GAMEMASTER, false, &HandleNpcSetSubNameCommand, "", NULL }, { "subname", SEC_GAMEMASTER, false, &HandleNpcSetSubNameCommand, "" },
//} //}
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand npcCommandTable[] = static std::vector<ChatCommand> npcCommandTable =
{ {
{ "info", SEC_ADMINISTRATOR, false, &HandleNpcInfoCommand, "", NULL }, { "info", SEC_ADMINISTRATOR, false, &HandleNpcInfoCommand, "" },
{ "near", SEC_GAMEMASTER, false, &HandleNpcNearCommand, "", NULL }, { "near", SEC_GAMEMASTER, false, &HandleNpcNearCommand, "" },
{ "move", SEC_GAMEMASTER, false, &HandleNpcMoveCommand, "", NULL }, { "move", SEC_GAMEMASTER, false, &HandleNpcMoveCommand, "" },
{ "playemote", SEC_ADMINISTRATOR, false, &HandleNpcPlayEmoteCommand, "", NULL }, { "playemote", SEC_ADMINISTRATOR, false, &HandleNpcPlayEmoteCommand, "" },
{ "say", SEC_GAMEMASTER, false, &HandleNpcSayCommand, "", NULL }, { "say", SEC_GAMEMASTER, false, &HandleNpcSayCommand, "" },
{ "textemote", SEC_GAMEMASTER, false, &HandleNpcTextEmoteCommand, "", NULL }, { "textemote", SEC_GAMEMASTER, false, &HandleNpcTextEmoteCommand, "" },
{ "whisper", SEC_GAMEMASTER, false, &HandleNpcWhisperCommand, "", NULL }, { "whisper", SEC_GAMEMASTER, false, &HandleNpcWhisperCommand, "" },
{ "yell", SEC_GAMEMASTER, false, &HandleNpcYellCommand, "", NULL }, { "yell", SEC_GAMEMASTER, false, &HandleNpcYellCommand, "" },
{ "tame", SEC_GAMEMASTER, false, &HandleNpcTameCommand, "", NULL }, { "tame", SEC_GAMEMASTER, false, &HandleNpcTameCommand, "" },
{ "add", SEC_GAMEMASTER, false, NULL, "", npcAddCommandTable }, { "add", SEC_GAMEMASTER, false, NULL, "", npcAddCommandTable },
{ "delete", SEC_GAMEMASTER, false, NULL, "", npcDeleteCommandTable }, { "delete", SEC_GAMEMASTER, false, NULL, "", npcDeleteCommandTable },
{ "follow", SEC_GAMEMASTER, false, NULL, "", npcFollowCommandTable }, { "follow", SEC_GAMEMASTER, false, NULL, "", npcFollowCommandTable },
{ "set", SEC_GAMEMASTER, false, NULL, "", npcSetCommandTable }, { "set", SEC_GAMEMASTER, false, NULL, "", npcSetCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "npc", SEC_GAMEMASTER, false, NULL, "", npcCommandTable }, { "npc", SEC_GAMEMASTER, false, NULL, "", npcCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -22,20 +22,20 @@ class quest_commandscript : public CommandScript
public: public:
quest_commandscript() : CommandScript("quest_commandscript") { } quest_commandscript() : CommandScript("quest_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand questCommandTable[] = static std::vector<ChatCommand> questCommandTable =
{ {
{ "add", SEC_ADMINISTRATOR, false, &HandleQuestAdd, "", NULL }, { "add", SEC_ADMINISTRATOR, false, &HandleQuestAdd, "" },
{ "complete", SEC_ADMINISTRATOR, false, &HandleQuestComplete, "", NULL }, { "complete", SEC_ADMINISTRATOR, false, &HandleQuestComplete, "" },
{ "remove", SEC_ADMINISTRATOR, false, &HandleQuestRemove, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &HandleQuestRemove, "" },
{ "reward", SEC_ADMINISTRATOR, false, &HandleQuestReward, "", NULL }, { "reward", SEC_ADMINISTRATOR, false, &HandleQuestReward, "" },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable }, { "quest", SEC_ADMINISTRATOR, false, NULL, "", questCommandTable },
{ NULL, SEC_PLAYER, false, NULL, "", NULL } { NULL, SEC_PLAYER, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -34,118 +34,118 @@ class reload_commandscript : public CommandScript
public: public:
reload_commandscript() : CommandScript("reload_commandscript") { } reload_commandscript() : CommandScript("reload_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand reloadAllCommandTable[] = static std::vector<ChatCommand> reloadAllCommandTable =
{ {
{ "achievement", SEC_ADMINISTRATOR, true, &HandleReloadAllAchievementCommand, "", NULL }, { "achievement", SEC_ADMINISTRATOR, true, &HandleReloadAllAchievementCommand, "" },
{ "area", SEC_ADMINISTRATOR, true, &HandleReloadAllAreaCommand, "", NULL }, { "area", SEC_ADMINISTRATOR, true, &HandleReloadAllAreaCommand, "" },
{ "gossips", SEC_ADMINISTRATOR, true, &HandleReloadAllGossipsCommand, "", NULL }, { "gossips", SEC_ADMINISTRATOR, true, &HandleReloadAllGossipsCommand, "" },
{ "item", SEC_ADMINISTRATOR, true, &HandleReloadAllItemCommand, "", NULL }, { "item", SEC_ADMINISTRATOR, true, &HandleReloadAllItemCommand, "" },
{ "locales", SEC_ADMINISTRATOR, true, &HandleReloadAllLocalesCommand, "", NULL }, { "locales", SEC_ADMINISTRATOR, true, &HandleReloadAllLocalesCommand, "" },
{ "loot", SEC_ADMINISTRATOR, true, &HandleReloadAllLootCommand, "", NULL }, { "loot", SEC_ADMINISTRATOR, true, &HandleReloadAllLootCommand, "" },
{ "npc", SEC_ADMINISTRATOR, true, &HandleReloadAllNpcCommand, "", NULL }, { "npc", SEC_ADMINISTRATOR, true, &HandleReloadAllNpcCommand, "" },
{ "quest", SEC_ADMINISTRATOR, true, &HandleReloadAllQuestCommand, "", NULL }, { "quest", SEC_ADMINISTRATOR, true, &HandleReloadAllQuestCommand, "" },
{ "scripts", SEC_ADMINISTRATOR, true, &HandleReloadAllScriptsCommand, "", NULL }, { "scripts", SEC_ADMINISTRATOR, true, &HandleReloadAllScriptsCommand, "" },
{ "spell", SEC_ADMINISTRATOR, true, &HandleReloadAllSpellCommand, "", NULL }, { "spell", SEC_ADMINISTRATOR, true, &HandleReloadAllSpellCommand, "" },
{ "", SEC_ADMINISTRATOR, true, &HandleReloadAllCommand, "", NULL }, { "", SEC_ADMINISTRATOR, true, &HandleReloadAllCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand reloadCommandTable[] = static std::vector<ChatCommand> reloadCommandTable =
{ {
{ "auctions", SEC_ADMINISTRATOR, true, &HandleReloadAuctionsCommand, "", NULL }, { "auctions", SEC_ADMINISTRATOR, true, &HandleReloadAuctionsCommand, "" },
{ "access_requirement", SEC_ADMINISTRATOR, true, &HandleReloadAccessRequirementCommand, "", NULL }, { "access_requirement", SEC_ADMINISTRATOR, true, &HandleReloadAccessRequirementCommand, "" },
{ "achievement_criteria_data", SEC_ADMINISTRATOR, true, &HandleReloadAchievementCriteriaDataCommand, "", NULL }, { "achievement_criteria_data", SEC_ADMINISTRATOR, true, &HandleReloadAchievementCriteriaDataCommand, "" },
{ "achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadAchievementRewardCommand, "", NULL }, { "achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadAchievementRewardCommand, "" },
{ "all", SEC_ADMINISTRATOR, true, NULL, "", reloadAllCommandTable }, { "all", SEC_ADMINISTRATOR, true, NULL, "", reloadAllCommandTable },
{ "areatrigger_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadQuestAreaTriggersCommand, "", NULL }, { "areatrigger_involvedrelation", SEC_ADMINISTRATOR, true, &HandleReloadQuestAreaTriggersCommand, "" },
{ "areatrigger_tavern", SEC_ADMINISTRATOR, true, &HandleReloadAreaTriggerTavernCommand, "", NULL }, { "areatrigger_tavern", SEC_ADMINISTRATOR, true, &HandleReloadAreaTriggerTavernCommand, "" },
{ "areatrigger_teleport", SEC_ADMINISTRATOR, true, &HandleReloadAreaTriggerTeleportCommand, "", NULL }, { "areatrigger_teleport", SEC_ADMINISTRATOR, true, &HandleReloadAreaTriggerTeleportCommand, "" },
{ "autobroadcast", SEC_ADMINISTRATOR, true, &HandleReloadAutobroadcastCommand, "", NULL }, { "autobroadcast", SEC_ADMINISTRATOR, true, &HandleReloadAutobroadcastCommand, "" },
{ "command", SEC_ADMINISTRATOR, true, &HandleReloadCommandCommand, "", NULL }, { "command", SEC_ADMINISTRATOR, true, &HandleReloadCommandCommand, "" },
{ "conditions", SEC_ADMINISTRATOR, true, &HandleReloadConditions, "", NULL }, { "conditions", SEC_ADMINISTRATOR, true, &HandleReloadConditions, "" },
{ "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "", NULL }, { "config", SEC_ADMINISTRATOR, true, &HandleReloadConfigCommand, "" },
{ "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "", NULL }, { "creature_text", SEC_ADMINISTRATOR, true, &HandleReloadCreatureText, "" },
{ "creature_questender", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestEnderCommand, "", NULL }, { "creature_questender", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestEnderCommand, "" },
{ "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "", NULL }, { "creature_linked_respawn", SEC_GAMEMASTER, true, &HandleReloadLinkedRespawnCommand, "" },
{ "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "", NULL }, { "creature_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesCreatureCommand, "" },
{ "creature_onkill_reputation", SEC_ADMINISTRATOR, true, &HandleReloadOnKillReputationCommand, "", NULL }, { "creature_onkill_reputation", SEC_ADMINISTRATOR, true, &HandleReloadOnKillReputationCommand, "" },
{ "creature_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestStarterCommand, "", NULL }, { "creature_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadCreatureQuestStarterCommand, "" },
{ "creature_template", SEC_ADMINISTRATOR, true, &HandleReloadCreatureTemplateCommand, "", NULL }, { "creature_template", SEC_ADMINISTRATOR, true, &HandleReloadCreatureTemplateCommand, "" },
//{ "db_script_string", SEC_ADMINISTRATOR, true, &HandleReloadDbScriptStringCommand, "", NULL }, //{ "db_script_string", SEC_ADMINISTRATOR, true, &HandleReloadDbScriptStringCommand, "" },
{ "disables", SEC_ADMINISTRATOR, true, &HandleReloadDisablesCommand, "", NULL }, { "disables", SEC_ADMINISTRATOR, true, &HandleReloadDisablesCommand, "" },
{ "disenchant_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesDisenchantCommand, "", NULL }, { "disenchant_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesDisenchantCommand, "" },
{ "event_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventScriptsCommand, "", NULL }, { "event_scripts", SEC_ADMINISTRATOR, true, &HandleReloadEventScriptsCommand, "" },
{ "fishing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesFishingCommand, "", NULL }, { "fishing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesFishingCommand, "" },
{ "game_graveyard_zone", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardZoneCommand, "", NULL }, { "game_graveyard_zone", SEC_ADMINISTRATOR, true, &HandleReloadGameGraveyardZoneCommand, "" },
{ "game_tele", SEC_ADMINISTRATOR, true, &HandleReloadGameTeleCommand, "", NULL }, { "game_tele", SEC_ADMINISTRATOR, true, &HandleReloadGameTeleCommand, "" },
{ "gameobject_questender", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestEnderCommand, "", NULL }, { "gameobject_questender", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestEnderCommand, "" },
{ "gameobject_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesGameobjectCommand, "", NULL }, { "gameobject_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesGameobjectCommand, "" },
{ "gameobject_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestStarterCommand, "", NULL }, { "gameobject_queststarter", SEC_ADMINISTRATOR, true, &HandleReloadGOQuestStarterCommand, "" },
{ "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "", NULL }, { "gm_tickets", SEC_ADMINISTRATOR, true, &HandleReloadGMTicketsCommand, "" },
{ "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "", NULL }, { "gossip_menu", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuCommand, "" },
{ "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "", NULL }, { "gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadGossipMenuOptionCommand, "" },
{ "item_enchantment_template", SEC_ADMINISTRATOR, true, &HandleReloadItemEnchantementsCommand, "", NULL }, { "item_enchantment_template", SEC_ADMINISTRATOR, true, &HandleReloadItemEnchantementsCommand, "" },
{ "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "", NULL }, { "item_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesItemCommand, "" },
{ "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "", NULL }, { "item_set_names", SEC_ADMINISTRATOR, true, &HandleReloadItemSetNamesCommand, "" },
{ "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "", NULL }, { "lfg_dungeon_rewards", SEC_ADMINISTRATOR, true, &HandleReloadLfgRewardsCommand, "" },
{ "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "", NULL }, { "locales_achievement_reward", SEC_ADMINISTRATOR, true, &HandleReloadLocalesAchievementRewardCommand, "" },
{ "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "", NULL }, { "locales_creature", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureCommand, "" },
{ "locales_creature_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureTextCommand, "", NULL }, { "locales_creature_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesCreatureTextCommand, "" },
{ "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "", NULL }, { "locales_gameobject", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGameobjectCommand, "" },
{ "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "", NULL }, { "locales_gossip_menu_option", SEC_ADMINISTRATOR, true, &HandleReloadLocalesGossipMenuOptionCommand, "" },
{ "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "", NULL }, { "locales_item", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemCommand, "" },
{ "locales_item_set_name", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "", NULL }, { "locales_item_set_name", SEC_ADMINISTRATOR, true, &HandleReloadLocalesItemSetNameCommand, "" },
{ "locales_npc_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "", NULL }, { "locales_npc_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesNpcTextCommand, "" },
{ "locales_page_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "", NULL }, { "locales_page_text", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPageTextCommand, "" },
{ "locales_points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "", NULL }, { "locales_points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesPointsOfInterestCommand, "" },
{ "locales_quest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesQuestCommand, "", NULL }, { "locales_quest", SEC_ADMINISTRATOR, true, &HandleReloadLocalesQuestCommand, "" },
{ "mail_level_reward", SEC_ADMINISTRATOR, true, &HandleReloadMailLevelRewardCommand, "", NULL }, { "mail_level_reward", SEC_ADMINISTRATOR, true, &HandleReloadMailLevelRewardCommand, "" },
{ "mail_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMailCommand, "", NULL }, { "mail_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMailCommand, "" },
{ "milling_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMillingCommand, "", NULL }, { "milling_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesMillingCommand, "" },
{ "npc_spellclick_spells", SEC_ADMINISTRATOR, true, &HandleReloadSpellClickSpellsCommand, "", NULL}, { "npc_spellclick_spells", SEC_ADMINISTRATOR, true, &HandleReloadSpellClickSpellsCommand, "", NULL},
{ "npc_trainer", SEC_ADMINISTRATOR, true, &HandleReloadNpcTrainerCommand, "", NULL }, { "npc_trainer", SEC_ADMINISTRATOR, true, &HandleReloadNpcTrainerCommand, "" },
{ "npc_vendor", SEC_ADMINISTRATOR, true, &HandleReloadNpcVendorCommand, "", NULL }, { "npc_vendor", SEC_ADMINISTRATOR, true, &HandleReloadNpcVendorCommand, "" },
{ "page_text", SEC_ADMINISTRATOR, true, &HandleReloadPageTextsCommand, "", NULL }, { "page_text", SEC_ADMINISTRATOR, true, &HandleReloadPageTextsCommand, "" },
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL}, { "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
{ "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL }, { "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "" },
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL }, { "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "" },
{ "quest_poi", SEC_ADMINISTRATOR, true, &HandleReloadQuestPOICommand, "", NULL }, { "quest_poi", SEC_ADMINISTRATOR, true, &HandleReloadQuestPOICommand, "" },
{ "quest_template", SEC_ADMINISTRATOR, true, &HandleReloadQuestTemplateCommand, "", NULL }, { "quest_template", SEC_ADMINISTRATOR, true, &HandleReloadQuestTemplateCommand, "" },
{ "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL }, { "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "" },
{ "reserved_name", SEC_ADMINISTRATOR, true, &HandleReloadReservedNameCommand, "", NULL }, { "reserved_name", SEC_ADMINISTRATOR, true, &HandleReloadReservedNameCommand, "" },
{ "reputation_reward_rate", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "", NULL }, { "reputation_reward_rate", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "" },
{ "reputation_spillover_template", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "", NULL }, { "reputation_spillover_template", SEC_ADMINISTRATOR, true, &HandleReloadReputationRewardRateCommand, "" },
{ "skill_discovery_template", SEC_ADMINISTRATOR, true, &HandleReloadSkillDiscoveryTemplateCommand, "", NULL }, { "skill_discovery_template", SEC_ADMINISTRATOR, true, &HandleReloadSkillDiscoveryTemplateCommand, "" },
{ "skill_extra_item_template", SEC_ADMINISTRATOR, true, &HandleReloadSkillExtraItemTemplateCommand, "", NULL }, { "skill_extra_item_template", SEC_ADMINISTRATOR, true, &HandleReloadSkillExtraItemTemplateCommand, "" },
{ "skill_fishing_base_level", SEC_ADMINISTRATOR, true, &HandleReloadSkillFishingBaseLevelCommand, "", NULL }, { "skill_fishing_base_level", SEC_ADMINISTRATOR, true, &HandleReloadSkillFishingBaseLevelCommand, "" },
{ "skinning_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesSkinningCommand, "", NULL }, { "skinning_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesSkinningCommand, "" },
{ "smart_scripts", SEC_ADMINISTRATOR, true, &HandleReloadSmartScripts, "", NULL }, { "smart_scripts", SEC_ADMINISTRATOR, true, &HandleReloadSmartScripts, "" },
{ "spell_required", SEC_ADMINISTRATOR, true, &HandleReloadSpellRequiredCommand, "", NULL }, { "spell_required", SEC_ADMINISTRATOR, true, &HandleReloadSpellRequiredCommand, "" },
{ "spell_area", SEC_ADMINISTRATOR, true, &HandleReloadSpellAreaCommand, "", NULL }, { "spell_area", SEC_ADMINISTRATOR, true, &HandleReloadSpellAreaCommand, "" },
{ "spell_bonus_data", SEC_ADMINISTRATOR, true, &HandleReloadSpellBonusesCommand, "", NULL }, { "spell_bonus_data", SEC_ADMINISTRATOR, true, &HandleReloadSpellBonusesCommand, "" },
{ "spell_group", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupsCommand, "", NULL }, { "spell_group", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupsCommand, "" },
{ "spell_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesSpellCommand, "", NULL }, { "spell_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesSpellCommand, "" },
{ "spell_linked_spell", SEC_ADMINISTRATOR, true, &HandleReloadSpellLinkedSpellCommand, "", NULL }, { "spell_linked_spell", SEC_ADMINISTRATOR, true, &HandleReloadSpellLinkedSpellCommand, "" },
{ "spell_pet_auras", SEC_ADMINISTRATOR, true, &HandleReloadSpellPetAurasCommand, "", NULL }, { "spell_pet_auras", SEC_ADMINISTRATOR, true, &HandleReloadSpellPetAurasCommand, "" },
{ "spell_proc_event", SEC_ADMINISTRATOR, true, &HandleReloadSpellProcEventCommand, "", NULL }, { "spell_proc_event", SEC_ADMINISTRATOR, true, &HandleReloadSpellProcEventCommand, "" },
{ "spell_proc", SEC_ADMINISTRATOR, true, &HandleReloadSpellProcsCommand, "", NULL }, { "spell_proc", SEC_ADMINISTRATOR, true, &HandleReloadSpellProcsCommand, "" },
{ "spell_scripts", SEC_ADMINISTRATOR, true, &HandleReloadSpellScriptsCommand, "", NULL }, { "spell_scripts", SEC_ADMINISTRATOR, true, &HandleReloadSpellScriptsCommand, "" },
{ "spell_target_position", SEC_ADMINISTRATOR, true, &HandleReloadSpellTargetPositionCommand, "", NULL }, { "spell_target_position", SEC_ADMINISTRATOR, true, &HandleReloadSpellTargetPositionCommand, "" },
{ "spell_threats", SEC_ADMINISTRATOR, true, &HandleReloadSpellThreatsCommand, "", NULL }, { "spell_threats", SEC_ADMINISTRATOR, true, &HandleReloadSpellThreatsCommand, "" },
{ "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "", NULL }, { "spell_group_stack_rules", SEC_ADMINISTRATOR, true, &HandleReloadSpellGroupStackRulesCommand, "" },
{ "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "", NULL }, { "trinity_string", SEC_ADMINISTRATOR, true, &HandleReloadTrinityStringCommand, "" },
{ "warden_action", SEC_ADMINISTRATOR, true, &HandleReloadWardenactionCommand, "", NULL }, { "warden_action", SEC_ADMINISTRATOR, true, &HandleReloadWardenactionCommand, "" },
{ "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "", NULL }, { "waypoint_scripts", SEC_ADMINISTRATOR, true, &HandleReloadWpScriptsCommand, "" },
{ "waypoint_data", SEC_ADMINISTRATOR, true, &HandleReloadWpCommand, "", NULL }, { "waypoint_data", SEC_ADMINISTRATOR, true, &HandleReloadWpCommand, "" },
{ "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "", NULL }, { "vehicle_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleAccessoryCommand, "" },
{ "vehicle_template_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleTemplateAccessoryCommand, "", NULL }, { "vehicle_template_accessory", SEC_ADMINISTRATOR, true, &HandleReloadVehicleTemplateAccessoryCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable }, { "reload", SEC_ADMINISTRATOR, true, NULL, "", reloadCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -24,23 +24,23 @@ class reset_commandscript : public CommandScript
public: public:
reset_commandscript() : CommandScript("reset_commandscript") { } reset_commandscript() : CommandScript("reset_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand resetCommandTable[] = static std::vector<ChatCommand> resetCommandTable =
{ {
{ "achievements", SEC_ADMINISTRATOR, true, &HandleResetAchievementsCommand, "", NULL }, { "achievements", SEC_ADMINISTRATOR, true, &HandleResetAchievementsCommand, "" },
{ "honor", SEC_ADMINISTRATOR, true, &HandleResetHonorCommand, "", NULL }, { "honor", SEC_ADMINISTRATOR, true, &HandleResetHonorCommand, "" },
{ "level", SEC_ADMINISTRATOR, true, &HandleResetLevelCommand, "", NULL }, { "level", SEC_ADMINISTRATOR, true, &HandleResetLevelCommand, "" },
{ "spells", SEC_ADMINISTRATOR, true, &HandleResetSpellsCommand, "", NULL }, { "spells", SEC_ADMINISTRATOR, true, &HandleResetSpellsCommand, "" },
{ "stats", SEC_ADMINISTRATOR, true, &HandleResetStatsCommand, "", NULL }, { "stats", SEC_ADMINISTRATOR, true, &HandleResetStatsCommand, "" },
{ "talents", SEC_ADMINISTRATOR, true, &HandleResetTalentsCommand, "", NULL }, { "talents", SEC_ADMINISTRATOR, true, &HandleResetTalentsCommand, "" },
{ "all", SEC_ADMINISTRATOR, true, &HandleResetAllCommand, "", NULL }, { "all", SEC_ADMINISTRATOR, true, &HandleResetAllCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable }, { "reset", SEC_ADMINISTRATOR, true, NULL, "", resetCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -25,65 +25,65 @@ class server_commandscript : public CommandScript
public: public:
server_commandscript() : CommandScript("server_commandscript") { } server_commandscript() : CommandScript("server_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand serverIdleRestartCommandTable[] = static std::vector<ChatCommand> serverIdleRestartCommandTable =
{ {
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
{ "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "", NULL }, { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleRestartCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand serverIdleShutdownCommandTable[] = static std::vector<ChatCommand> serverIdleShutdownCommandTable =
{ {
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
{ "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "", NULL }, { "" , SEC_ADMINISTRATOR, true, &HandleServerIdleShutDownCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand serverRestartCommandTable[] = static std::vector<ChatCommand> serverRestartCommandTable =
{ {
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
{ "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "", NULL }, { "" , SEC_ADMINISTRATOR, true, &HandleServerRestartCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand serverShutdownCommandTable[] = static std::vector<ChatCommand> serverShutdownCommandTable =
{ {
{ "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "", NULL }, { "cancel", SEC_ADMINISTRATOR, true, &HandleServerShutDownCancelCommand, "" },
{ "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "", NULL }, { "" , SEC_ADMINISTRATOR, true, &HandleServerShutDownCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand serverSetCommandTable[] = static std::vector<ChatCommand> serverSetCommandTable =
{ {
{ "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "", NULL }, { "difftime", SEC_CONSOLE, true, &HandleServerSetDiffTimeCommand, "" },
{ "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "", NULL }, { "loglevel", SEC_CONSOLE, true, &HandleServerSetLogLevelCommand, "" },
{ "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "", NULL }, { "logfilelevel", SEC_CONSOLE, true, &HandleServerSetLogFileLevelCommand, "" },
{ "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "", NULL }, { "motd", SEC_ADMINISTRATOR, true, &HandleServerSetMotdCommand, "" },
{ "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "", NULL }, { "closed", SEC_ADMINISTRATOR, true, &HandleServerSetClosedCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand serverCommandTable[] = static std::vector<ChatCommand> serverCommandTable =
{ {
{ "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "", NULL }, { "corpses", SEC_GAMEMASTER, true, &HandleServerCorpsesCommand, "" },
{ "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "", NULL }, { "exit", SEC_CONSOLE, true, &HandleServerExitCommand, "" },
{ "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable }, { "idlerestart", SEC_ADMINISTRATOR, true, NULL, "", serverIdleRestartCommandTable },
{ "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable }, { "idleshutdown", SEC_ADMINISTRATOR, true, NULL, "", serverIdleShutdownCommandTable },
{ "info", SEC_PLAYER, true, &HandleServerInfoCommand, "", NULL }, { "info", SEC_PLAYER, true, &HandleServerInfoCommand, "" },
{ "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "", NULL }, { "motd", SEC_PLAYER, true, &HandleServerMotdCommand, "" },
{ "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable }, { "restart", SEC_ADMINISTRATOR, true, NULL, "", serverRestartCommandTable },
{ "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable }, { "shutdown", SEC_ADMINISTRATOR, true, NULL, "", serverShutdownCommandTable },
{ "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable }, { "set", SEC_ADMINISTRATOR, true, NULL, "", serverSetCommandTable },
{ "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "", NULL }, { "togglequerylog", SEC_CONSOLE, true, &HandleServerToggleQueryLogging, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable }, { "server", SEC_ADMINISTRATOR, true, NULL, "", serverCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -16,22 +16,22 @@ class spectator_commandscript : public CommandScript
public: public:
spectator_commandscript() : CommandScript("spectator_commandscript") { } spectator_commandscript() : CommandScript("spectator_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand spectatorCommandTable[] = static std::vector<ChatCommand> spectatorCommandTable =
{ {
{ "version", SEC_CONSOLE, false, &HandleSpectatorVersionCommand, "", NULL }, { "version", SEC_CONSOLE, false, &HandleSpectatorVersionCommand, "" },
{ "reset", SEC_CONSOLE, false, &HandleSpectatorResetCommand, "", NULL }, { "reset", SEC_CONSOLE, false, &HandleSpectatorResetCommand, "" },
{ "spectate", SEC_CONSOLE, false, &ArenaSpectator::HandleSpectatorSpectateCommand, "", NULL }, { "spectate", SEC_CONSOLE, false, &ArenaSpectator::HandleSpectatorSpectateCommand, "" },
{ "watch", SEC_CONSOLE, false, &ArenaSpectator::HandleSpectatorWatchCommand, "", NULL }, { "watch", SEC_CONSOLE, false, &ArenaSpectator::HandleSpectatorWatchCommand, "" },
{ "leave", SEC_CONSOLE, false, &HandleSpectatorLeaveCommand, "", NULL }, { "leave", SEC_CONSOLE, false, &HandleSpectatorLeaveCommand, "" },
{ "", SEC_CONSOLE, false, &HandleSpectatorCommand, "", NULL }, { "", SEC_CONSOLE, false, &HandleSpectatorCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "spect", SEC_CONSOLE, false, NULL, "", spectatorCommandTable }, { "spect", SEC_CONSOLE, false, NULL, "", spectatorCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -24,21 +24,21 @@ class tele_commandscript : public CommandScript
public: public:
tele_commandscript() : CommandScript("tele_commandscript") { } tele_commandscript() : CommandScript("tele_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand teleCommandTable[] = static std::vector<ChatCommand> teleCommandTable =
{ {
{ "add", SEC_ADMINISTRATOR, false, &HandleTeleAddCommand, "", NULL }, { "add", SEC_ADMINISTRATOR, false, &HandleTeleAddCommand, "" },
{ "del", SEC_ADMINISTRATOR, true, &HandleTeleDelCommand, "", NULL }, { "del", SEC_ADMINISTRATOR, true, &HandleTeleDelCommand, "" },
{ "name", SEC_GAMEMASTER, true, &HandleTeleNameCommand, "", NULL }, { "name", SEC_GAMEMASTER, true, &HandleTeleNameCommand, "" },
{ "group", SEC_GAMEMASTER, false, &HandleTeleGroupCommand, "", NULL }, { "group", SEC_GAMEMASTER, false, &HandleTeleGroupCommand, "" },
{ "", SEC_GAMEMASTER, false, &HandleTeleCommand, "", NULL }, { "", SEC_GAMEMASTER, false, &HandleTeleCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "tele", SEC_GAMEMASTER, false, NULL, "", teleCommandTable }, { "tele", SEC_GAMEMASTER, false, NULL, "", teleCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -25,38 +25,38 @@ class ticket_commandscript : public CommandScript
public: public:
ticket_commandscript() : CommandScript("ticket_commandscript") { } ticket_commandscript() : CommandScript("ticket_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand ticketResponseCommandTable[] = static std::vector<ChatCommand> ticketResponseCommandTable =
{ {
{ "append", SEC_GAMEMASTER, true, &HandleGMTicketResponseAppendCommand, "", NULL }, { "append", SEC_GAMEMASTER, true, &HandleGMTicketResponseAppendCommand, "" },
{ "appendln", SEC_GAMEMASTER, true, &HandleGMTicketResponseAppendLnCommand, "", NULL }, { "appendln", SEC_GAMEMASTER, true, &HandleGMTicketResponseAppendLnCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand ticketCommandTable[] = static std::vector<ChatCommand> ticketCommandTable =
{ {
{ "assign", SEC_GAMEMASTER, true, &HandleGMTicketAssignToCommand, "", NULL }, { "assign", SEC_GAMEMASTER, true, &HandleGMTicketAssignToCommand, "" },
{ "close", SEC_GAMEMASTER, true, &HandleGMTicketCloseByIdCommand, "", NULL }, { "close", SEC_GAMEMASTER, true, &HandleGMTicketCloseByIdCommand, "" },
{ "closedlist", SEC_GAMEMASTER, true, &HandleGMTicketListClosedCommand, "", NULL }, { "closedlist", SEC_GAMEMASTER, true, &HandleGMTicketListClosedCommand, "" },
{ "comment", SEC_GAMEMASTER, true, &HandleGMTicketCommentCommand, "", NULL }, { "comment", SEC_GAMEMASTER, true, &HandleGMTicketCommentCommand, "" },
{ "complete", SEC_GAMEMASTER, true, &HandleGMTicketCompleteCommand, "", NULL }, { "complete", SEC_GAMEMASTER, true, &HandleGMTicketCompleteCommand, "" },
{ "delete", SEC_ADMINISTRATOR, true, &HandleGMTicketDeleteByIdCommand, "", NULL }, { "delete", SEC_ADMINISTRATOR, true, &HandleGMTicketDeleteByIdCommand, "" },
{ "escalate", SEC_GAMEMASTER, true, &HandleGMTicketEscalateCommand, "", NULL }, { "escalate", SEC_GAMEMASTER, true, &HandleGMTicketEscalateCommand, "" },
{ "escalatedlist", SEC_GAMEMASTER, true, &HandleGMTicketListEscalatedCommand, "", NULL }, { "escalatedlist", SEC_GAMEMASTER, true, &HandleGMTicketListEscalatedCommand, "" },
{ "list", SEC_GAMEMASTER, true, &HandleGMTicketListCommand, "", NULL }, { "list", SEC_GAMEMASTER, true, &HandleGMTicketListCommand, "" },
{ "onlinelist", SEC_GAMEMASTER, true, &HandleGMTicketListOnlineCommand, "", NULL }, { "onlinelist", SEC_GAMEMASTER, true, &HandleGMTicketListOnlineCommand, "" },
{ "reset", SEC_ADMINISTRATOR, true, &HandleGMTicketResetCommand, "", NULL }, { "reset", SEC_ADMINISTRATOR, true, &HandleGMTicketResetCommand, "" },
{ "response", SEC_GAMEMASTER, true, NULL, "", ticketResponseCommandTable }, { "response", SEC_GAMEMASTER, true, NULL, "", ticketResponseCommandTable },
{ "togglesystem", SEC_ADMINISTRATOR, true, &HandleToggleGMTicketSystem, "", NULL }, { "togglesystem", SEC_ADMINISTRATOR, true, &HandleToggleGMTicketSystem, "" },
{ "unassign", SEC_GAMEMASTER, true, &HandleGMTicketUnAssignCommand, "", NULL }, { "unassign", SEC_GAMEMASTER, true, &HandleGMTicketUnAssignCommand, "" },
{ "viewid", SEC_GAMEMASTER, true, &HandleGMTicketGetByIdCommand, "", NULL }, { "viewid", SEC_GAMEMASTER, true, &HandleGMTicketGetByIdCommand, "" },
{ "viewname", SEC_GAMEMASTER, true, &HandleGMTicketGetByNameCommand, "", NULL }, { "viewname", SEC_GAMEMASTER, true, &HandleGMTicketGetByNameCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "ticket", SEC_GAMEMASTER, false, NULL, "", ticketCommandTable }, { "ticket", SEC_GAMEMASTER, false, NULL, "", ticketCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -22,25 +22,25 @@ class titles_commandscript : public CommandScript
public: public:
titles_commandscript() : CommandScript("titles_commandscript") { } titles_commandscript() : CommandScript("titles_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand titlesSetCommandTable[] = static std::vector<ChatCommand> titlesSetCommandTable =
{ {
{ "mask", SEC_GAMEMASTER, false, &HandleTitlesSetMaskCommand, "", NULL }, { "mask", SEC_GAMEMASTER, false, &HandleTitlesSetMaskCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand titlesCommandTable[] = static std::vector<ChatCommand> titlesCommandTable =
{ {
{ "add", SEC_GAMEMASTER, false, &HandleTitlesAddCommand, "", NULL }, { "add", SEC_GAMEMASTER, false, &HandleTitlesAddCommand, "" },
{ "current", SEC_GAMEMASTER, false, &HandleTitlesCurrentCommand, "", NULL }, { "current", SEC_GAMEMASTER, false, &HandleTitlesCurrentCommand, "" },
{ "remove", SEC_GAMEMASTER, false, &HandleTitlesRemoveCommand, "", NULL }, { "remove", SEC_GAMEMASTER, false, &HandleTitlesRemoveCommand, "" },
{ "set", SEC_GAMEMASTER, false, NULL, "", titlesSetCommandTable }, { "set", SEC_GAMEMASTER, false, NULL, "", titlesSetCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "titles", SEC_GAMEMASTER, false, NULL, "", titlesCommandTable }, { "titles", SEC_GAMEMASTER, false, NULL, "", titlesCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -23,23 +23,23 @@ class wp_commandscript : public CommandScript
public: public:
wp_commandscript() : CommandScript("wp_commandscript") { } wp_commandscript() : CommandScript("wp_commandscript") { }
ChatCommand* GetCommands() const std::vector<ChatCommand> GetCommands() const override
{ {
static ChatCommand wpCommandTable[] = static std::vector<ChatCommand> wpCommandTable =
{ {
{ "add", SEC_GAMEMASTER, false, &HandleWpAddCommand, "", NULL }, { "add", SEC_GAMEMASTER, false, &HandleWpAddCommand, "" },
{ "event", SEC_GAMEMASTER, false, &HandleWpEventCommand, "", NULL }, { "event", SEC_GAMEMASTER, false, &HandleWpEventCommand, "" },
{ "load", SEC_GAMEMASTER, false, &HandleWpLoadCommand, "", NULL }, { "load", SEC_GAMEMASTER, false, &HandleWpLoadCommand, "" },
{ "modify", SEC_GAMEMASTER, false, &HandleWpModifyCommand, "", NULL }, { "modify", SEC_GAMEMASTER, false, &HandleWpModifyCommand, "" },
{ "unload", SEC_GAMEMASTER, false, &HandleWpUnLoadCommand, "", NULL }, { "unload", SEC_GAMEMASTER, false, &HandleWpUnLoadCommand, "" },
{ "reload", SEC_ADMINISTRATOR, false, &HandleWpReloadCommand, "", NULL }, { "reload", SEC_ADMINISTRATOR, false, &HandleWpReloadCommand, "" },
{ "show", SEC_GAMEMASTER, false, &HandleWpShowCommand, "", NULL }, { "show", SEC_GAMEMASTER, false, &HandleWpShowCommand, "" },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
static ChatCommand commandTable[] = static std::vector<ChatCommand> commandTable =
{ {
{ "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable }, { "wp", SEC_GAMEMASTER, false, NULL, "", wpCommandTable },
{ NULL, 0, false, NULL, "", NULL } { NULL, 0, false, NULL, "" }
}; };
return commandTable; return commandTable;
} }

View File

@@ -29,9 +29,9 @@
char* command_finder(const char* text, int state) char* command_finder(const char* text, int state)
{ {
static int idx, len; static size_t idx, len;
const char* ret; const char* ret;
ChatCommand* cmd = ChatHandler::getCommandTable(); std::vector<ChatCommand> const& cmd = ChatHandler::getCommandTable();
if (!state) if (!state)
{ {
@@ -39,20 +39,18 @@ char* command_finder(const char* text, int state)
len = strlen(text); len = strlen(text);
} }
while ((ret = cmd[idx].Name)) while (idx < cmd.size())
{ {
if (!cmd[idx].AllowConsole) if (!cmd[idx].AllowConsole)
{ {
idx++; ++idx;
continue; continue;
} }
idx++; ++idx;
//printf("Checking %s \n", cmd[idx].Name); //printf("Checking %s \n", cmd[idx].Name);
if (strncmp(ret, text, len) == 0) if (strncmp(ret, text, len) == 0)
return strdup(ret); return strdup(ret);
if (cmd[idx].Name == NULL)
break;
} }
return ((char*)NULL); return ((char*)NULL);