summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 18:10:38 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-16 18:10:38 +0000
commit293df6a8b55e89c127e60e92711ef0ef1027bff8 (patch)
treeda33b32cfdd5b6e93cabaf288316671af9a51297 /include
parent0d6f3c83f101e3cb1f6cd6768cc4d17de24db489 (diff)
Split all commands into seperate files and redid command system to take classes, not function pointers (function pointers suck ass)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2534 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r--include/cmd_admin.h38
-rw-r--r--include/cmd_away.h38
-rw-r--r--include/cmd_commands.h38
-rw-r--r--include/cmd_connect.h38
-rw-r--r--include/cmd_die.h38
-rw-r--r--include/cmd_eline.h38
-rw-r--r--include/cmd_gline.h38
-rw-r--r--include/cmd_info.h38
-rw-r--r--include/cmd_invite.h38
-rw-r--r--include/cmd_ison.h38
-rw-r--r--include/cmd_join.h38
-rw-r--r--include/cmd_kick.h38
-rw-r--r--include/cmd_kill.h38
-rw-r--r--include/cmd_kline.h38
-rw-r--r--include/cmd_links.h38
-rw-r--r--include/cmd_list.h38
-rw-r--r--include/cmd_loadmodule.h38
-rw-r--r--include/cmd_lusers.h38
-rw-r--r--include/cmd_map.h38
-rw-r--r--include/cmd_modules.h38
-rw-r--r--include/cmd_motd.h38
-rw-r--r--include/cmd_names.h38
-rw-r--r--include/cmd_nick.h38
-rw-r--r--include/cmd_notice.h38
-rw-r--r--include/cmd_oper.h38
-rw-r--r--include/cmd_part.h38
-rw-r--r--include/cmd_pass.h38
-rw-r--r--include/cmd_ping.h38
-rw-r--r--include/cmd_pong.h38
-rw-r--r--include/cmd_privmsg.h38
-rw-r--r--include/cmd_qline.h38
-rw-r--r--include/cmd_quit.h38
-rw-r--r--include/cmd_rehash.h38
-rw-r--r--include/cmd_restart.h38
-rw-r--r--include/cmd_rules.h38
-rw-r--r--include/cmd_server.h38
-rw-r--r--include/cmd_squit.h38
-rw-r--r--include/cmd_stats.h38
-rw-r--r--include/cmd_summon.h38
-rw-r--r--include/cmd_time.h38
-rw-r--r--include/cmd_topic.h38
-rw-r--r--include/cmd_trace.h38
-rw-r--r--include/cmd_unloadmodule.h38
-rw-r--r--include/cmd_user.h38
-rw-r--r--include/cmd_user.h~38
-rw-r--r--include/cmd_userhost.h38
-rw-r--r--include/cmd_users.h38
-rw-r--r--include/cmd_version.h38
-rw-r--r--include/cmd_wallops.h38
-rw-r--r--include/cmd_who.h38
-rw-r--r--include/cmd_whois.h38
-rw-r--r--include/cmd_whowas.h38
-rw-r--r--include/cmd_zline.h38
-rw-r--r--include/command_parse.h4
-rw-r--r--include/commands.h121
-rw-r--r--include/ctables.h21
-rw-r--r--include/mode.h9
-rw-r--r--include/modules.h2
58 files changed, 2097 insertions, 74 deletions
diff --git a/include/cmd_admin.h b/include/cmd_admin.h
new file mode 100644
index 000000000..861030677
--- /dev/null
+++ b/include/cmd_admin.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_ADMIN_H__
+#define __CMD_ADMIN_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_admin : public command_t
+{
+ public:
+ cmd_admin () : command_t("ADMIN",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_away.h b/include/cmd_away.h
new file mode 100644
index 000000000..2c504a66e
--- /dev/null
+++ b/include/cmd_away.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_AWAY_H__
+#define __CMD_AWAY_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_away : public command_t
+{
+ public:
+ cmd_away () : command_t("AWAY",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_commands.h b/include/cmd_commands.h
new file mode 100644
index 000000000..575c9722c
--- /dev/null
+++ b/include/cmd_commands.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_COMMANDS_H__
+#define __CMD_COMMANDS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_commands : public command_t
+{
+ public:
+ cmd_commands () : command_t("COMMANDS",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_connect.h b/include/cmd_connect.h
new file mode 100644
index 000000000..3b0401366
--- /dev/null
+++ b/include/cmd_connect.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_CONNECT_H__
+#define __CMD_CONNECT_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_connect : public command_t
+{
+ public:
+ cmd_connect () : command_t("CONNECT",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_die.h b/include/cmd_die.h
new file mode 100644
index 000000000..5bdf6a6bf
--- /dev/null
+++ b/include/cmd_die.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_DIE_H__
+#define __CMD_DIE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_die : public command_t
+{
+ public:
+ cmd_die () : command_t("DIE",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_eline.h b/include/cmd_eline.h
new file mode 100644
index 000000000..f538f6b67
--- /dev/null
+++ b/include/cmd_eline.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_ELINE_H__
+#define __CMD_ELINE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_eline : public command_t
+{
+ public:
+ cmd_eline () : command_t("ELINE",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_gline.h b/include/cmd_gline.h
new file mode 100644
index 000000000..49f372e9c
--- /dev/null
+++ b/include/cmd_gline.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_GLINE_H__
+#define __CMD_GLINE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_gline : public command_t
+{
+ public:
+ cmd_gline () : command_t("GLINE",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_info.h b/include/cmd_info.h
new file mode 100644
index 000000000..9dc1a441e
--- /dev/null
+++ b/include/cmd_info.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_INFO_H__
+#define __CMD_INFO_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_info : public command_t
+{
+ public:
+ cmd_info () : command_t("INFO",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_invite.h b/include/cmd_invite.h
new file mode 100644
index 000000000..bb75900fb
--- /dev/null
+++ b/include/cmd_invite.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_INVITE_H__
+#define __CMD_INVITE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_invite : public command_t
+{
+ public:
+ cmd_invite () : command_t("INVITE",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_ison.h b/include/cmd_ison.h
new file mode 100644
index 000000000..e5da106c5
--- /dev/null
+++ b/include/cmd_ison.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_ISON_H__
+#define __CMD_ISON_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_ison : public command_t
+{
+ public:
+ cmd_ison () : command_t("ISON",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_join.h b/include/cmd_join.h
new file mode 100644
index 000000000..ec54c00f3
--- /dev/null
+++ b/include/cmd_join.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_JOIN_H__
+#define __CMD_JOIN_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_join : public command_t
+{
+ public:
+ cmd_join () : command_t("JOIN",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_kick.h b/include/cmd_kick.h
new file mode 100644
index 000000000..74525c85c
--- /dev/null
+++ b/include/cmd_kick.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_KICK_H__
+#define __CMD_KICK_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_kick : public command_t
+{
+ public:
+ cmd_kick () : command_t("KICK",0,2) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_kill.h b/include/cmd_kill.h
new file mode 100644
index 000000000..19956544a
--- /dev/null
+++ b/include/cmd_kill.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_KILL_H__
+#define __CMD_KILL_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_kill : public command_t
+{
+ public:
+ cmd_kill () : command_t("KILL",'o',2) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_kline.h b/include/cmd_kline.h
new file mode 100644
index 000000000..6fa004cde
--- /dev/null
+++ b/include/cmd_kline.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_KLINE_H__
+#define __CMD_KLINE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_kline : public command_t
+{
+ public:
+ cmd_kline () : command_t("KLINE",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_links.h b/include/cmd_links.h
new file mode 100644
index 000000000..5ff84baff
--- /dev/null
+++ b/include/cmd_links.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_LINKS_H__
+#define __CMD_LINKS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_links : public command_t
+{
+ public:
+ cmd_links () : command_t("LINKS",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_list.h b/include/cmd_list.h
new file mode 100644
index 000000000..096f8a381
--- /dev/null
+++ b/include/cmd_list.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_LIST_H__
+#define __CMD_LIST_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_list : public command_t
+{
+ public:
+ cmd_list () : command_t("LIST",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_loadmodule.h b/include/cmd_loadmodule.h
new file mode 100644
index 000000000..e1e99c69a
--- /dev/null
+++ b/include/cmd_loadmodule.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_LOADMODULE_H__
+#define __CMD_LOADMODULE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_loadmodule : public command_t
+{
+ public:
+ cmd_loadmodule () : command_t("LOADMODULE",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_lusers.h b/include/cmd_lusers.h
new file mode 100644
index 000000000..7dba571d0
--- /dev/null
+++ b/include/cmd_lusers.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_LUSERS_H__
+#define __CMD_LUSERS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_lusers : public command_t
+{
+ public:
+ cmd_lusers () : command_t("LUSERS",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_map.h b/include/cmd_map.h
new file mode 100644
index 000000000..8a16b25f3
--- /dev/null
+++ b/include/cmd_map.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_MAP_H__
+#define __CMD_MAP_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_map : public command_t
+{
+ public:
+ cmd_map () : command_t("MAP",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_modules.h b/include/cmd_modules.h
new file mode 100644
index 000000000..3e23d5fe3
--- /dev/null
+++ b/include/cmd_modules.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_MODULES_H__
+#define __CMD_MODULES_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_modules : public command_t
+{
+ public:
+ cmd_modules () : command_t("MODULES",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_motd.h b/include/cmd_motd.h
new file mode 100644
index 000000000..ce584fc5c
--- /dev/null
+++ b/include/cmd_motd.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_MOTD_H__
+#define __CMD_MOTD_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_motd : public command_t
+{
+ public:
+ cmd_motd () : command_t("MOTD",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_names.h b/include/cmd_names.h
new file mode 100644
index 000000000..556bdc757
--- /dev/null
+++ b/include/cmd_names.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_NAMES_H__
+#define __CMD_NAMES_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_names : public command_t
+{
+ public:
+ cmd_names () : command_t("NAMES",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_nick.h b/include/cmd_nick.h
new file mode 100644
index 000000000..0ec7a3966
--- /dev/null
+++ b/include/cmd_nick.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_NICK_H__
+#define __CMD_NICK_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_nick : public command_t
+{
+ public:
+ cmd_nick () : command_t("NICK",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_notice.h b/include/cmd_notice.h
new file mode 100644
index 000000000..48858f87c
--- /dev/null
+++ b/include/cmd_notice.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_NOTICE_H__
+#define __CMD_NOTICE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_notice : public command_t
+{
+ public:
+ cmd_notice () : command_t("NOTICE",0,2) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_oper.h b/include/cmd_oper.h
new file mode 100644
index 000000000..9d1bec410
--- /dev/null
+++ b/include/cmd_oper.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_OPER_H__
+#define __CMD_OPER_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_oper : public command_t
+{
+ public:
+ cmd_oper () : command_t("OPER",0,2) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_part.h b/include/cmd_part.h
new file mode 100644
index 000000000..f6533890a
--- /dev/null
+++ b/include/cmd_part.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_PART_H__
+#define __CMD_PART_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_part : public command_t
+{
+ public:
+ cmd_part () : command_t("PART",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_pass.h b/include/cmd_pass.h
new file mode 100644
index 000000000..793ee73a3
--- /dev/null
+++ b/include/cmd_pass.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_PASS_H__
+#define __CMD_PASS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_pass : public command_t
+{
+ public:
+ cmd_pass () : command_t("PASS",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_ping.h b/include/cmd_ping.h
new file mode 100644
index 000000000..cda3c5a03
--- /dev/null
+++ b/include/cmd_ping.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_PING_H__
+#define __CMD_PING_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_ping : public command_t
+{
+ public:
+ cmd_ping () : command_t("PING",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_pong.h b/include/cmd_pong.h
new file mode 100644
index 000000000..92f4d5d7f
--- /dev/null
+++ b/include/cmd_pong.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_PONG_H__
+#define __CMD_PONG_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_pong : public command_t
+{
+ public:
+ cmd_pong () : command_t("PONG",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_privmsg.h b/include/cmd_privmsg.h
new file mode 100644
index 000000000..9f4f3d1b3
--- /dev/null
+++ b/include/cmd_privmsg.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_PRIVMSG_H__
+#define __CMD_PRIVMSG_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_privmsg : public command_t
+{
+ public:
+ cmd_privmsg () : command_t("PRIVMSG",0,2) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_qline.h b/include/cmd_qline.h
new file mode 100644
index 000000000..4e8fac232
--- /dev/null
+++ b/include/cmd_qline.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_QLINE_H__
+#define __CMD_QLINE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_qline : public command_t
+{
+ public:
+ cmd_qline () : command_t("QLINE",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_quit.h b/include/cmd_quit.h
new file mode 100644
index 000000000..51eb77b92
--- /dev/null
+++ b/include/cmd_quit.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_QUIT_H__
+#define __CMD_QUIT_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_quit : public command_t
+{
+ public:
+ cmd_quit () : command_t("QUIT",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_rehash.h b/include/cmd_rehash.h
new file mode 100644
index 000000000..09d4ef6e9
--- /dev/null
+++ b/include/cmd_rehash.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_REHASH_H__
+#define __CMD_REHASH_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_rehash : public command_t
+{
+ public:
+ cmd_rehash () : command_t("REHASH",'o',0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_restart.h b/include/cmd_restart.h
new file mode 100644
index 000000000..14eb8cc93
--- /dev/null
+++ b/include/cmd_restart.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_RESTART_H__
+#define __CMD_RESTART_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_restart : public command_t
+{
+ public:
+ cmd_restart () : command_t("RESTART",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_rules.h b/include/cmd_rules.h
new file mode 100644
index 000000000..5fa0945ec
--- /dev/null
+++ b/include/cmd_rules.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_RULES_H__
+#define __CMD_RULES_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_rules : public command_t
+{
+ public:
+ cmd_rules () : command_t("RULES",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_server.h b/include/cmd_server.h
new file mode 100644
index 000000000..fb6dc2877
--- /dev/null
+++ b/include/cmd_server.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_SERVER_H__
+#define __CMD_SERVER_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_server : public command_t
+{
+ public:
+ cmd_server () : command_t("SERVER",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_squit.h b/include/cmd_squit.h
new file mode 100644
index 000000000..5e1695a4b
--- /dev/null
+++ b/include/cmd_squit.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_SQUIT_H__
+#define __CMD_SQUIT_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_squit : public command_t
+{
+ public:
+ cmd_squit () : command_t("SQUIT",'o',0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_stats.h b/include/cmd_stats.h
new file mode 100644
index 000000000..7b0597e8e
--- /dev/null
+++ b/include/cmd_stats.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_STATS_H__
+#define __CMD_STATS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_stats : public command_t
+{
+ public:
+ cmd_stats () : command_t("STATS",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_summon.h b/include/cmd_summon.h
new file mode 100644
index 000000000..d852365c4
--- /dev/null
+++ b/include/cmd_summon.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_SUMMON_H__
+#define __CMD_SUMMON_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_summon : public command_t
+{
+ public:
+ cmd_summon () : command_t("SUMMON",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_time.h b/include/cmd_time.h
new file mode 100644
index 000000000..969a3388f
--- /dev/null
+++ b/include/cmd_time.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_TIME_H__
+#define __CMD_TIME_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_time : public command_t
+{
+ public:
+ cmd_time () : command_t("TIME",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_topic.h b/include/cmd_topic.h
new file mode 100644
index 000000000..c52087424
--- /dev/null
+++ b/include/cmd_topic.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_TOPIC_H__
+#define __CMD_TOPIC_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_topic : public command_t
+{
+ public:
+ cmd_topic () : command_t("TOPIC",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_trace.h b/include/cmd_trace.h
new file mode 100644
index 000000000..aa4b3ebd3
--- /dev/null
+++ b/include/cmd_trace.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_TRACE_H__
+#define __CMD_TRACE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_trace : public command_t
+{
+ public:
+ cmd_trace () : command_t("TRACE",'o',0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_unloadmodule.h b/include/cmd_unloadmodule.h
new file mode 100644
index 000000000..4fb6a8693
--- /dev/null
+++ b/include/cmd_unloadmodule.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_UNLOADMODULE_H__
+#define __CMD_UNLOADMODULE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_unloadmodule : public command_t
+{
+ public:
+ cmd_unloadmodule () : command_t("UNLOADMODULE",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_user.h b/include/cmd_user.h
new file mode 100644
index 000000000..2c5bba3ca
--- /dev/null
+++ b/include/cmd_user.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_USER_H__
+#define __CMD_USER_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_user : public command_t
+{
+ public:
+ cmd_user () : command_t("USER",0,4) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_user.h~ b/include/cmd_user.h~
new file mode 100644
index 000000000..1b2d5f670
--- /dev/null
+++ b/include/cmd_user.h~
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_USER_H__
+#define __CMD_USER_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_user : public command_t
+{
+ public:
+ cmd_user () : command_t("USER",,) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_userhost.h b/include/cmd_userhost.h
new file mode 100644
index 000000000..82f46de7c
--- /dev/null
+++ b/include/cmd_userhost.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_USERHOST_H__
+#define __CMD_USERHOST_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_userhost : public command_t
+{
+ public:
+ cmd_userhost () : command_t("USERHOST",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_users.h b/include/cmd_users.h
new file mode 100644
index 000000000..6032ae711
--- /dev/null
+++ b/include/cmd_users.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_USERS_H__
+#define __CMD_USERS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_users : public command_t
+{
+ public:
+ cmd_users () : command_t("USERS",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_version.h b/include/cmd_version.h
new file mode 100644
index 000000000..8e0b475cd
--- /dev/null
+++ b/include/cmd_version.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_VERSION_H__
+#define __CMD_VERSION_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_version : public command_t
+{
+ public:
+ cmd_version () : command_t("VERSION",0,0) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_wallops.h b/include/cmd_wallops.h
new file mode 100644
index 000000000..63cbafe90
--- /dev/null
+++ b/include/cmd_wallops.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_WALLOPS_H__
+#define __CMD_WALLOPS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_wallops : public command_t
+{
+ public:
+ cmd_wallops () : command_t("WALLOPS",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_who.h b/include/cmd_who.h
new file mode 100644
index 000000000..4d6c6cbf9
--- /dev/null
+++ b/include/cmd_who.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_WHO_H__
+#define __CMD_WHO_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_who : public command_t
+{
+ public:
+ cmd_who () : command_t("WHO",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_whois.h b/include/cmd_whois.h
new file mode 100644
index 000000000..55236932d
--- /dev/null
+++ b/include/cmd_whois.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_WHOIS_H__
+#define __CMD_WHOIS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_whois : public command_t
+{
+ public:
+ cmd_whois () : command_t("WHOIS",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_whowas.h b/include/cmd_whowas.h
new file mode 100644
index 000000000..28afd5901
--- /dev/null
+++ b/include/cmd_whowas.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_WHOWAS_H__
+#define __CMD_WHOWAS_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_whowas : public command_t
+{
+ public:
+ cmd_whowas () : command_t("WHOWAS",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/cmd_zline.h b/include/cmd_zline.h
new file mode 100644
index 000000000..4bcc7ff21
--- /dev/null
+++ b/include/cmd_zline.h
@@ -0,0 +1,38 @@
+/* +------------------------------------+
+ * | Inspire Internet Relay Chat Daemon |
+ * +------------------------------------+
+ *
+ * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ * E-mail:
+ * <brain.net>
+ * <Craig.net>
+ *
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ * the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#ifndef __CMD_ZLINE_H__
+#define __CMD_ZLINE_H__
+
+// include the common header files
+
+#include <typeinfo>
+#include <iostream>
+#include <string>
+#include <deque>
+#include <sstream>
+#include <vector>
+#include "users.h"
+#include "channels.h"
+
+class cmd_zline : public command_t
+{
+ public:
+ cmd_zline () : command_t("ZLINE",'o',1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
+
+#endif
diff --git a/include/command_parse.h b/include/command_parse.h
index b199123ee..d66726379 100644
--- a/include/command_parse.h
+++ b/include/command_parse.h
@@ -36,10 +36,10 @@ class CommandParser
CommandParser();
void CallHandler(std::string &commandname,char **parameters, int pcnt, userrec *user);
bool IsValidCommand(std::string &commandname, int pcnt, userrec * user);
- int LoopCall(handlerfunc fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
+ int LoopCall(command_t *fn, char **parameters, int pcnt, userrec *u, int start, int end, int joins);
void ProcessBuffer(const char* cmdbuf,userrec *user);
bool RemoveCommands(const char* source);
- bool CreateCommand(char* cmd, handlerfunc f, char flags, int minparams,char* source);
+ bool CreateCommand(command_t *f);
};
#endif
diff --git a/include/commands.h b/include/commands.h
index 115705eb5..ff6106cb6 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -28,70 +28,67 @@
#include "users.h"
#include "channels.h"
-
-/** These are the handlers for user commands
- */
-void handle_join(char **parameters, int pcnt, userrec *user);
-void handle_part(char **parameters, int pcnt, userrec *user);
-void handle_kick(char **parameters, int pcnt, userrec *user);
-void handle_die(char **parameters, int pcnt, userrec *user);
-void handle_restart(char **parameters, int pcnt, userrec *user);
-void handle_kill(char **parameters, int pcnt, userrec *user);
-void handle_summon(char **parameters, int pcnt, userrec *user);
-void handle_users(char **parameters, int pcnt, userrec *user);
-void handle_pass(char **parameters, int pcnt, userrec *user);
-void handle_invite(char **parameters, int pcnt, userrec *user);
-void handle_topic(char **parameters, int pcnt, userrec *user);
-void handle_names(char **parameters, int pcnt, userrec *user);
-void handle_privmsg(char **parameters, int pcnt, userrec *user);
-void handle_notice(char **parameters, int pcnt, userrec *user);
-void handle_info(char **parameters, int pcnt, userrec *user);
-void handle_time(char **parameters, int pcnt, userrec *user);
-void handle_whois(char **parameters, int pcnt, userrec *user);
-void handle_quit(char **parameters, int pcnt, userrec *user);
-void handle_who(char **parameters, int pcnt, userrec *user);
-void handle_wallops(char **parameters, int pcnt, userrec *user);
-void handle_list(char **parameters, int pcnt, userrec *user);
-void handle_rehash(char **parameters, int pcnt, userrec *user);
-void handle_lusers(char **parameters, int pcnt, userrec *user);
-void handle_admin(char **parameters, int pcnt, userrec *user);
-void handle_ping(char **parameters, int pcnt, userrec *user);
-void handle_pong(char **parameters, int pcnt, userrec *user);
-void handle_motd(char **parameters, int pcnt, userrec *user);
-void handle_rules(char **parameters, int pcnt, userrec *user);
-void handle_user(char **parameters, int pcnt, userrec *user);
-void handle_userhost(char **parameters, int pcnt, userrec *user);
-void handle_ison(char **parameters, int pcnt, userrec *user);
-void handle_away(char **parameters, int pcnt, userrec *user);
-void handle_whowas(char **parameters, int pcnt, userrec *user);
-void handle_trace(char **parameters, int pcnt, userrec *user);
-void handle_modules(char **parameters, int pcnt, userrec *user);
-void handle_stats(char **parameters, int pcnt, userrec *user);
-void handle_connect(char **parameters, int pcnt, userrec *user);
-void handle_squit(char **parameters, int pcnt, userrec *user);
-void handle_links(char **parameters, int pcnt, userrec *user);
-void handle_map(char **parameters, int pcnt, userrec *user);
-void handle_oper(char **parameters, int pcnt, userrec *user);
-void handle_nick(char **parameters, int pcnt, userrec *user);
-void handle_kline(char **parameters, int pcnt, userrec *user);
-void handle_gline(char **parameters, int pcnt, userrec *user);
-void handle_zline(char **parameters, int pcnt, userrec *user);
-void handle_qline(char **parameters, int pcnt, userrec *user);
-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);
-void handle_version(char **parameters, int pcnt, userrec *user);
-
-/** Functions for u:lined servers
- */
+char* CleanFilename(char* name);
bool is_uline(const char* server);
-
-/** Other useful functions
- */
long duration(const char* str);
-
void do_whois(userrec* user, userrec* dest,unsigned long signon, unsigned long idle, char* nick);
+bool host_matches_everyone(std::string mask, userrec* user);
+bool ip_matches_everyone(std::string ip, userrec* user);
+bool nick_matches_everyone(std::string nick, userrec* user);
+int operstrcmp(char* data,char* input);
+
+#include "cmd_admin.h"
+#include "cmd_away.h"
+#include "cmd_commands.h"
+#include "cmd_connect.h"
+#include "cmd_die.h"
+#include "cmd_eline.h"
+#include "cmd_gline.h"
+#include "cmd_info.h"
+#include "cmd_invite.h"
+#include "cmd_ison.h"
+#include "cmd_join.h"
+#include "cmd_kick.h"
+#include "cmd_kill.h"
+#include "cmd_kline.h"
+#include "cmd_links.h"
+#include "cmd_list.h"
+#include "cmd_loadmodule.h"
+#include "cmd_lusers.h"
+#include "cmd_map.h"
+#include "cmd_modules.h"
+#include "cmd_motd.h"
+#include "cmd_names.h"
+#include "cmd_nick.h"
+#include "cmd_notice.h"
+#include "cmd_oper.h"
+#include "cmd_part.h"
+#include "cmd_pass.h"
+#include "cmd_ping.h"
+#include "cmd_pong.h"
+#include "cmd_privmsg.h"
+#include "cmd_qline.h"
+#include "cmd_quit.h"
+#include "cmd_rehash.h"
+#include "cmd_restart.h"
+#include "cmd_rules.h"
+#include "cmd_server.h"
+#include "cmd_squit.h"
+#include "cmd_stats.h"
+#include "cmd_summon.h"
+#include "cmd_time.h"
+#include "cmd_topic.h"
+#include "cmd_trace.h"
+#include "cmd_unloadmodule.h"
+#include "cmd_user.h"
+#include "cmd_userhost.h"
+#include "cmd_users.h"
+#include "cmd_version.h"
+#include "cmd_wallops.h"
+#include "cmd_who.h"
+#include "cmd_whois.h"
+#include "cmd_whowas.h"
+#include "cmd_zline.h"
+
#endif
diff --git a/include/ctables.h b/include/ctables.h
index 2dadca42d..65b469948 100644
--- a/include/ctables.h
+++ b/include/ctables.h
@@ -22,7 +22,7 @@
class userrec;
-typedef void (handlerfunc) (char**, int, userrec*);
+/*typedef void (handlerfunc) (char**, int, userrec*);*/
/** A structure that defines a command
*/
@@ -31,10 +31,7 @@ class command_t
public:
/** Command name
*/
- char command[MAXBUF];
- /** Handler function as in typedef
- */
- handlerfunc *handler_function;
+ std::string command;
/** User flags needed to execute the command or 0
*/
char flags_needed;
@@ -49,10 +46,20 @@ class command_t
long total_bytes;
/** used for resource tracking between modules
*/
- char source[MAXBUF];
+ std::string source;
+
+ command_t(std::string cmd, char flags, int minpara) : command(cmd), flags_needed(flags), min_params(minpara)
+ {
+ use_count = total_bytes = 0;
+ source = "<core>";
+ }
+
+ virtual void Handle(char** parameters, int pcnt, userrec* user) = 0;
+
+ virtual ~command_t() {}
};
-typedef std::deque<command_t> command_table;
+typedef std::deque<command_t*> command_table;
#endif
diff --git a/include/mode.h b/include/mode.h
index efc83b281..82b329b22 100644
--- a/include/mode.h
+++ b/include/mode.h
@@ -27,6 +27,7 @@
#include <vector>
#include "users.h"
#include "channels.h"
+#include "ctables.h"
class ModeParser
{
@@ -47,7 +48,11 @@ class ModeParser
void ServerMode(char **parameters, int pcnt, userrec *user);
};
-void handle_mode(char **parameters, int pcnt, userrec *user);
-
+class cmd_mode : public command_t
+{
+ public:
+ cmd_mode () : command_t("MODE",0,1) { }
+ void Handle(char **parameters, int pcnt, userrec *user);
+};
#endif
diff --git a/include/modules.h b/include/modules.h
index f52c1653b..4bc3a1aa1 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -1303,7 +1303,7 @@ class Server : public classbase
* extension) e.g. "m_blarp.so". If you place the wrong identifier here, you can cause crashes if your module
* is unloaded.
*/
- virtual void AddCommand(char* cmd, handlerfunc f, char flags, int minparams, char* source);
+ virtual void AddCommand(command_t *f);
/** Sends a servermode.
* you must format the parameters array with the target, modes and parameters for those modes.