diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-09 14:39:07 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2005-04-09 14:39:07 +0000 |
commit | 3d7312f8af1becdbe458392e14ea64c904ee7b92 (patch) | |
tree | 8cc2699e70e6904046cf937803d058845e57ec0d /src | |
parent | 237766c84573c4a5439382fe6ba2afc026a18e09 (diff) |
Changed parameters of OnPacketTransmit and OnPacketReceive to be much more useful
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1024 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r-- | src/inspircd.cpp | 25 | ||||
-rw-r--r-- | src/modules.cpp | 4 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index eb014f611..d69aa6a1e 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -915,6 +915,10 @@ void NetSendToCommon(userrec* u, char* s) log(DEBUG,"NetSendToCommon: '%s' '%s'",u->nick,s); + std::string msg = buffer; + FOREACH_MOD OnPacketTransmit(msg,s); + strlcpy(buffer,msg.c_str(),MAXBUF); + for (int j = 0; j < 32; j++) { if (me[j] != NULL) @@ -938,6 +942,10 @@ void NetSendToAll(char* s) log(DEBUG,"NetSendToAll: '%s'",s); + std::string msg = buffer; + FOREACH_MOD OnPacketTransmit(msg,s); + strlcpy(buffer,msg.c_str(),MAXBUF); + for (int j = 0; j < 32; j++) { if (me[j] != NULL) @@ -957,6 +965,10 @@ void NetSendToAllAlive(char* s) log(DEBUG,"NetSendToAllAlive: '%s'",s); + std::string msg = buffer; + FOREACH_MOD OnPacketTransmit(msg,s); + strlcpy(buffer,msg.c_str(),MAXBUF); + for (int j = 0; j < 32; j++) { if (me[j] != NULL) @@ -984,6 +996,10 @@ void NetSendToOne(char* target,char* s) log(DEBUG,"NetSendToOne: '%s' '%s'",target,s); + std::string msg = buffer; + FOREACH_MOD OnPacketTransmit(msg,s); + strlcpy(buffer,msg.c_str(),MAXBUF); + for (int j = 0; j < 32; j++) { if (me[j] != NULL) @@ -1006,6 +1022,10 @@ void NetSendToAllExcept(const char* target,char* s) log(DEBUG,"NetSendToAllExcept: '%s' '%s'",target,s); + std::string msg = buffer; + FOREACH_MOD OnPacketTransmit(msg,s); + strlcpy(buffer,msg.c_str(),MAXBUF); + for (int j = 0; j < 32; j++) { if (me[j] != NULL) @@ -3806,8 +3826,9 @@ int InspIRCd(void) else NetSendToAllExcept(tcp_host,udp_msg); } - FOREACH_MOD OnPacketReceive(udp_msg); - handle_link_packet(udp_msg, tcp_host, me[x]); + std::string msg = udp_msg; + FOREACH_MOD OnPacketReceive(msg,tcp_host); + strlcpy(udp_msg,msg.c_str(),MAXBUF); } goto label; } diff --git a/src/modules.cpp b/src/modules.cpp index f068dc591..324ab375c 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -309,8 +309,8 @@ void Module::OnUserConnect(userrec* user) { } void Module::OnUserQuit(userrec* user) { } void Module::OnUserJoin(userrec* user, chanrec* channel) { } void Module::OnUserPart(userrec* user, chanrec* channel) { } -void Module::OnPacketTransmit(char *p) { } -void Module::OnPacketReceive(char *p) { } +void Module::OnPacketTransmit(std::string &data, std::string serv) { } +void Module::OnPacketReceive(std::string &data, std::string serv) { } void Module::OnRehash() { } void Module::OnServerRaw(std::string &raw, bool inbound, userrec* user) { } int Module::OnUserPreJoin(userrec* user, chanrec* chan, const char* cname) { return 0; } |