+ if (!hook.empty())
+ {
+ modulelist* ml = ServerInstance->Modules->FindInterface("BufferedSocketHook");
+ if (ml)
+ {
+ for(modulelist::iterator i = ml->begin(); i != ml->end(); ++i)
+ {
+ std::string name = (**i).ModuleSourceFile;
+ int a = name.rfind('_');
+ int b = name.rfind('.');
+ name = name.substr(a+1, b-a-1);
+ if (name == hook)
+ {
+ AddIOHook(*i);
+ goto found;
+ }
+ }
+ }
+ SetError("Could not find hook '" + hook + "' for connection to " + ServerName);
+ return;
+ }
+found: