summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-26 17:57:24 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-26 17:57:24 +0000
commitbd59b1a9a283c09b318bd3a6cb93774d5961b794 (patch)
treea6a24a33ef748ec2c0e080acb51f961e9e4a81f0
parenta9b90ecb4329498aba52da6aaa9812e3a70b8e11 (diff)
Fixed support for implementation hooks
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2654 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/modules.h5
-rw-r--r--src/cmd_eline.cpp1
-rw-r--r--src/cmd_gline.cpp1
-rw-r--r--src/cmd_info.cpp1
-rw-r--r--src/cmd_invite.cpp1
-rw-r--r--src/cmd_qline.cpp1
-rw-r--r--src/cmd_zline.cpp1
-rw-r--r--src/inspircd.cpp7
-rw-r--r--src/mode.cpp2
-rw-r--r--src/modules.cpp2
10 files changed, 17 insertions, 5 deletions
diff --git a/include/modules.h b/include/modules.h
index 28dbadb2e..264354db9 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -280,7 +280,8 @@ enum Implementation { I_OnUserConnect, I_OnUserQuit, I_OnUserDisconnect, I_OnUse
I_OnBackgroundTimer, I_OnSendList, I_OnPreCommand, I_OnCheckReady, I_OnUserRrgister, I_OnRawMode, I_OnCheckInvite,
I_OnCheckKey, I_OnCheckLimit, I_OnCheckBan, I_OnStats, I_OnChangeLocalUserHost, I_OnChangeLocalUserGecos, I_OnLocalTopicChange,
I_OnPostLocalTopicChange, I_OnEvent, I_OnRequest, I_OnOperCompre, I_OnGlobalOper, I_OnGlobalConnect, I_OnAddBan, I_OnDelBan,
- I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead };
+ I_OnRawSocketAccept, I_OnRawSocketClose, I_OnRawSocketWrite, I_OnRawSocketRead, I_OnChangeLocalUserGECOS, I_OnUserRegister,
+ I_OnOperCompare };
/** Base class for all InspIRCd modules
* This class is the base class for InspIRCd modules. All modules must inherit from this class,
@@ -308,7 +309,7 @@ class Module : public classbase
*/
virtual Version GetVersion();
- virtual void Implements(bool &Implements[255]);
+ virtual void Implements(char* Implements);
/** Called when a user connects.
* The details of the connecting user are available to you in the parameter userrec *user
diff --git a/src/cmd_eline.cpp b/src/cmd_eline.cpp
index 7927dcad1..b92c17d31 100644
--- a/src/cmd_eline.cpp
+++ b/src/cmd_eline.cpp
@@ -42,6 +42,7 @@ using namespace std;
#include "cmd_eline.h"
extern int MODCOUNT;
+extern ServerConfig* Config;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
diff --git a/src/cmd_gline.cpp b/src/cmd_gline.cpp
index f3d8ee170..d99435e4f 100644
--- a/src/cmd_gline.cpp
+++ b/src/cmd_gline.cpp
@@ -41,6 +41,7 @@ using namespace std;
#include "command_parse.h"
#include "cmd_eline.h"
+extern ServerConfig* Config;
extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
diff --git a/src/cmd_info.cpp b/src/cmd_info.cpp
index 0f9abf8d5..ad1464afb 100644
--- a/src/cmd_info.cpp
+++ b/src/cmd_info.cpp
@@ -33,6 +33,7 @@ using namespace std;
#include "typedefs.h"
#include "cmd_info.h"
+extern ServerConfig* Config;
extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
diff --git a/src/cmd_invite.cpp b/src/cmd_invite.cpp
index b99f80db4..a91c5ba4c 100644
--- a/src/cmd_invite.cpp
+++ b/src/cmd_invite.cpp
@@ -36,6 +36,7 @@ using namespace std;
#include "command_parse.h"
#include "cmd_invite.h"
+extern ServerConfig* Config;
extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
diff --git a/src/cmd_qline.cpp b/src/cmd_qline.cpp
index 2b1361fcc..91b875b27 100644
--- a/src/cmd_qline.cpp
+++ b/src/cmd_qline.cpp
@@ -41,6 +41,7 @@ using namespace std;
#include "command_parse.h"
#include "cmd_eline.h"
+extern ServerConfig* Config;
extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
diff --git a/src/cmd_zline.cpp b/src/cmd_zline.cpp
index 99be92980..048fa9140 100644
--- a/src/cmd_zline.cpp
+++ b/src/cmd_zline.cpp
@@ -41,6 +41,7 @@ using namespace std;
#include "command_parse.h"
#include "cmd_eline.h"
+extern ServerConfig* Config;
extern int MODCOUNT;
extern std::vector<Module*> modules;
extern std::vector<ircd_module*> factory;
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 33190e171..f15fba3a0 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -359,7 +359,12 @@ bool InspIRCd::LoadModule(const char* filename)
/* save the module and the module's classfactory, if
* this isnt done, random crashes can occur :/ */
Config->module_names.push_back(filename);
- modules[MODCOUNT+1]->Implements(Config->implement_lists[MODCOUNT+1]);
+
+ char* x = &Config->implement_lists[MODCOUNT+1][0];
+ for(int t = 0; t < 255; t++)
+ x[t] = 0;
+
+ modules[MODCOUNT+1]->Implements(x);
}
else
{
diff --git a/src/mode.cpp b/src/mode.cpp
index e1bfe56e2..787e9f1f3 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -562,7 +562,7 @@ void ModeParser::ProcessModes(char **parameters,userrec* user,chanrec *chan,int
}
int MOD_RESULT = 0;
- FOREACH_RESULT(I_OnAccessCheck(user,NULL,chan,AC_GENERAL_MODE));
+ FOREACH_RESULT(I_OnAccessCheck,OnAccessCheck(user,NULL,chan,AC_GENERAL_MODE));
if (MOD_RESULT == ACR_DENY)
return;
diff --git a/src/modules.cpp b/src/modules.cpp
index 01aef0802..cb9a228a2 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -296,7 +296,7 @@ void Module::OnDelKLine(userrec* source, std::string hostmask) { };
void Module::OnDelQLine(userrec* source, std::string nickmask) { };
void Module::OnDelELine(userrec* source, std::string hostmask) { };
void Module::OnCleanup(int target_type, void* item) { };
-void Module::Implements(bool &Implements[255]) { for (int j = 0; j < 255; j++) Implements[j] = false; };
+void Module::Implements(char* Implements) { for (int j = 0; j < 255; j++) Implements[j] = 0; };
/* server is a wrapper class that provides methods to all of the C-style
* exports in the core