summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-20 00:03:30 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-20 00:03:30 +0000
commit9e81044ffde2b1fc62456aca512d0cd7f1e52ad8 (patch)
tree189ab43567f2a49f6178a3de51bf9164e1daa723
parent8516fe8689952df3eb2e4b7a01ef4f640940fd03 (diff)
Added COMMANDS command (yes, really)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1456 e03df62e-2008-0410-955e-edbf42e46eb7
-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)