srvx-commits Mailing List for srvx IRC Services (Page 8)
Brought to you by:
entrope
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(80) |
Sep
(51) |
Oct
(94) |
Nov
(132) |
Dec
(85) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(163) |
Feb
(96) |
Mar
(70) |
Apr
(182) |
May
(173) |
Jun
(73) |
Jul
(101) |
Aug
(101) |
Sep
(71) |
Oct
(76) |
Nov
(58) |
Dec
(60) |
2003 |
Jan
(61) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(7) |
Jun
(22) |
Jul
(81) |
Aug
(41) |
Sep
(34) |
Oct
(41) |
Nov
(16) |
Dec
(28) |
2004 |
Jan
(7) |
Feb
|
Mar
(3) |
Apr
(15) |
May
(11) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2005 |
Jan
(13) |
Feb
(6) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2009 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
(2) |
Feb
(3) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2025 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Entrope <en...@us...> - 2003-10-20 19:00:29
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv7716/src Modified Files: main.c Log Message: replace accidentally removed #endif Index: main.c =================================================================== RCS file: /cvsroot/srvx/services/src/main.c,v retrieving revision 1.155 retrieving revision 1.156 diff -C2 -r1.155 -r1.156 *** main.c 20 Oct 2003 16:20:09 -0000 1.155 --- main.c 20 Oct 2003 16:32:03 -0000 1.156 *************** *** 585,589 **** policer_params_delete(oper_policer_params); policer_params_delete(luser_policer_params); ! if (replay_file) fclose(replay_file); } --- 585,590 ---- policer_params_delete(oper_policer_params); policer_params_delete(luser_policer_params); ! if (replay_file) ! fclose(replay_file); } *************** *** 719,722 **** --- 720,724 ---- daemon = 0; } + #endif if (replay_file) { |
From: Entrope <en...@us...> - 2003-10-20 18:21:33
|
Update of /cvsroot/srvx/services In directory sc8-pr-cvs1:/tmp/cvs-serv5444 Modified Files: configure.in Log Message: add check for usable libdl on boehm-gc build Index: configure.in =================================================================== RCS file: /cvsroot/srvx/services/configure.in,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -r1.73 -r1.74 *** configure.in 9 Sep 2003 01:56:37 -0000 1.73 --- configure.in 20 Oct 2003 16:19:40 -0000 1.74 *************** *** 220,223 **** --- 220,224 ---- AC_MSG_RESULT(boehm-gc) AC_CHECK_HEADERS(gc/gc.h,,AC_MSG_ERROR([Boehm GC header file missing. boehm-gc build will fail.])) + AC_CHECK_LIB(dl, dlopen, , AC_MSG_ERROR([libdl library is missing. boehm-gc build will fail.])) AC_CHECK_LIB(gc, GC_gcollect, , AC_MSG_ERROR([Boehm GC library is missing. boehm-gc build will fail.])) AC_DEFINE(WITH_MALLOC_BOEHM_GC, 1, [Define if using the Boehm GC to garbage collect and check memory leaks]) |
From: Entrope <en...@us...> - 2003-10-20 18:01:23
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv5580/src Modified Files: main.c Log Message: relocate boehm-gc debug callback to a more useful place Index: main.c =================================================================== RCS file: /cvsroot/srvx/services/src/main.c,v retrieving revision 1.154 retrieving revision 1.155 diff -C2 -r1.154 -r1.155 *** main.c 1 Sep 2003 14:50:28 -0000 1.154 --- main.c 20 Oct 2003 16:20:09 -0000 1.155 *************** *** 719,726 **** daemon = 0; } - #endif - #if WITH_MALLOC_BOEHM_GC - GC_set_warn_proc(gc_warn_proc); - #endif if (replay_file) { --- 719,722 ---- *************** *** 774,780 **** log_init(); MAIN_LOG = log_register_type("srvx", "file:main.log"); ! if (debug) { log_debug(); ! } timeq_init(); modcmd_init(); --- 770,779 ---- log_init(); MAIN_LOG = log_register_type("srvx", "file:main.log"); ! if (debug) log_debug(); ! #if WITH_MALLOC_BOEHM_GC ! GC_set_warn_proc(gc_warn_proc); ! GC_enable_incremental(); ! #endif timeq_init(); modcmd_init(); |
From: Entrope <en...@us...> - 2003-10-20 17:27:42
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv19277/src Modified Files: chanserv.c Log Message: require an extra argument if !say is used with a user's nickname Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.387 retrieving revision 1.388 diff -C2 -r1.387 -r1.388 *** chanserv.c 18 Oct 2003 15:52:21 -0000 1.387 --- chanserv.c 20 Oct 2003 17:17:40 -0000 1.388 *************** *** 414,418 **** #define CHANSERV_FUNC(NAME) MODCMD_FUNC(NAME) #define CHANSERV_SYNTAX() svccmd_send_help(user, chanserv, cmd) ! #define REQUIRE_PARAMS(N) if(argc < N) { \ chanserv_notice(user, MSG_MISSING_PARAMS, argv[0]); \ CHANSERV_SYNTAX(); \ --- 414,418 ---- #define CHANSERV_FUNC(NAME) MODCMD_FUNC(NAME) #define CHANSERV_SYNTAX() svccmd_send_help(user, chanserv, cmd) ! #define REQUIRE_PARAMS(N) if(argc < (N)) { \ chanserv_notice(user, MSG_MISSING_PARAMS, argv[0]); \ CHANSERV_SYNTAX(); \ *************** *** 4585,4589 **** { char *msg; ! assert(argc >= 2); if (channel) { msg = unsplit_string(argv + 1, argc - 1, NULL); --- 4585,4589 ---- { char *msg; ! REQUIRE_PARAMS(channel ? 2 : 3); if (channel) { msg = unsplit_string(argv + 1, argc - 1, NULL); |
From: Entrope <en...@us...> - 2003-10-20 17:24:14
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv15326/src Modified Files: gline.c opserv.c Log Message: allow glines for local channels take OpServ out of bad-word channels when they are addexempt'ed or delbad'ed Index: gline.c =================================================================== RCS file: /cvsroot/srvx/services/src/gline.c,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** gline.c 12 Oct 2003 19:39:59 -0000 1.38 --- gline.c 20 Oct 2003 16:56:54 -0000 1.39 *************** *** 165,169 **** return res; /* Stock ircu requires BADCHANs to match exactly. */ ! if (target[0] == '#') return NULL; else { --- 165,169 ---- return res; /* Stock ircu requires BADCHANs to match exactly. */ ! if ((target[0] == '#') || (target[0] == '&')) return NULL; else { Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.346 retrieving revision 1.347 diff -C2 -r1.346 -r1.347 *** opserv.c 12 Oct 2003 19:39:59 -0000 1.346 --- opserv.c 20 Oct 2003 16:56:55 -0000 1.347 *************** *** 797,805 **** reason = unsplit_string(argv+3, argc-3, NULL); ! if (!is_gline(argv[1]) && !IsChannelName(argv[1])) { opserv_notice(user, MSG_INVALID_GLINE, argv[1]); return 0; } ! if (!argv[1][strspn(argv[1], "#*?@.")] && (strlen(argv[1]) < 10)) { opserv_notice(user, OSMSG_STUPID_GLINE, argv[1]); return 0; --- 797,805 ---- reason = unsplit_string(argv+3, argc-3, NULL); ! if (!is_gline(argv[1]) && !IsChannelName(argv[1]) && (argv[1][0] != '&')) { opserv_notice(user, MSG_INVALID_GLINE, argv[1]); return 0; } ! if (!argv[1][strspn(argv[1], "#&*?@.")] && (strlen(argv[1]) < 10)) { opserv_notice(user, OSMSG_STUPID_GLINE, argv[1]); return 0; *************** *** 1975,1980 **** channel = iter_data(it); if (irccasestr(channel->name, argv[1]) ! && !opserv_bad_channel(channel->name)) channel->bad_channel = 0; } opserv_notice(user, OSMSG_REMOVED_BAD, argv[1]); --- 1975,1983 ---- channel = iter_data(it); if (irccasestr(channel->name, argv[1]) ! && !opserv_bad_channel(channel->name)) { ! DelChannelUser(opserv, channel, "Channel name no longer contains a bad word.", 1); ! timeq_del(0, opserv_part_channel, channel, TIMEQ_IGNORE_WHEN); channel->bad_channel = 0; + } } opserv_notice(user, OSMSG_REMOVED_BAD, argv[1]); *************** *** 1999,2004 **** dict_insert(opserv_exempt_channels, strdup(chanName), NULL); channel = GetChannel(chanName); ! if (channel) channel->bad_channel = 0; reply(OSMSG_ADDED_EXEMPTION, chanName); return 1; --- 2002,2012 ---- dict_insert(opserv_exempt_channels, strdup(chanName), NULL); channel = GetChannel(chanName); ! if (channel) { ! if (channel->bad_channel) { ! DelChannelUser(opserv, channel, "Channel is now exempt from bad-word checking.", 1); ! timeq_del(0, opserv_part_channel, channel, TIMEQ_IGNORE_WHEN); ! } channel->bad_channel = 0; + } reply(OSMSG_ADDED_EXEMPTION, chanName); return 1; *************** *** 2045,2049 **** th->expires = expires; dict_insert(opserv_trusted_hosts, th->ipaddr, th); ! if (th->expires) timeq_add(th->expires, opserv_expire_trusted_host, th); } --- 2053,2058 ---- th->expires = expires; dict_insert(opserv_trusted_hosts, th->ipaddr, th); ! if (th->expires) ! timeq_add(th->expires, opserv_expire_trusted_host, th); } |
From: Entrope <en...@us...> - 2003-10-20 17:06:43
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv10187/src Modified Files: mod-memoserv.c Log Message: show correct message counts when users log in Index: mod-memoserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/mod-memoserv.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** mod-memoserv.c 9 Sep 2003 16:40:29 -0000 1.7 --- mod-memoserv.c 20 Oct 2003 16:44:25 -0000 1.8 *************** *** 73,77 **** #define MSMSG_EXPIRY "Messages will be expired when they are %s old (%d seconds)." #define MSMSG_MESSAGES_EXPIRED "$b%lu$b message(s) expired." ! #define MSMSG_MEMOS_INBOX "You have $b%d$b new message(s) in your inbox (%d old). Use /msg $S LIST to list them." #define MSMSG_NEW_MESSAGE "You have a new message from $b%s$b." #define MSMSG_DELETED_ALL "Deleted all of your messages." --- 73,77 ---- #define MSMSG_EXPIRY "Messages will be expired when they are %s old (%d seconds)." #define MSMSG_MESSAGES_EXPIRED "$b%lu$b message(s) expired." ! #define MSMSG_MEMOS_INBOX "You have $b%d$b new message(s) in your inbox and %d old messages. Use /msg $S LIST to list them." #define MSMSG_NEW_MESSAGE "You have a new message from $b%s$b." #define MSMSG_DELETED_ALL "Deleted all of your messages." *************** *** 543,548 **** unseen++; } ! if (ii && memoserv_conf.bot) ! send_message(user, memoserv_conf.bot, MSMSG_MEMOS_INBOX, unseen, ii); } --- 543,548 ---- unseen++; } ! if (ma->recvd.used && memoserv_conf.bot) ! send_message(user, memoserv_conf.bot, MSMSG_MEMOS_INBOX, unseen, ma->recvd.used - unseen); } |
From: Entrope <en...@us...> - 2003-10-19 18:12:44
|
Update of /cvsroot/srvx/services/patches In directory sc8-pr-cvs1:/tmp/cvs-serv17391/patches Added Files: helpserv-pgsql.diff helpserv-pgsql.txt Log Message: log HelpServ requests and statistics to PostgreSQL --- NEW FILE --- Index: src/Makefile.am =================================================================== RCS file: /cvsroot/srvx/services/src/Makefile.am,v retrieving revision 1.59 diff -u -r1.59 Makefile.am --- src/Makefile.am 9 Sep 2003 01:56:55 -0000 1.59 +++ src/Makefile.am 19 Oct 2003 17:17:28 -0000 @@ -9,7 +9,7 @@ ./expnhelp < $(srcdir)/nickserv.help.m4 > $@ EXTRA_srvx_SOURCES = proto-bahamut.c proto-common.c proto-p10.c mod-snoop.c mod-memoserv.c -srvx_LDADD = @MODULE_OBJS@ +srvx_LDADD = @MODULE_OBJS@ -lpq srvx_DEPENDENCIES = @MODULE_OBJS@ srvx_SOURCES = \ chanserv.c chanserv.h \ Index: src/helpserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpserv.c,v retrieving revision 1.83 diff -u -r1.83 helpserv.c --- src/helpserv.c 19 Oct 2003 04:16:10 -0000 1.83 +++ src/helpserv.c 19 Oct 2003 17:17:30 -0000 @@ -46,6 +46,7 @@ #include "opserv.h" #include "saxdb.h" #include "timeq.h" +#include <postgresql/libpq-fe.h> #define HELPSERV_CONF_NAME "services/helpserv" #define HELPSERV_HELPFILE_NAME "helpserv.help" @@ -94,6 +95,7 @@ #define KEY_REQ_ON_JOIN "req_on_join" #define KEY_AUTO_VOICE "auto_voice" #define KEY_AUTO_DEVOICE "auto_devoice" +#define KEY_LOG_SQL "log_sql" /* General */ #define HSMSG_WRITE_SUCCESS "HelpServ db write completed (in "FMT_TIME_T".%03lu seconds)." @@ -401,6 +403,7 @@ const char *description; unsigned long db_backup_frequency; const char *reqlogfile; + PGconn *sql_log; } helpserv_conf; static int helpserv_enabled; @@ -443,6 +446,7 @@ unsigned int req_on_join : 1; unsigned int auto_voice : 1; unsigned int auto_devoice : 1; + unsigned int log_sql : 1; unsigned int helpchan_empty : 1; @@ -608,36 +612,106 @@ return dict_find(hs->users, hi->handle, NULL); } -static void helpserv_log_request(struct helpserv_request *req, const char *reason) { - char key[27+NICKLEN]; - char userhost[USERLEN+HOSTLEN+2]; +static void +string_buffer_append_quoted(struct string_buffer *dest, const char *src) { + if (src) { + size_t len = strlen(src); + string_buffer_append(dest, '\''); + if (dest->size < (dest->used + len * 2)) { + if (dest->size < len * 2) + dest->size = len * 4; + else + dest->size = dest->size * 2; + dest->list = realloc(dest->list, dest->size); + } + dest->used += PQescapeString(dest->list + dest->used, src, len); + string_buffer_append_string(dest, "', "); + } else { + string_buffer_append_string(dest, "NULL, "); + } +} - if (!reqlog_ctx || !req) +static void +string_buffer_append_time(struct string_buffer *dest, time_t when) { + struct tm broken_out; + if (!when) { + string_buffer_append_string(dest, "NULL, "); return; - if (!reason) - reason = ""; - - sprintf(key, "%s-" FMT_TIME_T "-%lu", req->hs->helpserv->nick, req->opened, req->id); - saxdb_start_record(reqlog_ctx, key, 1); - if (req->helper) { - saxdb_write_string(reqlog_ctx, KEY_REQUEST_HELPER, req->helper->handle->handle); - saxdb_write_int(reqlog_ctx, KEY_REQUEST_ASSIGNED, req->assigned); } - if (req->handle) { - saxdb_write_string(reqlog_ctx, KEY_REQUEST_HANDLE, req->handle->handle); + if (dest->size < dest->used + 20) { + if (dest->size < 20) { + dest->size = 40; + } else { + dest->size = dest->size * 2; + } + dest->list = realloc(dest->list, dest->size); } - if (req->user) { - saxdb_write_string(reqlog_ctx, KEY_REQUEST_NICK, req->user->nick); + dest->used += strftime(dest->list + dest->used, dest->size - dest->used, "'%Y-%m-%d %H:%M:%S', ", localtime_r(&when, &broken_out)); +} + +static void helpserv_log_request(struct helpserv_request *req, const char *reason) { + char userhost[USERLEN+HOSTLEN+2]; + + if (req->user) sprintf(userhost, "%s@%s", req->user->ident, req->user->hostname); - saxdb_write_string(reqlog_ctx, KEY_REQUEST_USERHOST, userhost); + else + userhost[0] = 0; + if (reqlog_ctx) { + char key[27+NICKLEN]; + sprintf(key, "%s-" FMT_TIME_T "-%lu", req->hs->helpserv->nick, req->opened, req->id); + saxdb_start_record(reqlog_ctx, key, 1); + if (req->helper) { + saxdb_write_string(reqlog_ctx, KEY_REQUEST_HELPER, req->helper->handle->handle); + saxdb_write_int(reqlog_ctx, KEY_REQUEST_ASSIGNED, req->assigned); + } + if (req->handle) + saxdb_write_string(reqlog_ctx, KEY_REQUEST_HANDLE, req->handle->handle); + if (req->user) { + saxdb_write_string(reqlog_ctx, KEY_REQUEST_NICK, req->user->nick); + saxdb_write_string(reqlog_ctx, KEY_REQUEST_USERHOST, userhost); + } + saxdb_write_int(reqlog_ctx, KEY_REQUEST_OPENED, req->opened); + saxdb_write_int(reqlog_ctx, KEY_REQUEST_CLOSED, now); + saxdb_write_string(reqlog_ctx, KEY_REQUEST_CLOSEREASON, reason); + saxdb_write_string_list(reqlog_ctx, KEY_REQUEST_TEXT, req->text); + saxdb_end_record(reqlog_ctx); + fflush(reqlog_f); + } + if (helpserv_conf.sql_log && req->hs->log_sql) { + struct string_buffer query, sb; + unsigned int ii; + PGresult *res; + + sb.used = query.used = 0; + sb.size = query.size = 512; + query.list = malloc(query.size); + sb.list = malloc(sb.size); + string_buffer_append_string(&query, "INSERT INTO srvx_helpserv_reqs (c_bot, t_opened, t_assigned, t_closed, i_id, c_helper, c_user_account, c_user_nick, c_user_host, c_close_reason, c_text) VALUES ("); + string_buffer_append_quoted(&query, req->hs->helpserv->nick); + string_buffer_append_time(&query, req->opened); + string_buffer_append_time(&query, req->assigned); + string_buffer_append_time(&query, now); + string_buffer_append_printf(&query, "%lu, ", req->id); + string_buffer_append_quoted(&query, req->helper ? req->helper->handle->handle : NULL); + string_buffer_append_quoted(&query, req->handle ? req->handle->handle : NULL); + string_buffer_append_quoted(&query, req->user ? req->user->nick : NULL); + string_buffer_append_quoted(&query, req->user ? userhost : NULL); + string_buffer_append_quoted(&query, reason); + for (ii = 0; ii < req->text->used; ++ii) { + string_buffer_append_string(&sb, req->text->list[ii]); + string_buffer_append(&sb, '\n'); + } + string_buffer_append(&sb, 0); + string_buffer_append_quoted(&query, sb.list); + query.used -= 2; /* chop off ", " from append_quoted */ + string_buffer_append_string(&query, ");"); + res = PQexec(helpserv_conf.sql_log, query.list); + if (PQresultStatus(res) != PGRES_COMMAND_OK) + log_module(HS_LOG, LOG_ERROR, "Unable to SQL-store request %lu on bot %s: %s", req->id, req->hs->helpserv->nick, PQerrorMessage(helpserv_conf.sql_log)); + PQclear(res); + free(query.list); + free(sb.list); } - saxdb_write_int(reqlog_ctx, KEY_REQUEST_OPENED, req->opened); - saxdb_write_int(reqlog_ctx, KEY_REQUEST_CLOSED, now); - saxdb_write_string(reqlog_ctx, KEY_REQUEST_CLOSEREASON, reason); - saxdb_write_string_list(reqlog_ctx, KEY_REQUEST_TEXT, req->text); - saxdb_end_record(reqlog_ctx); - - fflush(reqlog_f); } /* Searches for a request by number, nick, or account (num|nick|*account). @@ -2931,6 +3005,28 @@ OPTION_BINARY(hs->auto_devoice, "AutoDeVoice"); } +static HELPSERV_OPTION(opt_log_sql) { + int changed = 0; + if (argc > 0) { + if (!from_opserv) { + helpserv_notice(user, HSMSG_SET_NEED_OPER); + return 0; + } + if (enabled_string(argv[0])) { + hs->log_sql = 1; + changed = 1; + } else if (disabled_string(argv[0])) { + hs->log_sql = 0; + changed = 1; + } else { + helpserv_notice(user, MSG_INVALID_BINARY, argv[0]); + return 0; + } + } + helpserv_notice(user, HSMSG_STRING_VALUE, "LogSql", hs->log_sql ? "Enabled" : "Disabled"); + return changed; +} + static HELPSERV_FUNC(cmd_set) { helpserv_option_func_t *opt; @@ -2944,7 +3040,7 @@ opt_empty_interval, opt_stale_delay, opt_request_persistence, opt_helper_persistence, opt_notification, opt_id_wrap, opt_req_maxlen, opt_privmsg_only, opt_req_on_join, opt_auto_voice, - opt_auto_devoice + opt_auto_devoice, opt_log_sql }; helpserv_notice(user, HSMSG_QUEUE_OPTIONS); @@ -3267,6 +3363,7 @@ saxdb_write_int(ctx, KEY_REQ_ON_JOIN, hs->req_on_join); saxdb_write_int(ctx, KEY_AUTO_VOICE, hs->auto_voice); saxdb_write_int(ctx, KEY_AUTO_DEVOICE, hs->auto_devoice); + saxdb_write_int(ctx, KEY_LOG_SQL, hs->log_sql); /* End bot record */ saxdb_end_record(ctx); @@ -3376,6 +3473,8 @@ hs->auto_voice = str ? enabled_string(str) : 0; str = database_get_data(GET_RECORD_OBJECT(br), KEY_AUTO_DEVOICE, RECDB_QSTRING); hs->auto_devoice = str ? enabled_string(str) : 0; + str = database_get_data(GET_RECORD_OBJECT(br), KEY_LOG_SQL, RECDB_QSTRING); + hs->log_sql = str ? enabled_string(str) : 0; dict_foreach(users, user_read_helper, hs); @@ -3422,6 +3521,23 @@ helpserv_conf.reqlogfile = NULL; } + if (helpserv_conf.sql_log) { + PQfinish(helpserv_conf.sql_log); + helpserv_conf.sql_log = NULL; + } + str = database_get_data(conf_node, "sql_log", RECDB_QSTRING); + if (str) { + PGconn *conn = PQconnectdb(str); + if (!conn) { + log_module(HS_LOG, LOG_ERROR, "Unable to allocate pgsql connection"); + } else if (PQstatus(conn) == CONNECTION_BAD) { + log_module(HS_LOG, LOG_ERROR, "Pgsql connection failed: %s", PQerrorMessage(conn)); + PQfinish(conn); + } else { + helpserv_conf.sql_log = conn; + } + } + if (reqlog_ctx) { saxdb_close_context(reqlog_ctx); reqlog_ctx = NULL; @@ -4159,25 +4275,31 @@ return mktime(timeinfo); } -/* If data != NULL, then don't add to the timeq */ static void helpserv_run_stats(time_t when) { struct tm when_s; + struct string_buffer query; struct helpserv_bot *hs; struct helpserv_user *hs_user; - int i; dict_iterator_t it, it2; + int i; + char timestamp[64]; last_stats_update = when; localtime_r(&when, &when_s); + strftime(timestamp, sizeof(timestamp), "'%Y-%m-%d %H:%M:%S', ", &when_s); + query.size = 512; + query.list = malloc(query.size); for (it=dict_first(helpserv_bots_dict); it; it=iter_next(it)) { hs = iter_data(it); for (it2=dict_first(hs->users); it2; it2=iter_next(it2)) { hs_user = iter_data(it2); + /* Skip the helper if it's not their week-start day. */ if (hs_user->week_start != when_s.tm_wday) continue; + /* Adjust their credit if they are in-channel at rollover. */ if (hs_user->join_time) { hs_user->time_per_week[0] += when - hs_user->join_time; hs_user->time_per_week[4] += when - hs_user->join_time; @@ -4193,10 +4315,26 @@ hs_user->reassigned_to[i] = hs_user->reassigned_to[i-1]; } + /* Log to SQL */ + if (helpserv_conf.sql_log && hs->log_sql) { + PGresult *res; + query.used = 0; + string_buffer_append_string(&query, "INSERT INTO srvx_helpserv_stats (c_bot, t_weekstart, c_helper, i_time, i_picked_up, i_closed, i_reassigned_from, i_reassigned_to) VALUES("); + string_buffer_append_quoted(&query, hs->helpserv->nick); + string_buffer_append_quoted(&query, timestamp); + string_buffer_append_quoted(&query, hs_user->handle->handle); + string_buffer_append_printf(&query, "%d, %d, %d, %d, %d);", hs_user->time_per_week[0], hs_user->picked_up[0], hs_user->closed[0], hs_user->reassigned_from[0], hs_user->reassigned_to[0]); + res = PQexec(helpserv_conf.sql_log, query.list); + if (PQresultStatus(res) != PGRES_COMMAND_OK) + log_module(HS_LOG, LOG_ERROR, "Unable to SQL-store stats for helper %s on bot %s: %s", hs_user->handle->handle, hs->helpserv->nick, PQerrorMessage(helpserv_conf.sql_log)); + PQclear(res); + } + /* Reset it for this week */ hs_user->time_per_week[0] = hs_user->picked_up[0] = hs_user->closed[0] = hs_user->reassigned_from[0] = hs_user->reassigned_to[0] = 0; } } + free(query.list); } static void helpserv_timed_run_stats(UNUSED_ARG(void *data)) { @@ -4226,6 +4364,10 @@ saxdb_close_context(reqlog_ctx); if (reqlog_f) fclose(reqlog_f); + if (helpserv_conf.sql_log) { + PQfinish(helpserv_conf.sql_log); + helpserv_conf.sql_log = NULL; + } } void init_helpserv() { @@ -4291,6 +4433,7 @@ helpserv_define_option("REQONJOIN", opt_req_on_join); helpserv_define_option("AUTOVOICE", opt_auto_voice); helpserv_define_option("AUTODEVOICE", opt_auto_devoice); + helpserv_define_option("LOGSQL", opt_log_sql); helpserv_bots_dict = dict_new(); dict_set_free_data(helpserv_bots_dict, helpserv_free_bot); --- NEW FILE --- -- This patch assumes a database prepared with the script below. -- Once this is set up, you tell the HelpServ code to log stats -- by adding an entry to the "helpserv" section of srvx.conf: -- "sql_log" "host=postgres.testnet.com port=5432 dbname=srvx user=srvx password=TeStNeT requiressl=1"; -- some of those options may be omitted, in which case the PostgreSQL -- client library will use defaults. You may use hostaddr=10.0.0.7 -- instead of host=postgres.testnet.com, if the database server does -- not have a name in DNS or in /etc/hosts. CREATE TABLE srvx_helpserv_reqs ( c_bot VARCHAR(32) NOT NULL, t_opened TIMESTAMP NOT NULL, t_assigned TIMESTAMP, t_closed TIMESTAMP NOT NULL, i_id INTEGER NOT NULL, c_helper VARCHAR(32), c_user_account VARCHAR(32), c_user_nick VARCHAR(32), c_user_host VARCHAR(80), c_close_reason TEXT NOT NULL, c_text TEXT); CREATE TABLE srvx_helpserv_stats ( c_bot VARCHAR(32) NOT NULL, t_weekstart TIMESTAMP NOT NULL, c_helper VARCHAR(32) NOT NULL, i_time INTEGER NOT NULL, i_picked_up INTEGER NOT NULL, i_closed INTEGER NOT NULL, i_reassigned_from INTEGER NOT NULL, i_reassigned_to INTEGER NOT NULL); |
From: Entrope <en...@us...> - 2003-10-19 17:22:51
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv538/src Modified Files: log.c opserv.help Log Message: fix ?LOG LEVEL <x> and document its corrected behavior Index: log.c =================================================================== RCS file: /cvsroot/srvx/services/src/log.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** log.c 22 Aug 2003 00:26:21 -0000 1.65 --- log.c 19 Oct 2003 15:32:51 -0000 1.66 *************** *** 227,233 **** { enum log_severity ls; ! for (ls = 0; ls < LOG_NUM_SEVERITIES; ++ls) { ! if (!irccasecmp(text, log_severity_names[ls])) return ls; ! } return LOG_NUM_SEVERITIES; } --- 227,233 ---- { enum log_severity ls; ! for (ls = 0; ls < LOG_NUM_SEVERITIES; ++ls) ! if (!ircncasecmp(text, log_severity_names[ls], strlen(log_severity_names[ls]))) ! return ls; return LOG_NUM_SEVERITIES; } *************** *** 653,682 **** discrim->limit = strtoul(argv[++ii], NULL, 10); } else if (!irccasecmp(argv[ii], "level")) { ! enum log_severity sev; ! if (!irccasecmp(argv[++ii], "*")) { ! discrim->severities ^= ~0; ! } else { ! int add = 1; ! char *severity; ! ! switch (*argv[ii]) { ! case '-': ! add = 0; ! case '+': ! argv[ii]++; ! default: ! severity = argv[ii]; ! } ! sev = find_severity(severity); if (sev == LOG_NUM_SEVERITIES) { ! send_message(user, service, MSG_INVALID_SEVERITY, argv[ii]); goto fail; - } else { - if (add) { - discrim->severities |= 1 << sev; - } else { - discrim->severities &= ~(1 << sev); - } } } } else if (!irccasecmp(argv[ii], "type")) { --- 653,669 ---- discrim->limit = strtoul(argv[++ii], NULL, 10); } else if (!irccasecmp(argv[ii], "level")) { ! char *severity = argv[++ii]; ! discrim->severities = 0; ! while (1) { ! enum log_severity sev = find_severity(severity); if (sev == LOG_NUM_SEVERITIES) { ! send_message(user, service, MSG_INVALID_SEVERITY, severity); goto fail; } + discrim->severities |= 1 << sev; + severity = strchr(severity, ','); + if (!severity) + break; + severity++; } } else if (!irccasecmp(argv[ii], "type")) { Index: opserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.help,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -r1.67 -r1.68 *** opserv.help 12 Oct 2003 03:35:51 -0000 1.67 --- opserv.help 19 Oct 2003 15:32:51 -0000 1.68 *************** *** 322,326 **** "$bAGE$b - Age of commands to find (for example, 1m or >3m).", "$bLIMIT$b - Maximum number of results to show.", ! "$bLEVEL$b - One of COMMAND, OVERRIDE, STAFF or *, to return only some results.", "$bTYPE$b - Name of module that generated log (see $bSTATS MODULES$b).", "By default, all levels of audit log entries are returned. You may exclude levels from the results by using the level criteria and the '-' character in front of the level name."); --- 322,326 ---- "$bAGE$b - Age of commands to find (for example, 1m or >3m).", "$bLIMIT$b - Maximum number of results to show.", ! "$bLEVEL$b - Comma-separated list of COMMAND, OVERRIDE, STAFF, to return only those commands.", "$bTYPE$b - Name of module that generated log (see $bSTATS MODULES$b).", "By default, all levels of audit log entries are returned. You may exclude levels from the results by using the level criteria and the '-' character in front of the level name."); |
From: Entrope <en...@us...> - 2003-10-19 17:00:51
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv420/src Modified Files: modcmd.c Log Message: report HELPING-required commands as staff commands, too Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -r1.71 -r1.72 *** modcmd.c 18 Oct 2003 15:52:21 -0000 1.71 --- modcmd.c 19 Oct 2003 15:31:59 -0000 1.72 *************** *** 537,544 **** } } ! if ((flags & MODCMD_REQUIRE_HELPING) && !HANDLE_FLAGGED(user->handle_info, HELPING)) { ! if (options & SVCCMD_NOISY) ! send_message(user, bot, MCMSG_MUST_BE_HELPING); ! return 0; } if (cmd->min_opserv_level > 0) { --- 537,547 ---- } } ! if (flags & MODCMD_REQUIRE_HELPING) { ! if (!HANDLE_FLAGGED(user->handle_info, HELPING)) { ! if (options & SVCCMD_NOISY) ! send_message(user, bot, MCMSG_MUST_BE_HELPING); ! return 0; ! } ! rflags |= ACTION_STAFF; } if (cmd->min_opserv_level > 0) { |
From: Entrope <en...@us...> - 2003-10-19 04:19:04
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv5232/src Modified Files: helpserv.c Log Message: allow configuration of when week starts for different helpers Index: helpserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpserv.c,v retrieving revision 1.82 retrieving revision 1.83 diff -C2 -r1.82 -r1.83 *** helpserv.c 26 Sep 2003 15:16:58 -0000 1.82 --- helpserv.c 19 Oct 2003 04:16:10 -0000 1.83 *************** *** 73,76 **** --- 73,77 ---- #define KEY_HELPER_LEVEL "level" #define KEY_HELPER_HELPMODE "helpmode" + #define KEY_HELPER_WEEKSTART "weekstart" #define KEY_HELPER_STATS "stats" #define KEY_HELPER_STATS_TIME "time" *************** *** 132,135 **** --- 133,138 ---- #define HSMSG_INVALID_ACCESS "$b%s$b is an invalid access level." #define HSMSG_CHANGED_ACCESS "%s is now %s $b%s$b" + #define HSMSG_BAD_WEEKDAY "I do not know which day of the week $b%s$b is." + #define HSMSG_WEEK_STARTS "$b%s$b's weeks start on $b%s$b." /* Registration */ *************** *** 240,244 **** #define HSMSG_STATS_TIME "$uTime spent helping in %s:$u" #define HSMSG_STATS_REQS "$uRequest activity statistics:$u" - #define HSFMT_STATS_REPORT_WEEK "Stats report for the week of $b%a, %d %b %Y$b" enum helpserv_level { --- 243,246 ---- *************** *** 378,381 **** --- 380,401 ---- }; + static const char *weekday_names[] = { + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + NULL + }; + + static const char *statsreport_week[] = { + "Stats report for current week", + "Stats report for one week ago", + "Stats report for two weeks ago", + "Stats report for three weeks ago" + }; + static struct { const char *description; *************** *** 435,438 **** --- 455,459 ---- struct helpserv_bot *hs; unsigned int help_mode : 1; + unsigned int week_start : 3; enum helpserv_level level; /* statistics */ *************** *** 1271,1275 **** line = 1; tbl.length = dict_size(hs->users)+1; ! tbl.width = 2; tbl.flags = TABLE_NO_FREE; tbl.contents = alloca(tbl.length * sizeof(*tbl.contents)); --- 1292,1296 ---- line = 1; tbl.length = dict_size(hs->users)+1; ! tbl.width = 3; tbl.flags = TABLE_NO_FREE; tbl.contents = alloca(tbl.length * sizeof(*tbl.contents)); *************** *** 1277,1280 **** --- 1298,1302 ---- tbl.contents[0][0] = "Level"; tbl.contents[0][1] = "Handle"; + tbl.contents[0][2] = "WeekStart"; for (lvl = lvl_highest; lvl >= lvl_lowest; lvl--) { *************** *** 1283,1286 **** --- 1305,1309 ---- tbl.contents[line][0] = helpserv_level_names[lvl]; tbl.contents[line][1] = userList[lvl][i]->handle->handle; + tbl.contents[line][2] = weekday_names[userList[lvl][i]->week_start]; } } *************** *** 1954,1966 **** dict_iterator_t it; unsigned int line, i; - char weekstr[MAX_LINE_SIZE]; - struct tm week_tm; struct userNode *srcbot = from_opserv ? opserv : hs->helpserv; ! if (argc > 1) { ! if (!irccasecmp(argv[1], "NOTICE")) { ! use_privmsg = 0; ! } ! } tbl.length = dict_size(hs->users)+1; --- 1977,1984 ---- dict_iterator_t it; unsigned int line, i; struct userNode *srcbot = from_opserv ? opserv : hs->helpserv; ! if ((argc > 1) && !irccasecmp(argv[1], "NOTICE")) ! use_privmsg = 0; tbl.length = dict_size(hs->users)+1; *************** *** 1982,1990 **** } - localtime_r(&last_stats_update, &week_tm); - week_tm.tm_mday -= week_tm.tm_wday; /* Ensure it'll start on Sunday */ - week_tm.tm_mday -= 7 * 3; /* Oldest to newest */ /* 4 to 1 instead of 3 to 0 because it's unsigned */ ! for (i=4; i > 0; i--, week_tm.tm_mday += 7) { for (it=dict_first(hs->users), line=0; it; it=iter_next(it)) { struct helpserv_user *hs_user = iter_data(it); --- 2000,2005 ---- } /* 4 to 1 instead of 3 to 0 because it's unsigned */ ! for (i=4; i > 0; i--) { for (it=dict_first(hs->users), line=0; it; it=iter_next(it)) { struct helpserv_user *hs_user = iter_data(it); *************** *** 1998,2004 **** sprintf((char *)tbl.contents[line][1], "%u", hs_user->picked_up[i-1]+hs_user->reassigned_to[i-1]); } ! mktime(&week_tm); /* To fix up stuff after messing with tm_mday */ ! strftime(weekstr, MAX_LINE_SIZE, HSFMT_STATS_REPORT_WEEK, &week_tm); ! send_target_message(use_privmsg, user->nick, srcbot, "%s", weekstr); table_send(srcbot, user->nick, 0, (use_privmsg ? irc_privmsg : irc_notice), tbl); } --- 2013,2017 ---- sprintf((char *)tbl.contents[line][1], "%u", hs_user->picked_up[i-1]+hs_user->reassigned_to[i-1]); } ! send_target_message(use_privmsg, user->nick, srcbot, statsreport_week[i-1]); table_send(srcbot, user->nick, 0, (use_privmsg ? irc_privmsg : irc_notice), tbl); } *************** *** 2559,2562 **** --- 2572,2622 ---- } + static HELPSERV_FUNC(cmd_weekstart) { + struct handle_info *hi; + struct helpserv_user *actor, *victim; + int changed = 0; + + REQUIRE_PARMS(2); + actor = from_opserv ? NULL : GetHSUser(hs, user->handle_info); + if (!(hi = helpserv_get_handle_info(user, argv[1]))) + return 0; + if (!(victim = GetHSUser(hs, hi))) { + helpserv_notice(user, HSMSG_NOT_IN_USERLIST, hi->handle, hs->helpserv->nick); + return 0; + } + if (actor && (actor->level <= victim->level) && (actor != victim)) { + helpserv_notice(user, MSG_USER_OUTRANKED, victim->handle->handle); + return 0; + } + if (argc > 2 && (!actor || actor->level >= HlManager)) { + int new_day = 7; + switch (argv[2][0]) { + case 's': case 'S': + if ((argv[2][1] == 'u') || (argv[2][1] == 'U')) + new_day = 0; + else if ((argv[2][1] == 'a') || (argv[2][1] == 'A')) + new_day = 6; + break; + case 'm': case 'M': new_day = 1; break; + case 't': case 'T': + if ((argv[2][1] == 'u') || (argv[2][1] == 'U')) + new_day = 2; + else if ((argv[2][1] == 'h') || (argv[2][1] == 'H')) + new_day = 4; + break; + case 'w': case 'W': new_day = 3; break; + case 'f': case 'F': new_day = 5; break; + } + if (new_day == 7) { + helpserv_notice(user, HSMSG_BAD_WEEKDAY, argv[2]); + return 0; + } + victim->week_start = new_day; + changed = 1; + } + helpserv_notice(user, HSMSG_WEEK_STARTS, victim->handle->handle, weekday_names[victim->week_start]); + return changed; + } + static void set_page_target(struct helpserv_bot *hs, enum page_source idx, const char *target) { struct chanNode *new_target, *old_target; *************** *** 2927,2930 **** --- 2987,2991 ---- saxdb_write_string(ctx, KEY_HELPER_LEVEL, helpserv_level2str(hs_user->level)); saxdb_write_string(ctx, KEY_HELPER_HELPMODE, (hs_user->help_mode ? "1" : "0")); + saxdb_write_int(ctx, KEY_HELPER_WEEKSTART, hs_user->week_start); /* Helper stats */ saxdb_start_record(ctx, KEY_HELPER_STATS, 0); *************** *** 2999,3002 **** --- 3060,3065 ---- str = database_get_data(rd->d.object, KEY_HELPER_HELPMODE, RECDB_QSTRING); hs_user->help_mode = (str && strtol(str, NULL, 0)) ? 1 : 0; + str = database_get_data(rd->d.object, KEY_HELPER_WEEKSTART, RECDB_QSTRING); + hs_user->week_start = str ? strtol(str, NULL, 0) : 0; /* Stats */ *************** *** 4085,4096 **** static time_t helpserv_next_stats(time_t after_when) { ! struct tm *timeinfo=localtime(&after_when); /* This works because mktime(3) says it will accept out-of-range values * and fix them for us. tm_wday and tm_yday are ignored. */ ! timeinfo->tm_mday += 7 - timeinfo->tm_wday; ! /* We want to run stats at midnight (local time). Perhaps make this ! * configurable? */ timeinfo->tm_sec = timeinfo->tm_min = timeinfo->tm_hour = 0; --- 4148,4158 ---- static time_t helpserv_next_stats(time_t after_when) { ! struct tm *timeinfo = localtime(&after_when); /* This works because mktime(3) says it will accept out-of-range values * and fix them for us. tm_wday and tm_yday are ignored. */ ! timeinfo->tm_mday++; ! /* We want to run stats at midnight (local time). */ timeinfo->tm_sec = timeinfo->tm_min = timeinfo->tm_hour = 0; *************** *** 4099,4103 **** /* If data != NULL, then don't add to the timeq */ ! static void helpserv_run_stats(UNUSED_ARG(void *data)) { struct helpserv_bot *hs; struct helpserv_user *hs_user; --- 4161,4166 ---- /* If data != NULL, then don't add to the timeq */ ! static void helpserv_run_stats(time_t when) { ! struct tm when_s; struct helpserv_bot *hs; struct helpserv_user *hs_user; *************** *** 4105,4108 **** --- 4168,4173 ---- dict_iterator_t it, it2; + last_stats_update = when; + localtime_r(&when, &when_s); for (it=dict_first(helpserv_bots_dict); it; it=iter_next(it)) { hs = iter_data(it); *************** *** 4111,4118 **** hs_user = iter_data(it2); if (hs_user->join_time) { ! hs_user->time_per_week[0] += now - hs_user->join_time; ! hs_user->time_per_week[4] += now - hs_user->join_time; ! hs_user->join_time = now; } --- 4176,4186 ---- hs_user = iter_data(it2); + if (hs_user->week_start != when_s.tm_wday) + continue; + if (hs_user->join_time) { ! hs_user->time_per_week[0] += when - hs_user->join_time; ! hs_user->time_per_week[4] += when - hs_user->join_time; ! hs_user->join_time = when; } *************** *** 4130,4140 **** } } - - last_stats_update = now; - if (!data) { - timeq_add(helpserv_next_stats(now), helpserv_run_stats, NULL); - } } static void --- 4198,4207 ---- } } } + static void helpserv_timed_run_stats(UNUSED_ARG(void *data)) { + helpserv_run_stats(now); + timeq_add(helpserv_next_stats(now), helpserv_timed_run_stats, data); + } static void *************** *** 4197,4200 **** --- 4264,4268 ---- helpserv_define_func("MOVE", cmd_move, HlOper, CMD_FROM_OPSERV_ONLY|CMD_NEED_BOT); helpserv_define_func("BOTS", cmd_bots, HlOper, CMD_FROM_OPSERV_ONLY|CMD_IGNORE_EVENT); + helpserv_define_func("WEEKSTART", cmd_weekstart, HlTrial, CMD_NEED_BOT); helpserv_option_dict = dict_new(); *************** *** 4245,4255 **** * time_per_week */ if (last_stats_update && (helpserv_next_stats(last_stats_update) < now)) { ! time_t statsrun=last_stats_update; ! ! while ((statsrun = helpserv_next_stats(statsrun)) < now) { ! helpserv_run_stats((void *)1); ! } } ! timeq_add(helpserv_next_stats(now), helpserv_run_stats, NULL); reg_join_func(handle_join); --- 4313,4321 ---- * time_per_week */ if (last_stats_update && (helpserv_next_stats(last_stats_update) < now)) { ! time_t statsrun = last_stats_update; ! while ((statsrun = helpserv_next_stats(statsrun)) < now) ! helpserv_run_stats(statsrun); } ! timeq_add(helpserv_next_stats(now), helpserv_timed_run_stats, NULL); reg_join_func(handle_join); |
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv30859/src Modified Files: chanserv.c chanserv.help helpfile.c modcmd.c modcmd.h modcmd.help nickserv.c nickserv.help.m4 Log Message: move standard "help commands" entry into modcmd.c Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.386 retrieving revision 1.387 diff -C2 -r1.386 -r1.387 *** chanserv.c 10 Oct 2003 02:52:58 -0000 1.386 --- chanserv.c 18 Oct 2003 15:52:21 -0000 1.387 *************** *** 1124,1139 **** } - static int - append_entry(const char *key, UNUSED_ARG(void *data), void *extra) - { - struct helpfile_expansion *exp = extra; - int row; - - row = exp->value.table.length++; - exp->value.table.contents[row] = calloc(1, sizeof(char*)); - exp->value.table.contents[row][0] = key; - return 0; - } - static char max_length_text[MAXLEN+1][16]; --- 1124,1127 ---- *************** *** 1143,1159 **** struct helpfile_expansion exp; ! if(!irccasecmp(variable, "index")) ! { ! exp.type = HF_TABLE; ! exp.value.table.length = 1; ! exp.value.table.width = 1; ! exp.value.table.flags = TABLE_REPEAT_ROWS; ! exp.value.table.contents = calloc(dict_size(chanserv_service->commands)+1, sizeof(char**)); ! exp.value.table.contents[0] = calloc(1, sizeof(char*)); ! exp.value.table.contents[0][0] = "Commands:"; ! dict_foreach(chanserv_service->commands, append_entry, &exp); ! return exp; ! } ! else if(!irccasecmp(variable, "notes")) { dict_iterator_t it; --- 1131,1135 ---- struct helpfile_expansion exp; ! if(!irccasecmp(variable, "notes")) { dict_iterator_t it; *************** *** 3579,3582 **** --- 3555,3559 ---- tmp_table.width = list->table.width; tmp_table.flags = list->table.flags; + list->table.contents[0][0] = " "; for(start = curr = 1; curr < list->table.length; ++curr) { *************** *** 3674,3678 **** ary = malloc(lData.table.width*sizeof(**lData.table.contents)); lData.table.contents[0] = ary; ! ary[0] = " "; ary[1] = "Account"; ary[2] = "Last Seen"; --- 3651,3655 ---- ary = malloc(lData.table.width*sizeof(**lData.table.contents)); lData.table.contents[0] = ary; ! ary[0] = "Access"; ary[1] = "Account"; ary[2] = "Last Seen"; Index: chanserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.help,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -r1.53 -r1.54 *** chanserv.help 1 Sep 2003 14:52:45 -0000 1.53 --- chanserv.help 18 Oct 2003 15:52:21 -0000 1.54 *************** *** 8,12 **** " OPER Helper/Operator commands." ); - "COMMANDS" "${index}"; "USER" ("$bUser commands:$b", " ACCESS Check your own or another person's access to a channel.", --- 8,11 ---- Index: helpfile.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpfile.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** helpfile.c 10 Oct 2003 02:41:01 -0000 1.65 --- helpfile.c 18 Oct 2003 15:52:21 -0000 1.66 *************** *** 31,34 **** --- 31,35 ---- extern struct userNode *global, *chanserv, *opserv, *nickserv; struct userNode *message_dest; + struct userNode *message_source; void *************** *** 52,55 **** --- 53,57 ---- #endif } + message_source = from; /* If size or irc_send are 0, we should try to use a default. */ *************** *** 170,173 **** --- 172,176 ---- #endif } + message_source = src; /* fill in a buffer with the string */ input.used = 0; Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -r1.70 -r1.71 *** modcmd.c 7 Oct 2003 03:42:06 -0000 1.70 --- modcmd.c 18 Oct 2003 15:52:21 -0000 1.71 *************** *** 1825,1828 **** --- 1825,1860 ---- } + static int + append_entry(const char *key, UNUSED_ARG(void *data), void *extra) { + struct helpfile_expansion *exp = extra; + int row = exp->value.table.length++; + exp->value.table.contents[row] = calloc(1, sizeof(char*)); + exp->value.table.contents[row][0] = key; + return 0; + } + + static struct helpfile_expansion + modcmd_expand(const char *variable) { + struct helpfile_expansion exp; + extern struct userNode *message_source; + struct service *service; + + service = dict_find(services, message_source->nick, NULL); + if (!irccasecmp(variable, "index")) { + exp.type = HF_TABLE; + exp.value.table.length = 1; + exp.value.table.width = 1; + exp.value.table.flags = TABLE_REPEAT_ROWS; + exp.value.table.contents = calloc(dict_size(service->commands)+1, sizeof(char**)); + exp.value.table.contents[0] = calloc(1, sizeof(char*)); + exp.value.table.contents[0][0] = "Commands:"; + dict_foreach(service->commands, append_entry, &exp); + return exp; + } + exp.type = HF_STRING; + exp.value.str = NULL; + return exp; + } + void modcmd_init(void) { *************** *** 1835,1839 **** reg_exit_func(modcmd_cleanup); ! modcmd_module = module_register("modcmd", MAIN_LOG, "modcmd.help", NULL); bind_command = modcmd_register(modcmd_module, "bind", cmd_bind, 4, MODCMD_KEEP_BOUND, "access", "800", NULL); help_command = modcmd_register(modcmd_module, "help", cmd_help, 1, 0, "flags", "+nolog", NULL); --- 1867,1871 ---- reg_exit_func(modcmd_cleanup); ! modcmd_module = module_register("modcmd", MAIN_LOG, "modcmd.help", modcmd_expand); bind_command = modcmd_register(modcmd_module, "bind", cmd_bind, 4, MODCMD_KEEP_BOUND, "access", "800", NULL); help_command = modcmd_register(modcmd_module, "help", cmd_help, 1, 0, "flags", "+nolog", NULL); *************** *** 2130,2134 **** saxdb_register("modcmd", modcmd_saxdb_read, modcmd_saxdb_write); create_default_binds(); ! if (!saxdb_present) import_aliases_db(); /* Resolve command rule-templates. */ --- 2162,2167 ---- saxdb_register("modcmd", modcmd_saxdb_read, modcmd_saxdb_write); create_default_binds(); ! if (!saxdb_present) ! import_aliases_db(); /* Resolve command rule-templates. */ Index: modcmd.h =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** modcmd.h 7 Oct 2003 03:42:07 -0000 1.21 --- modcmd.h 18 Oct 2003 15:52:21 -0000 1.22 *************** *** 99,103 **** struct module_list modules; dict_t commands; /* contains struct svccmd* */ - struct helpserv_bot *hs; unsigned int privileged : 1; char trigger; --- 99,102 ---- Index: modcmd.help =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.help,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** modcmd.help 26 Sep 2003 15:27:17 -0000 1.11 --- modcmd.help 18 Oct 2003 15:52:21 -0000 1.12 *************** *** 8,11 **** --- 8,12 ---- "(A command binding is very similar to an alias, but only pays the speed penalty for alias expansion when there are additional arguments in the binding.)", "$uSee also:$u unbind"); + "commands" "${index}"; "god" ("/msg $C GOD [on|off]", "Toggles security override, which grants you complete access to all channels. Please use carefully."); Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.263 retrieving revision 1.264 diff -C2 -r1.263 -r1.264 *** nickserv.c 8 Oct 2003 03:46:35 -0000 1.263 --- nickserv.c 18 Oct 2003 15:52:21 -0000 1.264 *************** *** 2559,2592 **** } - static struct helpfile_expansion - nickserv_help_expand(const char *variable) - { - struct helpfile_expansion exp; - dict_iterator_t it; - int row; - const char *cmdname; - - if (!irccasecmp(variable, "index")) { - exp.type = HF_TABLE; - exp.value.table.length = 1; - exp.value.table.width = 1; - exp.value.table.flags = TABLE_REPEAT_ROWS; - exp.value.table.contents = calloc(dict_size(nickserv_service->commands)+1, sizeof(char**)); - exp.value.table.contents[0] = calloc(1, sizeof(char*)); - exp.value.table.contents[0][0] = "Commands:"; - for (it=dict_first(nickserv_service->commands); it; it=iter_next(it)) { - cmdname = iter_key(it); - if (strchr(cmdname, ' ')) continue; - row = exp.value.table.length++; - exp.value.table.contents[row] = calloc(1, sizeof(char*)); - exp.value.table.contents[row][0] = cmdname; - } - } else { - exp.type = HF_STRING; - exp.value.str = NULL; - } - return exp; - } - static handle_merge_func_t *handle_merge_func_list; static unsigned int handle_merge_func_size = 0, handle_merge_func_used = 0; --- 2559,2562 ---- *************** *** 3507,3511 **** dict_set_free_data(nickserv_email_dict, nickserv_free_email_addr); ! nickserv_module = module_register("NickServ", NS_LOG, "nickserv.help", nickserv_help_expand); modcmd_register(nickserv_module, "AUTH", cmd_auth, 2, MODCMD_KEEP_BOUND, "flags", "+qualified,+loghostmask", NULL); nickserv_define_func("ALLOWAUTH", cmd_allowauth, 0, 1, 0); --- 3477,3481 ---- dict_set_free_data(nickserv_email_dict, nickserv_free_email_addr); ! nickserv_module = module_register("NickServ", NS_LOG, "nickserv.help", NULL); modcmd_register(nickserv_module, "AUTH", cmd_auth, 2, MODCMD_KEEP_BOUND, "flags", "+qualified,+loghostmask", NULL); nickserv_define_func("ALLOWAUTH", cmd_allowauth, 0, 1, 0); Index: nickserv.help.m4 =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.help.m4,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** nickserv.help.m4 10 Oct 2003 03:27:35 -0000 1.20 --- nickserv.help.m4 18 Oct 2003 15:52:21 -0000 1.21 *************** *** 11,15 **** " OTHERS Other functions.", " COMMANDS A list of all available commands."); - "COMMANDS" ("$({i}ndex)"); "HANDLE" ("The term $uhandle$u from earlier versions was confusing to many new users. Therefore, it has been changed to $uaccount$u."); --- 11,14 ---- |
From: Entrope <en...@us...> - 2003-10-13 02:36:06
|
Update of /cvsroot/srvx/services/tests In directory sc8-pr-cvs1:/tmp/cvs-serv11156/tests Added Files: coverage.cmd Log Message: unfinished, unpolished coverage/torture script if you use this, change the macros at the top of the file to point to your own testnet -- else entrope will yell at you --- NEW FILE --- # Declarations at first define srv1 irc.clan-dk.org:7701 define srv1name irc.clan-dk.org define srv2 irc.clan-dk.org:7711 define srv2name irc2.clan-dk.org define srvx srvx.clan-dk.org define domain troilus.org # These aren't so likely to change define chanserv ChanServ define global Global define memoserv MemoServ define nickserv AuthServ define opserv OpServ define helpserv CoverageServ define helpserv2 C0v3r4g3S3rv define opernick test_oper define operpass i_r_teh_0p3r define testchan #testchan # Connect, join testing channel, oper up, log in connect cl1 test1 test1 %srv1% :Test Bot 1 :cl1 join %testchan%1 :cl1 raw :OPER %opernick% %operpass% :cl1 privmsg %nickserv% :ACCOUNTINFO :cl1 privmsg %nickserv%@%srvx% :AUTH :cl1 privmsg %nickserv%@%srvx% :AUTH bogus bogus :cl1 privmsg %nickserv%@%srvx% :AUTH testest :cl1 privmsg %nickserv% :OSET test1 EPITHET some damn test bot :cl1 privmsg %nickserv% :ACCOUNTINFO # Test common infrastructure things :cl1 nick test1_new :cl1 nick test1 :cl1 privmsg %opserv% :REHASH :cl1 privmsg %opserv% :REOPEN :cl1 privmsg %opserv% :QUERY :cl1 privmsg %opserv% :LOG LIMIT 30 :cl1 privmsg %opserv% :RECONNECT :cl1 privmsg %opserv% :HELP WRITE :cl1 privmsg %opserv% :WRITE MONDO :cl1 privmsg %opserv% :WRITEALL :cl1 privmsg %opserv% :STATS DATABASES # Test global's functionality :cl1 privmsg %global% :NOTICE users Hello world! :cl1 privmsg %global% :MESSAGE TARGET users DURATION 1h TEXT Hello world (short duration)! connect cl2 test2 test2 %srv1% :Test Bot 2 connect cl3 test3 test3 %srv1% :Test Bot 3 :cl2 join %testchan%1 :cl2 privmsg %nickserv%@%srvx% :REGISTER test2 testest :cl2 privmsg %global% :LIST :cl3 join %testchan%1 :cl3 privmsg %global% :MESSAGES :cl3 privmsg %global% :VERSION :cl1 wait cl2,cl3 :cl1 privmsg %global% :REMOVE 1 :cl1 privmsg %global% :MESSAGE SOURCELESS pizza TARGET all TARGET helpers TARGET opers TARGET staff TARGET channels DURATION 5s TEXT Hollow world (very short duration). :cl1 privmsg %global% :MESSAGE TARGET all :cl1 privmsg %global% :NOTICE ANNOUNCEMENT test of announcement code :cl1 privmsg %global% :NOTICE CHANNELS test of channel spamming code (sorry! :) :cl1 privmsg %global% :NOTICE BOGUS :cl1 privmsg %global% :NOTICE DIFFERENTLY BOGUS :cl1 privmsg %global% :LIST :cl1 privmsg %global% :REMOVE 30 :cl1 privmsg %global% :MESSAGES # Test ChanServ functions :cl1 privmsg %chanserv% :HELP :cl1 privmsg %chanserv% :HELP commands :cl1 privmsg %chanserv% :HELP note types :cl1 privmsg %chanserv% :VERSION CVS :cl1 privmsg %chanserv% :NETINFO :cl1 privmsg %chanserv% :STAFF :cl1 privmsg %chanserv% :GOD ON :cl1 privmsg %chanserv% :REGISTER %testchan%1 :cl1 privmsg %chanserv% :REGISTER %testchan%2 test2 :cl1 privmsg %chanserv% :GOD OFF :cl1 privmsg %chanserv% :ADDUSER %testchan%1 OP test2 :cl1 privmsg %chanserv% :GOD ON :cl1 privmsg %testchan%1 :PING :cl1 privmsg %chanserv% :CREATENOTE url setter all 400 :cl1 privmsg %chanserv% :%testchan%1 NOTE url http://www.srvx.net/index.php :cl1 privmsg %chanserv% :CREATENOTE url privileged 1 privileged 20 :cl1 privmsg %chanserv% :CREATENOTE url channel owner channel_users 20 :cl1 privmsg %chanserv% :CREATENOTE url bogus all 20 :cl1 privmsg %chanserv% :%testchan%1 NOTE :cl1 privmsg %chanserv% :REMOVENOTE url :cl2 wait cl1 :cl2 privmsg %chanserv% :%testchan%1 NOTE :cl1 privmsg %chanserv% :REMOVENOTE bogus :cl1 privmsg %chanserv% :%testchan%1 DELNOTE bogus :cl1 privmsg %chanserv% :%testchan%1 DELNOTE url :cl1 privmsg %chanserv% :%testchan%1 NOTE url http://www.srvx.net/ :cl1 wait cl2 :cl1 privmsg %chanserv% :REMOVENOTE url FORCE :cl1 privmsg %chanserv% :%testchan%1 ADDUSER OP test2 :cl1 privmsg %chanserv% :%testchan%1 OP test2 :cl1 privmsg %chanserv% :%testchan%1 OP test3 :cl2 wait cl1 :cl2 mode %testchan%1 -clo test3 :cl1 privmsg %chanserv% :%testchan%1 SET MODES +sntlcCDk 500 bah :cl1 privmsg %chanserv% :%testchan%1 SET MODES -lk :cl1 privmsg %chanserv% :%testchan%1 SET ENFMODES 4 :cl1 privmsg %chanserv% :%testchan%1 SET PROTECT 0 :cl2 wait cl1 :cl2 mode %testchan%1 +l 600 :cl1 wait cl2 :cl1 privmsg %chanserv% :%testchan%1 SET CTCPUSERS 6 :cl3 wait cl1 :cl3 privmsg %testchan%1 :TIME :cl1 privmsg %chanserv% :EXPIRE :cl2 privmsg %chanserv% :%testchan%1 DELETEME a5bfa227 :cl1 privmsg %chanserv% :NOREGISTER *test2 USUX :cl1 privmsg %chanserv% :NOREGISTER %testchan%3 USUX2 :cl1 privmsg %chanserv% :NOREGISTER #*tch* USUX3 :cl1 privmsg %chanserv% :NOREGISTER %testchan%3 :cl1 privmsg %chanserv% :NOREGISTER *test2 :cl1 privmsg %chanserv% :NOREGISTER *test194 :cl1 privmsg %chanserv% :NOREGISTER :cl1 privmsg %chanserv% :REGISTER %testchan%3 test2 :cl1 privmsg %chanserv% :ALLOWREGISTER :cl1 privmsg %chanserv% :ALLOWREGISTER *test2 :cl1 privmsg %chanserv% :REGISTER %testchan%3 test2 :cl1 privmsg %chanserv% :ALLOWREGISTER %testchan%3 :cl1 privmsg %chanserv% :REGISTER %testchan%3 test2 :cl1 privmsg %chanserv% :ALLOWREGISTER #*tch* :cl1 join %testchan%3 :cl1 privmsg %opserv% :ADDBAD %testchan%3 :cl1 privmsg %chanserv% :REGISTER %testchan%3 test2 :cl1 privmsg %opserv% :CHANINFO %testchan%3 :cl1 privmsg %chanserv% :%testchan%1 MOVE %testchan%3 :cl1 join %testchan%3 :cl1 privmsg %opserv% :DELBAD %testchan%3 :cl1 privmsg %opserv% :ADDBAD %testchan%4 :cl1 privmsg %chanserv% :REGISTER %testchan%4 test2 :cl1 privmsg %chanserv% :%testchan%1 MOVE %testchan%4 :cl1 privmsg %opserv% :DELBAD %testchan%4 :cl1 privmsg %chanserv% :REGISTER %testchan%3 test2 :cl1 privmsg %chanserv% :ALLOWREGISTER #pizza :cl2 wait cl1 :cl2 privmsg %chanserv% :%testchan%3 OPCHAN :cl1 wait cl2 :cl1 privmsg %chanserv% :%testchan%3 CSUSPEND 1m H8! :cl2 wait cl1 :cl2 privmsg %chanserv% :%testchan%3 UNREGISTER 1234a2ec :cl2 privmsg %chanserv% :%testchan%3 OPCHAN :cl2 privmsg %chanserv% :%testchan%1 UNREGISTER :cl1 wait cl2 :cl1 privmsg %chanserv% :%testchan%3 CUNSUSPEND :cl2 wait cl1 :cl2 privmsg %chanserv% :%testchan%3 UNREGISTER :cl2 privmsg %chanserv% :%testchan%3 OPCHAN :cl2 privmsg %chanserv% :%testchan%3 UNREGISTER 1234a2ec :cl1 join %testchan%4 :cl1 privmsg %chanserv% :%testchan%4 UNREGISTER :cl1 privmsg %chanserv% :%testchan%2 MOVE %testchan%4 :cl1 privmsg %chanserv% :%testchan%4 MERGE %testchan%1 :cl1 privmsg %chanserv% :%testchan%1 OPCHAN :cl1 privmsg %chanserv% :%testchan%1 CLVL test2 bogus :cl1 privmsg %chanserv% :%testchan%1 CLVL test2 COOWNER :cl1 privmsg %chanserv% :%testchan%1 DELUSER COOWNER test2 :cl1 privmsg %chanserv% :%testchan%1 MDELOP * :cl1 privmsg %chanserv% :%testchan%1 TRIM BANS 1w :cl1 privmsg %chanserv% :%testchan%1 TRIM USERS 1w :cl1 privmsg %chanserv% :%testchan%1 DOWN :cl1 privmsg %chanserv% :%testchan%1 UP :cl1 privmsg %chanserv% :UPALL :cl1 privmsg %chanserv% :DOWNALL :cl1 privmsg %chanserv% :%testchan%1 OP test1 :cl1 privmsg %chanserv% :%testchan%1 OP test2 :cl1 privmsg %chanserv% :%testchan%1 DEOP test2 :cl1 privmsg %chanserv% :%testchan%1 VOICE test2 :cl1 privmsg %chanserv% :%testchan%1 DEVOICE test2 :cl1 privmsg %chanserv% :%testchan%1 ADDTIMEDBAN test2 30s WEH8U :cl1 privmsg %chanserv% :%testchan%1 BANS :cl1 privmsg %chanserv% :%testchan%1 UNBAN test3 :cl1 privmsg %chanserv% :%testchan%1 DELBAN test2 :cl1 mode %testchan%1 +bbb abcdef!gh...@12...uvwx.yz ghijkl!mnopqr@123456789012345678901234567890stuvwx.yzabcd.ef mnopqr!stuvwx@123456789012345678901234567890yzabcd.efghij.kl :cl1 mode %testchan%1 +bbb stuvwx!yzabcd@123456789012345678901234567890efghij.klmnop.qr yzabcd!efghij@123456789012345678901234567890klmnop.qrstuv.wx efghij!kl...@12... :cl1 mode %testchan%1 +bbb klmnop!qr...@12...efgh.ij qrstuv!wxyzab@123456789012345678901234567890cdefgh.ijklmn.op wxyzab!cdefgh@123456789012345678901234567890ijklmn.opqrst.uv :cl1 privmsg %chanserv% :%testchan%1 ADDTIMEDBAN a!b@c.om 15s :cl1 privmsg %chanserv% :%testchan%1 UNBANALL :cl1 privmsg %chanserv% :%testchan%1 OPEN :cl1 privmsg %chanserv% :%testchan%1 ACCESS test2 :cl1 privmsg %chanserv% :%testchan%1 ACCESS test1 :cl1 privmsg %chanserv% :%testchan%1 USERS :cl1 privmsg %chanserv% :%testchan%1 CSUSPEND 1w WEH8URCHAN :cl1 privmsg %chanserv% :%testchan%1 INFO :cl1 privmsg %chanserv% :%testchan%1 CUNSUSPEND :cl1 privmsg %chanserv% :%testchan%1 PEEK :cl1 privmsg %chanserv% :%testchan%1 SETINFO Wraa! :cl1 privmsg %chanserv% :%testchan%1 ADDUSER MASTER test2 :cl2 wait cl1 :cl2 privmsg %chanserv% :%testchan%1 SETINFO Arrr! :cl1 privmsg %chanserv% :%testchan%1 WIPEINFO test2 :cl1 privmsg %chanserv% :%testchan%1 SEEN test2 :cl2 privmsg %chanserv% :%testchan%1 NAMES :cl1 privmsg %chanserv% :%testchan%1 EVENTS :cl1 privmsg %chanserv% :%testchan%1 SAY Hi :cl1 privmsg %chanserv% :%testchan%1 EMOTE burps. :cl1 privmsg %chanserv% :CSEARCH PRINT LIMIT 20 :cl1 privmsg %chanserv% :UNVISITED :cl1 privmsg %chanserv% :%testchan%1 SET DEFAULTTOPIC foo bar baz :cl1 privmsg %chanserv% :%testchan%1 SET TOPICMASK foo * baz :cl1 privmsg %chanserv% :%testchan%1 SET ENFTOPIC 5 :cl1 privmsg %chanserv% :%testchan%1 SET GREETING Hello non-user! :cl1 privmsg %chanserv% :%testchan%1 SET USERGREETING Hello user! :cl1 privmsg %chanserv% :%testchan%1 SET PUBCMD 6 :cl1 privmsg %chanserv% :%testchan%1 SET STRICTOP 5 :cl1 privmsg %chanserv% :%testchan%1 SET AUTOOP 4 :cl1 privmsg %chanserv% :%testchan%1 SET PROTECT 0 :cl1 privmsg %chanserv% :%testchan%1 SET TOYS 0 :cl1 privmsg %chanserv% :%testchan%1 SET SETTERS 2 :cl1 privmsg %chanserv% :%testchan%1 SET TOPICREFRESH 1 :cl1 privmsg %chanserv% :%testchan%1 SET VOICE OFF :cl1 privmsg %chanserv% :%testchan%1 SET USERINFO ON :cl1 privmsg %chanserv% :%testchan%1 SET DYNLIMIT ON :cl1 privmsg %chanserv% :%testchan%1 SET TOPICSNARF OFF :cl1 privmsg %chanserv% :%testchan%1 SET PEONINVITE OFF :cl1 privmsg %chanserv% :%testchan%1 SET NODELETE ON :cl1 privmsg %chanserv% :%testchan%1 SET DYNLIMIT OFF :cl1 raw :CLEARMODE %testchan%1 :cl1 raw :OPMODE %testchan%1 +oo %chanserv% test1 :cl1 privmsg %chanserv% :%testchan%1 UNREGISTER :cl1 privmsg %chanserv% :%testchan%1 TOPIC blah blah blah :cl1 privmsg %chanserv% :%testchan%1 DEOP %chanserv% :cl1 raw :KICK %testchan%1 test2 :cl1 raw :TOPIC %testchan%1 :Topic set by test1 :cl1 privmsg %testchan%1 :goodbye # Test raw protocol functionality :cl1 raw :STATS u %srvx% :cl1 raw :STATS c %srvx% :cl1 raw :VERSION %srvx% :cl1 raw :ADMIN %srvx% :cl1 raw :WHOIS %nickserv% %nickserv% :cl1 join 0 :cl1 raw :AWAY :doing stuff :cl1 raw :AWAY :cl1 raw :MODE test1 +iwsdh :cl1 raw :KILL test3 :die, foo :cl1 raw :MODE test1 -oiwsdh # Test gline functions :cl1 raw :OPER %opernick% %operpass% :cl1 privmsg %opserv% :gline a@b.com 1h Test gline 1 :cl1 privmsg %opserv% :gline b@c.com 1m Test gline 2 :cl1 privmsg %opserv% :gline b@c.com 1h Test gline 2 (updated) :cl1 privmsg %opserv% :gline a@a.com 10 Very short gline :cl1 privmsg %opserv% :refreshg %srv1name% :cl1 privmsg %opserv% :refreshg :cl1 privmsg %opserv% :stats glines :cl1 privmsg %opserv% :gtrace print mask *@* limit 5 issuer test1 reason * :cl1 privmsg %opserv% :gtrace count mask *@* limit 5 issuer test1 reason * :cl1 privmsg %opserv% :gtrace ungline mask *@b.com :cl1 privmsg %opserv% :gtrace break mask *@b.com :cl1 privmsg %opserv% :trace print ip 66.0.0.0/8 mask *!*@* limit 5 :cl1 privmsg %opserv% :trace print ip 66.* :cl1 mode %testchan%1 +b abc!de...@gh... :cl1 privmsg %opserv% :%testchan%1 BAN def :cl1 privmsg %opserv% :%testchan%1 BAN *!*@def.ghi.com # Test modcmd functions :cl1 privmsg %chanserv% :%testchan%1 :cl1 privmsg %opserv% :TIMECMD BIND %opserv% gumbo *modcmd.bind %opserv% $1- $$ :cl1 privmsg %opserv% :HELP gumbo :cl1 privmsg %opserv% :gumbo gumbo gumbo :cl1 privmsg %opserv% :MODCMD gumbo FLAGS gumbo :cl1 privmsg %opserv% :MODCMD gumbo FLAGS +gumbo :cl1 privmsg %opserv% :MODCMD gumbo FLAGS +disabled,-oper CHANNEL_LEVEL none :cl1 privmsg %opserv% :MODCMD gumbo OPER_LEVEL 1001 :cl1 privmsg %opserv% :MODCMD gumbo ACCOUNT_FLAGS +g WEIGHT 0 :cl1 privmsg %opserv% :MODCMD gumbo bogus options :cl1 privmsg %opserv% :UNBIND %opserv% gumbo :cl1 privmsg %opserv% :TIMECMD BIND %opserv% gumbo %opserv%.bind %opserv% $1- :cl1 privmsg %opserv% :UNBIND %opserv% gumbo :cl1 privmsg %opserv% :STATS :cl1 privmsg %opserv% :STATS MODULES :cl1 privmsg %opserv% :STATS MODULES MODCMD :cl1 privmsg %opserv% :STATS SERVICES :cl1 privmsg %opserv% :STATS SERVICES %opserv% :cl1 privmsg %opserv% :READHELP OpServ :cl1 privmsg %opserv% :SHOWCOMMANDS :cl1 privmsg %opserv% :HELPFILES %opserv% :cl1 privmsg %chanserv% :COMMAND REGISTER # Test HelpServ functions connect cl3 test3 test3 %srv1% :Test Bot 3 :cl1 privmsg %opserv% :HELPSERV REGISTER %helpserv% %testchan%1 test1 :cl1 privmsg %helpserv% :huh? :cl1 privmsg %helpserv% :ADDHELPER test2 :cl1 privmsg %helpserv% :CLVL test2 pizzaboy :cl1 privmsg %helpserv% :DELUSER test2 :cl1 privmsg %helpserv% :DELUSER testy :cl1 privmsg %helpserv% :SET PAGETARGET %testchan%1 :cl1 privmsg %helpserv% :SET PAGETYPE NOTICE :cl1 privmsg %helpserv% :SET ALERTPAGETARGET %testchan%1 :cl1 privmsg %helpserv% :SET ALERTPAGETYPE PRIVMSG :cl1 privmsg %helpserv% :SET STATUSPAGETARGET %testchan%1 :cl1 privmsg %helpserv% :SET STATUSPAGETYPE ONOTICE :cl1 privmsg %helpserv% :SET GREETING Hello Earthling! Please talk to me! :cl1 privmsg %helpserv% :SET REQOPENED Your request has been accepted! :cl1 privmsg %helpserv% :SET REQASSIGNED Your request has been assigned to a helper! :cl1 privmsg %helpserv% :SET REQCLOSED Goodbye and leave us alone next time! :cl1 privmsg %helpserv% :SET IDLEDELAY 5m :cl1 privmsg %helpserv% :SET WHINEDELAY 3m :cl1 privmsg %helpserv% :SET WHINEINTERVAL 3m :cl1 privmsg %helpserv% :SET EMPTYINTERVAL 3m :cl1 privmsg %helpserv% :SET STALEDELAY 5m :cl1 privmsg %helpserv% :SET REQPERSIST PART :cl1 privmsg %helpserv% :SET HELPERPERSIST CLOSE :cl1 privmsg %helpserv% :SET NOTIFICATION ACCOUNTCHANGES :cl1 privmsg %helpserv% :SET REQMAXLEN 5 :cl1 privmsg %helpserv% :SET IDWRAP 10 :cl1 privmsg %helpserv% :SET REQONJOIN ON :cl1 privmsg %helpserv% :SET AUTOVOICE ON :cl1 privmsg %helpserv% :SET AUTODEVOICE ON :cl1 privmsg %helpserv% :SET :cl1 privmsg %helpserv% :LIST ALL :cl3 wait cl1 :cl3 join %testchan%1 :cl3 privmsg %helpserv% :eye kant auth 2 my acount test2 plz 2 help! :cl1 wait cl3 :cl1 privmsg %helpserv% :LIST :cl1 privmsg %helpserv% :LIST ASSIGNED :cl1 privmsg %helpserv% :STATS :cl1 privmsg %helpserv% :STATS test1 :cl1 privmsg %helpserv% :NEXT :cl1 privmsg %helpserv% :NEXT :cl1 privmsg %helpserv% :PICKUP test3 :cl1 privmsg %helpserv% :LIST ASSIGNED :cl1 privmsg %helpserv% :LIST UNASSIGNED :cl1 privmsg %helpserv% :LIST ALL :cl1 privmsg %helpserv% :LIST PIZZA :cl1 privmsg %nickserv% :ALLOWAUTH test3 test5 :cl1 privmsg %nickserv% :ALLOWAUTH test3 test2 :cl1 privmsg %nickserv% :ALLOWAUTH test3 :cl1 privmsg %nickserv% :ALLOWAUTH test3 test2 :cl3 wait cl1 :cl3 nick test4 :cl3 privmsg %nickserv%@%srvx% :AUTH test2 tested :cl3 nick test3 :cl1 wait cl3 :cl1 privmsg %nickserv% :ALLOWAUTH test3 test2 :cl1 privmsg %helpserv% :REASSIGN test3 test1 :cl3 wait cl1 :cl3 privmsg %nickserv%@%srvx% :AUTH test2 testest :cl3 privmsg %helpserv% :THX IT WORX NOW!! :cl1 wait cl3 :cl1 privmsg %helpserv% :LIST ME :cl1 privmsg %helpserv% :ADDNOTE george this guy is a tool :cl1 privmsg %helpserv% :ADDNOTE test2 this should be the first note that works :cl1 privmsg %helpserv% :ADDNOTE *test2 this guy is a tool :cl1 privmsg %helpserv% :CLOSE 2 :cl1 privmsg %helpserv% :SHOW 1 :cl1 privmsg %helpserv% :CLOSE test3 :cl1 privmsg %opserv% :RECONNECT :cl1 sleep 20 :cl1 privmsg %helpserv% :HELP :cl1 privmsg %helpserv% :HELP COMMANDS :cl1 privmsg %helpserv% :HELP BOTS :cl1 privmsg %helpserv% :BOTS :cl1 privmsg %nickserv% :SET BOGUS :cl1 privmsg %nickserv% :SET STYLE DEF :cl1 privmsg %helpserv% :HELPERS :cl1 privmsg %nickserv% :SET STYLE ZOOT :cl1 privmsg %helpserv% :HELPERS :cl1 privmsg %helpserv% :VERSION CVS :cl1 privmsg %helpserv% :PAGE and i-----i'm calling all you angels :cl1 privmsg %helpserv% :STATSREPORT :cl1 part %testchan%1 :cl1 privmsg %opserv% :HELPSERV :cl1 privmsg %opserv% :HELPSERV BOGUS :cl1 privmsg %opserv% :HELPSERV PICKUP :cl1 privmsg %opserv% :HELPSERV READHELP :cl1 privmsg %opserv% :HELPSERV BOTS :cl1 privmsg %opserv% :HELPSERV STATS %helpserv% :cl1 privmsg %opserv% :HELPSERV STATS %helpserv% test1 :cl1 privmsg %opserv% :HELPSERV MOVE %helpserv% %helpserv2% :cl1 privmsg %opserv% :HELPSERV UNREGISTER %helpserv2% # Test NickServ functions :cl1 privmsg %nickserv% :STATUS :cl1 privmsg %nickserv% :VERSION :cl1 privmsg %nickserv% :HELP COMMANDS :cl1 privmsg %nickserv% :ADDMASK :cl1 privmsg %nickserv% :ADDMASK *!**foo@**.bar.com :cl1 privmsg %nickserv% :ADDMASK **foo@**.bar.com :cl1 privmsg %nickserv% :OADDMASK test1 *!**foo@**.bar.com :cl1 privmsg %nickserv% :ODELMASK test1 *!**foo@**.bar.com :cl1 privmsg %nickserv% :DELMASK **foo@**.bar.com :cl1 privmsg %nickserv% :DELMASK *@*.%domain% :cl1 privmsg %nickserv% :SEARCH PRINT HOSTMASK :cl1 privmsg %nickserv% :SEARCH PRINT HOSTMASK EXACT *foo@*.bar.com LIMIT 5 REGISTERED >=1m # cannot test with email since it breaks profiling.. argh :cl3 privmsg %nickserv%@%srvx% :REGISTER test3 bleh :cl1 wait cl3 :cl1 privmsg %nickserv% :OUNREGISTER *bleh :cl1 privmsg %nickserv%@%srvx% :OREGISTER test4 bleh *@* test3 :cl1 privmsg %nickserv%@%srvx% :OREGISTER test4 bleh test3@bar :cl1 privmsg %nickserv% :ACCOUNTINFO test3 :cl1 privmsg %nickserv% :ACCOUNTINFO test3bcd :cl1 privmsg %nickserv% :USERINFO test3 :cl1 privmsg %nickserv% :NICKINFO test3 :cl1 privmsg %nickserv% :OSET test3 :cl1 privmsg %nickserv% :OSET jobaba :cl1 privmsg %nickserv% :OSET test3 BOGUS :cl1 privmsg %nickserv% :OSET test3 FLAGS +f :cl1 privmsg %nickserv% :RENAME test4 test3 :cl3 wait cl1 :cl3 privmsg %nickserv%@%srvx% :REGISTER test3 bleh :cl3 privmsg %nickserv%@%srvx% :AUTH bleh :cl1 wait cl3 :cl1 privmsg %nickserv% :ALLOWAUTH test3 test2 :cl3 wait cl1 :cl3 nick test4 :cl3 privmsg %nickserv% :REGNICK :cl3 nick test3 :cl3 privmsg %nickserv%@%srvx% :REGISTER test3 bleh :cl3 privmsg %nickserv%@%srvx% :AUTH bleh :cl3 privmsg %nickserv%@%srvx% :PASS bleh blargh :cl3 privmsg %nickserv%@%srvx% :ADDMASK *@foo.%domain% :cl3 privmsg %nickserv%@%srvx% :DELMASK *@foo.%domain% :cl3 privmsg %nickserv%@%srvx% :SET :cl3 privmsg %nickserv%@%srvx% :SET MAXLOGINS 1 :cl3 privmsg %nickserv%@%srvx% :RECLAIM test3 :cl3 privmsg %nickserv%@%srvx% :UNREGNICK test3 :cl3 privmsg %nickserv%@%srvx% :UNREGISTER bleach :cl1 wait cl3 :cl3 quit :cl1 sleep 5 :cl1 privmsg %nickserv% :RENAME *test4 test3 :cl1 privmsg %nickserv% :OSET *test3 INFO hi hi hi! :cl1 privmsg %nickserv% :OSET *test3 WIDTH 1 :cl1 privmsg %nickserv% :OSET *test3 WIDTH 80 :cl1 privmsg %nickserv% :OSET *test3 WIDTH 1000 :cl1 privmsg %nickserv% :OSET *test3 TABLEWIDTH 1 :cl1 privmsg %nickserv% :OSET *test3 TABLEWIDTH 80 :cl1 privmsg %nickserv% :OSET *test3 TABLEWIDTH 1000 :cl1 privmsg %nickserv% :OSET *test3 COLOR OFF :cl1 privmsg %nickserv% :OSET *test3 COLOR ON :cl1 privmsg %nickserv% :OSET *test3 COLOR TV :cl1 privmsg %nickserv% :OSET *test3 PRIVMSG ON :cl1 privmsg %nickserv% :OSET *test3 PRIVMSG OFF :cl1 privmsg %nickserv% :OSET *test3 PRIVMSG IGNORED :cl1 privmsg %nickserv% :OSET *test3 ANNOUNCEMENTS ON :cl1 privmsg %nickserv% :OSET *test3 ANNOUNCEMENTS OFF :cl1 privmsg %nickserv% :OSET *test3 ANNOUNCEMENTS ? :cl1 privmsg %nickserv% :OSET *test3 ANNOUNCEMENTS ARE NOT SPAM :cl1 privmsg %nickserv% :OSET *test3 PASSWORD whocares? :cl1 privmsg %nickserv% :ACCOUNTINFO *test3 :cl1 privmsg %nickserv% :OSET *test3 INFO * :cl1 privmsg %nickserv% :OREGISTER test4 bleh *@* :cl1 privmsg %nickserv% :OREGISTER test4@bogus bleh *@* :cl1 privmsg %nickserv% :OREGNICK *test3 test3a :cl1 privmsg %nickserv% :OREGNICK *test3 test3b :cl1 privmsg %nickserv% :OREGNICK *test3 test3c :cl1 privmsg %nickserv% :OUNREGNICK test3c :cl1 privmsg %nickserv% :OUNREGNICK test3b :cl1 privmsg %nickserv% :OUNREGNICK test3a :cl1 privmsg %chanserv% :REGISTER %testchan%2 *test2 :cl1 privmsg %chanserv% :REGISTER %testchan%3 *test3 :cl1 privmsg %chanserv% :%testchan%2 ADDUSER COOWNER *test3 :cl1 privmsg %chanserv% :%testchan%3 ADDUSER COOWNER *test2 :cl1 privmsg %chanserv% :%testchan%1 ADDUSER COOWNER *test3 :cl1 privmsg %chanserv% :%testchan%1 ADDUSER COOWNER *test2 :cl1 privmsg %nickserv% :MERGE *test3 *test2 :cl1 privmsg %nickserv% :SET STYLE DEF :cl1 privmsg %chanserv% :%testchan%1 USERS :cl1 privmsg %chanserv% :%testchan%2 USERS :cl1 privmsg %chanserv% :%testchan%3 USERS :cl1 privmsg %nickserv% :ACCOUNTINFO *test2 :cl1 privmsg %nickserv% :OSET *test2 MAXLOGINS 100 :cl1 privmsg %nickserv% :OSET *test2 MAXLOGINS 1 :cl1 privmsg %nickserv% :OSET *test2 LEVEL 999 :cl1 privmsg %nickserv% :OSET *test2 LEVEL 998 connect cl3 test3 test3 %srv1% :Test Bot 3 :cl1 sleep 6 :cl3 wait cl1 :cl3 privmsg %nickserv%@%srvx% :AUTH test2 testest :cl3 privmsg %nickserv% :VACATION :cl2 wait cl3 :cl2 privmsg %nickserv% :GHOST test3 :cl3 sleep 3 :cl3 quit # Test OpServ functions :cl1 privmsg %opserv% :ACCESS :cl1 privmsg %opserv% :ACCESS * :cl1 privmsg %opserv% :CHANINFO %testchan%1 :cl1 privmsg %opserv% :WHOIS test1 :cl1 privmsg %opserv% :INVITEME :cl1 privmsg %opserv% :JOIN %testchan%1 :cl1 privmsg %opserv% :PART %testchan%1 :cl1 privmsg %opserv% :STATS BAD :cl1 privmsg %opserv% :STATS GLINES :cl1 privmsg %opserv% :STATS LINKS :cl1 privmsg %opserv% :STATS MAX :cl1 privmsg %opserv% :STATS NETWORK :cl1 privmsg %opserv% :STATS NETWORK2 :cl1 privmsg %opserv% :STATS RESERVED :cl1 privmsg %opserv% :STATS TRUSTED :cl1 privmsg %opserv% :STATS UPLINK :cl1 privmsg %opserv% :STATS UPTIME :cl1 privmsg %opserv% :STATS ALERTS :cl1 privmsg %opserv% :STATS GAGS :cl1 privmsg %opserv% :STATS TIMEQ :cl1 privmsg %opserv% :STATS WARN :cl1 privmsg %opserv% :VERSION :cl1 privmsg %opserv% :HELP COMMANDS :cl1 privmsg %opserv% :HELP USER :cl1 privmsg %opserv% :TRACE DOMAINS DEPTH 2 :cl1 privmsg %opserv% :TRACE COUNT LIMIT 3 :cl1 privmsg %opserv% :TRACE HULA-HOOP LIMIT 3 :cl1 privmsg %opserv% :CSEARCH PRINT NAME * TOPIC * USERS <3 TIMESTAMP >0 LIMIT 5 :cl1 privmsg %opserv% :CSEARCH COUNT NAME * TOPIC * USERS <3 TIMESTAMP >0 LIMIT 5 :cl1 privmsg %opserv% :WARN %testchan%4 quiche eaters live here :cl1 privmsg %opserv% :STATS WARN :cl1 join %testchan%4 :cl1 privmsg %opserv% :UNWARN %testchan%4 :cl1 mode %testchan%4 +bbbsnt a!b@c.com b!c@a.org c!a.b.net :cl1 privmsg %opserv% :CLEARBANS %testchan%4 :cl1 privmsg %opserv% :CLEARMODES %testchan%4 :cl1 privmsg %opserv% :DEOP %testchan%4 test1 :cl1 privmsg %opserv% :OP %testchan%4 test1 :cl1 privmsg %opserv% :DEOPALL %testchan%4 :cl1 privmsg %opserv% :VOICEALL %testchan%4 :cl1 privmsg %opserv% :OPALL %testchan%4 :cl1 privmsg %opserv% :JUPE crap.tacular.net 4095 Craptacular Jupe Server :cl1 privmsg %opserv% :UNJUPE crap.tacular.net :cl1 privmsg %opserv% :JUMP clan-dk :cl1 privmsg %opserv% :GLINE pizza 1y Pizza is not allowed on this network :cl1 privmsg %opserv% :GLINE *@* 1w GO AWAY I HATE THE WORLD :cl1 privmsg %opserv% :GLINE pi...@th... 0 Fat-laden freak :cl1 privmsg %opserv% :GLINE fo...@ba... 1m Testing G-line removal :cl1 privmsg %opserv% :UNGLINE fo...@ba... 1m Testing G-line removal :cl1 privmsg %opserv% :UNGLINE fo...@ba... 1m Testing G-line removal :cl1 privmsg %opserv% :REFRESHG pizza.thehut.com :cl1 privmsg %opserv% :GSYNC %srv1name%.illegal :cl1 privmsg %opserv% :GSYNC :cl1 privmsg %opserv% :WHOIS test1 :cl1 privmsg %opserv% :JOIN pizza.thehut.com :cl1 privmsg %opserv% :JOIN %testchan%4 :cl1 privmsg %opserv% :JOIN %testchan%4 :cl1 privmsg %opserv% :KICK %testchan%4 test1 :cl1 join %testchan%4 :cl1 privmsg %opserv% :KICKALL %testchan%4 :cl1 join %testchan%4 :cl1 privmsg %opserv% :KICKBAN %testchan%4 test1 :cl1 privmsg %opserv% :PART %testchan%4 hahah u r banned :cl1 join %testchan%4 :cl1 privmsg %opserv% :MODE %testchan%4 +snti :cl1 privmsg %opserv% :NICKBAN %testchan%4 test1 :cl1 privmsg %opserv% :UNBAN %testchan%4 *!*@*.%domain% :cl1 privmsg %opserv% :KICKBANALL %testchan%4 :cl1 part %testchan%4 :cl1 privmsg %opserv% :COLLIDE test3 foo bar.com nick jupe :cl1 privmsg %opserv% :UNRESERVE test3 :cl1 privmsg %opserv% :RESERVE test3 foo bar.com nick jupe 2 :cl1 privmsg %opserv% :UNRESERVE test3 :cl1 privmsg %opserv% :ADDBAD %testchan%4abc :cl1 privmsg %opserv% :ADDBAD %testchan%4 :cl1 privmsg %opserv% :ADDBAD %testchan%4abc EXCEPT :cl1 privmsg %opserv% :ADDBAD %testchan%4abc EXCEPT %testchan%4ab :cl1 privmsg %opserv% :ADDEXEMPT %testchan%4ab :cl1 privmsg %opserv% :DELEXEMPT %testchan%4ab :cl1 privmsg %opserv% :ADDTRUST 1.2.3.4 0 1w We like incrementing numbers :cl1 privmsg %opserv% :ADDTRUST foo@1.2.3.4 0 1w We like incrementing numbers :cl1 privmsg %opserv% :ADDTRUST 1.2.3.4 0 1w We like incrementing numbers :cl1 privmsg %opserv% :DELTRUST 1.2.3.4 :cl1 privmsg %opserv% :CLONE ADD test3 joe.bar.com nick jupe 3 :cl1 privmsg %opserv% :CLONE ADD test3 jo...@ba... nick jupe 3 :cl1 privmsg %opserv% :CLONE REMOVE gobbledygook :cl1 privmsg %opserv% :CLONE REMOVE %chanserv% :cl1 privmsg %opserv% :CLONE bogus test3 :cl1 privmsg %opserv% :CLONE JOIN test3 %testchan%1 :cl1 privmsg %opserv% :CLONE OP test3 %testchan%1 :cl1 privmsg %opserv% :CLONE SAY test3 %testchan%1 :cl1 privmsg %opserv% :CLONE SAY test3 %testchan%1 HAHA H4X :cl1 privmsg %opserv% :CLONE JOIN test3 %testchan%1abc :cl1 privmsg %opserv% :CLONE PART test3 %testchan%1 :cl1 privmsg %opserv% :CLONE REMOVE test3 :cl1 privmsg %opserv% :GAG test3!*@*.%domain% 1w Clones sux connect cl3 test3 test3 %srv2% :Test Bot 3 :cl1 wait cl3 :cl1 privmsg %opserv% :ADDALERT test3 kill NICK test3 :cl1 privmsg %opserv% :DELALERT test3 kill NICK test3 :cl3 privmsg %nickserv% :HELP :cl3 nick test4 :cl3 privmsg %nickserv% :HELP :cl3 nick test3 :cl3 privmsg %nickserv% :HELP :cl1 privmsg %opserv% :UNGAG test3!*@*.%domain% :cl1 privmsg %opserv% :SET server/max_users 128 :cl1 privmsg %opserv% :SETTIME * # Test MemoServ functions :cl1 privmsg %memoserv% :SEND gobble,dy HELLO? :cl1 privmsg %memoserv% :SEND test2 HELLO? :cl1 privmsg %memoserv% :SET NOTIFY ON :cl1 privmsg %memoserv% :SET AUTHNOTIFY ON :cl2 wait cl1 :cl2 privmsg %memoserv% :SET NOTIFY OFF :cl2 privmsg %memoserv% :SET AUTHNOTIFY OFF :cl2 privmsg %memoserv% :LIST :cl2 privmsg %memoserv% :SEND test1 HELLO! :cl2 privmsg %memoserv% :DELETE 0 :cl1 wait cl2 :cl1 privmsg %memoserv% :SET PRIVATE ON :cl2 wait cl1 :cl2 privmsg %memoserv% :SEND test1 DO YOU STILL LIKE ME? :cl1 wait cl2 :cl1 privmsg %chanserv% :%testchan%1 DELUSER test2 :cl1 privmsg %nickserv% :RENAME test2 testy :cl2 wait cl1 :cl2 privmsg %memoserv% :SEND test1 DO YOU STILL LIKE ME? :cl1 privmsg %memoserv% :LIST :cl1 privmsg %memoserv% :READ 1 :cl1 privmsg %memoserv% :READ 10 :cl1 privmsg %memoserv% :DELETE 10 :cl1 privmsg %memoserv% :DELETE ALL :cl1 privmsg %memoserv% :DELETE ALL CONFIRM :cl1 privmsg %memoserv% :EXPIRE :cl1 privmsg %memoserv% :EXPIRY :cl1 privmsg %memoserv% :VERSION :cl1 privmsg %memoserv% :STATUS # Test ServerSpy functions :cl1 privmsg %opserv% :DISCONNECT :cl1 privmsg %opserv% :DISCONNECT :cl1 privmsg %opserv% :STATS SERVERSPY :cl1 privmsg %opserv% :CONNECT :cl1 privmsg %opserv% :CONNECT :cl1 privmsg %opserv% :DELMOD hl bogus :cl1 privmsg %opserv% :DELMOD hl cstrike :cl1 privmsg %opserv% :DELMOD bogus cstrike :cl1 privmsg %opserv% :DELGAME hl :cl1 privmsg %opserv% :DELGAME hl :cl1 privmsg %opserv% :ADDGAME hl Half Life :cl1 privmsg %opserv% :ADDGAME hl Half Life :cl1 privmsg %opserv% :ADDMOD hl cstrike Counter-Strike :cl1 privmsg %opserv% :ADDMOD hl cstrike Counter-Strike :cl1 privmsg %opserv% :ADDMOD bogus cstrike Counter-Strike :cl1 privmsg %chanserv% :HELP SERVERSPY :cl1 privmsg %chanserv% :SERVERSPY GAME hl :cl1 privmsg %chanserv% :SERVERSPY NAME Jose :cl1 privmsg %chanserv% :SERVERSPY NAME Jose GAME bogus :cl1 privmsg %chanserv% :SERVERSPY NAME Jose GAME hl MOD bogus :cl1 privmsg %chanserv% :SERVERSPY NAME Jose GAME hl MOD cstrike :cl1 privmsg %chanserv% :SERVERSPY NAME *p* GAME hl MOD cstrike :cl1 privmsg %chanserv% :SERVERSPY SERVER *?p* GAME hl MOD cstrike :cl1 privmsg %chanserv% :%testchan%1 SET GAME :cl1 privmsg %chanserv% :%testchan%1 SET GAME bogus :cl1 privmsg %chanserv% :%testchan%1 SET GAME hl :cl1 privmsg %chanserv% :%testchan%1 SET GAME :cl1 privmsg %chanserv% :%testchan%1 SET MOD :cl1 privmsg %chanserv% :%testchan%1 SET MOD bogus :cl1 privmsg %chanserv% :%testchan%1 SET MOD cstrike :cl1 privmsg %chanserv% :%testchan%1 SET MOD :cl1 privmsg %chanserv% :%testchan%1 SET CLANTAG [D] :cl1 privmsg %chanserv% :%testchan%1 SET CLANTAG [D* :cl1 privmsg %chanserv% :%testchan%1 SET CLANTAG :cl1 privmsg %chanserv% :%testchan%1 SET SERVERTAG [D] :cl1 privmsg %chanserv% :%testchan%1 SET SERVERTAG [D* :cl1 privmsg %chanserv% :%testchan%1 SET SERVERTAG :cl1 privmsg %chanserv% :%testchan%1 SERVERSPY NAME *p* :cl1 privmsg %chanserv% :%testchan%1 LOCATECLAN :cl1 privmsg %chanserv% :%testchan%1 LOCATESERVER :cl1 privmsg %opserv% :STATS SERVERSPY # Test proxy checker code :cl1 privmsg %opserv% :HOSTSCAN 62.255.216.72 :cl1 sleep 10 :cl1 privmsg %opserv% :CLEARHOST 62.255.216.72 # Clean up test channel :cl1 privmsg %chanserv% :%testchan%1 SET NODELETE OFF :cl1 privmsg %chanserv% :%testchan%1 UNREGISTER # exit all clients :cl2 wait cl1 :cl2 privmsg %nickserv%@%srvx% :UNREGISTER MY SHIZNIT :cl2 privmsg %nickserv%@%srvx% :UNREGISTER testest :cl1 wait cl2 :cl1 quit :cl2 quit :cl3 quit |
From: Entrope <en...@us...> - 2003-10-12 19:40:04
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv9390/src Modified Files: gline.c gline.h opserv.c Log Message: extend badchan support to treat badchans as unregisterable Index: gline.c =================================================================== RCS file: /cvsroot/srvx/services/src/gline.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** gline.c 12 Oct 2003 19:20:58 -0000 1.37 --- gline.c 12 Oct 2003 19:39:59 -0000 1.38 *************** *** 155,158 **** --- 155,181 ---- } + struct gline * + gline_find(const char *target) + { + struct gline *res; + dict_iterator_t it; + + res = dict_find(gline_dict, target, NULL); + if (res) + return res; + /* Stock ircu requires BADCHANs to match exactly. */ + if (target[0] == '#') + return NULL; + else { + /* Otherwise, do an obnoxiously long search. */ + for (it = dict_first(gline_dict); it; it = iter_next(it)) { + res = iter_data(it); + if (match_ircglob(target, res->target)) + return res; + } + } + return NULL; + } + static int gline_refresh_helper(UNUSED_ARG(void *key), void *data, void *extra) Index: gline.h =================================================================== RCS file: /cvsroot/srvx/services/src/gline.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** gline.h 7 Jul 2003 16:29:33 -0000 1.17 --- gline.h 12 Oct 2003 19:39:59 -0000 1.18 *************** *** 44,47 **** --- 44,48 ---- void gline_init(void); struct gline *gline_add(const char *issuer, const char *target, unsigned long duration, const char *reason, time_t issued, int announce); + struct gline *gline_find(const char *target); int gline_remove(const char *target, int announce); void gline_refresh_server(struct server *srv); Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.345 retrieving revision 1.346 diff -C2 -r1.345 -r1.346 *** opserv.c 12 Oct 2003 19:20:58 -0000 1.345 --- opserv.c 12 Oct 2003 19:39:59 -0000 1.346 *************** *** 1769,1772 **** --- 1769,1775 ---- return 0; + if (gline_find(name)) + return 1; + for (found=0; found<opserv_bad_words->used; ++found) if (irccasestr(name, opserv_bad_words->list[found])) |
From: Entrope <en...@us...> - 2003-10-12 19:21:02
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv3285/src Modified Files: gline.c opserv.c Log Message: add badchan support Index: gline.c =================================================================== RCS file: /cvsroot/srvx/services/src/gline.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** gline.c 26 Sep 2003 15:13:59 -0000 1.36 --- gline.c 12 Oct 2003 19:20:58 -0000 1.37 *************** *** 286,290 **** goto fail; } ! if (!is_gline(argv[++i])) { send_message(user, src, MSG_INVALID_GLINE, argv[i]); goto fail; --- 286,291 ---- goto fail; } ! ++i; ! if (!is_gline(argv[i]) && !IsChannelName(argv[i])) { send_message(user, src, MSG_INVALID_GLINE, argv[i]); goto fail; Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.344 retrieving revision 1.345 diff -C2 -r1.344 -r1.345 *** opserv.c 12 Oct 2003 03:35:50 -0000 1.344 --- opserv.c 12 Oct 2003 19:20:58 -0000 1.345 *************** *** 797,805 **** reason = unsplit_string(argv+3, argc-3, NULL); ! if (!is_gline(argv[1])) { opserv_notice(user, MSG_INVALID_GLINE, argv[1]); return 0; } ! if (!argv[1][strspn(argv[1], "*?@.")] && (strlen(argv[1]) < 10)) { opserv_notice(user, OSMSG_STUPID_GLINE, argv[1]); return 0; --- 797,805 ---- reason = unsplit_string(argv+3, argc-3, NULL); ! if (!is_gline(argv[1]) && !IsChannelName(argv[1])) { opserv_notice(user, MSG_INVALID_GLINE, argv[1]); return 0; } ! if (!argv[1][strspn(argv[1], "#*?@.")] && (strlen(argv[1]) < 10)) { opserv_notice(user, OSMSG_STUPID_GLINE, argv[1]); return 0; |
From: Entrope <en...@us...> - 2003-10-12 03:35:54
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv25385/src Modified Files: opserv.c opserv.help Log Message: change "linked" to "nickage" in trace criteria Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.343 retrieving revision 1.344 diff -C2 -r1.343 -r1.344 *** opserv.c 12 Oct 2003 03:30:40 -0000 1.343 --- opserv.c 12 Oct 2003 03:35:50 -0000 1.344 *************** *** 2917,2921 **** } else if (irccasecmp(argv[i], "last") == 0) { discrim->min_ts = now - ParseInterval(argv[++i]); ! } else if (irccasecmp(argv[i], "linked") == 0) { const unsigned char *cmp = argv[++i]; if (cmp[0] == '<') { --- 2917,2922 ---- } else if (irccasecmp(argv[i], "last") == 0) { discrim->min_ts = now - ParseInterval(argv[++i]); ! } else if ((irccasecmp(argv[i], "linked") == 0) ! || (irccasecmp(argv[i], "nickage") == 0)) { const unsigned char *cmp = argv[++i]; if (cmp[0] == '<') { Index: opserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.help,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -r1.66 -r1.67 *** opserv.help 30 Sep 2003 17:47:09 -0000 1.66 --- opserv.help 12 Oct 2003 03:35:51 -0000 1.67 *************** *** 76,81 **** "$bNUMCHANNELS$b 5 Specifies a number of channels the client must be in.", "$bLIMIT$b 50 Limits the number of responses to a certain number.", ! "$bLAST$b duration Client must have connected to IRC in the last $bduration$b (alias for LINKED <=duration)", ! "$bLINKED$b cmp Connected time constraint (<Nu, <=Nu, =Nu, >=Nu or >Nu)", "$bACCESS$b cmp Access constraints (<nnn, <=nnn, =nnn, >=nnn or >nnn)", "$bREASON$b reason Reason for kill or gline (must be listed last).", --- 76,80 ---- "$bNUMCHANNELS$b 5 Specifies a number of channels the client must be in.", "$bLIMIT$b 50 Limits the number of responses to a certain number.", ! "$bNICKAGE$b cmp Client has had nick this long (<Nu, <=Nu, =Nu, >=Nu or >Nu)", "$bACCESS$b cmp Access constraints (<nnn, <=nnn, =nnn, >=nnn or >nnn)", "$bREASON$b reason Reason for kill or gline (must be listed last).", |
From: Entrope <en...@us...> - 2003-10-12 03:30:49
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv24841/src Modified Files: opserv.c Log Message: change "Linked" label to "Nick Age" (which is what it is) Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.342 retrieving revision 1.343 diff -C2 -r1.342 -r1.343 *** opserv.c 7 Oct 2003 03:43:08 -0000 1.342 --- opserv.c 12 Oct 2003 03:30:40 -0000 1.343 *************** *** 122,126 **** #define OSMSG_WHOIS_NUMERIC "Numeric : %s" #define OSMSG_WHOIS_SERVER "Server : %s" ! #define OSMSG_WHOIS_CONNECTED "Linked : %s (%s ago)" #define OSMSG_WHOIS_ACCOUNT "Account : %s" #define OSMSG_WHOIS_CHANNELS "Channels:" --- 122,126 ---- #define OSMSG_WHOIS_NUMERIC "Numeric : %s" #define OSMSG_WHOIS_SERVER "Server : %s" ! #define OSMSG_WHOIS_NICK_AGE "Nick Age: %s" #define OSMSG_WHOIS_ACCOUNT "Account : %s" #define OSMSG_WHOIS_CHANNELS "Channels:" *************** *** 1164,1168 **** { struct userNode *target; ! char buffer[128], buffer2[INTERVALLEN]; int bpos, herelen; --- 1164,1168 ---- { struct userNode *target; ! char buffer[128]; int bpos, herelen; *************** *** 1205,1212 **** opserv_notice(user, OSMSG_WHOIS_SERVER, target->uplink->name); opserv_notice(user, OSMSG_WHOIS_ACCOUNT, (target->handle_info ? target->handle_info->handle : "Not authenticated")); ! strncpy(buffer, asctime(localtime(&target->timestamp)), sizeof(buffer)); ! buffer[strlen(buffer) - 1] = 0; /* take off trailing '\n' */ ! intervalString(buffer2, now - target->timestamp); ! opserv_notice(user, OSMSG_WHOIS_CONNECTED, buffer, buffer2); if (target->channels.used <= MAX_CHANNELS_WHOIS) { opserv_ison(user, target, OSMSG_WHOIS_CHANNELS); --- 1205,1210 ---- opserv_notice(user, OSMSG_WHOIS_SERVER, target->uplink->name); opserv_notice(user, OSMSG_WHOIS_ACCOUNT, (target->handle_info ? target->handle_info->handle : "Not authenticated")); ! intervalString(buffer, now - target->timestamp); ! opserv_notice(user, OSMSG_WHOIS_NICK_AGE, buffer); if (target->channels.used <= MAX_CHANNELS_WHOIS) { opserv_ison(user, target, OSMSG_WHOIS_CHANNELS); |
From: Entrope <en...@us...> - 2003-10-10 03:27:39
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv15329/src Modified Files: nickserv.help.m4 Log Message: fix documentation for oregnick command Index: nickserv.help.m4 =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.help.m4,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -r1.19 -r1.20 *** nickserv.help.m4 4 Oct 2003 01:36:26 -0000 1.19 --- nickserv.help.m4 10 Oct 2003 03:27:35 -0000 1.20 *************** *** 64,68 **** "$uSee Also:$u oregister, oregnick, ounregnick"); ! "OREGNICK" ("/msg $N OREGNICK [<nick> <nick|*account>]", "Registers specified nick to the specified account. If nick and account are not specified, then $boregnick$b registers your current nick to the account you are authenticated to.", "You may use *Account instead of Nick as the name argument; the * makes $N use the name of an account directly (useful if the user is not online).", --- 64,68 ---- "$uSee Also:$u oregister, oregnick, ounregnick"); ! "OREGNICK" ("/msg $N OREGNICK [<nick|*account> <nick>]", "Registers specified nick to the specified account. If nick and account are not specified, then $boregnick$b registers your current nick to the account you are authenticated to.", "You may use *Account instead of Nick as the name argument; the * makes $N use the name of an account directly (useful if the user is not online).", |
From: Entrope <en...@us...> - 2003-10-10 02:53:02
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv11285/src Modified Files: chanserv.c Log Message: rewrite user list code: include vacation/suspend/neither status, use table_send(), sort account names in each section Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.385 retrieving revision 1.386 diff -C2 -r1.385 -r1.386 *** chanserv.c 8 Oct 2003 04:46:14 -0000 1.385 --- chanserv.c 10 Oct 2003 02:52:58 -0000 1.386 *************** *** 258,263 **** #define CSMSG_ACCESS_SEARCH_HDR "%s $b%ss$b matching %s:" #define CSMSG_ACCESS_HEADER "%s $b%ss$b:" - #define CSMSG_USER_HEADER "$b%-*s%-*s%s$b" - #define CSMSG_USER_DATA "$b%-*s%-*s$b%s" /* Channel banlist */ --- 258,261 ---- *************** *** 464,474 **** struct listData { ! struct userData **users; ! unsigned int matches; ! ! enum userLevel lowest; ! enum userLevel highest; ! ! unsigned int handleLength; }; --- 462,472 ---- struct listData { ! struct userNode *user; ! struct chanNode *channel; ! const char *search; ! enum userLevel lowest; ! enum userLevel highest; ! struct userData **users; ! struct helpfile_table table; }; *************** *** 3563,3719 **** static void ! zoot_list(char *search, struct userNode *user, struct chanNode *channel, struct listData *list) { ! struct userData **users, *found; ! enum userLevel display; ! char buf[INTERVALLEN], *seen; ! unsigned int i; ! users = list->users; ! for(display = list->highest; display >= list->lowest; display--) { ! found = NULL; ! ! for(i = 0; i < list->matches; i++) ! { ! if(users[i]->access == display) ! { ! found = users[i]; ! break; ! } ! } ! ! if(!found) ! { ! if(list->highest == list->lowest) ! { ! if(search) ! { ! chanserv_notice(user, CSMSG_ACCESS_SEARCH_HDR, channel->name, accessNames[display], search); ! } ! else ! { ! chanserv_notice(user, CSMSG_ACCESS_HEADER, channel->name, accessNames[display]); ! } ! chanserv_notice(user, "$bNone.$b"); ! return; ! } ! continue; ! } ! ! if(search) ! { ! chanserv_notice(user, CSMSG_ACCESS_SEARCH_HDR, channel->name, accessNames[display], search); ! } else { ! chanserv_notice(user, CSMSG_ACCESS_HEADER, channel->name, accessNames[display]); } - chanserv_notice(user, CSMSG_USER_HEADER, 0, "", list->handleLength+2, "Account:", "Last Seen:"); - - while(i < list->matches) - { - if(users[i]->access != display) - { - i++; - continue; - } - - if(!users[i]->present) - { - if(users[i]->seen) - { - intervalString(buf, now - users[i]->seen); - seen = buf; - } - else - { - seen = "Never."; - } - } - else - { - seen = "Here."; - } - - chanserv_notice(user, CSMSG_USER_DATA, 2, "", list->handleLength, users[i]->handle->handle, seen); - - i++; - } } } static void ! def_list(char *search, struct userNode *user, struct chanNode *channel, struct listData *list) { ! struct userData **users, *found; ! enum userLevel display; ! char buf[INTERVALLEN], *seen; ! unsigned int i; ! ! if(search) ! { ! chanserv_notice(user, CSMSG_ACCESS_SEARCH_HDR, channel->name, list->highest == list->lowest ? accessNames[list->lowest] : "user", search); ! } else ! { ! chanserv_notice(user, CSMSG_ACCESS_HEADER, channel->name, list->highest == list->lowest ? accessNames[list->lowest] : "user"); ! } ! chanserv_notice(user, CSMSG_USER_HEADER, ACCESSLEN, "Access:", list->handleLength, "Account:", "Last Seen:"); ! ! users = list->users; ! for(display = list->highest; display >= list->lowest; display--) ! { ! found = NULL; ! ! for(i = 0; i < list->matches; i++) ! { ! if(users[i]->access == display) ! { ! found = users[i]; ! break; ! } ! } ! ! if(!found) ! { ! if(list->highest == list->lowest) ! { ! chanserv_notice(user, "$bNone.$b"); ! return; ! } ! continue; ! } ! ! while(i < list->matches) ! { ! if(users[i]->access != display) ! { ! i++; ! continue; ! } ! ! if(!users[i]->present) ! { ! if(users[i]->seen) ! { ! intervalString(buf, now - users[i]->seen); ! seen = buf; ! } ! else ! { ! seen = "Never."; ! } ! } ! else ! { ! seen = "Here."; ! } ! ! chanserv_notice(user, CSMSG_USER_DATA, ACCESSLEN, accessTitles[users[i]->access], list->handleLength, users[i]->handle->handle, seen); ! i++; ! } ! } } --- 3561,3627 ---- static void ! zoot_list(struct listData *list) { ! enum userLevel lvl = list->highest; ! struct userData *uData; ! unsigned int start, curr; ! struct helpfile_table tmp_table; ! const char **temp; ! if(list->table.length == 1) { ! if(list->search) ! chanserv_notice(list->user, CSMSG_ACCESS_SEARCH_HDR, list->channel->name, list->highest == list->lowest ? accessNames[list->lowest] : "user", list->search); else + chanserv_notice(list->user, CSMSG_ACCESS_HEADER, list->channel->name, list->highest == list->lowest ? accessNames[list->lowest] : "user"); + chanserv_notice(list->user, " None"); + } + tmp_table.width = list->table.width; + tmp_table.flags = list->table.flags; + for(start = curr = 1; curr < list->table.length; ++curr) + { + uData = list->users[curr-1]; + list->table.contents[curr][0] = " "; + if((start != curr) && ((uData->access != lvl) || (curr+1 == list->table.length))) { ! if(list->search) ! chanserv_notice(list->user, CSMSG_ACCESS_SEARCH_HDR, list->channel->name, accessNames[lvl], list->search); ! else ! chanserv_notice(list->user, CSMSG_ACCESS_HEADER, list->channel->name, accessNames[lvl]); ! temp = list->table.contents[--start]; ! list->table.contents[start] = list->table.contents[0]; ! tmp_table.contents = list->table.contents + start; ! tmp_table.length = curr - start; ! table_send(chanserv, list->user->nick, 0, NULL, tmp_table); ! list->table.contents[start] = temp; ! start = curr; ! lvl = uData->access; } } } static void ! def_list(struct listData *list) { ! if(list->search) ! chanserv_notice(list->user, CSMSG_ACCESS_SEARCH_HDR, list->channel->name, list->highest == list->lowest ? accessNames[list->lowest] : "user", list->search); else ! chanserv_notice(list->user, CSMSG_ACCESS_HEADER, list->channel->name, list->highest == list->lowest ? accessNames[list->lowest] : "user"); ! table_send(chanserv, list->user->nick, 0, NULL, list->table); ! if(list->table.length == 1) ! chanserv_notice(list->user, " None"); ! } ! static int ! userData_access_comp(const void *arg_a, const void *arg_b) ! { ! const struct userData *a = *(struct userData**)arg_a; ! const struct userData *b = *(struct userData**)arg_b; ! int res; ! if(a->access != b->access) ! res = b->access - a->access; ! else ! res = irccasecmp(a->handle->handle, b->handle->handle); ! return res; } *************** *** 3721,3733 **** cmd_list_users(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd), enum userLevel display_lowest, enum userLevel display_highest) { ! void (*send_list)(char *, struct userNode *, struct chanNode *, struct listData *); ! struct userData *uData, **users; ! struct chanData *cData; struct listData lData; enum userLevel display; ! unsigned int handleLength = 0, matches = 0; ! char *search = NULL; ! if(argc > 1) search = argv[1]; send_list = zoot_list; --- 3629,3644 ---- cmd_list_users(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd), enum userLevel display_lowest, enum userLevel display_highest) { ! void (*send_list)(struct listData *); ! struct userData *uData; struct listData lData; enum userLevel display; ! unsigned int matches; ! const char **ary; ! lData.user = user; ! lData.channel = channel; ! lData.lowest = display_lowest; ! lData.highest = display_highest; ! lData.search = (argc > 1) ? argv[1] : NULL; send_list = zoot_list; *************** *** 3737,3775 **** { case HI_STYLE_DEF: send_list = def_list; break; } } ! cData = channel->channel_info; for(display = display_highest; display >= display_lowest; display--) ! { ! matches += cData->userCount[display]; ! } ! users = alloca(matches * sizeof(struct userData *)); matches = 0; ! ! for(uData = cData->users; uData; uData = uData->next) { ! if(uData->access < display_lowest || uData->access > display_highest) continue; ! ! if(search && !match_ircglob(uData->handle->handle, search)) ! continue; ! ! users[matches++] = uData; ! ! if((unsigned int)strlen(uData->handle->handle) > handleLength) ! handleLength = strlen(uData->handle->handle); } ! lData.users = users; ! lData.matches = matches; ! lData.lowest = display_lowest; ! lData.highest = display_highest; ! /* Must be at least strlen("Account:")+3 */ ! lData.handleLength = handleLength < 11 ? 11 : handleLength + 3; ! ! send_list(search, user, channel, &lData); ! return 1; } --- 3648,3712 ---- { case HI_STYLE_DEF: send_list = def_list; break; + case HI_STYLE_ZOOT: send_list = zoot_list; break; } } ! matches = 0; for(display = display_highest; display >= display_lowest; display--) ! matches += channel->channel_info->userCount[display]; ! lData.users = alloca(matches * sizeof(struct userData *)); matches = 0; ! for(uData = channel->channel_info->users; uData; uData = uData->next) { ! if((uData->access < display_lowest) ! || (uData->access > display_highest) ! || (lData.search && !match_ircglob(uData->handle->handle, lData.search))) continue; ! lData.users[matches++] = uData; } + qsort(lData.users, matches, sizeof(lData.users[0]), userData_access_comp); ! lData.table.length = matches+1; ! lData.table.width = 4; ! lData.table.flags = TABLE_NO_FREE; ! lData.table.contents = malloc(lData.table.length*sizeof(*lData.table.contents)); ! ary = malloc(lData.table.width*sizeof(**lData.table.contents)); ! lData.table.contents[0] = ary; ! ary[0] = " "; ! ary[1] = "Account"; ! ary[2] = "Last Seen"; ! ary[3] = "Status"; ! for(matches = 1; matches < lData.table.length; ++matches) ! { ! struct userData *uData = lData.users[matches-1]; ! char seen[INTERVALLEN]; ! ! ary = malloc(lData.table.width*sizeof(**lData.table.contents)); ! lData.table.contents[matches] = ary; ! ary[0] = accessNames[uData->access]; ! ary[1] = uData->handle->handle; ! if(uData->present) ! ary[2] = "Here"; ! else if(!uData->seen) ! ary[2] = "Never"; ! else ! ary[2] = intervalString(seen, now - uData->seen); ! ary[2] = strdup(ary[2]); ! if(IsUserSuspended(uData)) ! ary[3] = "Suspended"; ! else if(HANDLE_FLAGGED(uData->handle, FROZEN)) ! ary[3] = "Vacation"; ! else ! ary[3] = "Normal"; ! } ! send_list(&lData); ! for(matches = 1; matches < lData.table.length; ++matches) ! { ! free((char*)lData.table.contents[matches][2]); ! free(lData.table.contents[matches]); ! } ! free(lData.table.contents[0]); ! free(lData.table.contents); return 1; } |
From: Entrope <en...@us...> - 2003-10-10 02:41:04
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv10018/src Modified Files: helpfile.c Log Message: don't send extra spaces at the end of lines in tables Index: helpfile.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpfile.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -r1.64 -r1.65 *** helpfile.c 26 Sep 2003 15:18:02 -0000 1.64 --- helpfile.c 10 Oct 2003 02:41:01 -0000 1.65 *************** *** 104,108 **** * in a row. */ for (pos=ii=0; ii<((table.flags & TABLE_REPEAT_HEADERS)?nreps:1); ii++) { ! for (jj=0; jj<table.width; jj++) { len = strlen(table.contents[0][jj]); spaces = max_width[jj] - len; --- 104,108 ---- * in a row. */ for (pos=ii=0; ii<((table.flags & TABLE_REPEAT_HEADERS)?nreps:1); ii++) { ! for (jj=0; 1; ) { len = strlen(table.contents[0][jj]); spaces = max_width[jj] - len; *************** *** 110,124 **** memcpy(line+pos, table.contents[0][jj], len); pos += len; if (!(table.flags & TABLE_PAD_LEFT)) while (spaces--) line[pos++] = ' '; line[pos++] = ' '; } } ! line[--pos] = 0; irc_send(from, to, line); ii = 1; } /* Send the table. */ ! for (pos=0, reps=0; ii<table.length; ) { ! for (jj=0; jj<table.width; jj++) { len = strlen(table.contents[ii][jj]); spaces = max_width[jj] - len; --- 110,125 ---- memcpy(line+pos, table.contents[0][jj], len); pos += len; + if (++jj == table.width) break; if (!(table.flags & TABLE_PAD_LEFT)) while (spaces--) line[pos++] = ' '; line[pos++] = ' '; } } ! line[pos] = 0; irc_send(from, to, line); ii = 1; } /* Send the table. */ ! for (jj=0, pos=0, reps=0; ii<table.length; ) { ! while (1) { len = strlen(table.contents[ii][jj]); spaces = max_width[jj] - len; *************** *** 126,137 **** memcpy(line+pos, table.contents[ii][jj], len); pos += len; if (!(table.flags & TABLE_PAD_LEFT)) while (spaces--) line[pos++] = ' '; line[pos++] = ' '; - } - ++ii; ++reps; - if ((reps == nreps) || (ii==table.length)) { - line[--pos] = 0; - irc_send(from, to, line); - pos = reps = 0; } } --- 127,141 ---- memcpy(line+pos, table.contents[ii][jj], len); pos += len; + if (++jj == table.width) { + jj = 0, ++ii, ++reps; + if ((reps == nreps) || (ii == table.length)) { + line[pos] = 0; + irc_send(from, to, line); + pos = reps = 0; + break; + } + } if (!(table.flags & TABLE_PAD_LEFT)) while (spaces--) line[pos++] = ' '; line[pos++] = ' '; } } |
From: Entrope <en...@us...> - 2003-10-10 02:40:30
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv9917/src Modified Files: common.h tools.c Log Message: add intervalString2(): returns output buffer, allows brief output Index: common.h =================================================================== RCS file: /cvsroot/srvx/services/src/common.h,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -r1.92 -r1.93 *** common.h 1 Sep 2003 14:43:22 -0000 1.92 --- common.h 10 Oct 2003 02:40:25 -0000 1.93 *************** *** 168,172 **** #define INTERVALLEN 32 ! void intervalString(char *output, time_t interval); int getipbyname(const char *name, unsigned long *ip); --- 168,173 ---- #define INTERVALLEN 32 ! char *intervalString2(char *output, time_t interval, int brief); ! #define intervalString(OUTPUT, INTERVAL) intervalString2((OUTPUT), (INTERVAL), 0) int getipbyname(const char *name, unsigned long *ip); Index: tools.c =================================================================== RCS file: /cvsroot/srvx/services/src/tools.c,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -r1.127 -r1.128 *** tools.c 26 Sep 2003 15:16:58 -0000 1.127 --- tools.c 10 Oct 2003 02:40:25 -0000 1.128 *************** *** 605,610 **** } ! void ! intervalString(char *output, time_t interval) { static const struct { --- 605,610 ---- } ! char * ! intervalString2(char *output, time_t interval, int brief) { static const struct { *************** *** 619,629 **** { "second", 1 } }; ! int words, pos, count; ! unsigned int type; if(!interval) { ! strcpy(output, "0 seconds"); ! return; } --- 619,628 ---- { "second", 1 } }; ! unsigned int type, words, pos, count; if(!interval) { ! strcpy(output, brief ? "0s" : "0 seconds"); ! return output; } *************** *** 631,649 **** interval && (words < 2) && (type < ArrayLength(unit)); type++) { ! if(interval < unit[type].length) continue; count = interval / unit[type].length; interval = interval % unit[type].length; ! if(words == 1) ! { ! memcpy(output + pos, " and ", 5); ! pos += 5; ! } ! pos += sprintf(output + pos, "%d %s", count, unit[type].name); ! if(count != 1) output[pos++] = 's'; words++; } output[pos] = 0; } --- 630,651 ---- interval && (words < 2) && (type < ArrayLength(unit)); type++) { ! if (interval < unit[type].length) ! continue; count = interval / unit[type].length; interval = interval % unit[type].length; ! if (brief) ! pos += sprintf(output + pos, "%d%c", count, unit[type].name[0]); ! else if (words == 1) ! pos += sprintf(output + pos, " and %d %s", count, unit[type].name); ! else ! pos += sprintf(output + pos, "%d %s", count, unit[type].name); ! if (count != 1) ! output[pos++] = 's'; words++; } output[pos] = 0; + return output; } |
From: Entrope <en...@us...> - 2003-10-08 04:46:18
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv15966/src Modified Files: chanserv.c Log Message: check permanent ban lists when a user changes nick Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.384 retrieving revision 1.385 diff -C2 -r1.384 -r1.385 *** chanserv.c 8 Oct 2003 03:04:46 -0000 1.384 --- chanserv.c 8 Oct 2003 04:46:14 -0000 1.385 *************** *** 6406,6409 **** --- 6406,6449 ---- } + static void + handle_nick_change(struct userNode *user, UNUSED_ARG(const char *old_nick)) + { + struct chanNode *channel; + struct banData *bData; + unsigned int ii, jj; + char kick_reason[MAXLEN]; + + for(ii = 0; ii < user->channels.used; ++ii) + { + channel = user->channels.list[ii]->channel; + /* Need not check for bans if they're opped or voiced. */ + if(user->channels.list[ii]->modes & (MODE_CHANOP|MODE_VOICE)) + continue; + /* Need not check for bans unless channel registration is active. */ + if(!channel->channel_info || IsSuspended(channel->channel_info)) + continue; + /* Look for a matching ban already on the channel. */ + for(jj = 0; jj < channel->banlist.used; ++jj) + if(user_matches_glob(user, channel->banlist.list[jj]->ban, 1)) + break; + /* Need not act if we found one. */ + if(jj < channel->banlist.used) + continue; + /* Look for a matching ban in this channel. */ + for(bData = channel->channel_info->bans; bData; bData = bData->next) + { + const char *ban = bData->mask; + if(!user_matches_glob(user, ban, 1)) + continue; + /* note: &bData->mask == bData->mask, thus we have ban */ + AddChannelBan(1, (const char**)&ban, channel, chanserv, now, 1); + sprintf(kick_reason, CSMSG_KICK_FORMAT, bData->reason, bData->owner); + KickChannelUser(user, channel, chanserv, kick_reason); + ii--; /* make sure we don't skip a channel */ + break; /* we don't need to check any more bans in the channel */ + } + } + } + static void handle_rename(struct handle_info *handle, const char *old_handle) { *************** *** 7165,7168 **** --- 7205,7209 ---- reg_topic_func(handle_topic); reg_mode_change_func(handle_mode); + reg_nick_change_func(handle_nick_change); reg_auth_func(handle_auth); |
From: Entrope <en...@us...> - 2003-10-08 03:46:40
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv8432/src Modified Files: nickserv.c Log Message: fix up account DNR message to be consistent with other accountinfo (duh) Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.262 retrieving revision 1.263 diff -C2 -r1.262 -r1.263 *** nickserv.c 8 Oct 2003 03:04:46 -0000 1.262 --- nickserv.c 8 Oct 2003 03:46:35 -0000 1.263 *************** *** 163,166 **** --- 163,167 ---- #define NSMSG_HANDLEINFO_CHANNELS " Channel(s): %s" #define NSMSG_HANDLEINFO_CURRENT " Current nickname(s): %s" + #define NSMSG_HANDLEINFO_DNR " Do-not-register (by %s): %s" #define NSMSG_USERINFO_AUTHED_AS "$b%s$b is authenticated to account $b%s$b." #define NSMSG_USERINFO_NOT_AUTHED "$b%s$b is not authenticated to any account." *************** *** 235,239 **** #define NSMSG_INVALID_OPTION "$b%s$b is an invalid account setting." #define NSMSG_INVALID_ANNOUNCE "$b%s$b is an announcements value." - #define NSMSG_DNR_INFO "$b%s$b is do-not-register (by $b%s$b): %s" #define NSMSG_STR_SETTING "$b%14s $b%s" --- 236,239 ---- *************** *** 1221,1225 **** struct do_not_register *dnr; if ((dnr = chanserv_is_dnr(NULL, hi))) ! reply(NSMSG_DNR_INFO, hi->handle, dnr->setter, dnr->reason); } else if (hi != user->handle_info) return 1; --- 1221,1225 ---- struct do_not_register *dnr; if ((dnr = chanserv_is_dnr(NULL, hi))) ! reply(NSMSG_HANDLEINFO_DNR, dnr->setter, dnr->reason); } else if (hi != user->handle_info) return 1; |
From: Entrope <en...@us...> - 2003-10-08 03:04:51
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv2511/src Modified Files: chanserv.c chanserv.h nickserv.c Log Message: show DNR for account (if there is one) in accountinfo (SF#791716/694270) Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.383 retrieving revision 1.384 diff -C2 -r1.383 -r1.384 *** chanserv.c 5 Oct 2003 03:15:29 -0000 1.383 --- chanserv.c 8 Oct 2003 03:04:46 -0000 1.384 *************** *** 1658,1662 **** } ! static struct do_not_register * chanserv_is_dnr(const char *chan_name, struct handle_info *handle) { --- 1658,1662 ---- } ! struct do_not_register * chanserv_is_dnr(const char *chan_name, struct handle_info *handle) { Index: chanserv.h =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.h,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** chanserv.h 5 Aug 2003 01:31:16 -0000 1.49 --- chanserv.h 8 Oct 2003 03:04:46 -0000 1.50 *************** *** 184,187 **** --- 184,188 ---- enum userLevel user_level_from_name(const char *name); const char *user_level_from_level(enum userLevel level); + struct do_not_register *chanserv_is_dnr(const char *chan_name, struct handle_info *handle); #endif Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.261 retrieving revision 1.262 diff -C2 -r1.261 -r1.262 *** nickserv.c 5 Oct 2003 03:12:36 -0000 1.261 --- nickserv.c 8 Oct 2003 03:04:46 -0000 1.262 *************** *** 235,238 **** --- 235,239 ---- #define NSMSG_INVALID_OPTION "$b%s$b is an invalid account setting." #define NSMSG_INVALID_ANNOUNCE "$b%s$b is an announcements value." + #define NSMSG_DNR_INFO "$b%s$b is do-not-register (by $b%s$b): %s" #define NSMSG_STR_SETTING "$b%14s $b%s" *************** *** 1217,1221 **** nickserv_notice(user, NSMSG_HANDLEINFO_VACATION); ! if ((hi != user->handle_info) && (!is_valid_oper(user, 0, 1))) return 1; --- 1218,1226 ---- nickserv_notice(user, NSMSG_HANDLEINFO_VACATION); ! if (is_valid_oper(user, 0, 1)) { ! struct do_not_register *dnr; ! if ((dnr = chanserv_is_dnr(NULL, hi))) ! reply(NSMSG_DNR_INFO, hi->handle, dnr->setter, dnr->reason); ! } else if (hi != user->handle_info) return 1; |
From: Entrope <en...@us...> - 2003-10-07 03:43:11
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv10341/src Modified Files: opserv.c Log Message: tidy up warn handling a little Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.341 retrieving revision 1.342 diff -C2 -r1.341 -r1.342 *** opserv.c 5 Oct 2003 03:12:36 -0000 1.341 --- opserv.c 7 Oct 2003 03:43:08 -0000 1.342 *************** *** 234,237 **** --- 234,238 ---- #define OSMSG_WARN_DELETE "Removed channel activity warning for $b%s$b" #define OSMSG_WARN_NOEXIST "Channel activity warning for $b%s$b does not exist." + #define OSMSG_WARN_TRIGGERED "Channel activity warning for channel %s: %s" #define OSMSG_WARN_LISTSTART "Channel activity warnings:" #define OSMSG_WARN_LISTEND "End of activity warning list." *************** *** 472,499 **** char *reason, *message; ! if (IsChannelName(argv[1])) { ! char *cmd; ! cmd = dict_find(opserv_chan_warn, argv[1], NULL); ! if (cmd) { ! opserv_notice(user, OSMSG_WARN_EXISTS, argv[1]); ! return 0; ! } else { ! if (argv[2]) ! reason = strdup(unsplit_string(argv+1, argc-1, NULL)); ! else ! reason = strdup("No reason"); ! dict_insert(opserv_chan_warn, strdup(argv[1]), reason); ! opserv_notice(user, OSMSG_WARN_ADDED, argv[1], reason); ! ! if (dict_find(channels, argv[1], NULL)) { ! message = alloca(strlen(reason) + strlen(argv[1]) + 55); ! sprintf(message, "Channel activity warning for channel `%s' (%s).", argv[1], reason); ! global_message(MESSAGE_RECIPIENT_OPERS, message); ! } ! } ! } else { opserv_notice(user, OSMSG_NEED_CHANNEL, argv[0]); return 0; } return 1; } --- 473,496 ---- char *reason, *message; ! if (!IsChannelName(argv[1])) { opserv_notice(user, OSMSG_NEED_CHANNEL, argv[0]); return 0; } + reason = dict_find(opserv_chan_warn, argv[1], NULL); + if (reason) { + opserv_notice(user, OSMSG_WARN_EXISTS, argv[1]); + return 0; + } + if (argv[2]) + reason = strdup(unsplit_string(argv+2, argc-2, NULL)); + else + reason = strdup("No reason"); + dict_insert(opserv_chan_warn, strdup(argv[1]), reason); + opserv_notice(user, OSMSG_WARN_ADDED, argv[1], reason); + if (dict_find(channels, argv[1], NULL)) { + message = alloca(strlen(reason) + strlen(argv[1]) + 55); + sprintf(message, OSMSG_WARN_TRIGGERED, argv[1], reason); + global_message(MESSAGE_RECIPIENT_OPERS, message); + } return 1; } *************** *** 1813,1817 **** if ((warning = dict_find(opserv_chan_warn, newchan->name, NULL))) { char message[MAXLEN]; ! snprintf(message, sizeof(message), "Channel activity warning for channel %s: %s.", newchan->name, warning); global_message(MESSAGE_RECIPIENT_OPERS, message); } --- 1810,1814 ---- if ((warning = dict_find(opserv_chan_warn, newchan->name, NULL))) { char message[MAXLEN]; ! snprintf(message, sizeof(message), OSMSG_WARN_TRIGGERED, newchan->name, warning); global_message(MESSAGE_RECIPIENT_OPERS, message); } |
From: Entrope <en...@us...> - 2003-10-07 03:42:11
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv10229/src Modified Files: modcmd.c modcmd.h Log Message: check pubcmd setting in the original channel, not the target channel Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -r1.69 -r1.70 *** modcmd.c 5 Oct 2003 03:27:49 -0000 1.69 --- modcmd.c 7 Oct 2003 03:42:06 -0000 1.70 *************** *** 438,442 **** int svccmd_can_invoke(struct userNode *user, struct userNode *bot, struct svccmd *cmd, struct chanNode *channel, int options) { - extern struct userNode *chanserv; unsigned int uData_checked = 0; struct userData *uData = NULL; --- 438,441 ---- *************** *** 526,554 **** } } - /* Count the abstraction violations while we support !set pubcmd.. */ - if ((options & SVCCMD_IN_CHANNEL) && channel - && (bot == chanserv) && channel->channel_info - && (channel->channel_info->options[optPubCmd] != 'a')) { - char pubcmd = channel->channel_info->options[optPubCmd]; - int prohibit = 0; - if (!uData_checked) - uData = _GetChannelUser(channel->channel_info, user->handle_info, 1, 0), uData_checked = 1; - if (uData) - switch (pubcmd) { - case 'p': prohibit = uData->access < ulPeon; break; - case 'o': prohibit = uData->access < ulOp; break; - case 'm': prohibit = uData->access < ulMaster; break; - case 'c': prohibit = uData->access < ulCoowner; break; - case 'w': prohibit = uData->access < ulOwner; break; - case 'n': prohibit = uData->access < ulHelper; break; - } - else - prohibit = 1; - if (prohibit) { - if (options & SVCCMD_NOISY) - send_message(user, bot, MCMSG_PUBLIC_DENY, channel->name); - return 0; - } - } if (flags & MODCMD_REQUIRE_STAFF) { if (((flags & MODCMD_REQUIRE_OPER) && IsOper(user)) --- 525,528 ---- *************** *** 652,660 **** int svccmd_invoke_argv(struct userNode *user, struct service *service, struct chanNode *channel, unsigned int argc, unsigned char *argv[], unsigned int server_qualified) { struct svccmd *cmd; unsigned int cmd_arg, perms, flags, options; char channel_name[CHANNELLEN+1]; ! options = (server_qualified ? SVCCMD_QUALIFIED : 0) | (channel ? SVCCMD_IN_CHANNEL : 0) | SVCCMD_DEBIT | SVCCMD_NOISY; /* Find the command argument. */ cmd_arg = IsChannelName(argv[0]) ? 1 : 0; --- 626,658 ---- int svccmd_invoke_argv(struct userNode *user, struct service *service, struct chanNode *channel, unsigned int argc, unsigned char *argv[], unsigned int server_qualified) { + extern struct userNode *chanserv; struct svccmd *cmd; unsigned int cmd_arg, perms, flags, options; char channel_name[CHANNELLEN+1]; ! /* First check pubcmd for the channel (while smashing abstraction ! * barriers left and right). */ ! if (channel && (channel->channel_info) && (service->bot == chanserv) ! && (channel->channel_info->options[optPubCmd] != 'a')) { ! struct userData *uData = _GetChannelUser(channel->channel_info, user->handle_info, 1, 0); ! char pubcmd = channel->channel_info->options[optPubCmd]; ! int prohibit = 0; ! if (!uData) ! prohibit = 1; ! else switch (pubcmd) { ! case 'p': prohibit = uData->access < ulPeon; break; ! case 'o': prohibit = uData->access < ulOp; break; ! case 'm': prohibit = uData->access < ulMaster; break; ! case 'c': prohibit = uData->access < ulCoowner; break; ! case 'w': prohibit = uData->access < ulOwner; break; ! case 'n': prohibit = uData->access < ulHelper; break; ! } ! if (prohibit) { ! send_message(user, service->bot, MCMSG_PUBLIC_DENY, channel->name); ! return 0; ! } ! } ! ! options = (server_qualified ? SVCCMD_QUALIFIED : 0) | SVCCMD_DEBIT | SVCCMD_NOISY; /* Find the command argument. */ cmd_arg = IsChannelName(argv[0]) ? 1 : 0; Index: modcmd.h =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** modcmd.h 29 Jul 2003 01:50:48 -0000 1.20 --- modcmd.h 7 Oct 2003 03:42:07 -0000 1.21 *************** *** 70,74 **** #define SVCCMD_DEBIT 0x000002 #define SVCCMD_NOISY 0x000004 - #define SVCCMD_IN_CHANNEL 0x000008 /* Modularized commands work like this: --- 70,73 ---- |