mirror of
https://github.com/anope/anope.git
synced 2026-07-08 09:43:13 +02:00
Made service_reference type safe
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ enum ChannelAccess
|
||||
|
||||
class ChanAccess;
|
||||
|
||||
class CoreExport AccessProvider : public Service
|
||||
class CoreExport AccessProvider : public Service<AccessProvider>
|
||||
{
|
||||
public:
|
||||
AccessProvider(Module *o, const Anope::string &n);
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ struct CoreExport CommandSource
|
||||
|
||||
/** Every services command is a class, inheriting from Command.
|
||||
*/
|
||||
class CoreExport Command : public Service, public Flags<CommandFlag>
|
||||
class CoreExport Command : public Service<Command>, public Flags<CommandFlag>
|
||||
{
|
||||
Anope::string desc;
|
||||
std::vector<Anope::string> syntax;
|
||||
|
||||
+2
-31
@@ -1076,16 +1076,10 @@ enum Implementation
|
||||
I_END
|
||||
};
|
||||
|
||||
class Service;
|
||||
|
||||
/** Used to manage modules.
|
||||
*/
|
||||
class CoreExport ModuleManager
|
||||
{
|
||||
private:
|
||||
/** A map of service providers
|
||||
*/
|
||||
static std::map<Anope::string, Service *> ServiceProviders;
|
||||
public:
|
||||
/** Event handler hooks.
|
||||
* This needs to be public to be used by FOREACH_MOD and friends.
|
||||
@@ -1197,29 +1191,6 @@ class CoreExport ModuleManager
|
||||
*/
|
||||
static void UnloadAll();
|
||||
|
||||
/** Register a service
|
||||
* @param s The service
|
||||
* @return true if it was successfully registeed, else false (service name colision)
|
||||
*/
|
||||
static bool RegisterService(Service *s);
|
||||
|
||||
/** Unregister a service
|
||||
* @param s The service
|
||||
* @return true if it was unregistered successfully
|
||||
*/
|
||||
static bool UnregisterService(Service *s);
|
||||
|
||||
/** Get a service
|
||||
* @param name The service name
|
||||
* @return The services, or NULL
|
||||
*/
|
||||
static Service *GetService(const Anope::string &name);
|
||||
|
||||
/** Get the existing service key names
|
||||
* @return The keys
|
||||
*/
|
||||
static std::vector<Anope::string> GetServiceKeys();
|
||||
|
||||
private:
|
||||
/** Call the module_delete function to safely delete the module
|
||||
* @param m the module to delete
|
||||
@@ -1254,7 +1225,7 @@ class service_reference : public dynamic_reference<T>
|
||||
Anope::string name;
|
||||
|
||||
public:
|
||||
service_reference(const Anope::string &n) : dynamic_reference<T>(static_cast<T *>(ModuleManager::GetService(n))), name(n)
|
||||
service_reference(const Anope::string &n) : dynamic_reference<T>(NULL), name(n)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1267,7 +1238,7 @@ class service_reference : public dynamic_reference<T>
|
||||
}
|
||||
if (!this->ref)
|
||||
{
|
||||
this->ref = static_cast<T *>(ModuleManager::GetService(this->name));
|
||||
this->ref = Service<T>::FindService(this->name);
|
||||
if (this->ref)
|
||||
this->ref->AddReference(this);
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ class CoreExport XLine
|
||||
sockaddrs GetIP() const;
|
||||
};
|
||||
|
||||
class CoreExport XLineManager : public Service
|
||||
class CoreExport XLineManager : public Service<XLineManager>
|
||||
{
|
||||
char type;
|
||||
protected:
|
||||
|
||||
+29
-4
@@ -347,17 +347,42 @@ template<typename T, size_t Size = 32> class Flags
|
||||
|
||||
class Module;
|
||||
|
||||
class CoreExport Service : public Base
|
||||
template<typename T> class CoreExport Service : public Base
|
||||
{
|
||||
static Anope::map<T *> services;
|
||||
public:
|
||||
static T* FindService(const Anope::string &n)
|
||||
{
|
||||
typename Anope::map<T *>::iterator it = Service<T>::services.find(n);
|
||||
if (it != Service<T>::services.end())
|
||||
return it->second;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static std::vector<Anope::string> GetServiceKeys()
|
||||
{
|
||||
std::vector<Anope::string> keys;
|
||||
for (typename Anope::map<T *>::iterator it = Service<T>::services.begin(), it_end = Service<T>::services.end(); it != it_end; ++it)
|
||||
keys.push_back(it->first);
|
||||
return keys;
|
||||
}
|
||||
|
||||
Module *owner;
|
||||
Anope::string name;
|
||||
|
||||
Service(Module *o, const Anope::string &n);
|
||||
Service(Module *o, const Anope::string &n) : owner(o), name(n)
|
||||
{
|
||||
if (Service<T>::services.find(n) != Service<T>::services.end())
|
||||
throw ModuleException("Service with name " + n + " already exists");
|
||||
Service<T>::services[n] = static_cast<T *>(this);
|
||||
}
|
||||
|
||||
virtual ~Service();
|
||||
virtual ~Service()
|
||||
{
|
||||
Service<T>::services.erase(this->name);
|
||||
}
|
||||
};
|
||||
|
||||
template<typename T> Anope::map<T *> Service<T>::services;
|
||||
|
||||
#include "sockets.h"
|
||||
#include "socketengine.h"
|
||||
|
||||
@@ -160,8 +160,6 @@ class BSAssign : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandbsassign);
|
||||
ModuleManager::RegisterService(&commandbsunassign);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -324,7 +324,6 @@ class BSBadwords : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandbsbadwords);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -407,7 +407,6 @@ class BSBot : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandbsbot);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ class BSBotList : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandbsbotlist);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -150,8 +150,6 @@ class BSControl : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandbssay);
|
||||
ModuleManager::RegisterService(&commandbsact);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -237,7 +237,6 @@ class BSInfo : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandbsinfo);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -739,7 +739,6 @@ class BSKick : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandbskick);
|
||||
|
||||
ModuleManager::Attach(I_OnPrivmsg, this);
|
||||
}
|
||||
|
||||
@@ -302,7 +302,6 @@ class BSSet : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandbsset);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -882,9 +882,6 @@ class CSAccess : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&accessprovider);
|
||||
ModuleManager::RegisterService(&commandcsaccess);
|
||||
ModuleManager::RegisterService(&commandcslevels);
|
||||
|
||||
Implementation i[] = { I_OnReload, I_OnChanRegistered, I_OnCreateChan, I_OnGroupCheckPriv };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
@@ -557,7 +557,6 @@ class CSAKick : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsakick);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -110,7 +110,6 @@ class CSAppendTopic : public Module
|
||||
{
|
||||
this->SetAuthor("SGR");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsappendtopic);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -102,7 +102,6 @@ class CSBan : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsban);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -76,7 +76,6 @@ class CSClearUsers : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsclearusers);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -186,7 +186,6 @@ class CSClone : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsclone);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -93,7 +93,6 @@ class CSDrop : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsdrop);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -208,7 +208,6 @@ class CSEnforce : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsenforce);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -168,7 +168,6 @@ class CSEntryMessage : public Module
|
||||
Implementation i[] = { I_OnJoinChannel, I_OnReload, I_OnDatabaseReadMetadata, I_OnDatabaseWriteMetadata };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
ModuleManager::RegisterService(&commandentrymsg);
|
||||
|
||||
this->OnReload();
|
||||
}
|
||||
|
||||
@@ -427,8 +427,6 @@ class CSFlags : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&accessprovider);
|
||||
ModuleManager::RegisterService(&commandcsflags);
|
||||
|
||||
Implementation i[] = { I_OnReload };
|
||||
ModuleManager::Attach(i, this, 1);
|
||||
|
||||
@@ -73,7 +73,6 @@ class CSGetKey : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsgetkey);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ class CommandCSInfo : public Command
|
||||
Anope::string optbuf;
|
||||
|
||||
CheckOptStr(optbuf, CI_KEEPTOPIC, _("Topic Retention"), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_OPNOTICE, _("OP Notice"), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_PEACE, _("Peace"), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_PRIVATE, _("Private"), ci, u->Account());
|
||||
CheckOptStr(optbuf, CI_RESTRICTED, _("Restricted Access"), ci, u->Account());
|
||||
@@ -135,7 +134,6 @@ class CSInfo : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsinfo);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -95,7 +95,6 @@ class CSInvite : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsinvite);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -84,7 +84,6 @@ class CSKick : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcskick);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -129,7 +129,6 @@ class CSList : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcslist);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -365,7 +365,6 @@ class CSMode : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsmode);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -61,17 +61,16 @@ class CommandModeBase : public Command
|
||||
* @param set Is the mode being set or removed
|
||||
* @param level The acecss level required to set this mode on someone else
|
||||
* @param levelself The access level required to set this mode on yourself
|
||||
* @param notice Flag required on a channel to send a notice
|
||||
*/
|
||||
void do_util(CommandSource &source, Command *com, ChannelMode *cm, const Anope::string &chan, const Anope::string &nick, bool set, ChannelAccess level, ChannelAccess levelself, ChannelInfoFlag notice)
|
||||
void do_util(CommandSource &source, Command *com, ChannelMode *cm, const Anope::string &chan, const Anope::string &nick, bool set, ChannelAccess level, ChannelAccess levelself)
|
||||
{
|
||||
User *u = source.u;
|
||||
|
||||
if (chan.empty())
|
||||
for (UChannelList::iterator it = u->chans.begin(); it != u->chans.end(); ++it)
|
||||
do_mode(source, com, cm, (*it)->chan->name, u->nick, set, level, levelself, notice);
|
||||
do_mode(source, com, cm, (*it)->chan->name, u->nick, set, level, levelself);
|
||||
else
|
||||
do_mode(source, com, cm, chan, !nick.empty() ? nick : u->nick, set, level, levelself, notice);
|
||||
do_mode(source, com, cm, chan, !nick.empty() ? nick : u->nick, set, level, levelself);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -153,7 +152,7 @@ class CommandCSVoice : public CommandModeBase
|
||||
{
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_VOICE);
|
||||
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_VOICE, CA_VOICEME, CI_BEGIN);
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_VOICE, CA_VOICEME);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
@@ -183,7 +182,7 @@ class CommandCSDeVoice : public CommandModeBase
|
||||
{
|
||||
ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_VOICE);
|
||||
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_VOICE, CA_VOICEME, CI_BEGIN);
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_VOICE, CA_VOICEME);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
@@ -216,7 +215,7 @@ class CommandCSHalfOp : public CommandModeBase
|
||||
if (!cm)
|
||||
return;
|
||||
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_HALFOP, CA_HALFOPME, CI_BEGIN);
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_HALFOP, CA_HALFOPME);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
@@ -248,7 +247,7 @@ class CommandCSDeHalfOp : public CommandModeBase
|
||||
if (!cm)
|
||||
return;
|
||||
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_HALFOP, CA_HALFOPME, CI_BEGIN);
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_HALFOP, CA_HALFOPME);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
@@ -281,7 +280,7 @@ class CommandCSProtect : public CommandModeBase
|
||||
if (!cm)
|
||||
return;
|
||||
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_PROTECT, CA_PROTECTME, CI_BEGIN);
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_PROTECT, CA_PROTECTME);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
@@ -313,7 +312,7 @@ class CommandCSDeProtect : public CommandModeBase
|
||||
if (!cm)
|
||||
return;
|
||||
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_PROTECT, CA_PROTECTME, CI_BEGIN);
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_PROTECT, CA_PROTECTME);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
@@ -344,7 +343,7 @@ class CommandCSOwner : public CommandModeBase
|
||||
if (!cm)
|
||||
return;
|
||||
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_OWNER, CA_OWNERME, CI_BEGIN);
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", true, CA_OWNER, CA_OWNERME);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
@@ -375,7 +374,7 @@ class CommandCSDeOwner : public CommandModeBase
|
||||
if (!cm)
|
||||
return;
|
||||
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_OWNER, CA_OWNERME, CI_BEGIN);
|
||||
return do_util(source, this, cm, !params.empty() ? params[0] : "", params.size() > 1 ? params[1] : "", false, CA_OWNER, CA_OWNERME);
|
||||
}
|
||||
|
||||
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
|
||||
@@ -412,17 +411,7 @@ class CSModes : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsop);
|
||||
ModuleManager::RegisterService(&commandcsdeop);
|
||||
ModuleManager::RegisterService(&commandcsvoice);
|
||||
ModuleManager::RegisterService(&commandcsdevoice);
|
||||
|
||||
ModuleManager::RegisterService(&commandcsowner);
|
||||
ModuleManager::RegisterService(&commandcsdeowner);
|
||||
ModuleManager::RegisterService(&commandcsprotect);
|
||||
ModuleManager::RegisterService(&commandcsdeprotect);
|
||||
ModuleManager::RegisterService(&commandcshalfop);
|
||||
ModuleManager::RegisterService(&commandcsdehalfop);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -182,7 +182,6 @@ class CSRegister : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsregister);
|
||||
ModuleManager::Attach(I_OnDelChan, this);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ class CSSASet : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssaset);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -74,7 +74,6 @@ class CSSetNoexpire : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssasetnoexpire);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -294,8 +294,6 @@ class CSSeen : public Module
|
||||
I_OnDatabaseWrite };
|
||||
ModuleManager::Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
|
||||
|
||||
ModuleManager::RegisterService(&commandseen);
|
||||
ModuleManager::RegisterService(&commandosseen);
|
||||
|
||||
OnReload();
|
||||
}
|
||||
|
||||
@@ -67,7 +67,6 @@ class CSSet : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsset);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -90,8 +90,6 @@ class CSSetBanType : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetbantype);
|
||||
ModuleManager::RegisterService(&commandcssasetbantype);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -81,8 +81,6 @@ class CSSetDescription : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetdescription);
|
||||
ModuleManager::RegisterService(&commandcssasetdescription);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -97,8 +97,6 @@ class CSSetFounder : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetfounder);
|
||||
ModuleManager::RegisterService(&commandcssasetfounder);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -86,8 +86,6 @@ class CSSetKeepTopic : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetkeeptopic);
|
||||
ModuleManager::RegisterService(&commandcssasetkeeptopic);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -67,8 +67,6 @@ class CSSetMisc : public Module
|
||||
Implementation i[] = { I_OnChanInfo, I_OnDatabaseWriteMetadata, I_OnDatabaseReadMetadata };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
ModuleManager::RegisterService(&this->commandcssetmisc);
|
||||
ModuleManager::RegisterService(&this->commandcssasetmisc);
|
||||
}
|
||||
|
||||
void OnChanInfo(CommandSource &source, ChannelInfo *ci, bool ShowHidden)
|
||||
|
||||
@@ -85,8 +85,6 @@ class CSSetPeace : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetpeace);
|
||||
ModuleManager::RegisterService(&commandcssasetpeace);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -172,8 +172,6 @@ class CSSetPersist : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetpeace);
|
||||
ModuleManager::RegisterService(&commandcssasetpeace);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -85,8 +85,6 @@ class CSSetPrivate : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetprivate);
|
||||
ModuleManager::RegisterService(&commandcssasetprivate);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -83,8 +83,6 @@ class CSSetRestricted : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetrestricted);
|
||||
ModuleManager::RegisterService(&commandcssasetrestricted);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -86,8 +86,6 @@ class CSSetSecure : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetsecure);
|
||||
ModuleManager::RegisterService(&commandcssasetsecure);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -87,8 +87,6 @@ class CSSetSecureFounder : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetsecurefounder);
|
||||
ModuleManager::RegisterService(&commandcssasetsecurefounder);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -84,8 +84,6 @@ class CSSetSecureOps : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetsecureops);
|
||||
ModuleManager::RegisterService(&commandcssasetsecureops);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -96,8 +96,6 @@ class CSSetSignKick : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetsignkick);
|
||||
ModuleManager::RegisterService(&commandcssasetsignkick);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -111,8 +111,6 @@ class CSSetSuccessor : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssetsuccessor);
|
||||
ModuleManager::RegisterService(&commandcssasetsuccessor);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -84,8 +84,6 @@ class CSSetTopicLock : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssettopiclock);
|
||||
ModuleManager::RegisterService(&commandcssasettopiclock);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -150,8 +150,6 @@ class CSSuspend : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssuspend);
|
||||
ModuleManager::RegisterService(&commandcsunsuspend);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@ class CSSync : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcssync);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -109,7 +109,6 @@ class CSTBan : public Module
|
||||
|
||||
me = this;
|
||||
|
||||
ModuleManager::RegisterService(&commandcstban);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ class CSTopic : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcstopic);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -87,7 +87,6 @@ class CSUnban : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsunban);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -122,8 +122,6 @@ class CSUpDown : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandcsup);
|
||||
ModuleManager::RegisterService(&commandcsdown);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -868,12 +868,6 @@ class CSXOP : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&accessprovider);
|
||||
ModuleManager::RegisterService(&commandcssop);
|
||||
ModuleManager::RegisterService(&commandcsaop);
|
||||
ModuleManager::RegisterService(&commandcsqop);
|
||||
ModuleManager::RegisterService(&commandcsvop);
|
||||
ModuleManager::RegisterService(&commandcshop);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ class GLGlobal : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandglglobal);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -123,7 +123,6 @@ class Help : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandhelp);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -99,8 +99,6 @@ class HSDel : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandhsdel);
|
||||
ModuleManager::RegisterService(&commandhsdelall);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -73,7 +73,6 @@ class HSGroup : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandhsgroup);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -130,7 +130,6 @@ class HSList : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandhslist);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ class HSOff : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandhsoff);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ class HSOn : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandhson);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -306,10 +306,6 @@ class HSRequest : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandhsrequest);
|
||||
ModuleManager::RegisterService(&commandhsactive);
|
||||
ModuleManager::RegisterService(&commandhsreject);
|
||||
ModuleManager::RegisterService(&commandhswaiting);
|
||||
|
||||
Implementation i[] = { I_OnDelNick, I_OnDatabaseRead, I_OnDatabaseWrite, I_OnReload };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
@@ -216,8 +216,6 @@ class HSSet : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandhsset);
|
||||
ModuleManager::RegisterService(&commandhssetall);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ class MSCancel : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmscancel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -82,7 +82,6 @@ class MSCheck : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmscheck);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -156,7 +156,6 @@ class MSDel : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmsdel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ class MSIgnore : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmsignore);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -212,7 +212,6 @@ class MSInfo : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmsinfo);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -161,7 +161,6 @@ class MSList : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmslist);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -189,7 +189,6 @@ class MSRead : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmsread);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -99,7 +99,6 @@ class MSRSend : public Module
|
||||
if (!Config->MSMemoReceipt)
|
||||
throw ModuleException("Invalid value for memoreceipt");
|
||||
|
||||
ModuleManager::RegisterService(&commandmsrsend);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ class MSSend : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmssend);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -67,7 +67,6 @@ class MSSendAll : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmssendall);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -305,7 +305,6 @@ class MSSet : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmsset);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ class MSStaff : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandmsstaff);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -188,7 +188,6 @@ class NSAccess : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsaccess);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -120,7 +120,6 @@ class NSAJoin : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsajoin);
|
||||
|
||||
Implementation i[] = { I_OnNickIdentify, I_OnDatabaseWriteMetadata, I_OnDatabaseReadMetadata };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
@@ -95,7 +95,6 @@ class NSAList : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsalist);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -214,7 +214,6 @@ class NSCert : public Module
|
||||
Implementation i[] = { I_OnFingerprint };
|
||||
ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation));
|
||||
|
||||
ModuleManager::RegisterService(&commandnscert);
|
||||
}
|
||||
|
||||
void OnFingerprint(User *u)
|
||||
|
||||
@@ -123,7 +123,6 @@ class NSDrop : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsdrop);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -75,7 +75,6 @@ class NSGetEMail : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsgetemail);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -72,7 +72,6 @@ class NSGetPass : public Module
|
||||
if (enc_decrypt(tmp_pass, tmp_pass) == -1)
|
||||
throw ModuleException("Incompatible with the encryption module being used");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsgetpass);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -115,7 +115,6 @@ class NSGhost : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsghost);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -296,9 +296,6 @@ class NSGroup : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsgroup);
|
||||
ModuleManager::RegisterService(&commandnsungroup);
|
||||
ModuleManager::RegisterService(&commandnsglist);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -86,7 +86,6 @@ class NSIdentify : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsidentify);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -171,7 +171,6 @@ class NSInfo : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsinfo);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -162,7 +162,6 @@ class NSList : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnslist);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -90,7 +90,6 @@ class NSLogout : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnslogout);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +133,6 @@ class NSRecover : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsrecover);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -315,9 +315,6 @@ class NSRegister : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsregister);
|
||||
ModuleManager::RegisterService(&commandnsconfirm);
|
||||
ModuleManager::RegisterService(&commandnsrsend);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -103,7 +103,6 @@ class NSRelease : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsrelease);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ class NSResetPass : public Module
|
||||
if (!Config->UseMail)
|
||||
throw ModuleException("Not using mail.");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsresetpass);
|
||||
|
||||
ModuleManager::Attach(I_OnPreCommand, this);
|
||||
}
|
||||
|
||||
@@ -164,9 +164,6 @@ class NSSASet : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnssaset);
|
||||
ModuleManager::RegisterService(&commandnssasetdisplay);
|
||||
ModuleManager::RegisterService(&commandnssasetpassword);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -69,7 +69,6 @@ class NSSASetNoexpire : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnssasetnoexpire);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -83,7 +83,6 @@ class NSSendPass : public Module
|
||||
if (enc_decrypt(tmp_pass, tmp_pass) == -1)
|
||||
throw ModuleException("Incompatible with the encryption module being used");
|
||||
|
||||
ModuleManager::RegisterService(&commandnssendpass);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -149,9 +149,6 @@ class NSSet : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnsset);
|
||||
ModuleManager::RegisterService(&commandnssetdisplay);
|
||||
ModuleManager::RegisterService(&commandnssetpassword);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -99,8 +99,6 @@ class NSSetAutoOp : public Module
|
||||
{
|
||||
this->SetAuthor("Anope");
|
||||
|
||||
ModuleManager::RegisterService(&commandnssetautoop);
|
||||
ModuleManager::RegisterService(&commandnssasetautoop);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user