mirror of
https://github.com/anope/anope.git
synced 2026-07-01 00:26:37 +02:00
BUILD : 1.7.5 (396) BUGS : N/A NOTES : Added arvg[0] to AnopeInit call, it will contain the nick of the person who loaded the module. All existing modules are un-effected :)
git-svn-id: svn://svn.anope.org/anope/trunk@396 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@261 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
e6ed7b9eb5
commit
d24c7ebd16
@@ -1,6 +1,7 @@
|
||||
Anope Version S V N
|
||||
-------------------
|
||||
Provided by Anope Dev. <dev@anope.org> - 2004
|
||||
10/13 A Added argv[0] as nick for AnopeInit. [ #00]
|
||||
09/20 A Added RestrictOperNicks as new feature in services.conf. [ #00]
|
||||
09/08 A Removed rand() and ported bsd's arc4random() to fit our needs. [ #00]
|
||||
08/24 A New -l option for am script to list possible selectors. [ #00]
|
||||
|
||||
+15
-1
@@ -318,6 +318,9 @@ int loadModule(Module * m, User * u)
|
||||
const char *err;
|
||||
int (*func) (int, char **);
|
||||
int ret = 0;
|
||||
char *argv[1];
|
||||
int argc = 0;
|
||||
|
||||
Module *m2;
|
||||
if (!m || !m->name) {
|
||||
return MOD_ERR_PARAMS;
|
||||
@@ -360,7 +363,18 @@ int loadModule(Module * m, User * u)
|
||||
}
|
||||
if (func) {
|
||||
mod_current_module_name = m->name;
|
||||
ret = func(0, NULL); /* exec AnopeInit */
|
||||
/* argv[0] is the user if there was one, or NULL if not */
|
||||
if(u) {
|
||||
argv[0] = sstrdup(u->nick);
|
||||
} else {
|
||||
argv[0] = NULL;
|
||||
}
|
||||
argc++;
|
||||
|
||||
ret = func(argc, argv); /* exec AnopeInit */
|
||||
if(u) {
|
||||
free(argv[0]);
|
||||
}
|
||||
if (ret == MOD_STOP) {
|
||||
alog("%s requested unload...", m->name);
|
||||
unloadModule(m, NULL);
|
||||
|
||||
@@ -35,6 +35,17 @@ int AnopeInit(int argc, char **argv) /* This will be executed when the mod
|
||||
moduleSetHostHelp(myHostServHelp); /* add us to the .hs help list */
|
||||
|
||||
status = moduleAddCommand(HOSTSERV, c, MOD_HEAD); /* Add the command to the HOSTSERV cmd table */
|
||||
|
||||
/* Check if we have any argv's */
|
||||
if(argc>0) {
|
||||
/* we do, the first will be the nick of the person modload'ing us */
|
||||
/* or NULL if we were auto-loaded */
|
||||
if(argv[0]) {
|
||||
alog("hs_moo was modloaded by: [%s]",argv[0]);
|
||||
} else {
|
||||
alog("hs_moo was automatically loaded by anope");
|
||||
}
|
||||
}
|
||||
alog("hs_moo.so: Add Command 'moo' Status: %d",status); /* Log the command being added */
|
||||
|
||||
moduleAddCallback("test",time(NULL)+dotime("15s"),test,0,NULL); /* set a call-back function to exec in 3 mins time */
|
||||
|
||||
+5
-1
@@ -8,10 +8,14 @@
|
||||
VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="5"
|
||||
VERSION_BUILD="395"
|
||||
VERSION_BUILD="396"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.5 (396)
|
||||
# BUGS : N/A
|
||||
# NOTES : Added arvg[0] to AnopeInit call, it will contain the nick of the person who loaded the module. All existing modules are un-effected :)
|
||||
#
|
||||
# BUILD : 1.7.5 (395)
|
||||
# BUGS : N/A
|
||||
# NOTES : Fixed a typo in all source files, and merged sstrdup and anopeStrDup, as they do the same thing
|
||||
|
||||
Reference in New Issue
Block a user