1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
7 * <brain@chatspike.net>
8 * <Craig@chatspike.net>
10 * Written by Craig Edwards, Craig McLure, and others.
11 * This program is free but copyrighted software; see
12 * the file COPYING for details.
14 * ---------------------------------------------------
19 // Globops and +g support module by C.J.Edwards
27 /* $ModDesc: Provides support for unreal-style GLOBOPS and umode +g */
31 void handle_globops(char **parameters, int pcnt, userrec *user)
33 std::string line = "*** GLOBOPS - From " + std::string(user->nick) + ": ";
34 for (int i = 0; i < pcnt; i++)
36 line = line + std::string(parameters[i]) + " ";
38 Srv->SendToModeMask("og",WM_AND,line);
42 class ModuleGlobops : public Module
49 if (!Srv->AddExtendedMode('g',MT_CLIENT,true,0,0))
51 Srv->Log(DEFAULT,"*** m_globops: ERROR, failed to allocate user mode +g!");
52 printf("Could not claim usermode +g for this module!");
55 else Srv->AddCommand("GLOBOPS",handle_globops,'o',1,"m_globops.so");
58 virtual ~ModuleGlobops()
63 virtual Version GetVersion()
65 return Version(1,0,0,1,VF_STATIC|VF_VENDOR);
68 virtual int OnExtendedMode(userrec* user, void* target, char modechar, int type, bool mode_on, string_list ¶ms)
70 // check if this is our mode character...
71 if ((modechar == 'g') && (type == MT_CLIENT))
73 // we dont actually do anything with the mode in this module -
74 // just tell the core its been claimed and is ok to give users.
79 // this mode isn't ours, we have to bail and return 0 to not handle it.
85 // stuff down here is the module-factory stuff. For basic modules you can ignore this.
87 class ModuleGlobopsFactory : public ModuleFactory
90 ModuleGlobopsFactory()
94 ~ModuleGlobopsFactory()
98 virtual Module * CreateModule()
100 return new ModuleGlobops;
106 extern "C" void * init_module( void )
108 return new ModuleGlobopsFactory;