From ca0889d458ab768f32f399c0afe5f4e36dcd07d9 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 Dec 2005 20:48:54 +0000 Subject: Added IOHookModule stuff to allow for different modules to hook different ports git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2564 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index e1ade25c9..037a7a3af 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -61,7 +61,6 @@ static char already_sent[65536]; extern std::vector all_opers; extern user_hash clientlist; extern chan_hash chanlist; -extern Module* IOHookModule; void log(int level,char *text, ...) { @@ -140,9 +139,9 @@ void Write(int sock,char *text, ...) chop(tb); if (fd_ref_table[sock]) { - if (IOHookModule) + if (Config->GetIOHook(fd_ref_table[sock]->port)) { - IOHookModule->OnRawSocketWrite(sock,tb,bytes); + Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes); } else { @@ -173,9 +172,9 @@ void WriteServ(int sock, char* text, ...) chop(tb); if (fd_ref_table[sock]) { - if (IOHookModule) + if (Config->GetIOHook(fd_ref_table[sock]->port)) { - IOHookModule->OnRawSocketWrite(sock,tb,bytes); + Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes); } else { @@ -206,9 +205,9 @@ void WriteFrom(int sock, userrec *user,char* text, ...) chop(tb); if (fd_ref_table[sock]) { - if (IOHookModule) + if (Config->GetIOHook(fd_ref_table[sock]->port)) { - IOHookModule->OnRawSocketWrite(sock,tb,bytes); + Config->GetIOHook(fd_ref_table[sock]->port)->OnRawSocketWrite(sock,tb,bytes); } else { @@ -1065,9 +1064,9 @@ void ShowMOTD(userrec *user) snprintf(mbuf,MAXBUF,":%s 376 %s :End of message of the day.\r\n", Config->ServerName, user->nick); WholeMOTD = WholeMOTD + mbuf; // only one write operation - if (IOHookModule) + if (Config->GetIOHook(user->port)) { - IOHookModule->OnRawSocketWrite(user->fd,(char*)WholeMOTD.c_str(),WholeMOTD.length()); + Config->GetIOHook(user->port)->OnRawSocketWrite(user->fd,(char*)WholeMOTD.c_str(),WholeMOTD.length()); } else { -- cgit v1.3.1-10-gc9f91