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_sajoin.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ src/modules/m_sanick.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ src/modules/m_sapart.cpp | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 210 insertions(+) create mode 100644 src/modules/m_sajoin.cpp create mode 100644 src/modules/m_sanick.cpp create mode 100644 src/modules/m_sapart.cpp (limited to 'src/modules') diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp new file mode 100644 index 000000000..5e7ae9786 --- /dev/null +++ b/src/modules/m_sajoin.cpp @@ -0,0 +1,70 @@ +// Sajoin 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_sajoin(char **parameters, int pcnt, userrec *user) +{ + userrec* dest = Srv->FindNick(std::string(parameters[0])); + if (dest) + { + Srv->SendOpers(std::string(user->nick)+" used SAJOIN to make "+std::String(dest->nick)+" join "+parameters[1]); + Srv->JoinUserToChannel(dest,std::String(parameters[1]),std::string(dest->nick)); + } +} + + +class ModuleSajoin : public Module +{ + public: + ModuleSajoin() + { + Srv = new Server; + Srv->AddCommand("SAJOIN",handle_sajoin,'o',2); + } + + virtual ~ModuleSajoin() + { + 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 ModuleSajoinFactory : public ModuleFactory +{ + public: + ModuleSajoinFactory() + { + } + + ~ModuleSajoinFactory() + { + } + + virtual Module * CreateModule() + { + return new ModuleSajoin; + } + +}; + + +extern "C" void * init_module( void ) +{ + return new ModuleSajoinFactory; +} + diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp new file mode 100644 index 000000000..d929efd4a --- /dev/null +++ b/src/modules/m_sanick.cpp @@ -0,0 +1,70 @@ +// Sanick 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_sanick(char **parameters, int pcnt, userrec *user) +{ + userrec* source = Srv->FindNick(std::string(parameters[0])); + if (source) + { + Srv->SendOpers(std::string(user->nick)+" used SANICK to change "+std::String(dest->nick)+" to "+parameters[1]); + Srv->ChangeUserNick(source,std::String(parameters[1])); + } +} + + +class ModuleSanick : public Module +{ + public: + ModuleSanick() + { + Srv = new Server; + Srv->AddCommand("SANICK",handle_sanick,'o',2); + } + + virtual ~ModuleSanick() + { + 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 ModuleSanickFactory : public ModuleFactory +{ + public: + ModuleSanickFactory() + { + } + + ~ModuleSanickFactory() + { + } + + virtual Module * CreateModule() + { + return new ModuleSanick; + } + +}; + + +extern "C" void * init_module( void ) +{ + return new ModuleSanickFactory; +} + 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