Ejemplo n.º 1
0
int AnopeInit(int argc, char **argv)
{
    Command *c;
    EvtHook *hook;

    c = createCommand("request", hs_do_request, nick_identified, -1, -1,
                      -1, -1, -1);
    moduleAddHelp(c, hs_help_request);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    c = createCommand("activate", hs_do_activate, is_host_setter, -1, -1,
                      -1, -1, -1);
    moduleAddHelp(c, hs_help_activate);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    c = createCommand("reject", hs_do_reject, is_host_setter, -1, -1, -1,
                      -1, -1);
    moduleAddHelp(c, hs_help_reject);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    c = createCommand("waiting", hs_do_waiting, is_host_setter, -1, -1, -1,
                      -1, -1);
    moduleAddHelp(c, hs_help_waiting);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    c = createCommand("list", hs_do_list_out, is_services_oper, -1, -1, -1,
                      -1, -1);
    moduleAddCommand(HOSTSERV, c, MOD_HEAD);

    hook = createEventHook(EVENT_NICK_DROPPED, hsreqevt_nick_dropped);
    moduleAddEventHook(hook);

    hook = createEventHook(EVENT_NICK_EXPIRE, hsreqevt_nick_dropped);
    moduleAddEventHook(hook);

    hook = createEventHook(EVENT_DB_SAVING, hsreqevt_db_saving);
    moduleAddEventHook(hook);

    hook = createEventHook(EVENT_DB_BACKUP, hsreqevt_db_backup);
    moduleAddEventHook(hook);

    moduleSetHostHelp(hs_help);
    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    moduleSetType(SUPPORTED);

    my_load_config();
    my_add_languages();
    hs_request_head = NULL;

    if (debug)
        alog("[hs_request] Loading database...");
    hsreq_load_db();
    alog("hs_request loaded");
    return MOD_CONT;
}
Ejemplo n.º 2
0
/**
* AnopeInit is called when the module is loaded
* @param argc Argument count
* @param argv Argument list
* @return MOD_CONT to allow the module, MOD_STOP to stop it
**/
int AnopeInit(int argc, char **argv)
{
	Command *c;
	EvtHook *hook = NULL;

	int status;

	moduleAddAuthor(AUTHOR);
	moduleAddVersion(VERSION);

	alog("ns_qdbban: Loading configuration directives...");
	if (mLoadConfig()) {
		return MOD_STOP;
	}

	c = createCommand("SASET", myAddQDBBan, is_services_oper, -1, -1, -1, -1, -1);
	status = moduleAddCommand(NICKSERV, c, MOD_HEAD);

	c = createCommand("QLIST", mQList, is_services_oper, -1, -1, -1, -1, -1);
	moduleAddOperHelp(c, nsHelpQList);
	moduleSetNickHelp(nsHelp);
	status = moduleAddCommand(NICKSERV, c, MOD_HEAD);

	/*
	Add the SASET command again for the purpose of adding stuff to /ns help saset
	calls doModCont as using NULL causes Anope to crash. This is due to a (possible)
	bug in 1.8.4.
	*/
	c = createCommand("SASET", doModCont, NULL, -1, -1, -1, -1, -1);
	moduleAddOperHelp(c, mMainSetHelp);
	status = moduleAddCommand(NICKSERV, c, MOD_TAIL);

	c = createCommand("SASET QDBBAN", NULL, NULL, -1, -1, -1, -1, -1);
	moduleAddOperHelp(c, mQDBBanHelp);
	moduleAddCommand(NICKSERV, c, MOD_HEAD);

	c = createCommand("INFO", myNickInfo, NULL, -1, -1, -1, -1, -1);
	status = moduleAddCommand(NICKSERV, c, MOD_TAIL);

	hook = createEventHook(EVENT_DB_SAVING, mSaveData);
	status = moduleAddEventHook(hook);

	hook = createEventHook(EVENT_DB_BACKUP, mBackupData);
	status = moduleAddEventHook(hook);

	hook = createEventHook(EVENT_RELOAD, mEventReload);
	status = moduleAddEventHook(hook);

	mLoadData();
	m_AddLanguages();

	return MOD_CONT;
}
Ejemplo n.º 3
0
/**
 * Create the hook, and tell Denora about it.
 **/
