diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-05-29 11:57:17 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-05-29 11:57:17 +0000 |
commit | 44a7931867b710365859d72de0f71b5f87bbdfe3 (patch) | |
tree | 655843975c716c9e6203114bfcbff1ecf9fa8129 | |
parent | 3eea190b733dc27d271ebe9274541b58ad4f2a6f (diff) |
Added m_botmode, module that provides unreal style +B and the SWHOIS that goes with it
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@832 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/InspIRCd.dev | 12 | ||||
-rw-r--r-- | src/InspIRCd.layout | 59 | ||||
-rw-r--r-- | src/modules/m_botmode.cpp | 98 |
3 files changed, 142 insertions, 27 deletions
diff --git a/src/InspIRCd.dev b/src/InspIRCd.dev index 3068daece..594cde4d0 100644 --- a/src/InspIRCd.dev +++ b/src/InspIRCd.dev @@ -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= + diff --git a/src/InspIRCd.layout b/src/InspIRCd.layout index 8e5b1ecf1..1b8b2a396 100644 --- a/src/InspIRCd.layout +++ b/src/InspIRCd.layout @@ -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 index 000000000..6d8269435 --- /dev/null +++ b/src/modules/m_botmode.cpp @@ -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 ¶ms) + { + 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; +} + |