示例#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;
}
示例#2
0
int AnopeInit(int argc, char **argv)
{
    Command *c;
    int status;

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

    c = createCommand("APPENDTOPIC", my_cs_appendtopic, NULL, -1, -1, -1,
                      -1, -1);
    if ((status = moduleAddCommand(CHANSERV, c, MOD_HEAD))) {
        alog("[cs_appendtopic] Unable to create APPENDTOPIC command: %d",
             status);
        return MOD_STOP;
    }
    moduleAddHelp(c, my_cs_help_appendtopic);
    moduleSetChanHelp(my_cs_help);

    my_add_languages();

    alog("[cs_appendtopic] Loaded successfully");

    return MOD_CONT;
}
示例#3
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;
}
示例#4
0
int AnopeInit(int argc, char **argv) {
        Command *c;
        c = createCommand("QAKILL", do_qakill_some_lameass, is_services_admin,-1,-1,-1,-1,-1);
        alog("Loading module os_qakill.so [Status: %d]", moduleAddCommand(OPERSERV,c,MOD_HEAD));
	moduleAddHelp(c,SGR_Module_Help_OPERSERV_QAKILL_FULL);
        moduleSetOperHelp(SGR_Module_Help_OPERSERV_QAKILL);
        alog("[os_qakill] New command: /msg operserv QAKILL [nick] [reason]");
        alog("[os_qakill] For information see: /msg operserv HELP QAKILL");
        alog("[os_qakill] Yayness!(tm) - MODULE LOADED AND ACTIVE");
        moduleAddAuthor(AUTHOR);
        moduleAddVersion(VERSION);
        return MOD_CONT; 
}
示例#5
0
int AnopeInit(int argc, char **argv)
{
	Command *c;

	moduleAddAuthor("Adam");
	moduleAddVersion("1.1");

	c = createCommand("SAREGISTER", do_saregister, is_services_admin, -1, -1, -1, -1, -1);
	moduleAddCommand(NICKSERV, c, MOD_HEAD);
	moduleAddHelp(c, cs_help_saregister);
	moduleSetNickHelp(myNickServHelp);

	return MOD_CONT;
}
示例#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;
}
示例#7
0
int AnopeInit(int argc, char **argv)
{
    Command *c;
    int status = 0;

    moduleSetChanHelp(myHelp);
    c = createCommand("TBAN", do_tban, NULL, -1, -1, -1, -1, -1);
    moduleAddHelp(c, myFullHelp);
    status = moduleAddCommand(CHANSERV, c, MOD_HEAD);

    mAddLanguages();

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

    if (status != MOD_ERR_OK) {
        return MOD_STOP;
    }
    return MOD_CONT;
}
示例#8
0
int AnopeInit(int argc, char **argv)
{
    Command *c;
    int status;

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

    c = createCommand("ENFORCE", my_cs_enforce, NULL, -1, -1, -1, -1, -1);
    if ((status = moduleAddCommand(CHANSERV, c, MOD_HEAD))) {
        alog("[cs_enforce] Unable to create ENFORCE command: %d", status);
        return MOD_STOP;
    }

    moduleAddHelp(c, my_cs_help_enforce);
    moduleSetChanHelp(my_cs_help);

    my_add_languages();

    return MOD_CONT;
}
示例#9
0
int AnopeInit(int argc, char **argv)							/* This will be executed when the module is loaded */
{
    Command *c;											/* Pointer to a Command */
    int status = 0;											/* the status of our new command */
    c = createCommand("moo", hs_moo_show, NULL, -1, -1, -1, -1, -1);	/* Create a new command "moo" pointing to hs_moo */

    moduleAddHelp(c,myHostServMooHelp);						/* add help for all users to this command */
    moduleAddRegHelp(c,myHostServMooRegHelp);				/* add extra regular-user only help to this command */
    moduleAddOperHelp(c,myHostServMooOperHelp);				/* add extra oper only help to this command */
    moduleAddAdminHelp(c,myHostServMooAdminHelp);				/* add extra admin only help to this command */
    moduleAddRootHelp(c,myHostServMooRootHelp);				/* add extra root only help to this command */

    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 */
    moduleDelCallback("test");
    moduleAddAuthor(AUTHOR);								/* tell Anope about the author */
    moduleAddVersion(VERSION);								/* Tell Anope about the verison */

    if(status!=MOD_ERR_OK) {
	return MOD_STOP;
    }
    return MOD_CONT;
}