summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-06-21 12:31:54 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-06-21 12:31:54 +0000
commitfbc5d6b616ec9738579ce8800eca78716512515a (patch)
treeb824d0692cc981d89562c9b0826abc0a1ed2c348 /src
parentb0d03755f23f72e747e9874c32d00b5cf3f955cf (diff)
Added Server::PublishFeature(),
Server::UnpublishFeature(), Server::FindFeature(). See comments in modules.h for usage git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4041 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index 24b3e1945..b2fdc512d 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -60,6 +60,7 @@ extern command_table cmdlist;
class Server;
ExtModeList EMode;
+featurelist Features;
// returns true if an extended mode character is in use
bool ModeDefined(char modechar, int type)
@@ -350,6 +351,36 @@ long Server::PriorityBefore(const std::string &modulename)
return PRIORITY_DONTCARE;
}
+bool Server::PublishFeature(std::string FeatureName, Module* Mod)
+{
+ if (Features.find(FeatureName) == Features.end())
+ {
+ Features[FeatureName] = Mod;
+ return true;
+ }
+ return false;
+}
+
+bool Server::UnpublishFeature(std::string FeatureName)
+{
+ featurelist::iterator iter = Features.find(FeatureName);
+
+ if (iter == Features.end())
+ return false;
+
+ Features.erase(iter);
+}
+
+Module* Server::FindFeature(std::string FeatureName)
+{
+ featurelist::iterator iter = Features.find(FeatureName);
+
+ if (iter == Features.end())
+ return NULL;
+
+ return iter->second;
+}
+
void Server::RehashServer()
{
WriteOpers("*** Rehashing config file");