diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-06 11:03:53 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-06 11:03:53 +0000 |
commit | f9b4fb41816a3099d00126951ffa4fef6b175506 (patch) | |
tree | ea610e27198b9b5ba0f278bddc047a8e2705067c /src/modules | |
parent | 1d994c544474da53159257d9097997c0744a48a5 (diff) |
Added SA* modules (untested)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@401 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/m_sajoin.cpp | 70 | ||||
-rw-r--r-- | src/modules/m_sanick.cpp | 70 | ||||
-rw-r--r-- | src/modules/m_sapart.cpp | 70 |
3 files changed, 210 insertions, 0 deletions
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 <stdio.h> +#include <string> +#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 <stdio.h> +#include <string> +#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 <stdio.h> +#include <string> +#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; +} + |