summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/commands.h1
-rw-r--r--src/commands.cpp9
-rw-r--r--src/helperfuncs.cpp1
3 files changed, 11 insertions, 0 deletions
diff --git a/include/commands.h b/include/commands.h
index f83ab5f81..c12d1b36b 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -81,6 +81,7 @@ void handle_eline(char **parameters, int pcnt, userrec *user);
void handle_server(char **parameters, int pcnt, userrec *user);
void handle_loadmodule(char **parameters, int pcnt, userrec *user);
void handle_unloadmodule(char **parameters, int pcnt, userrec *user);
+void handle_commands(char **parameters, int pcnt, userrec *user);
/** Special functions for processing server to server traffic
*/
diff --git a/src/commands.cpp b/src/commands.cpp
index 5011b7d61..2b96b0a8f 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -187,6 +187,15 @@ void handle_part(char **parameters, int pcnt, userrec *user)
}
}
+void handle_commands(char **parameters, int pcnt, userrec *user)
+{
+ for (int i = 0; i < command_table.size(); i++)
+ {
+ WriteServ(user->fd,"902 %s :%s %s",user->nick,command_table[i].command,command_table[i].source);
+ }
+ WriteServ(user->fd,"903 %s :End of COMMANDS list");
+}
+
void handle_kick(char **parameters, int pcnt, userrec *user)
{
chanrec* Ptr = FindChan(parameters[0]);
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 703705f23..b4f4b77a0 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -1490,6 +1490,7 @@ void SetupCommandTable(void)
createcommand("LOADMODULE",handle_loadmodule,'o',1,"<core>");
createcommand("UNLOADMODULE",handle_unloadmodule,'o',1,"<core>");
createcommand("SERVER",handle_server,0,0,"<core>");
+ createcommand("COMMANDS",handle_commands,0,0,"<core>");
}
bool DirValid(char* dirandfile)