int DenoraInit(int argc, char **argv)
{
    EvtHook *hook;
    Command *c;

    if (denora->debug)
        protocol_debug(NULL, argc, argv);

    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    moduleSetType(THIRD);

    if ((VERSION_MAJOR != 1) && (VERSION_MINOR < 4)) {
        alog(LOG_ERROR,
             "[seen] Your Denora version is incompatible with this module.");
        return MOD_STOP;
    }

    if (!denora->do_sql) {
        alog(LOG_ERROR,
             "[seen] SQL needs to be enabled to load this module.");
        return MOD_STOP;
    }

    hook = createEventHook(EVENT_FANTASY, do_fantasy_seen);
    moduleAddEventHook(hook);

    c = createCommand("SEEN", do_msg_seen, NULL, -1, -1, -1, -1);
    moduleAddCommand(STATSERV, c, MOD_UNIQUE);

    mAddLanguages();

    return MOD_CONT;
}
Ejemplo n.º 4
0
int AnopeInit(int argc, char **argv)
{
    Command *c;
    EvtHook *evt;
    int status;

    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    moduleSetType(SUPPORTED);

    c = createCommand("REGISTER", my_ns_register, NULL, -1, -1, -1, -1,
                      -1);
    if ((status = moduleAddCommand(NICKSERV, c, MOD_HEAD))) {
        alog("[ns_maxemail] Unable to create REGISTER command: %d",
             status);
        return MOD_STOP;
    }

    c = createCommand("SET", my_ns_set, NULL, -1, -1, -1, -1, -1);
    if ((status = moduleAddCommand(NICKSERV, c, MOD_HEAD))) {
        alog("[ns_maxemail] Unable to create SET command: %d", status);
        return MOD_STOP;
    }

    evt = createEventHook(EVENT_RELOAD, my_event_reload);
    if ((status = moduleAddEventHook(evt))) {
        alog("[ns_maxemail] Unable to hook to EVENT_RELOAD: %d", status);
        return MOD_STOP;
    }

    my_load_config();
    my_add_languages();

    return MOD_CONT;
}
Ejemplo n.º 5
0
/**
 * Create the command, and tell anope about it.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int AnopeInit(int argc, char **argv)
{
    Command *c;
    EvtHook *hook;

    moduleAddAuthor("Anope");
    moduleAddVersion(VERSION_STRING);
    moduleSetType(CORE);

    /** 
     * For some unknown reason, do_opernews is actaully defined in news.c
     * we can look at moving it here later
     **/
    c = createCommand("OPERNEWS", do_opernews, is_services_admin,
                      NEWS_HELP_OPER, -1, -1, -1, -1);
    c->help_param1 = (char *) (long) NewsCount;
    moduleAddCommand(OPERSERV, c, MOD_UNIQUE);

    moduleSetOperHelp(myOperServHelp);

    hook = createEventHook(EVENT_RELOAD, reload_config);
    if (moduleAddEventHook(hook) != MOD_ERR_OK) {
        alog("[\002os_opernews\002] Can't hook to EVENT_RELOAD event");
        return MOD_STOP;
    }

    return MOD_CONT;
}
Ejemplo n.º 6
0
int AnopeInit(int argc, char **argv)
{
    Command *c = NULL;
    EvtHook *hook = NULL;
    int status = 0;
	if (!moduleMinVersion(1,7,21,1341)) {
		alog("cs_autovoice: Your version of Anope isn't supported. This module require Anope-1.7.21 (1341) or later. Please upgrade to a newer release.");
		return MOD_STOP;
	}
    hook = createEventHook(EVENT_DB_SAVING, mSaveData);
    status = moduleAddEventHook(hook);
	if (status != MOD_ERR_OK) {
		alog("cs_autovoice: Cannot hook to EVENT_DB_SAVING.");
		return MOD_STOP;
	}
	hook = createEventHook(EVENT_DB_BACKUP, mBackupData);
    status = moduleAddEventHook(hook);
	if (status != MOD_ERR_OK) {
		alog("cs_autovoice: Cannot hook to EVENT_DB_BACKUP.");
		return MOD_STOP;
	}
    hook = createEventHook(EVENT_JOIN_CHANNEL, mEventJoin);
    status = moduleAddEventHook(hook);
	if (status != MOD_ERR_OK) {
		alog("cs_autovoice: Cannot hook to EVENT_JOIN_CHANNEL.");
		return MOD_STOP;
	}
    c = createCommand("AUTOVOICE", do_avoice, NULL, -1, -1, -1, -1, -1);
	moduleAddHelp(c, myChanServAvoiceHelp);
    moduleSetChanHelp(myChanServHelp);
    moduleAddCommand(CHANSERV, c, MOD_HEAD);
	if (status != MOD_ERR_OK) {
		alog("cs_autovoice: Something isn't init right!");
		return MOD_STOP;
	} else {
		alog("cs_autovoice: New command: \2/msg %s HELP AUTOVOICE\2", s_ChanServ);
		alog("cs_autovoice: Module loaded successfully.");
	}
	mLoadConfig();
	mAddLanguages();
	moduleAddCallback("cs_autovoice: mLoadData", time(NULL) + 2, mLoadData, 0, NULL);
    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    return MOD_CONT;
}
Ejemplo n.º 7
0
int AnopeInit(int argc, char **argv)
{
    EvtHook *hook;

    moduleAddAuthor(AUTHOR);
    moduleAddVersion (VERSION);

    hook = createEventHook(EVENT_BOT_FANTASY, fantasy_defkick);
    moduleAddEventHook(hook);

    return MOD_CONT;
}
Ejemplo n.º 8
0
/**
 * Create the hook, and tell anope about it.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int AnopeInit(int argc, char **argv)
{
    EvtHook *hook;

    moduleAddAuthor("Anope");
    moduleAddVersion(VERSION_STRING);
    moduleSetType(CORE);
    hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
    moduleAddEventHook(hook);

    return MOD_CONT;
}
Ejemplo n.º 9
0
/**
 * Create the hook, and tell anope about it.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int AnopeInit(int argc, char **argv)
{
    EvtHook *hook;

    moduleAddAuthor("Anope");
    moduleAddVersion
        ("$Id: bs_fantasy_kickban.c 1029 2006-04-29 09:29:34Z certus $");
    moduleSetType(CORE);

    hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
    moduleAddEventHook(hook);

    return MOD_CONT;
}
Ejemplo n.º 10
0
/**
 * Create the hook, and tell anope about it.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int AnopeInit(int argc, char **argv)
{
    EvtHook *hook;

    moduleAddAuthor("Anope");
    moduleAddVersion
        ("$Id: bs_fantasy_unban.c 953 2006-01-14 11:36:29Z certus $");
    moduleSetType(CORE);

    hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
    moduleAddEventHook(hook);

    return MOD_CONT;
}
Ejemplo n.º 11
0
/**
 * Create the hook, and tell anope about it.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int AnopeInit(int argc, char **argv)
{
    EvtHook *hook;

    moduleAddAuthor("Anope");
    moduleAddVersion
        ("$Id: bs_fantasy_kick.c 1265 2007-08-26 15:33:06Z geniusdex $");
    moduleSetType(CORE);

    hook = createEventHook(EVENT_BOT_FANTASY, do_fantasy);
    moduleAddEventHook(hook);

    return MOD_CONT;
}
Ejemplo n.º 12
0
int AnopeInit(int argc, char **argv) {
    int status = 0;
	Command *c = NULL;
	EvtHook *hook = NULL;

	if (!moduleMinVersion(1,7,10,810)) {
		alog("%s: [cs_autoowner]: Your version of Anope isn't supported.", s_OperServ);
		return MOD_STOP;
	}

	if (!ircd->owner) {
		alog("%s: [cs_autoowner]: Your IRCd does not support channel owner mode, unloading...", s_OperServ);
		return MOD_STOP;
	}

	load_config();

	hook = createEventHook(EVENT_RELOAD, reload_config); status += moduleAddEventHook(hook);
	hook = createEventHook(EVENT_JOIN_CHANNEL, do_on_join); status += moduleAddEventHook(hook);
	hook = createEventHook(EVENT_NICK_IDENTIFY, do_on_identify); status += moduleAddEventHook(hook);

	c = createCommand("UPDATE", do_on_update, NULL, -1, -1, -1, -1, -1);
	status += moduleAddCommand(NICKSERV, c, MOD_TAIL);
	
	if (status != 0) {
		alog("%s: [cs_autoowner]: Module could not load successfully", s_OperServ);
		return MOD_STOP;
	}

	moduleAddAuthor(AUTHOR);
	moduleAddVersion(VERSION);
	moduleSetType(THIRD);

	alog("%s: [cs_autoowner]: Module loaded successfully", s_OperServ);
	return MOD_CONT;
}
Ejemplo n.º 13
0
/**
 * AnopeInit is called when the module is loaded
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int AnopeInit(int argc, char **argv)
{
    EvtHook *hook = NULL;
    Command *c;

    int status = 0;

    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    moduleSetType(THIRD);

    /* Load configuration directives from services.conf */
    alog("[%s] Loading configuration directives", MYNAME);
    if (mLoadConfig(0, NULL))
        return MOD_STOP;

    hook = createEventHook(EVENT_RELOAD, mLoadConfig);
    status += moduleAddEventHook(hook);

    c = createCommand("RESETPASS", do_resetpass, NULL, -1, -1, -1, -1, -1);
    moduleAddHelp(c, ResetPassHelp);
    status += moduleAddCommand(NICKSERV, c, MOD_HEAD);

    c = createCommand("CONFIRMRESET", do_confirm, NULL, -1, -1, -1, -1, -1);
    moduleAddHelp(c, EntercodeResetHelp);
    status += moduleAddCommand(NICKSERV, c, MOD_HEAD);

    c = createCommand("RESENDRESET", do_resendcode, NULL, -1, -1, -1, -1,
                      -1);
    moduleAddHelp(c, ResendPassCodeHelp);
    status += moduleAddCommand(NICKSERV, c, MOD_HEAD);

    c = createCommand("SENDPASS", do_sendpass, NULL, -1, -1, -1, -1, -1);
    status += moduleAddCommand(NICKSERV, c, MOD_HEAD);

    moduleSetNickHelp(mMainNickHelp);
    
    m_AddLanguages();

    if (status != MOD_ERR_OK) {
        alog(LOG_CREATE_COMMAND_ERROR, MYNAME);
        return MOD_STOP;
    }

    return MOD_CONT;
}
Ejemplo n.º 14
0
int DenoraInit(int argc, char **argv)
{
    EvtHook *hook = NULL;
    int status;

    hook = createEventHook(EVENT_CTCP_VERSION, my_version);
    status = moduleAddEventHook(hook);
    if (status != MOD_ERR_OK) {
        /* something went wrong say something about */
        alog(LOG_NORMAL, "[%s%s] unable to bind to EVENT_CTCP_VERSION error [%d][%s]", MYNAME, MODULE_EXT, status, ModuleGetErrStr(status));
        return MOD_STOP;
    }

    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    return MOD_CONT;
}
Ejemplo n.º 15
0
/**
 * Create the hook, and tell Denora about it.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int DenoraInit(int argc, char **argv)
{
    EvtHook *hook;

    if (denora->debug >= 2) {
        protocol_debug(NULL, argc, argv);
    }

    moduleAddAuthor("Denora");
    moduleAddVersion
        ("$Id: ss_fantasy_help.c 386 2011-01-04 17:16:43Z hal9000 $");
    moduleSetType(CORE);

    hook = createEventHook(EVENT_FANTASY, do_fantasy);
    moduleAddEventHook(hook);

    return MOD_CONT;
}
Ejemplo n.º 16
0
/**
 * Create the hook, and tell Denora about it.
 * @param argc Argument count
 * @param argv Argument list
 * @return MOD_CONT to allow the module, MOD_STOP to stop it
 **/
int DenoraInit(int argc, char **argv)
{
    EvtHook *hook;

    if (denora->debug >= 2) {
        protocol_debug(NULL, argc, argv);
    }

    moduleAddAuthor("Denora");
    moduleAddVersion
        ("$Id$");
    moduleSetType(CORE);

    hook = createEventHook(EVENT_FANTASY, do_fantasy);
    moduleAddEventHook(hook);

#ifdef USE_MYSQL
    return MOD_CONT;
#else
    return MOD_STOP;
#endif
}
Ejemplo n.º 17
0
int AnopeInit(int argc, char **argv)
{
        EvtHook *hook;

        hook = createEventHook(EVENT_JOIN_CHANNEL, do_chanurl);
        if (moduleAddEventHook(hook) != MOD_ERR_OK) {
        alog("Can't hook to EVENT_JOIN_CHANNEL event");
        return MOD_STOP;
     }

        alog("Loading ircd_chanurl");

        if (findModule("os_raw")) {
                alog("I found os_raw loaded!, Sorry it didn't work out.");
                return MOD_STOP;
        }

        moduleAddAuthor(AUTHOR);
        moduleAddVersion(VERSION);

    return MOD_CONT;

}
Ejemplo n.º 18
0
int DenoraInit(int argc, char **argv)
{
    Message *msg = NULL;
    EvtHook *hook;
    PrivMsg *p;
    int status;

    ConnectServConnected = 0;

    hook = createEventHook(EVENT_RELOAD, do_reload);
    status = moduleAddEventHook(hook);

    hook = createEventHook(EVENT_NEWNICK, do_newnick);
    status = moduleAddEventHook(hook);

    hook = createEventHook(EVENT_CHANGE_NICK, cs_user_nick);
    status = moduleAddEventHook(hook);

    hook = createEventHook(EVENT_SERVER, cs_server_join);
    status = moduleAddEventHook(hook);

    hook = createEventHook(EVENT_SQUIT, cs_server_quit);
    status = moduleAddEventHook(hook);

    hook = createEventHook(EVENT_GLOBAL_KILL, cs_global_kill);
    status = moduleAddEventHook(hook);

    hook = createEventHook(EVENT_SERVER_KILL, cs_server_kill);
    status = moduleAddEventHook(hook);

    hook = createEventHook(EVENT_USER_LOGOFF, cs_user_logoff);
    status = moduleAddEventHook(hook);

    hook = createEventHook(EVENT_USER_MODE, cs_user_modes);
    status = moduleAddEventHook(hook);


    if (!load_config()) {
        return MOD_STOP;
    }

    if (status == MOD_ERR_OK) {
        cs_addClient();
        ConnectServConnected = 1;
        cs_addMessageList();
        p = createPrivmsg(s_ConnectServ, ConnectServ);
        addPrivMsg(p);
    } else {
        alog(LOG_NORMAL, "Error status was [%d]", status);
        return MOD_STOP;
    }
    my_add_languages();

    if (CsJoinLogChan) {
        denora_cmd_join(s_ConnectServ, LogChannel, time(NULL));
    }

    moduleAddAuthor(AUTHOR);
    moduleAddVersion(VERSION);
    alog(LOG_NORMAL, "ConnectServ%s: loaded", MODULE_EXT);
    return MOD_CONT;
}