summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-10 17:37:25 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-10 17:37:25 +0000
commitafa1ec0e9586d93482b5dfdc2d77e93c9499ea10 (patch)
tree871b1c3029692605a7d0a038068dae09e4238122 /src
parente91d5023f3ace4bb80d197621d6dc20b6e293641 (diff)
PublishFeature, FindFeature, FindModule, PriorityBefore, PriorityAfter -> InspIRCd::
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4846 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules.cpp22
-rw-r--r--src/modules/extra/m_mysql.cpp2
-rw-r--r--src/modules/extra/m_pgsql.cpp2
-rw-r--r--src/modules/extra/m_sqlauth.cpp4
-rw-r--r--src/modules/extra/m_sqllog.cpp2
-rw-r--r--src/modules/extra/m_sqloper.cpp4
-rw-r--r--src/modules/extra/m_sqlutils.cpp4
-rw-r--r--src/modules/extra/m_testclient.cpp4
-rw-r--r--src/modules/m_hostchange.cpp4
-rw-r--r--src/modules/m_securelist.cpp4
10 files changed, 30 insertions, 22 deletions
diff --git a/src/modules.cpp b/src/modules.cpp
index ee18cb9a6..78beb5715 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -241,11 +241,11 @@ void Server::RemoveSocket(InspSocket* sock)
}
}
-long Server::PriorityAfter(const std::string &modulename)
+long InspIRCd::PriorityAfter(const std::string &modulename)
{
- for (unsigned int j = 0; j < ServerInstance->Config->module_names.size(); j++)
+ for (unsigned int j = 0; j < this->Config->module_names.size(); j++)
{
- if (ServerInstance->Config->module_names[j] == modulename)
+ if (this->Config->module_names[j] == modulename)
{
return ((j << 8) | PRIORITY_AFTER);
}
@@ -253,11 +253,11 @@ long Server::PriorityAfter(const std::string &modulename)
return PRIORITY_DONTCARE;
}
-long Server::PriorityBefore(const std::string &modulename)
+long InspIRCd::PriorityBefore(const std::string &modulename)
{
- for (unsigned int j = 0; j < ServerInstance->Config->module_names.size(); j++)
+ for (unsigned int j = 0; j < this->Config->module_names.size(); j++)
{
- if (ServerInstance->Config->module_names[j] == modulename)
+ if (this->Config->module_names[j] == modulename)
{
return ((j << 8) | PRIORITY_BEFORE);
}
@@ -265,7 +265,7 @@ long Server::PriorityBefore(const std::string &modulename)
return PRIORITY_DONTCARE;
}
-bool Server::PublishFeature(const std::string &FeatureName, Module* Mod)
+bool InspIRCd::PublishFeature(const std::string &FeatureName, Module* Mod)
{
if (Features.find(FeatureName) == Features.end())
{
@@ -275,7 +275,7 @@ bool Server::PublishFeature(const std::string &FeatureName, Module* Mod)
return false;
}
-bool Server::UnpublishFeature(const std::string &FeatureName)
+bool InspIRCd::UnpublishFeature(const std::string &FeatureName)
{
featurelist::iterator iter = Features.find(FeatureName);
@@ -286,7 +286,7 @@ bool Server::UnpublishFeature(const std::string &FeatureName)
return true;
}
-Module* Server::FindFeature(const std::string &FeatureName)
+Module* InspIRCd::FindFeature(const std::string &FeatureName)
{
featurelist::iterator iter = Features.find(FeatureName);
@@ -296,14 +296,14 @@ Module* Server::FindFeature(const std::string &FeatureName)
return iter->second;
}
-const std::string& Server::GetModuleName(Module* m)
+const std::string& InspIRCd::GetModuleName(Module* m)
{
static std::string nothing = ""; /* Prevent compiler warning */
for (int i = 0; i <= MODCOUNT; i++)
{
if (modules[i] == m)
{
- return ServerInstance->Config->module_names[i];
+ return this->Config->module_names[i];
}
}
return nothing; /* As above */
diff --git a/src/modules/extra/m_mysql.cpp b/src/modules/extra/m_mysql.cpp
index a6fa7ab8e..5eaa0e8d3 100644
--- a/src/modules/extra/m_mysql.cpp
+++ b/src/modules/extra/m_mysql.cpp
@@ -808,7 +808,7 @@ class ModuleSQL : public Module
{
throw ModuleException("m_mysql: Failed to create dispatcher thread: " + std::string(strerror(errno)));
}
- if (!Srv->PublishFeature("SQL", this))
+ if (!ServerInstance->PublishFeature("SQL", this))
{
/* Tell worker thread to exit NOW */
giveup = true;
diff --git a/src/modules/extra/m_pgsql.cpp b/src/modules/extra/m_pgsql.cpp
index d488bed8e..988700d41 100644
--- a/src/modules/extra/m_pgsql.cpp
+++ b/src/modules/extra/m_pgsql.cpp
@@ -522,7 +522,7 @@ public:
ModulePgSQL(Server* Me)
: Module::Module(Me), Srv(Me), currid(0)
{
- log(DEBUG, "%s 'SQL' feature", Srv->PublishFeature("SQL", this) ? "Published" : "Couldn't publish");
+ log(DEBUG, "%s 'SQL' feature", ServerInstance->PublishFeature("SQL", this) ? "Published" : "Couldn't publish");
sqlsuccess = new char[strlen(SQLSUCCESS)+1];
diff --git a/src/modules/extra/m_sqlauth.cpp b/src/modules/extra/m_sqlauth.cpp
index bc72e0e0c..960a3c540 100644
--- a/src/modules/extra/m_sqlauth.cpp
+++ b/src/modules/extra/m_sqlauth.cpp
@@ -48,7 +48,7 @@ public:
ModuleSQLAuth(Server* Me)
: Module::Module(Me), Srv(Me)
{
- SQLutils = Srv->FindFeature("SQLutils");
+ SQLutils = ServerInstance->FindFeature("SQLutils");
if(SQLutils)
{
@@ -104,7 +104,7 @@ public:
{
Module* target;
- target = Srv->FindFeature("SQL");
+ target = ServerInstance->FindFeature("SQL");
if(target)
{
diff --git a/src/modules/extra/m_sqllog.cpp b/src/modules/extra/m_sqllog.cpp
index a7d73af18..b2ddf1c5d 100644
--- a/src/modules/extra/m_sqllog.cpp
+++ b/src/modules/extra/m_sqllog.cpp
@@ -279,7 +279,7 @@ class ModuleSQLLog : public Module
Conf = new ConfigReader();
dbid = Conf->ReadValue("sqllog","dbid",0); // database id of a database configured in sql module
DELETE(Conf);
- SQLModule = Srv->FindFeature("SQL");
+ SQLModule = ServerInstance->FindFeature("SQL");
if (!SQLModule)
log(DEFAULT,"WARNING: m_sqllog.so could not initialize because an SQL module is not loaded. Load the module and rehash your server.");
return (SQLModule);
diff --git a/src/modules/extra/m_sqloper.cpp b/src/modules/extra/m_sqloper.cpp
index 17188ed68..7e905d691 100644
--- a/src/modules/extra/m_sqloper.cpp
+++ b/src/modules/extra/m_sqloper.cpp
@@ -44,7 +44,7 @@ public:
ModuleSQLOper(Server* Me)
: Module::Module(Me), Srv(Me)
{
- SQLutils = Srv->FindFeature("SQLutils");
+ SQLutils = ServerInstance->FindFeature("SQLutils");
if (SQLutils)
{
@@ -91,7 +91,7 @@ public:
{
Module* target;
- target = Srv->FindFeature("SQL");
+ target = ServerInstance->FindFeature("SQL");
if (target)
{
diff --git a/src/modules/extra/m_sqlutils.cpp b/src/modules/extra/m_sqlutils.cpp
index bbda7f3ea..f2085cbcd 100644
--- a/src/modules/extra/m_sqlutils.cpp
+++ b/src/modules/extra/m_sqlutils.cpp
@@ -31,6 +31,8 @@
/* $ModDesc: Provides some utilities to SQL client modules, such as mapping queries to users and channels */
+extern InspIRCd* ServerInstance;
+
typedef std::map<unsigned long, userrec*> IdUserMap;
typedef std::map<unsigned long, chanrec*> IdChanMap;
typedef std::list<unsigned long> AssocIdList;
@@ -47,7 +49,7 @@ public:
ModuleSQLutils(Server* Me)
: Module::Module(Me), Srv(Me)
{
- log(DEBUG, "%s 'SQLutils' feature", Srv->PublishFeature("SQLutils", this) ? "Published" : "Couldn't publish");
+ log(DEBUG, "%s 'SQLutils' feature", ServerInstance->PublishFeature("SQLutils", this) ? "Published" : "Couldn't publish");
}
void Implements(char* List)
diff --git a/src/modules/extra/m_testclient.cpp b/src/modules/extra/m_testclient.cpp
index 6aec581ae..a5744f240 100644
--- a/src/modules/extra/m_testclient.cpp
+++ b/src/modules/extra/m_testclient.cpp
@@ -8,6 +8,8 @@
#include "configreader.h"
#include "m_sqlv2.h"
+extern InspIRCd* ServerInstance;
+
class ModuleTestClient : public Module
{
private:
@@ -31,7 +33,7 @@ public:
virtual void OnBackgroundTimer(time_t foo)
{
- Module* target = Srv->FindFeature("SQL");
+ Module* target = ServerInstance->FindFeature("SQL");
if(target)
{
diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp
index 354eea3ed..d4da6d1ff 100644
--- a/src/modules/m_hostchange.cpp
+++ b/src/modules/m_hostchange.cpp
@@ -24,6 +24,8 @@ using namespace std;
/* $ModDesc: Provides masking of user hostnames in a different way to m_cloaking */
+extern InspIRCd* ServerInstance;
+
class Host : public classbase
{
public:
@@ -58,7 +60,7 @@ class ModuleHostChange : public Module
Priority Prioritize()
{
- return (Priority)Srv->PriorityAfter("m_cloaking.so");
+ return (Priority)ServerInstance->PriorityAfter("m_cloaking.so");
}
void Implements(char* List)
diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp
index 232a083be..00e860467 100644
--- a/src/modules/m_securelist.cpp
+++ b/src/modules/m_securelist.cpp
@@ -27,6 +27,8 @@ using namespace std;
extern time_t TIME;
/* $ModDesc: A module overriding /list, and making it safe - stop those sendq problems. */
+
+extern InspIRCd* ServerInstance;
class ModuleSecureList : public Module
{
@@ -82,7 +84,7 @@ class ModuleSecureList : public Module
virtual Priority Prioritize()
{
- return (Priority)Srv->PriorityBefore("m_safelist.so");
+ return (Priority)ServerInstance->PriorityBefore("m_safelist.so");
}
};