char *filesys_start(Function *global_funcs) { global = global_funcs; module_register(MODULE_NAME, filesys_table, 2, 0); if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.6.0 or later."; } if (!(transfer_funcs = module_depend(MODULE_NAME, "transfer", 2, 0))) { module_undepend(MODULE_NAME); return "This module requires transfer module 2.0 or later."; } add_tcl_commands(mytcls); add_tcl_strings(mystrings); add_tcl_ints(myints); H_fil = add_bind_table("fil", 0, builtin_fil); add_builtins(H_dcc, mydcc); add_builtins(H_fil, myfiles); add_builtins(H_load, myload); add_help_reference("filesys.help"); init_server_ctcps(0); my_memcpy(&USERENTRY_DCCDIR, &USERENTRY_INFO, sizeof(struct user_entry_type) - sizeof(char *)); USERENTRY_DCCDIR.got_share = 0; /* We dont want it shared tho */ add_entry_type(&USERENTRY_DCCDIR); DCC_FILES_PASS.timeout_val = &password_timeout; add_lang_section("filesys"); return NULL; }
char *ctcp_start(Function *global_funcs) { global = global_funcs; module_register(MODULE_NAME, ctcp_table, 1, 1); if (!module_depend(MODULE_NAME, "eggdrop", 108, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.8.0 or later."; } if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 0))) { module_undepend(MODULE_NAME); return "This module requires server module 1.0 or later."; } add_tcl_strings(mystrings); add_tcl_ints(myints); add_builtins(H_ctcp, myctcp); add_help_reference("ctcp.help"); if (!ctcp_version[0]) { strncpy(ctcp_version, ver, 120); ctcp_version[120] = 0; } if (!ctcp_finger[0]) { strncpy(ctcp_finger, ver, 120); ctcp_finger[120] = 0; } if (!ctcp_userinfo[0]) { strncpy(ctcp_userinfo, ver, 120); ctcp_userinfo[120] = 0; } return NULL; }
char *wire_start(Function *global_funcs) { p_tcl_bind_list H_temp; global = global_funcs; module_register(MODULE_NAME, wire_table, 2, 0); if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.6.0 or later."; } if (!(encryption_funcs = module_depend(MODULE_NAME, "encryption", 2, 1))) { module_undepend(MODULE_NAME); return "This module requires an encryption module."; } add_help_reference("wire.help"); add_builtins(H_dcc, wire_dcc); H_temp = find_bind_table("filt"); add_builtins(H_filt, wire_filt); H_temp = find_bind_table("chof"); add_builtins(H_chof, wire_chof); wirelist = NULL; add_lang_section("wire"); return NULL; }
char *compress_start(Function *global_funcs) { global = global_funcs; compressed_files = 0; uncompressed_files = 0; share_compressed = 0; compress_level = 9; module_register(MODULE_NAME, compress_table, 1, 1); if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.6.0 or later."; } share_funcs = module_depend(MODULE_NAME, "share", 2, 3); if (!share_funcs) { module_undepend(MODULE_NAME); return "This module requires share module 2.3 or later."; } uff_addtable(compress_uff_table); add_tcl_ints(my_tcl_ints); add_tcl_commands(my_tcl_cmds); add_help_reference("compress.help"); return NULL; }
/* This function is called as the module is loaded. */ char *sample_start(Function *global_funcs) { /* Assign the global function table. After this point, you can use all * normal functions defined in src/mod/modules.h. */ global = global_funcs; /* Register the module. */ module_register(MODULE_NAME, sample_table, 2, 0); /* ^--- minor module version * ^------ major module version * ^-------------------- module function table * ^--------------------------------- module name */ /* Depend on the Eggdrop core, version 1.7.0 or later. */ if (!module_depend(MODULE_NAME, "eggdrop", 107, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.7.0 or later."; } /* Add command table to bind list H_dcc, responsible for DCC/partyline * commands. Currently we only add one command, 'sample'. */ add_builtins(H_dcc, mydcc); /* Return NULL unless we're passing an error message. */ return NULL; }
char *notes_start(Function *global_funcs) { global = global_funcs; notefile[0] = 0; module_register(MODULE_NAME, notes_table, 2, 2); if (!module_depend(MODULE_NAME, "eggdrop", 108, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.8.0 or later."; } add_hook(HOOK_HOURLY, (Function) notes_hourly); add_hook(HOOK_MATCH_NOTEREJ, (Function) match_note_ignore); add_tcl_ints(notes_ints); add_tcl_strings(notes_strings); add_tcl_commands(notes_tcls); add_builtins(H_dcc, notes_cmds); add_builtins(H_chon, notes_chon); add_builtins(H_away, notes_away); add_builtins(H_nkch, notes_nkch); add_builtins(H_load, notes_load); add_help_reference("notes.help"); add_lang_section("notes"); notes_server_setup(0); notes_irc_setup(0); my_memcpy(&USERENTRY_FWD, &USERENTRY_INFO, sizeof(void *) * 12); add_entry_type(&USERENTRY_FWD); return NULL; }
static char *channels_close() { write_channels(); free_udef(udef); if (lastdeletedmask) nfree(lastdeletedmask); rem_builtins(H_chon, my_chon); rem_builtins(H_dcc, C_dcc_irc); rem_tcl_commands(channels_cmds); rem_tcl_strings(my_tcl_strings); rem_tcl_ints(my_tcl_ints); rem_tcl_coups(mychan_tcl_coups); del_hook(HOOK_USERFILE, (Function) channels_writeuserfile); del_hook(HOOK_BACKUP, (Function) backup_chanfile); del_hook(HOOK_REHASH, (Function) channels_rehash); del_hook(HOOK_PRE_REHASH, (Function) channels_prerehash); del_hook(HOOK_MINUTELY, (Function) check_expired_bans); del_hook(HOOK_MINUTELY, (Function) check_expired_exempts); del_hook(HOOK_MINUTELY, (Function) check_expired_invites); Tcl_UntraceVar(interp, "global-chanset", TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS, traced_globchanset, NULL); rem_help_reference("channels.help"); rem_help_reference("chaninfo.help"); module_undepend(MODULE_NAME); return NULL; }
char *dns_start(Function *global_funcs) { int idx; global = global_funcs; module_register(MODULE_NAME, dns_table, 1, 0); if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.6.0 or later."; } idx = new_dcc(&DCC_DNS, 0); if (idx < 0) return "NO MORE DCC CONNECTIONS -- Can't create DNS socket."; if (!init_dns_core()) { lostdcc(idx); return "DNS initialisation failed."; } dcc[idx].sock = resfd; dcc[idx].timeval = now; strcpy(dcc[idx].nick, "(dns)"); add_hook(HOOK_SECONDLY, (Function) dns_check_expires); add_hook(HOOK_DNS_HOSTBYIP, (Function) dns_lookup); add_hook(HOOK_DNS_IPBYHOST, (Function) dns_forward); return NULL; }
static char *filesys_close() { int i; p_tcl_bind_list H_ctcp; Context; putlog(LOG_MISC, "*", "Unloading filesystem, killing all filesystem connections.."); for (i = 0; i < dcc_total; i++) if (dcc[i].type == &DCC_FILES) { dprintf(i, DCC_BOOTED1); dprintf(i, "You have been booted from the filesystem, module unloaded.\n"); killsock(dcc[i].sock); lostdcc(i); } else if (dcc[i].type == &DCC_FILES_PASS) { killsock(dcc[i].sock); lostdcc(i); } rem_tcl_commands(mytcls); rem_tcl_strings(mystrings); rem_tcl_ints(myints); rem_builtins(H_dcc, mydcc); rem_builtins(H_load, myload); rem_builtins(H_fil, myfiles); rem_help_reference("filesys.help"); if ((H_ctcp = find_bind_table("ctcp"))) rem_builtins(H_ctcp, myctcp); del_bind_table(H_fil); del_entry_type(&USERENTRY_DCCDIR); del_lang_section("filesys"); module_undepend(MODULE_NAME); return NULL; }
/* This function is called when the module is unloaded. */ static char *sample_close() { /* Remove the partyline commands we added when the module is unloaded. */ rem_builtins(H_dcc, mydcc); module_undepend(MODULE_NAME); return NULL; }
static char *ctcp_close() { rem_tcl_strings(mystrings); rem_tcl_ints(myints); rem_builtins(H_ctcp, myctcp); rem_help_reference("ctcp.help"); module_undepend(MODULE_NAME); return NULL; }
static char *compress_close() { rem_help_reference("compress.help"); rem_tcl_commands(my_tcl_cmds); rem_tcl_ints(my_tcl_ints); uff_deltable(compress_uff_table); module_undepend(MODULE_NAME); return NULL; }
static char *assoc_close() { kill_all_assoc(); rem_builtins(H_dcc, mydcc); rem_builtins(H_bot, mybot); rem_builtins(H_link, mylink); rem_tcl_commands(mytcl); rem_help_reference("assoc.help"); del_lang_section("assoc"); module_undepend(MODULE_NAME); return NULL; }
static char *seen_close() { p_tcl_bind_list H_temp; rem_builtins(H_load, seen_load); rem_builtins(H_dcc, seen_dcc); rem_help_reference("seen.help"); if ((H_temp = find_bind_table("pub"))) rem_builtins(H_temp, seen_pub); if ((H_temp = find_bind_table("msg"))) rem_builtins(H_temp, seen_msg); module_undepend(MODULE_NAME); return NULL; }
char *uptime_start(Function *global_funcs) { if (global_funcs) { global = global_funcs; module_register(MODULE_NAME, uptime_table, 1, 3); if (!module_depend(MODULE_NAME, "eggdrop", 106, 11)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.6.11 or later."; } add_help_reference("uptime.help"); add_hook(HOOK_MINUTELY, (Function) check_minutely); init_uptime(); } return NULL; }
char *seen_start(Function *egg_func_table) { global = egg_func_table; module_register(MODULE_NAME, seen_table, 2, 0); if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.6.0 or later."; } add_builtins(H_load, seen_load); add_builtins(H_dcc, seen_dcc); add_help_reference("seen.help"); server_seen_setup(NULL); irc_seen_setup(NULL); trigdata[4].key = botnetnick; return NULL; }
char *assoc_start(Function *global_funcs) { global = global_funcs; module_register(MODULE_NAME, assoc_table, 2, 0); if (!module_depend(MODULE_NAME, "eggdrop", 106, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.6.0 or later."; } assoc = NULL; add_builtins(H_dcc, mydcc); add_builtins(H_bot, mybot); add_builtins(H_link, mylink); add_lang_section("assoc"); add_tcl_commands(mytcl); add_help_reference("assoc.help"); return NULL; }
char *channels_start(Function * global_funcs) { global = global_funcs; gfld_chan_thr = 10; gfld_chan_time = 60; gfld_deop_thr = 3; gfld_deop_time = 10; gfld_kick_thr = 3; gfld_kick_time = 10; gfld_join_thr = 5; gfld_join_time = 60; gfld_ctcp_thr = 5; gfld_ctcp_time = 60; global_idle_kick = 0; Context; module_register(MODULE_NAME, channels_table, 1, 0); if (!module_depend(MODULE_NAME, "eggdrop", 105, 3)) { module_undepend(MODULE_NAME); return "This module needs eggdrop1.5.3 or later"; } add_hook(HOOK_MINUTELY, (Function) check_expired_bans); add_hook(HOOK_MINUTELY, (Function) check_expired_exempts); add_hook(HOOK_MINUTELY, (Function) check_expired_invites); add_hook(HOOK_USERFILE, (Function) channels_writeuserfile); add_hook(HOOK_REHASH, (Function) channels_rehash); add_hook(HOOK_PRE_REHASH, (Function) channels_prerehash); Tcl_TraceVar(interp, "global-chanset", TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS, traced_globchanset, NULL); add_builtins(H_chon, my_chon); add_builtins(H_dcc, C_dcc_irc); add_tcl_commands(channels_cmds); add_tcl_strings(my_tcl_strings); add_help_reference("channels.help"); add_help_reference("chaninfo.help"); my_tcl_ints[0].val = &share_greet; add_tcl_ints(my_tcl_ints); add_tcl_coups(mychan_tcl_coups); read_channels(0); setstatic = 1; return NULL; }
static char *dns_close() { int i; del_hook(HOOK_DNS_HOSTBYIP, (Function) dns_lookup); del_hook(HOOK_DNS_IPBYHOST, (Function) dns_forward); del_hook(HOOK_SECONDLY, (Function) dns_check_expires); for (i = 0; i < dcc_total; i++) { if (dcc[i].type == &DCC_DNS && dcc[i].sock == resfd) { killsock(dcc[i].sock); lostdcc(i); break; } } dns_free_cache(); module_undepend(MODULE_NAME); return NULL; }
static char *irc_close() { struct chanset_t *chan; /* Force bot to part all channels */ dprintf(DP_MODE, "JOIN 0\n"); for (chan = chanset; chan; chan = chan->next) clear_channel(chan, 1); del_bind_table(H_topc); del_bind_table(H_splt); del_bind_table(H_sign); del_bind_table(H_rejn); del_bind_table(H_part); del_bind_table(H_nick); del_bind_table(H_mode); del_bind_table(H_kick); del_bind_table(H_join); del_bind_table(H_pubm); del_bind_table(H_pub); del_bind_table(H_need); rem_tcl_strings(mystrings); rem_tcl_ints(myints); rem_builtins(H_dcc, irc_dcc); rem_builtins(H_msg, C_msg); rem_builtins(H_raw, irc_raw); rem_tcl_commands(tclchan_cmds); rem_help_reference("irc.help"); del_hook(HOOK_MINUTELY, (Function) check_expired_chanstuff); del_hook(HOOK_5MINUTELY, (Function) status_log); del_hook(HOOK_ADD_MODE, (Function) real_add_mode); del_hook(HOOK_IDLE, (Function) flush_modes); Tcl_UntraceVar(interp, "rfc-compliant", TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS, traced_rfccompliant, NULL); Tcl_UntraceVar(interp, "net-type", TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS, traced_nettype, NULL); module_undepend(MODULE_NAME); return NULL; }
static char *wire_close() { wire_list *w = wirelist; char wiretmp[512]; char *enctmp; p_tcl_bind_list H_temp; /* Remove any current wire encrypt bindings for now, don't worry * about duplicate unbinds. */ while (w) { enctmp = encrypt_string(w->key, "wire"); sprintf(wiretmp, "!wire%s", enctmp); nfree(enctmp); wire_bot[0].name = wiretmp; wire_bot[0].flags = ""; wire_bot[0].func = (IntFunc) wire_filter; rem_builtins(H_bot, wire_bot); w = w->next; } w = wirelist; while (w && w->sock) { dprintf(findanyidx(w->sock), "----- %s\n", WIRE_UNLOAD); dprintf(findanyidx(w->sock), "----- %s\n", WIRE_NOLONGERWIRED); wire_leave(w->sock); w = wirelist; } rem_help_reference("wire.help"); rem_builtins(H_dcc, wire_dcc); H_temp = find_bind_table("filt"); rem_builtins(H_temp, wire_filt); H_temp = find_bind_table("chof"); rem_builtins(H_temp, wire_chof); del_lang_section("wire"); module_undepend(MODULE_NAME); return NULL; }
static char *notes_close() { p_tcl_bind_list H_temp; rem_tcl_ints(notes_ints); rem_tcl_strings(notes_strings); rem_tcl_commands(notes_tcls); if ((H_temp = find_bind_table("msg"))) rem_builtins(H_temp, notes_msgs); if ((H_temp = find_bind_table("join"))) rem_builtins(H_temp, notes_join); rem_builtins(H_dcc, notes_cmds); rem_builtins(H_chon, notes_chon); rem_builtins(H_away, notes_away); rem_builtins(H_nkch, notes_nkch); rem_builtins(H_load, notes_load); rem_help_reference("notes.help"); del_hook(HOOK_MATCH_NOTEREJ, (Function) match_note_ignore); del_hook(HOOK_HOURLY, (Function) notes_hourly); del_entry_type(&USERENTRY_FWD); del_lang_section("notes"); module_undepend(MODULE_NAME); return NULL; }
char *channels_start(Function *global_funcs) { global = global_funcs; gfld_chan_thr = 10; gfld_chan_time = 60; gfld_deop_thr = 3; gfld_deop_time = 10; gfld_kick_thr = 3; gfld_kick_time = 10; gfld_join_thr = 5; gfld_join_time = 60; gfld_ctcp_thr = 5; gfld_ctcp_time = 60; global_idle_kick = 0; global_aop_min = 5; global_aop_max = 30; allow_ps = 0; lastdeletedmask = 0; use_info = 1; strcpy(chanfile, "chanfile"); chan_hack = 0; quiet_save = 0; strcpy(glob_chanmode, "nt"); udef = NULL; global_stopnethack_mode = 0; global_revenge_mode = 0; global_ban_type = 3; global_ban_time = 120; global_exempt_time = 60; global_invite_time = 60; strcpy(glob_chanset, "-enforcebans " "+dynamicbans " "+userbans " "-autoop " "-bitch " "+greet " "+protectops " "+statuslog " "-revenge " "-secret " "-autovoice " "+cycle " "+dontkickops " "-inactive " "-protectfriends " "+shared " "-seen " "+userexempts " "+dynamicexempts " "+userinvites " "+dynamicinvites " "-revengebot " "-protecthalfops " "-autohalfop " "-nodesynch " "-static "); module_register(MODULE_NAME, channels_table, 1, 1); if (!module_depend(MODULE_NAME, "eggdrop", 106, 20)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.6.20 or later."; } add_hook(HOOK_MINUTELY, (Function) check_expired_bans); add_hook(HOOK_MINUTELY, (Function) check_expired_exempts); add_hook(HOOK_MINUTELY, (Function) check_expired_invites); add_hook(HOOK_USERFILE, (Function) channels_writeuserfile); add_hook(HOOK_BACKUP, (Function) backup_chanfile); add_hook(HOOK_REHASH, (Function) channels_rehash); add_hook(HOOK_PRE_REHASH, (Function) channels_prerehash); Tcl_TraceVar(interp, "global-chanset", TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS, traced_globchanset, NULL); add_builtins(H_chon, my_chon); add_builtins(H_dcc, C_dcc_irc); add_tcl_commands(channels_cmds); add_tcl_strings(my_tcl_strings); add_help_reference("channels.help"); add_help_reference("chaninfo.help"); my_tcl_ints[0].val = &share_greet; add_tcl_ints(my_tcl_ints); add_tcl_coups(mychan_tcl_coups); read_channels(0, 1); return NULL; }
char *irc_start(Function *global_funcs) { struct chanset_t *chan; global = global_funcs; module_register(MODULE_NAME, irc_table, 1, 5); if (!module_depend(MODULE_NAME, "eggdrop", 108, 0)) { module_undepend(MODULE_NAME); return "This module requires Eggdrop 1.8.0 or later."; } if (!(server_funcs = module_depend(MODULE_NAME, "server", 1, 0))) { module_undepend(MODULE_NAME); return "This module requires server module 1.0 or later."; } if (!(channels_funcs = module_depend(MODULE_NAME, "channels", 1, 1))) { module_undepend(MODULE_NAME); return "This module requires channels module 1.1 or later."; } for (chan = chanset; chan; chan = chan->next) { if (!channel_inactive(chan)) { if (chan->key_prot[0]) dprintf(DP_SERVER, "JOIN %s %s\n", chan->name[0] ? chan->name : chan->dname, chan->key_prot); else dprintf(DP_SERVER, "JOIN %s\n", chan->name[0] ? chan->name : chan->dname); } chan->status &= ~(CHAN_ACTIVE | CHAN_PEND | CHAN_ASKEDBANS); chan->ircnet_status &= ~(CHAN_ASKED_INVITED | CHAN_ASKED_EXEMPTS); } add_hook(HOOK_MINUTELY, (Function) check_expired_chanstuff); add_hook(HOOK_5MINUTELY, (Function) status_log); add_hook(HOOK_ADD_MODE, (Function) real_add_mode); add_hook(HOOK_IDLE, (Function) flush_modes); Tcl_TraceVar(interp, "net-type", TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS, traced_nettype, NULL); Tcl_TraceVar(interp, "rfc-compliant", TCL_TRACE_READS | TCL_TRACE_WRITES | TCL_TRACE_UNSETS, traced_rfccompliant, NULL); strcpy(opchars, "@"); add_tcl_strings(mystrings); add_tcl_ints(myints); add_builtins(H_dcc, irc_dcc); add_builtins(H_msg, C_msg); add_builtins(H_raw, irc_raw); add_tcl_commands(tclchan_cmds); add_help_reference("irc.help"); H_topc = add_bind_table("topc", HT_STACKABLE, channels_5char); H_splt = add_bind_table("splt", HT_STACKABLE, channels_4char); H_sign = add_bind_table("sign", HT_STACKABLE, channels_5char); H_rejn = add_bind_table("rejn", HT_STACKABLE, channels_4char); H_part = add_bind_table("part", HT_STACKABLE, channels_5char); H_nick = add_bind_table("nick", HT_STACKABLE, channels_5char); H_mode = add_bind_table("mode", HT_STACKABLE, channels_6char); H_kick = add_bind_table("kick", HT_STACKABLE, channels_6char); H_join = add_bind_table("join", HT_STACKABLE, channels_4char); H_pubm = add_bind_table("pubm", HT_STACKABLE, channels_5char); H_pub = add_bind_table("pub", 0, channels_5char); H_need = add_bind_table("need", HT_STACKABLE, channels_2char); do_nettype(); return NULL; }