From 6d853575a51230b5b8905933423ed8cd94058435 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 Apr 2004 00:58:20 +0000 Subject: Added support for /modules command Updated contributors git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@373 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/inspircd.cpp') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index e825729f9..590daea9d 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -76,6 +76,7 @@ int DieDelay = 5; time_t startup_time = time(NULL); extern vector modules; +vector module_names; extern vector factory; vector fd_reap; @@ -3976,6 +3977,15 @@ void handle_trace(char **parameters, int pcnt, userrec *user) } } +void handle_modules(char **parameters, int pcnt, userrec *user) +{ + for (int i = 0; i < module_names.size(); i++) + { + Version V = modules[i]->GetVersion(); + WriteServ(user->fd,"900 0x%08lx %d.%d.%d.%d :%s",modules[i],V.Major,V.Minor,V.Revision,V.Build,module_names[i].c_str()); + } +} + void handle_stats(char **parameters, int pcnt, userrec *user) { if (pcnt != 1) @@ -4555,6 +4565,7 @@ void SetupCommandTable(void) createcommand("WHOWAS",handle_whowas,0,1); createcommand("CONNECT",handle_connect,'o',1); createcommand("SQUIT",handle_squit,'o',1); + createcommand("MODULES",handle_modules,'o',0); } void process_buffer(userrec *user) @@ -4906,8 +4917,9 @@ int InspIRCd(void) if (factory[count]->factory) { modules[count] = factory[count]->factory->CreateModule(); - /* save the module and the module's classfactory, if + /* save the module and the module's classfactory, if * this isnt done, random crashes can occur :/ */ + module_names.push_back(modfile); } else { -- cgit v1.3.1-10-gc9f91