mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-02 07:26:38 +02:00
/MODULE will now only list 3rd party modules by default since that's what most people are interested in.
You can still see the full list of loaded modules by using "/MODULE -all". Also fix /MODULE <server>, this was broken in earlier versions by nen.... you know who.
This commit is contained in:
+17
-16
@@ -1042,22 +1042,23 @@ help Mkpasswd {
|
||||
};
|
||||
|
||||
help Module {
|
||||
" This will give you a list of all modules loaded.";
|
||||
" Depending on whether you are a normal user or an oper";
|
||||
" it will give different output.";
|
||||
" -- normal user: --";
|
||||
" Syntax of command: MODULE";
|
||||
" Output of command: *** name - (description) [3RD]";
|
||||
" the [3RD] flag is present if it's an 3rd party module.";
|
||||
" -- ircop: -- ";
|
||||
" Syntax of command: MODULE [server]";
|
||||
" Output of command: *** name - version (description) [optional flags]";
|
||||
" flags can be:";
|
||||
" [PERM]: permanent module (not possible to unload/reload)";
|
||||
" [Unloading]: module is in the process of unloading";
|
||||
" [3RD] 3rd party module";
|
||||
" [OLD?] Lacking Mod_Version, forgot to recompile an old beta* module?";
|
||||
" Additionally you'll see a list of which hooks and command";
|
||||
" This will show the list of modules loaded on the server.";
|
||||
" By default it will only list 3rd party modules, unless you use -all";
|
||||
" -";
|
||||
" Syntax: MODULE [-all] [server]";
|
||||
" Example: MODULE";
|
||||
" -";
|
||||
" The output depends on whether you are a normal user or IRCOp:";
|
||||
" -- Normal user --";
|
||||
" *** name - (description) [3RD]";
|
||||
" The [3RD] flag is present if it's a 3rd party module.";
|
||||
" -- IRCOp -- ";
|
||||
" *** name - version (description) [optional flags]";
|
||||
" The optional flags may contain:";
|
||||
" [PERM]: Permanent module, not possible to unload/reload.";
|
||||
" [PERM-BUT-RELOADABLE]: Module can be reloaded but not unloaded.";
|
||||
" [3RD] 3rd party module, module is not part of UnrealIRCd.";
|
||||
" Additionally you will see a list of which hooks and command";
|
||||
" overrides are present (the hook number can be looked up in";
|
||||
" include/modules.h).";
|
||||
};
|
||||
|
||||
+24
-3
@@ -976,19 +976,38 @@ int Module_Depend_Resolve(Module *p, char *path)
|
||||
*/
|
||||
int m_module(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
{
|
||||
Module *mi;
|
||||
Module *mi;
|
||||
int i;
|
||||
char tmp[1024], *p;
|
||||
aCommand *mptr;
|
||||
int all = 0;
|
||||
#ifdef DEBUGMODE
|
||||
Efunction *e;
|
||||
#endif
|
||||
|
||||
if ((parc > 1) && (hunt_server(cptr, sptr, ":%s MODULES :%s", 1, parc, parv) != HUNTED_ISME))
|
||||
if ((parc > 1) && !strcmp(parv[1], "-all"))
|
||||
all = 1;
|
||||
|
||||
if (MyClient(sptr) && !IsOper(sptr) && all)
|
||||
sptr->local->since += 7; /* Lag them up. Big list. */
|
||||
|
||||
if ((parc > 2) && (hunt_server(cptr, sptr, ":%s MODULE %s :%s", 2, parc, parv) != HUNTED_ISME))
|
||||
return 0;
|
||||
|
||||
|
||||
if ((parc == 2) && (parv[1][0] != '-') && (hunt_server(cptr, sptr, ":%s MODULE :%s", 1, parc, parv) != HUNTED_ISME))
|
||||
return 0;
|
||||
|
||||
if (all)
|
||||
sendnotice(sptr, "Showing ALL loaded modules:");
|
||||
else
|
||||
sendnotice(sptr, "Showing loaded 3rd party modules (use \"MODULE -all\" to show all modules):");
|
||||
|
||||
for (mi = Modules; mi; mi = mi->next)
|
||||
{
|
||||
/* Skip official modules unless "MODULE -all" */
|
||||
if (!all && (mi->options & MOD_OPT_OFFICIAL))
|
||||
continue;
|
||||
|
||||
tmp[0] = '\0';
|
||||
if (mi->flags & MODFLAG_DELAYED)
|
||||
strncat(tmp, "[Unloading] ", sizeof(tmp)-strlen(tmp)-1);
|
||||
@@ -1007,6 +1026,8 @@ int m_module(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
||||
mi->header->name, mi->header->version, mi->header->description, tmp);
|
||||
}
|
||||
|
||||
sendnotice(sptr, "End of module list");
|
||||
|
||||
if (!ValidatePermissionsForPath("server:module",sptr,NULL,NULL,NULL))
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user