]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Added m_botmode, module that provides unreal style +B and the SWHOIS that goes with it
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 29 May 2004 11:57:17 +0000 (11:57 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sat, 29 May 2004 11:57:17 +0000 (11:57 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@832 e03df62e-2008-0410-955e-edbf42e46eb7

src/InspIRCd.dev
src/InspIRCd.layout
src/modules/m_botmode.cpp [new file with mode: 0644]

index 3068daece5b9921b5f454692b044f05f0ab5e4dd..594cde4d09dc159bdf9fb51ad19917caaa12409d 100644 (file)
@@ -1,7 +1,7 @@
 [Project]
 FileName=InspIRCd.dev
 Name=InspIRCd - The Inspire Internet Relay Chat Daemon
-UnitCount=63
+UnitCount=64
 Type=1
 Ver=1
 ObjFiles=
@@ -675,3 +675,13 @@ Priority=1000
 OverrideBuildCmd=0
 BuildCmd=
 
+[Unit64]
+FileName=modules\m_botmode.cpp
+CompileCpp=1
+Folder=Modules/User
+Compile=1
+Link=1
+Priority=1000
+OverrideBuildCmd=0
+BuildCmd=
+
index 8e5b1ecf1c85b7b21bef8735d040752b87839510..1b8b2a396e39a5cfc512f773f524d664d8b61893 100644 (file)
@@ -1,5 +1,5 @@
 [Editors]
-Focused=43
+Focused=-1
 Order=2,4,6,3,7,25,5,24,39,42,43,1,46,0,49,-1
 
 [Editor_0]
@@ -83,7 +83,7 @@ TopLine=1
 LeftChar=1
 
 [Editor_10]
-Open=1
+Open=0
 Top=0
 CursorCol=9
 CursorRow=88
@@ -99,7 +99,7 @@ TopLine=1
 LeftChar=1
 
 [Editor_12]
-Open=1
+Open=0
 Top=0
 CursorCol=7
 CursorRow=171
@@ -139,7 +139,7 @@ TopLine=1
 LeftChar=1
 
 [Editor_17]
-Open=1
+Open=0
 Top=0
 CursorCol=44
 CursorRow=78
@@ -163,7 +163,7 @@ TopLine=1
 LeftChar=1
 
 [Editor_20]
-Open=1
+Open=0
 Top=0
 CursorCol=70
 CursorRow=485
@@ -179,7 +179,7 @@ TopLine=1
 LeftChar=1
 
 [Editor_22]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=16
@@ -251,7 +251,7 @@ CursorRow=16
 TopLine=1
 LeftChar=1
 [Editor_32]
-Open=1
+Open=0
 Top=0
 CursorCol=28
 CursorRow=120
@@ -272,11 +272,11 @@ CursorRow=17
 TopLine=1
 LeftChar=1
 [Editor_35]
-Open=0
+Open=1
 Top=0
 CursorCol=1
 CursorRow=16
-TopLine=1
+TopLine=12
 LeftChar=1
 [Editor_36]
 Open=0
@@ -286,14 +286,14 @@ CursorRow=16
 TopLine=1
 LeftChar=1
 [Editor_37]
-Open=0
+Open=1
 Top=0
 CursorCol=1
-CursorRow=16
-TopLine=1
+CursorRow=193
+TopLine=154
 LeftChar=1
 [Editor_38]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=16
@@ -314,10 +314,10 @@ CursorRow=16
 TopLine=1
 LeftChar=1
 [Editor_41]
-Open=0
+Open=1
 Top=0
 CursorCol=1
-CursorRow=16
+CursorRow=31
 TopLine=1
 LeftChar=1
 [Editor_42]
@@ -329,7 +329,7 @@ TopLine=799
 LeftChar=34
 [Editor_43]
 Open=1
-Top=1
+Top=0
 CursorCol=1
 CursorRow=233
 TopLine=194
@@ -356,14 +356,14 @@ CursorRow=16
 TopLine=1
 LeftChar=1
 [Editor_47]
-Open=1
+Open=0
 Top=0
 CursorCol=12
 CursorRow=128
 TopLine=74
 LeftChar=1
 [Editor_48]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=16
@@ -377,14 +377,14 @@ CursorRow=16
 TopLine=1
 LeftChar=1
 [Editor_50]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=16
 TopLine=25
 LeftChar=1
 [Editor_51]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=89
@@ -412,7 +412,7 @@ CursorRow=16
 TopLine=1
 LeftChar=1
 [Editor_55]
-Open=1
+Open=0
 Top=0
 CursorCol=49
 CursorRow=60
@@ -426,14 +426,14 @@ CursorRow=16
 TopLine=1
 LeftChar=1
 [Editor_57]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=81
 TopLine=44
 LeftChar=1
 [Editor_58]
-Open=1
+Open=0
 Top=0
 CursorCol=27
 CursorRow=78
@@ -447,23 +447,30 @@ CursorRow=16
 TopLine=1
 LeftChar=1
 [Editor_60]
-Open=1
+Open=0
 Top=0
 CursorCol=22
 CursorRow=50
 TopLine=12
 LeftChar=1
 [Editor_61]
-Open=1
+Open=0
 Top=0
 CursorCol=1
 CursorRow=81
 TopLine=68
 LeftChar=1
 [Editor_62]
-Open=1
+Open=0
 Top=0
 CursorCol=29
 CursorRow=57
 TopLine=57
 LeftChar=1
+[Editor_63]
+Open=1
+Top=1
+CursorCol=1
+CursorRow=67
+TopLine=18
+LeftChar=1
diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp
new file mode 100644 (file)
index 0000000..6d82694
--- /dev/null
@@ -0,0 +1,98 @@
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *                       E-mail:
+ *                <brain@chatspike.net>
+ *               <Craig@chatspike.net>
+ *     
+ * Written by Craig Edwards, Craig McLure, and others.
+ * This program is free but copyrighted software; see
+ *            the file COPYING for details.
+ *
+ * ---------------------------------------------------
+ */
+
+#include <stdio.h>
+#include <string>
+#include "users.h"
+#include "channels.h"
+#include "modules.h"
+
+/* $ModDesc: Provides support for unreal-style umode +B */
+
+class ModuleBotMode : public Module
+{
+       Server *Srv; 
+ public:
+       ModuleBotMode()
+       {
+               Srv = new Server;
+               
+               if (!Srv->AddExtendedMode('B',MT_CLIENT,false,0,0))
+               {
+                       Srv->Log(DEFAULT,"*** m_botmode: ERROR, failed to allocate user mode +B!");
+                       printf("Could not claim usermode +B for this module!");
+                       exit(0);
+               }
+       }
+       
+       virtual ~ModuleBotMode()
+       {
+               delete Srv;
+       }
+       
+       virtual Version GetVersion()
+       {
+               return Version(1,0,0,0);
+       }
+       
+       virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list &params)
+       {
+               if ((modechar == 'B') && (type == MT_CLIENT))
+               {
+                       return 1;
+               }
+               else
+               {
+                       return 0;
+               }
+       }
+
+       virtual void OnWhois(userrec* src, userrec* dst)
+       {
+               if (strchr(dst->modes,'B'))
+               {
+                       Srv->SendTo(NULL,src,"335 "+std::string(src->nick)+" "+std::string(dst->nick)+" :is a \2bot\2 on "+Srv->GetNetworkName());
+               }
+       }
+
+};
+
+// stuff down here is the module-factory stuff. For basic modules you can ignore this.
+
+class ModuleBotModeFactory : public ModuleFactory
+{
+ public:
+       ModuleBotModeFactory()
+       {
+       }
+       
+       ~ModuleBotModeFactory()
+       {
+       }
+       
+       virtual Module * CreateModule()
+       {
+               return new ModuleBotMode;
+       }
+       
+};
+
+
+extern "C" void * init_module( void )
+{
+       return new ModuleBotModeFactory;
+}
+