]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_testcommand.cpp
AMD64 warning 'fix' which tested fine when I added it seems to now...stop things...
[user/henk/code/inspircd.git] / src / modules / m_testcommand.cpp
index 15405d80c185fb806913ea6393fa529f89dc1dd6..ceb0651d8b03de572b1570b33a9854658998a7bb 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
@@ -23,12 +23,12 @@ using namespace std;
 
 /* $ModDesc: Povides a proof-of-concept test /WOOT command */
 
-Server *Srv;
+static Server *Srv;
         
 class cmd_woot : public command_t
 {
  public:
-       cmd_woot () : command_t("WOOT", 0, 0);
+       cmd_woot () : command_t("WOOT", 0, 0)
        {
                this->source = "m_testcommand.so";
        }
@@ -68,11 +68,16 @@ class ModuleTestCommand : public Module
                // anyone can issue the command, and the
                // command takes only one parameter.
                newcommand = new cmd_woot();
-               Srv->AddCommand(mycommand);
+               Srv->AddCommand(newcommand);
 
                // Add a mode +Z for channels with no parameters                
                Srv->AddExtendedMode('Z',MT_CHANNEL,false,1,0);
        }
+
+       void Implements(char* List)
+       {
+               List[I_OnExtendedMode] = List[I_OnUserJoin] = 1;
+       }
        
        virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params)
        {
@@ -104,7 +109,7 @@ class ModuleTestCommand : public Module
        virtual void OnUserJoin(userrec* user, chanrec* channel)
        {
                Srv->Log(DEBUG,"OnUserJoin triggered");
-               if (channel->IsCustomModeSet('Z'))
+               if (channel->IsModeSet('Z'))
                {
                        std::string param = channel->GetModeParameter('Z');
                        Srv->Log(DEBUG,"Custom mode is set on this channel! Parameter="+param);
@@ -119,11 +124,6 @@ class ModuleTestCommand : public Module
        {
                return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
        }
-       
-       virtual void OnUserConnect(userrec* user)
-       {
-       }
-
 };