summaryrefslogtreecommitdiff
path: root/src/cmd_modules.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-26 22:35:39 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-12-26 22:35:39 +0000
commit005ba1bf25510ea0dc83291fa60145aac1c2e21d (patch)
treeef6e55219b5c1eeb4dd64d8140169e860dc82cc7 /src/cmd_modules.cpp
parent3926fcf5051d77798419096fc2e09df730df5bc9 (diff)
Fixed and implemented /modules debug <glob>
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2673 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_modules.cpp')
-rw-r--r--src/cmd_modules.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/src/cmd_modules.cpp b/src/cmd_modules.cpp
index ac25f1888..e9483ea65 100644
--- a/src/cmd_modules.cpp
+++ b/src/cmd_modules.cpp
@@ -98,11 +98,34 @@ void cmd_modules::Handle (char **parameters, int pcnt, userrec *user)
strlcpy(modulename,Config->module_names[i].c_str(),256);
if (strchr(user->modes,'o'))
{
- if ((pcnt > 0) && (!strcasecmp(parameters[0],"debug")))
+ if ((pcnt >= 2) && (!strcasecmp(parameters[0],"debug")))
{
- WriteServ(user->fd,"900 %s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,modules[i],V.Major,V.Minor,V.Revision,V.Build,CleanFilename(modulename),flagstate+2);
- for (int it = 0; itab[it]; it++)
- WriteServ(user->fd,"900 %s :%s [%s = %d]",user->nick,CleanFilename(modulename),itab[it],Config->implement_lists[i]);
+ if (match(Config->module_names[i].c_str(),parameters[1]))
+ {
+ WriteServ(user->fd,"900 %s :0x%08lx %d.%d.%d.%d %s (%s)",user->nick,modules[i],V.Major,V.Minor,V.Revision,V.Build,CleanFilename(modulename),flagstate+2);
+ for (int it = 0; itab[it];)
+ {
+ char data[MAXBUF];
+ char dlist[MAXBUF];
+ *dlist = 0;
+ for (int v = 0; v < 4; v++)
+ {
+ if (itab[it])
+ {
+ snprintf(data,MAXBUF,"%s=>%c ",itab[it],(Config->implement_lists[i][it] ? '1' : '0'));
+ strncat(dlist,data,MAXBUF);
+ it++;
+ }
+ }
+ if (*dlist)
+ WriteServ(user->fd,"900 %s :%s [ %s]",user->nick,CleanFilename(modulename),dlist);
+ }
+ WriteServ(user->fd,"900 %s :=== DEBUG: Implementation counts ===",user->nick);
+ for (int it = 0; itab[it]; it++)
+ {
+ WriteServ(user->fd,"900 %s :%s: %d times",user->nick, itab[it],(int)Config->global_implementation[it]);
+ }
+ }
}
else
{