diff -uNrd ircd-hybrid-6.3.1/autoconf/configure.in ircd-hybrid-6.3.1.curses/autoconf/configure.in --- ircd-hybrid-6.3.1/autoconf/configure.in 2002-01-27 23:36:52.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/autoconf/configure.in 2002-11-26 20:51:13.000000000 -0500 @@ -26,6 +26,9 @@ AC_CHECK_FUNC(inet_ntoa,, AC_CHECK_LIB(nsl, inet_ntoa,,)) AC_CHECK_FUNC(inet_aton,, AC_CHECK_LIB(resolv, inet_aton,,)) +dnl look for ncurses +AC_CHECK_LIB(ncurses, initscr) + dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(sys/param.h sys/select.h errno.h string.h stddef.h getopt.h crypt.h) diff -uNrd ircd-hybrid-6.3.1/configure ircd-hybrid-6.3.1.curses/configure --- ircd-hybrid-6.3.1/configure 2002-01-27 23:36:49.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/configure 2002-11-26 20:53:02.000000000 -0500 @@ -1462,8 +1462,56 @@ fi +echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>&6 +echo "configure:1467: checking for initscr in -lncurses" >&5 +ac_lib_var=`echo ncurses'_'initscr | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lncurses $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo ncurses | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1467: checking how to run the C preprocessor" >&5 +echo "configure:1515: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1478,13 +1526,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1488: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1495,13 +1543,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1512,13 +1560,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1522: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1570: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1543,12 +1591,12 @@ echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1547: checking for ANSI C header files" >&5 +echo "configure:1595: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1556,7 +1604,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1560: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1608: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1573,7 +1621,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1591,7 +1639,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1612,7 +1660,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1623,7 +1671,7 @@ exit (0); } EOF -if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1675: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1650,17 +1698,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1654: checking for $ac_hdr" >&5 +echo "configure:1702: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1689,17 +1737,17 @@ ac_safe=`echo "stdarg.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for stdarg.h""... $ac_c" 1>&6 -echo "configure:1693: checking for stdarg.h" >&5 +echo "configure:1741: checking for stdarg.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1703: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1724,13 +1772,13 @@ if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:1728: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:1776: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext < Autoconf TIOCGETP @@ -1748,7 +1796,7 @@ if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext < Autoconf TCGETA @@ -1771,7 +1819,7 @@ echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6 -echo "configure:1775: checking for deflate in -lz" >&5 +echo "configure:1823: checking for deflate in -lz" >&5 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1779,7 +1827,7 @@ ac_save_LIBS="$LIBS" LIBS="-lz $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1818,12 +1866,12 @@ fi echo $ac_n "checking for zlibVersion""... $ac_c" 1>&6 -echo "configure:1822: checking for zlibVersion" >&5 +echo "configure:1870: checking for zlibVersion" >&5 if eval "test \"`echo '$''{'ac_cv_func_zlibVersion'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_zlibVersion=yes" else @@ -1868,12 +1916,12 @@ echo $ac_n "checking for poll""... $ac_c" 1>&6 -echo "configure:1872: checking for poll" >&5 +echo "configure:1920: checking for poll" >&5 if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_poll=yes" else @@ -1920,12 +1968,12 @@ echo $ac_n "checking for non-blocking socket implementation""... $ac_c" 1>&6 -echo "configure:1924: checking for non-blocking socket implementation" >&5 +echo "configure:1972: checking for non-blocking socket implementation" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""cross compiling " 1>&6 else cat > conftest.$ac_ext < @@ -1957,7 +2005,7 @@ } EOF -if { (eval echo configure:1961: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define NBLOCK_POSIX 1 @@ -1975,17 +2023,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1979: checking for $ac_hdr" >&5 +echo "configure:2027: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1989: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2014,12 +2062,12 @@ for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2018: checking for $ac_func" >&5 +echo "configure:2066: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2067,7 +2115,7 @@ done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2071: checking for working mmap" >&5 +echo "configure:2119: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2075,7 +2123,7 @@ ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2242,7 +2290,7 @@ echo "$ac_t""unable to test" 1>&6 else cat > conftest.$ac_ext < @@ -2274,7 +2322,7 @@ } EOF -if { (eval echo configure:2278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define NBLOCK_BSD 1 @@ -2292,7 +2340,7 @@ echo "$ac_t""unable to test" 1>&6 else cat > conftest.$ac_ext < @@ -2324,7 +2372,7 @@ } EOF -if { (eval echo configure:2328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define NBLOCK_SYSV 1 @@ -2339,12 +2387,12 @@ echo $ac_n "checking signal implementation""... $ac_c" 1>&6 -echo "configure:2343: checking signal implementation" >&5 +echo "configure:2391: checking signal implementation" >&5 if test "$cross_compiling" = yes; then echo "$ac_t""unknown" 1>&6 else cat > conftest.$ac_ext < @@ -2358,7 +2406,7 @@ } EOF -if { (eval echo configure:2362: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define POSIX_SIGNALS 1 @@ -2372,7 +2420,7 @@ echo "$ac_t""uknown" 1>&6 else cat > conftest.$ac_ext < @@ -2393,7 +2441,7 @@ } EOF -if { (eval echo configure:2397: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define BSD_RELIABLE_SIGNALS 1 diff -uNrd ircd-hybrid-6.3.1/include/config.h ircd-hybrid-6.3.1.curses/include/config.h --- ircd-hybrid-6.3.1/include/config.h 2002-02-17 00:58:09.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/include/config.h 2002-11-27 18:34:14.000000000 -0500 @@ -172,6 +172,9 @@ #define TS_MAX_DELTA 300 /* seconds */ #define TS_WARN_DELTA 30 /* seconds */ +/* The time (in seconds) between status displays (in ncurses mode) */ +#define CURSES_STATUS_TIME 20 + /* TS5 * This will mean the oldest version of a channel will always remain after a * split, whereas TS3 behaviour was to allow any TS in an opless channel. diff -uNrd ircd-hybrid-6.3.1/include/config.h.dist ircd-hybrid-6.3.1.curses/include/config.h.dist --- ircd-hybrid-6.3.1/include/config.h.dist 2002-02-17 00:58:09.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/include/config.h.dist 2002-11-27 18:36:23.000000000 -0500 @@ -172,6 +172,9 @@ #define TS_MAX_DELTA 300 /* seconds */ #define TS_WARN_DELTA 30 /* seconds */ +/* The time (in seconds) between status displays (in ncurses mode) */ +#define CURSES_STATUS_TIME 20 + /* TS5 * This will mean the oldest version of a channel will always remain after a * split, whereas TS3 behaviour was to allow any TS in an opless channel. diff -uNrd ircd-hybrid-6.3.1/include/ircd.h ircd-hybrid-6.3.1.curses/include/ircd.h --- ircd-hybrid-6.3.1/include/ircd.h 2001-12-13 18:16:34.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/include/ircd.h 2002-11-27 18:10:07.000000000 -0500 @@ -32,6 +32,10 @@ #define INCLUDED_sys_types_h #endif +#ifdef HAVE_LIBNCURSES +#include +#endif + struct Client; struct SetOptions @@ -151,4 +155,16 @@ * complain */ #define MAX_SETBACK_TIME 1800 + +#ifdef HAVE_LIBNCURSES +extern int maxx; +extern int maxy; +extern WINDOW *mainwin; +extern WINDOW *statuswin; +extern WINDOW *ologwin; +extern WINDOW *logwin; +void fini_curses(void); +void wlog(char *, ...); +#endif + #endif diff -uNrd ircd-hybrid-6.3.1/include/patchlevel.h ircd-hybrid-6.3.1.curses/include/patchlevel.h --- ircd-hybrid-6.3.1/include/patchlevel.h 2002-04-17 22:54:49.000000000 -0400 +++ ircd-hybrid-6.3.1.curses/include/patchlevel.h 2002-11-27 18:35:31.000000000 -0500 @@ -19,5 +19,5 @@ */ #ifndef PATCHLEVEL -#define PATCHLEVEL "2.8/hybrid-6.3.1" +#define PATCHLEVEL "2.8/hybrid-6.3.1+ncurses" #endif diff -uNrd ircd-hybrid-6.3.1/include/setup.h.in ircd-hybrid-6.3.1.curses/include/setup.h.in --- ircd-hybrid-6.3.1/include/setup.h.in 2002-01-27 23:36:54.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/include/setup.h.in 2002-11-26 20:53:57.000000000 -0500 @@ -1,5 +1,4 @@ -/* $Id: setup.h.in,v 1.17 2002/01/28 04:36:54 androsyn Exp $ */ -/* include/setup.h.in. Generated automatically from autoconf/configure.in by autoheader 2.13. */ +/* include/setup.h.in. Generated automatically from configure.in by autoheader. */ /* Define if you have a working `mmap' system call. */ #undef HAVE_MMAP @@ -66,6 +65,9 @@ /* Define if you have the descrypt library (-ldescrypt). */ #undef HAVE_LIBDESCRYPT +/* Define if you have the ncurses library (-lncurses). */ +#undef HAVE_LIBNCURSES + /* Define if you have the nsl library (-lnsl). */ #undef HAVE_LIBNSL diff -uNrd ircd-hybrid-6.3.1/src/adns.c ircd-hybrid-6.3.1.curses/src/adns.c --- ircd-hybrid-6.3.1/src/adns.c 2002-03-04 18:07:24.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/adns.c 2002-11-26 21:33:11.000000000 -0500 @@ -58,6 +58,9 @@ r =adns_init(&dns_state, adns_if_noautosys, 0); if(dns_state == NULL) { log(L_CRIT, "Error opening /etc/resolv.conf: %s; r = %d", strerror(errno), r); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(76); } } diff -uNrd ircd-hybrid-6.3.1/src/channel.c ircd-hybrid-6.3.1.curses/src/channel.c --- ircd-hybrid-6.3.1/src/channel.c 2002-02-17 00:58:12.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/channel.c 2002-11-27 17:29:05.000000000 -0500 @@ -1615,6 +1615,10 @@ sendto_realops("%s!%s@%s locally juping channel %s", sptr->name, sptr->username, sptr->host, chptr->chname); +#ifdef HAVE_LIBNCURSES + wlog("LOCAL JUPE: %s by %s!%s@%s\n", chptr->chname, + sptr->name, sptr->username, sptr->host); +#endif } else if(whatt == MODE_DEL) { @@ -1622,6 +1626,10 @@ sendto_realops("%s!%s@%s locally unjuping channel %s", sptr->name, sptr->username, sptr->host, chptr->chname); +#ifdef HAVE_LIBNCURSES + wlog("LOCAL UNJUPE: %s by %s!%s@%s\n", chptr->chname, + sptr->name, sptr->username, sptr->host); +#endif if(chptr->users == 0) sub1_from_channel(chptr); } @@ -2178,6 +2186,9 @@ */ server_was_split = NO; sendto_ops("Net Rejoined, split-mode deactivated"); +#ifdef HAVE_LIBNCURSES + wlog("Net Rejoined, split-mode deactivated\n"); +#endif cold_start = NO; } else diff -uNrd ircd-hybrid-6.3.1/src/client.c ircd-hybrid-6.3.1.curses/src/client.c --- ircd-hybrid-6.3.1/src/client.c 2002-02-17 00:58:13.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/client.c 2002-11-27 17:32:32.000000000 -0500 @@ -324,6 +324,9 @@ sendto_realops("D-line active for %s", get_client_name(cptr, FALSE)); +#ifdef HAVE_LIBNCURSES + wlog("DLINE ACTIVE: %s\n", get_client_name(cptr, FALSE)); +#endif dying_clients[die_index] = cptr; /* Wintrhawk */ @@ -374,6 +377,9 @@ { sendto_realops("G-line active for %s", get_client_name(cptr, FALSE)); +#ifdef HAVE_LIBNCURSES + wlog("GLINE ACTIVE: %s\n", get_client_name(cptr, FALSE)); +#endif dying_clients[die_index] = cptr; /* Wintrhawk */ @@ -420,6 +426,9 @@ sendto_realops("K-line active for %s", get_client_name(cptr, FALSE)); +#ifdef HAVE_LIBNCURSES + wlog("KLINE ACTIVE: %s\n", get_client_name(cptr, FALSE)); +#endif dying_clients[die_index] = cptr; /* Wintrhawk */ @@ -668,6 +677,9 @@ sendto_realops_flags(FLAGS_EXTERNAL, "Server %s split from %s", cptr->name, cptr->servptr->name); +#ifdef HAVE_LIBNCURSES + wlog("SERVER SPLIT: %s from %s\n", cptr->name, cptr->servptr->name); +#endif #ifdef NEED_SPLITCODE /* Don't bother checking for a split, if split code @@ -678,6 +690,9 @@ if (!server_was_split) { sendto_ops("Netsplit detected, split-mode activated"); +#ifdef HAVE_LIBNCURSES + wlog("Netsplit detected, split-mode activated\n"); +#endif server_was_split = YES; } server_split_time = CurrentTime; diff -uNrd ircd-hybrid-6.3.1/src/ircd.c ircd-hybrid-6.3.1.curses/src/ircd.c --- ircd-hybrid-6.3.1/src/ircd.c 2002-02-05 23:56:12.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/ircd.c 2002-11-27 18:26:30.000000000 -0500 @@ -142,7 +142,7 @@ static size_t initialVMTop = 0; /* top of virtual memory at init */ static const char* logFileName = LPATH; -#if defined(__CYGWIN__) +#if defined(__CYGWIN__) || defined(HAVE_LIBNCURSES) static int bootDaemon = 0; #else static int bootDaemon = 1; @@ -172,6 +172,17 @@ time_t LCF = LOADCFREQ; float currlife = 0.0; +#ifdef HAVE_LIBNCURSES +int maxy; +int maxx; +WINDOW *mainwin; +WINDOW *statuswin; +WINDOW *logwin; +WINDOW *ologwin; +static time_t next_status = 0; +static void setup_curses(void); +static void curses_status(void); +#endif /* * get_vm_top - get the operating systems notion of the resident set size @@ -217,6 +228,9 @@ fprintf(stderr,"Hard Limit: %ld IRC max: %d\n", (long) limit.rlim_max, MAXCONNECTIONS); fprintf(stderr,"Fix MAXCONNECTIONS\n"); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-1); } @@ -225,6 +239,9 @@ { fprintf(stderr,"error setting max fd's to %ld\n", (long) limit.rlim_cur); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-1); } @@ -236,6 +253,9 @@ fprintf(stderr, "Make sure your kernel supports a larger FD_SETSIZE then " \ "recompile with -DFD_SETSIZE=%d\n", MAXCONNECTIONS); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-1); } printf("Value of FD_SETSIZE is %d\n", FD_SETSIZE); @@ -250,10 +270,18 @@ if((pid = fork()) < 0) { fprintf(stderr, "Couldn't fork: %s\n", strerror(errno)); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(0); } else if (pid > 0) + { +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(0); + } #ifdef TIOCNOTTY { /* scope */ int fd; @@ -280,6 +308,9 @@ "Usage: ircd [-d dlinefile] [-f configfile] [-h servername] " "[-k klinefile] [-l logfile] [-n] [-v] [-x debuglevel]\n"); fprintf(stderr, "Server not started\n"); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-2); } @@ -337,6 +368,9 @@ zlibVersion(), #endif ConfigFileEntry.dpath); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(0); break; /* NOT REACHED */ case 'x': @@ -547,6 +581,13 @@ next_gc = CurrentTime + 600; } +#ifdef HAVE_LIBNCURSES + if(CurrentTime >= next_status) + { + curses_status(); + next_status = CurrentTime + CURSES_STATUS_TIME; + } +#endif return delay; } @@ -669,6 +710,9 @@ if (pidfromfile != (int)getpid() && !kill(pidfromfile, 0)) { printf("ERROR: daemon is already running\n"); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-1); } } @@ -706,7 +750,7 @@ { time_t delay = 0; aConfItem* aconf; - + if(geteuid() == 0) { fprintf(stderr, "ERROR: Don't run ircd as root!\n"); @@ -722,6 +766,10 @@ exit(errno); } +#ifdef HAVE_LIBNCURSES + setup_curses(); +#endif + /* * Setup corefile size immediately after boot */ @@ -791,6 +839,9 @@ if (chdir(ConfigFileEntry.dpath)) { perror("chdir"); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-1); } @@ -844,6 +895,10 @@ log(L_NOTICE, "Server Ready"); +#ifdef HAVE_LIBNCURSES + wlog("ircd %s Ready\n", ircd_version); +#endif + ServerRunning = 1; while (ServerRunning) { usleep(100000); @@ -855,3 +910,55 @@ return 0; } +#ifdef HAVE_LIBNCURSES +/* SIDE EFFECT: sets global maxx and maxy */ +static void setup_curses(void) +{ + if (initscr()==NULL) + { + fprintf(stderr, "\nError initializing ncurses. Terminating!\n\n"); + exit(1); + } + + getmaxyx(stdscr, maxy, maxx); + /* XXX check x and y values */ + + mainwin = newwin(0, 0, 0, 0); + statuswin = subwin(mainwin, 5, maxx - 4, 0, 0); + ologwin = subwin(mainwin, maxy - 5, maxx - 4, 5, 0); + logwin = subwin(mainwin, maxy - 7, maxx - 8, 6, 2); + scrollok(logwin, 1); + wborder(statuswin, '*', '*', '*', '*', '*', '*', '*', '*'); + wborder(ologwin, '*', '*', '*', '*', '*', '*', '*', '*'); + wrefresh(mainwin); +} + +void fini_curses(void) +{ + delwin(logwin); + delwin(statuswin); + delwin(mainwin); + endwin(); +} + +static void curses_status(void) +{ + wclear(statuswin); + mvwprintw(statuswin, 1, 2, "(%s) Users - Local: %d/%d Global: %d/%d\n", + myctime(CurrentTime), Count.local, Count.max_loc, Count.total, + Count.max_tot); + mvwprintw(statuswin, 2, 2, " Opers: %d Channels: %d Servers: %d", + Count.oper, Count.chan, Count.server); + wborder(statuswin, '*', '*', '*', '*', '*', '*', '*', '*'); + wrefresh(statuswin); +} + +void wlog(char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vwprintw(logwin, fmt, ap); + wrefresh(logwin); +} +#endif diff -uNrd ircd-hybrid-6.3.1/src/ircd_signal.c ircd-hybrid-6.3.1.curses/src/ircd_signal.c --- ircd-hybrid-6.3.1/src/ircd_signal.c 2002-04-15 19:13:02.000000000 -0400 +++ ircd-hybrid-6.3.1.curses/src/ircd_signal.c 2002-11-26 21:40:08.000000000 -0500 @@ -44,6 +44,9 @@ { flush_connections(0); log(L_CRIT, "Server killed By SIGTERM"); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-1); } @@ -60,6 +63,12 @@ */ static void sigint_handler(int sig) { +#ifdef HAVE_LIBNCURSES + flush_connections(0); + log(L_CRIT, "Server killed By SIGINT"); + fini_curses(); + exit(-1); +#else static int restarting = 0; log(L_WARN, "Server Restarting on SIGINT"); @@ -67,6 +76,7 @@ restarting = 1; server_reboot(); } +#endif } /* diff -uNrd ircd-hybrid-6.3.1/src/m_die.c ircd-hybrid-6.3.1.curses/src/m_die.c --- ircd-hybrid-6.3.1/src/m_die.c 2001-12-08 02:06:13.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/m_die.c 2002-11-27 17:34:18.000000000 -0500 @@ -148,6 +148,10 @@ } flush_connections(0); log(L_NOTICE, "Server terminated by %s", get_client_name(sptr, HIDE_IP)); +#ifdef HAVE_LIBNCURSES + wlog("DIE: %s\n", get_client_name(sptr, HIDE_IP)); + fini_curses(); +#endif /* * this is a normal exit, tell the os it's ok */ diff -uNrd ircd-hybrid-6.3.1/src/m_gline.c ircd-hybrid-6.3.1.curses/src/m_gline.c --- ircd-hybrid-6.3.1/src/m_gline.c 2001-12-15 11:24:09.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/m_gline.c 2002-11-27 17:36:09.000000000 -0500 @@ -282,6 +282,11 @@ host, reason); +#ifdef HAVE_LIBNCURSES + wlog("GLINE REQUEST: %s@%s by %s!%s@%s on %s reason: %s\n", user, + host, oper_name, oper_username, oper_host, oper_server, reason); +#endif + /* If at least 3 opers agree this user should be G lined then do it */ if(majority_gline(sptr, oper_name, @@ -313,6 +318,11 @@ user, host, reason); + +#ifdef HAVE_LIBNCURSES + wlog("GLINE TRIGGER: %s@%s by %s!%s@%s on %s reason: %s\n", user, + host, oper_name, oper_username, oper_host, oper_server, reason); +#endif rehashed = YES; dline_in_progress = NO; diff -uNrd ircd-hybrid-6.3.1/src/m_kill.c ircd-hybrid-6.3.1.curses/src/m_kill.c --- ircd-hybrid-6.3.1/src/m_kill.c 2001-06-30 23:13:55.000000000 -0400 +++ ircd-hybrid-6.3.1.curses/src/m_kill.c 2002-11-27 17:38:34.000000000 -0500 @@ -236,6 +236,10 @@ { sendto_realops("Received KILL message for %s. From %s Path: %s!%s", acptr->name, parv[0], inpath, path); +#ifdef HAVE_LIBNCURSES + wlog("OPER KILL: %s from %s path %s!%s\n", acptr->name, parv[0], + inpath, path); +#endif /* * dilema here: we don't want non opers to see pathes which * contain real IP addresses. But we do want opers to see them. @@ -247,9 +251,14 @@ */ } else - sendto_realops_flags(FLAGS_SKILL, - "Received KILL message for %s. From %s", - acptr->name, parv[0]); + { + sendto_realops_flags(FLAGS_SKILL, + "Received KILL message for %s. From %s", + acptr->name, parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("SERVER KILL: %s from %s\n", acptr->name, parv[0]); +#endif + } #if defined(USE_SYSLOG) && defined(SYSLOG_KILL) if (IsOper(sptr)) diff -uNrd ircd-hybrid-6.3.1/src/m_kline.c ircd-hybrid-6.3.1.curses/src/m_kline.c --- ircd-hybrid-6.3.1/src/m_kline.c 2001-12-14 21:42:04.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/m_kline.c 2002-11-27 18:24:08.000000000 -0500 @@ -794,6 +794,10 @@ user, host, reason); +#ifdef HAVE_LIBNCURSES + wlog("TEMP KLINE ADDED: %s@%s by %s for %d minutes reason: %s\n", + user, host, parv[0], temporary_kline_time, reason); +#endif return 0; } else @@ -817,6 +821,10 @@ user, host, reason); +#ifdef HAVE_LIBNCURSES + wlog("KLINE ADDED: %s@%s by %s reason: %s\n", user, host, sptr->name, + reason); +#endif log(L_TRACE, "%s added K-Line for [%s@%s] [%s|%s]", @@ -1263,6 +1271,9 @@ sptr->name, host, reason); +#ifdef HAVE_LIBNCURSES + wlog("DLINE ADDED: %s by %s reason: %s\n", host, sptr->name, reason); +#endif log(L_TRACE, "%s added D-Line for [%s] [%s|%s]", sptr->name, host, reason, diff -uNrd ircd-hybrid-6.3.1/src/m_message.c ircd-hybrid-6.3.1.curses/src/m_message.c --- ircd-hybrid-6.3.1/src/m_message.c 2001-12-22 19:06:14.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/m_message.c 2002-11-27 17:42:17.000000000 -0500 @@ -435,6 +435,9 @@ if(!irccmp(nick,"opers") && IsAnOper(sptr)) { sendto_realops("To opers: From %s: %s",sptr->name,parv[2]); +#ifdef HAVE_LIBNCURSES + wlog("OPER MESSAGE: from %s: %s\n", sptr->name,parv[2]); +#endif continue; } diff -uNrd ircd-hybrid-6.3.1/src/m_oper.c ircd-hybrid-6.3.1.curses/src/m_oper.c --- ircd-hybrid-6.3.1/src/m_oper.c 2001-12-08 02:06:13.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/m_oper.c 2002-11-27 17:43:42.000000000 -0500 @@ -239,6 +239,10 @@ #endif /* CUSTOM_ERR */ sptr->username, sptr->host, IsOper(sptr) ? 'O' : 'o'); +#ifdef HAVE_LIBNCURSES + wlog("OPER: %s (%s@%s) (%c)\n", parv[0], sptr->username, sptr->host, + IsOper(sptr) ? 'O' : 'o'); +#endif send_umode_out(cptr, sptr, old); sendto_one(sptr, form_str(RPL_YOUREOPER), me.name, parv[0]); sendto_one(sptr, ":%s NOTICE %s :*** Oper privs are %s",me.name,parv[0], diff -uNrd ircd-hybrid-6.3.1/src/m_rehash.c ircd-hybrid-6.3.1.curses/src/m_rehash.c --- ircd-hybrid-6.3.1/src/m_rehash.c 2001-12-06 23:51:34.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/m_rehash.c 2002-11-27 17:49:55.000000000 -0500 @@ -123,6 +123,9 @@ sendto_ops("%s is rehashing DNS", #endif parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH DNS by %s\n", parv[0]); +#endif restart_resolver(); /* re-read /etc/resolv.conf AGAIN? and close/re-open res socket */ found = YES; @@ -143,6 +146,9 @@ sendto_ops("%s is clearing temp klines", #endif parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH TKLINES by %s\n", parv[0]); +#endif found = YES; } #ifdef GLINES @@ -164,6 +170,9 @@ sendto_ops("%s is clearing G-lines", #endif parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH GLINES by %s\n", parv[0]); +#endif found = YES; } #endif @@ -177,29 +186,44 @@ sendto_ops("%s is garbage collecting", #endif parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH GC by %s\n", parv[0]); +#endif found = YES; } else if(irccmp(parv[1],"MOTD") == 0) { sendto_ops("%s is forcing re-reading of MOTD file",parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH MOTD by %s\n", parv[0]); +#endif ReadMessageFile( &ConfigFileEntry.motd ); found = YES; } else if(irccmp(parv[1],"OMOTD") == 0) { sendto_ops("%s is forcing re-reading of oper MOTD file",parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH OMOTD by %s\n", parv[0]); +#endif ReadMessageFile( &ConfigFileEntry.opermotd ); found = YES; } else if(irccmp(parv[1],"HELP") == 0) { sendto_ops("%s is forcing re-reading of oper help file",parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH HELP by %s\n", parv[0]); +#endif ReadMessageFile( &ConfigFileEntry.helpfile ); found = YES; } else if(irccmp(parv[1],"DUMP") == 0) { sendto_ops("%s is dumping conf file",parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH DUMP by %s\n", parv[0]); +#endif rehash_dump(sptr); found = YES; } @@ -214,6 +238,9 @@ sendto_ops("%s is rehashing dlines from server config file", #endif parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH by %s\n", parv[0]); +#endif log(L_NOTICE, "REHASH From %s\n", get_client_name(sptr, HIDE_IP)); dline_in_progress = 1; return rehash(cptr, sptr, 0); @@ -246,6 +273,9 @@ sendto_ops("%s is rehashing server config file", #endif parv[0]); +#ifdef HAVE_LIBNCURSES + wlog("REHASH by %s\n", parv[0]); +#endif log(L_NOTICE, "REHASH From %s\n", get_client_name(sptr, SHOW_IP)); return rehash(cptr, sptr, 0); } diff -uNrd ircd-hybrid-6.3.1/src/m_restart.c ircd-hybrid-6.3.1.curses/src/m_restart.c --- ircd-hybrid-6.3.1/src/m_restart.c 2001-12-08 02:06:14.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/m_restart.c 2002-11-27 17:50:21.000000000 -0500 @@ -128,6 +128,9 @@ } } +#ifdef HAVE_LIBNCURSES + wlog("RESTART by %s\n", get_client_name(sptr, FALSE)); +#endif log(L_WARN, "Server RESTART by %s\n", get_client_name(sptr, SHOW_IP)); ircsprintf(buf, "Server RESTART by %s", get_client_name(sptr, SHOW_IP)); restart(buf); diff -uNrd ircd-hybrid-6.3.1/src/m_server.c ircd-hybrid-6.3.1.curses/src/m_server.c --- ircd-hybrid-6.3.1/src/m_server.c 2001-06-17 19:51:21.000000000 -0400 +++ ircd-hybrid-6.3.1.curses/src/m_server.c 2002-11-27 17:51:05.000000000 -0500 @@ -439,6 +439,9 @@ sendto_realops_flags(FLAGS_EXTERNAL, "Server %s being introduced by %s", acptr->name, sptr->name); +#ifdef HAVE_LIBNCURSES + wlog("NEW SERVER: %s to %s\n", acptr->name, sptr->name); +#endif return 0; } diff -uNrd ircd-hybrid-6.3.1/src/m_unkline.c ircd-hybrid-6.3.1.curses/src/m_unkline.c --- ircd-hybrid-6.3.1/src/m_unkline.c 2002-02-17 00:58:13.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/m_unkline.c 2002-11-27 17:53:59.000000000 -0500 @@ -150,6 +150,9 @@ me.name, parv[0],user, host); sendto_ops("%s has removed the temporary K-Line for: [%s@%s]", parv[0], user, host ); +#ifdef HAVE_LIBNCURSES + wlog("TEMP KLINE REMOVED: %s@%s by %s\n", user, host, parv[0]); +#endif log(L_NOTICE, "%s removed temporary K-Line for [%s@%s]", parv[0], user, host); @@ -337,6 +340,9 @@ me.name, parv[0], user,host); sendto_realops("%s has removed the K-Line for: [%s@%s]", parv[0], user, host); +#ifdef HAVE_LIBNCURSES + wlog("KLINE REMOVED: %s@%s by %s\n", user, host, parv[0]); +#endif log(L_NOTICE, "%s removed K-Line for [%s@%s]", parv[0], user, host); return 0; @@ -648,6 +654,9 @@ me.name, parv[0], cidr); sendto_ops("%s has removed the D-Line for: [%s]", parv[0], cidr); +#ifdef HAVE_LIBNCURSES + wlog("DLINE REMOVED: %s by %s\n", cidr, parv[0]); +#endif log(L_NOTICE, "%s removed D-Line for [%s]", parv[0], cidr); return 0; @@ -721,6 +730,9 @@ me.name, parv[0],user, host); sendto_ops("%s has removed the G-Line for: [%s@%s]", parv[0], user, host ); +#ifdef HAVE_LIBNCURSES + wlog("GLINE REMOVED: %s@%s by %s\n", user, host, parv[0]); +#endif log(L_NOTICE, "%s removed G-Line for [%s@%s]", parv[0], user, host); return 0; diff -uNrd ircd-hybrid-6.3.1/src/parse.c ircd-hybrid-6.3.1.curses/src/parse.c --- ircd-hybrid-6.3.1/src/parse.c 2001-12-29 22:25:48.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/parse.c 2002-11-26 21:35:39.000000000 -0500 @@ -387,6 +387,9 @@ if (mpt->cmd) { log(L_CRIT, "bad msgtab entry: ``%s''\n", mpt->cmd); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(1); } } @@ -453,6 +456,9 @@ } else { +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif assert(0); exit(1); } diff -uNrd ircd-hybrid-6.3.1/src/restart.c ircd-hybrid-6.3.1.curses/src/restart.c --- ircd-hybrid-6.3.1/src/restart.c 2001-12-08 02:06:14.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/restart.c 2002-11-26 21:36:48.000000000 -0500 @@ -40,7 +40,12 @@ log(L_NOTICE, "Restarting server..."); flush_connections(0); +#ifdef HAVE_LIBNCURSES + fini_curses(); + for (i = 3; i < MAXCONNECTIONS; ++i) +#else for (i = 0; i < MAXCONNECTIONS; ++i) +#endif close(i); execv(SPATH, myargv); diff -uNrd ircd-hybrid-6.3.1/src/s_bsd.c ircd-hybrid-6.3.1.curses/src/s_bsd.c --- ircd-hybrid-6.3.1/src/s_bsd.c 2002-02-05 23:56:12.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/s_bsd.c 2002-11-26 20:48:37.000000000 -0500 @@ -107,7 +107,12 @@ void close_all_connections(void) { int i; +#ifdef HAVE_LIBNCURSES + /* For the ncurses frontend, don't close STDOUT, STDIN, or STDERR */ + for (i = 3; i < MAXCONNECTIONS; ++i) { +#else for (i = 0; i < MAXCONNECTIONS; ++i) { +#endif close(i); local[i] = 0; } diff -uNrd ircd-hybrid-6.3.1/src/s_conf.c ircd-hybrid-6.3.1.curses/src/s_conf.c --- ircd-hybrid-6.3.1/src/s_conf.c 2002-02-17 00:58:13.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/s_conf.c 2002-11-27 17:57:40.000000000 -0500 @@ -1789,7 +1789,12 @@ int rehash(aClient *cptr,aClient *sptr, int sig) { if (sig) - sendto_realops("Got signal SIGHUP, reloading ircd conf. file"); + { + sendto_realops("Got signal SIGHUP, reloading ircd conf. file"); +#ifdef HAVE_LIBNCURSES + wlog("SIGHUP Caught, REHASH'ing\n"); +#endif + } read_conf_files(NO); close_listeners(); @@ -2590,6 +2595,9 @@ if(me.name[0] == '\0') { log(L_CRIT, "Server has no M: line"); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-1); } } @@ -2746,6 +2754,10 @@ sendto_realops("Temporary K-line for [%s@%s] expired", (cur_p->user) ? cur_p->user : "*", (cur_p->host) ? cur_p->host : "*"); +#ifdef HAVE_LIBNCURSES + wlog("TEMP KLINE EXPIRED: %s@%s\n", (cur_p->user) ? cur_p->user : "*", + (cur_p->host) ? cur_p->host : "*"); +#endif free_conf(cur_p); } else @@ -3530,6 +3542,9 @@ if(cold) { log(L_CRIT, "Failed in reading configuration file %s", filename); +#ifdef HAVE_LIBNCURSES + fini_curses(); +#endif exit(-1); } else @@ -3727,6 +3742,10 @@ { sendto_realops("%s added D-Line for [%s] [%s]", sptr->name, host, reason); +#ifdef HAVE_LIBNCURSES + wlog("DLINE ADDED: %s by %s reason: %s\n", host, sptr->name, + reason); +#endif sendto_one(sptr, ":%s NOTICE %s :Added D-Line [%s] to %s", me.name, sptr->name, host, filename); } @@ -3734,6 +3753,10 @@ { sendto_realops("%s added K-Line for [%s@%s] [%s]", sptr->name, user, host, reason); +#ifdef HAVE_LIBNCURSES + wlog("KLINE ADDED: %s@%s by %s reason: %s\n", user, host, + sptr->name, reason); +#endif sendto_one(sptr, ":%s NOTICE %s :Added K-Line [%s@%s] to %s", me.name, sptr->name, user, host, filename); } diff -uNrd ircd-hybrid-6.3.1/src/s_user.c ircd-hybrid-6.3.1.curses/src/s_user.c --- ircd-hybrid-6.3.1/src/s_user.c 2002-01-23 13:39:08.000000000 -0500 +++ ircd-hybrid-6.3.1.curses/src/s_user.c 2002-11-27 18:00:19.000000000 -0500 @@ -720,6 +720,11 @@ sptr->info, xreason, get_client_name(cptr, FALSE)); +#ifdef HAVE_LIBNCURSES + wlog("XLINE REJECT: %s gecos [%s] reason: %s\n", + get_client_name(cptr, FALSE), sptr->info, + xreason); +#endif } ServerStats->is_ref++; return exit_client(cptr, sptr, &me, "Bad user info"); @@ -753,8 +758,13 @@ { Count.max_loc = Count.local; if (!(Count.max_loc % 10)) - sendto_ops("New Max Local Clients: %d", - Count.max_loc); + { + sendto_ops("New Max Local Clients: %d", + Count.max_loc); +#ifdef HAVE_LIBNCURSES + wlog("New Max Local Clients: %d\n", Count.max_loc); +#endif + } } } else @@ -1402,6 +1412,9 @@ sendto_realops_flags(FLAGS_REJ, "Quarantined nick [%s] from user %s", nick,get_client_name(cptr, FALSE)); +#ifdef HAVE_LIBNCURSES + wlog("QLINE REJECT: %s from %s\n", nick,get_client_name(cptr, FALSE)); +#endif sendto_one(sptr, form_str(ERR_ERRONEUSNICKNAME), me.name, parv[0], parv[1]); return 0;