summaryrefslogtreecommitdiff
path: root/src/modules/m_opermotd.cpp
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 /src/modules/m_opermotd.cpp
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 'src/modules/m_opermotd.cpp')
-rw-r--r--src/modules/m_opermotd.cpp22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp
index a2a3c0312..7fd19122b 100644
--- a/src/modules/m_opermotd.cpp
+++ b/src/modules/m_opermotd.cpp
@@ -13,8 +13,6 @@ using namespace std;
FileReader* opermotd;
Server* Srv;
-void do_opermotd(char** parameters, int pcnt, userrec* user);
-
void LoadOperMOTD()
{
ConfigReader* conf = new ConfigReader;
@@ -45,20 +43,30 @@ void ShowOperMOTD(userrec* user)
}
-void do_opermotd(char** parameters, int pcnt, userrec* user)
+class cmd_opermotd : public command_t
{
- ShowOperMOTD(user);
-}
+ public:
+ cmd_opermotd () : command_t("OPERMOTD", 'o', 0)
+ {
+ this->source = "m_opermotd.so";
+ }
+
+ void Handle (char** parameters, int pcnt, userrec* user)
+ {
+ ShowOperMOTD(user);
+ }
+};
class ModuleOpermotd : public Module
{
+ cmd_opermotd* mycommand;
public:
ModuleOpermotd(Server* Me)
: Module::Module(Me)
{
Srv = Me;
-
- Srv->AddCommand("OPERMOTD",do_opermotd,'o',0,"m_opermotd.so");
+ mycommand = new cmd_opermotd();
+ Srv->AddCommand(mycommand);
opermotd = new FileReader();
LoadOperMOTD();
}