summaryrefslogtreecommitdiff
path: root/src/modules/m_sapart.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-06 11:03:53 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-06 11:03:53 +0000
commitf9b4fb41816a3099d00126951ffa4fef6b175506 (patch)
treeea610e27198b9b5ba0f278bddc047a8e2705067c /src/modules/m_sapart.cpp
parent1d994c544474da53159257d9097997c0744a48a5 (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/m_sapart.cpp')
-rw-r--r--src/modules/m_sapart.cpp70
1 files changed, 70 insertions, 0 deletions
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;
+}
+