From f9b4fb41816a3099d00126951ffa4fef6b175506 Mon Sep 17 00:00:00 2001 From: brain Date: Tue, 6 Apr 2004 11:03:53 +0000 Subject: Added SA* modules (untested) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@401 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_sapart.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 src/modules/m_sapart.cpp (limited to 'src/modules/m_sapart.cpp') diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp new file mode 100644 index 000000000..6b784c93b --- /dev/null +++ b/src/modules/m_sapart.cpp @@ -0,0 +1,70 @@ +// Sapart and +g support module by C.J.Edwards + +#include +#include +#include "users.h" +#include "channels.h" +#include "modules.h" + +/* $ModDesc: Provides support for unreal-style GLOBOPS and umode +g */ + +Server *Srv; + +void handle_sapart(char **parameters, int pcnt, userrec *user) +{ + userrec* dest = Srv->FindNick(std::string(parameters[0])); + if (dest) + { + Srv->SendOpers(std::string(user->nick)+" used SAPART to make "+std::String(dest->nick)+" part "+parameters[1]); + Srv->PartUserFromChannel(dest,std::String(parameters[1]),std::string(dest->nick)); + } +} + + +class ModuleSapart : public Module +{ + public: + ModuleSapart() + { + Srv = new Server; + Srv->AddCommand("SAPART",handle_sapart,'o',2); + } + + virtual ~ModuleSapart() + { + delete Srv; + } + + virtual Version GetVersion() + { + return Version(1,0,0,1); + } + +}; + +// stuff down here is the module-factory stuff. For basic modules you can ignore this. + +class ModuleSapartFactory : public ModuleFactory +{ + public: + ModuleSapartFactory() + { + } + + ~ModuleSapartFactory() + { + } + + virtual Module * CreateModule() + { + return new ModuleSapart; + } + +}; + + +extern "C" void * init_module( void ) +{ + return new ModuleSapartFactory; +} + -- cgit v1.2.3