summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/configreader.cpp3
-rw-r--r--src/coremods/core_info/cmd_commands.cpp5
-rw-r--r--src/coremods/core_stats.cpp7
-rw-r--r--src/modules/m_abbreviation.cpp3
4 files changed, 12 insertions, 6 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 1ac075557..945600e6c 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -69,7 +69,8 @@ bool ServerConfig::ApplyDisabledCommands(const std::string& data)
std::string thiscmd;
/* Enable everything first */
- for (Commandtable::iterator x = ServerInstance->Parser->cmdlist.begin(); x != ServerInstance->Parser->cmdlist.end(); x++)
+ const CommandParser::CommandMap& commands = ServerInstance->Parser->GetCommands();
+ for (CommandParser::CommandMap::const_iterator x = commands.begin(); x != commands.end(); ++x)
x->second->Disable(false);
/* Now disable all the ones which the user wants disabled */
diff --git a/src/coremods/core_info/cmd_commands.cpp b/src/coremods/core_info/cmd_commands.cpp
index 9ae258a9c..8b255a928 100644
--- a/src/coremods/core_info/cmd_commands.cpp
+++ b/src/coremods/core_info/cmd_commands.cpp
@@ -31,9 +31,10 @@ CommandCommands::CommandCommands(Module* parent)
*/
CmdResult CommandCommands::Handle (const std::vector<std::string>&, User *user)
{
+ const CommandParser::CommandMap& commands = ServerInstance->Parser->GetCommands();
std::vector<std::string> list;
- list.reserve(ServerInstance->Parser->cmdlist.size());
- for (Commandtable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
+ list.reserve(commands.size());
+ for (CommandParser::CommandMap::const_iterator i = commands.begin(); i != commands.end(); ++i)
{
// Don't show S2S commands to users
if (i->second->flags_needed == FLAG_SERVERONLY)
diff --git a/src/coremods/core_stats.cpp b/src/coremods/core_stats.cpp
index b8ea21731..1e90ed2bf 100644
--- a/src/coremods/core_stats.cpp
+++ b/src/coremods/core_stats.cpp
@@ -189,7 +189,9 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
/* stats m (list number of times each command has been used, plus bytecount) */
case 'm':
- for (Commandtable::iterator i = ServerInstance->Parser->cmdlist.begin(); i != ServerInstance->Parser->cmdlist.end(); i++)
+ {
+ const CommandParser::CommandMap& commands = ServerInstance->Parser->GetCommands();
+ for (CommandParser::CommandMap::const_iterator i = commands.begin(); i != commands.end(); ++i)
{
if (i->second->use_count)
{
@@ -197,6 +199,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
results.push_back("212 "+user->nick+" "+i->second->name+" "+ConvToStr(i->second->use_count));
}
}
+ }
break;
/* stats z (debug and memory info) */
@@ -204,7 +207,7 @@ void CommandStats::DoStats(char statschar, User* user, string_list &results)
{
results.push_back("249 "+user->nick+" :Users: "+ConvToStr(ServerInstance->Users->GetUsers().size()));
results.push_back("249 "+user->nick+" :Channels: "+ConvToStr(ServerInstance->GetChans().size()));
- results.push_back("249 "+user->nick+" :Commands: "+ConvToStr(ServerInstance->Parser->cmdlist.size()));
+ results.push_back("249 "+user->nick+" :Commands: "+ConvToStr(ServerInstance->Parser->GetCommands().size()));
float kbitpersec_in, kbitpersec_out, kbitpersec_total;
char kbitpersec_in_s[30], kbitpersec_out_s[30], kbitpersec_total_s[30];
diff --git a/src/modules/m_abbreviation.cpp b/src/modules/m_abbreviation.cpp
index f69d26749..a7bf8ceee 100644
--- a/src/modules/m_abbreviation.cpp
+++ b/src/modules/m_abbreviation.cpp
@@ -42,7 +42,8 @@ class ModuleAbbreviation : public Module
size_t clen = command.length() - 1;
std::string foundcommand, matchlist;
bool foundmatch = false;
- for (Commandtable::iterator n = ServerInstance->Parser->cmdlist.begin(); n != ServerInstance->Parser->cmdlist.end(); ++n)
+ const CommandParser::CommandMap& commands = ServerInstance->Parser->GetCommands();
+ for (CommandParser::CommandMap::const_iterator n = commands.begin(); n != commands.end(); ++n)
{
if (!command.compare(0, clen, n->first, 0, clen))
{