diff -uNrd -x ChangeLog ircd-hybrid-7.0/ChangeLog.save PleXusIRCd-1.17a/ChangeLog.save
--- ircd-hybrid-7.0/ChangeLog.save	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/ChangeLog.save	Sun Oct 12 08:30:24 2003
@@ -0,0 +1 @@
+UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU
\ No newline at end of file
diff -uNrd -x ChangeLog ircd-hybrid-7.0/TODO PleXusIRCd-1.17a/TODO
--- ircd-hybrid-7.0/TODO	Wed Aug 21 01:58:03 2002
+++ PleXusIRCd-1.17a/TODO	Mon Dec  1 05:33:14 2003
@@ -1,3 +1,10 @@
+static, TODO
+
+- Allow services to UNKLINE if needed
+- Client SSL
+- server<->server bursts with compression, desync causes 'Unknown Client' kills
+- ability to select which ip a client connects to on a hub server
+
 $Id: TODO,v 7.74 2002/08/21 05:58:03 lusky Exp $
 
 - add more stderr debugging (ircd -s)... one for every place we syslog()
diff -uNrd -x ChangeLog ircd-hybrid-7.0/config PleXusIRCd-1.17a/config
--- ircd-hybrid-7.0/config	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/config	Mon Oct 27 20:35:09 2003
@@ -0,0 +1,191 @@
+# Need to add hostmask and modelock p from config.h
+echo "##########################################################################"
+echo "#                                                                        #"
+echo "#                           PleXusIRCd V1.16 config                      #"
+echo "#                                                                        #"
+echo "##########################################################################"
+echo ">> Where do you want the ircd binaries to be installed?"
+echo -n "[$HOME/ircd] > $c"
+read cc
+HOME="$cc"
+FOO=""
+runonce=""
+while [ -z "$FOO" ] ; do
+    FOO="1"
+    echo ""
+    echo ">> What OS is your server running?"
+    echo "  (1) *BSD"
+    echo "  (2) Linux" 
+    echo -n "[$FOO] > $c"
+    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
+        read cc
+    else
+        cc=""
+        runonce=Yes
+    fi
+    if [ -z "$cc" ] ; then
+        cc=$FOO
+    fi
+    case "$cc" in
+        [1]*)
+            OS="--enable-kqueue --disable-small-net --disable-poll --enable-block-alloc"
+            ;;
+        [2]*)
+	    OS="--enable-poll --disable-select --enable-rtsigio --disable-assert"
+	    ;;
+        *)
+            echo ""
+            echo "You need to enter 1 or 2 here."
+            echo ""
+	    FOO=""
+            ;;
+    esac   
+done
+FOO=""
+runonce=""  
+while [ -z "$FOO" ] ; do
+    FOO="1024"
+    echo "" 
+    echo "Max users?"
+    echo -n "[$FOO] > $c"
+    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
+        read cc
+    else
+        cc=""
+        runonce=Yes
+    fi
+    if [ -z "$cc" ] ; then
+        cc=$FOO
+    fi
+    case "$cc" in
+        [1-9]*)
+            MAXUSERS="$cc"
+            ;;
+        *)
+            echo ""
+            echo "You need to enter a number here."
+            echo ""
+            FOO=""
+            ;;
+    esac
+done
+FOO=""
+runonce=""
+while [ -z "$FOO" ] ; do
+    FOO="0"
+    echo ""
+    echo "Network support for more than 10,000 users? (1 = yes, 0 = no)"
+    echo -n "[$FOO] > $c"
+    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
+        read cc
+    else
+        cc=""
+        runonce=Yes
+    fi
+    if [ -z "$cc" ] ; then
+        cc=$FOO    
+    fi
+    case "$cc" in
+        [1]*)
+            BIGNET=--disable-small-net
+            ;;
+        [0]*)
+	    BIGNET=--enable-small-net
+	    ;;
+	*)     
+            echo ""
+            echo "You need to enter 0 or 1 here."
+            echo ""
+            FOO=""
+            ;;
+    esac   
+done
+FOO=""
+runonce=""
+while [ -z "$FOO" ] ; do
+    FOO="30"
+    echo ""
+    echo "Maximum nickname length?"
+    echo -n "[$FOO] > $c"
+    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
+        read cc
+    else
+        cc=""
+        runonce=Yes
+    fi
+    if [ -z "$cc" ] ; then
+        cc=$FOO
+    fi
+    case "$cc" in
+        [1-9]*)
+            NICKLEN="$cc"
+            ;;
+        *)
+            echo ""
+            echo "You need to enter a number here."
+            echo ""
+            FOO=""
+            ;;
+    esac
+done
+FOO=""
+runonce=""
+while [ -z "$FOO" ] ; do
+    FOO="400"  
+    echo ""
+    echo "Maximum topic length?"
+    echo -n "[$FOO] > $c"
+    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
+        read cc
+    else
+        cc=""
+        runonce=Yes
+    fi 
+    if [ -z "$cc" ] ; then
+        cc=$FOO
+    fi      
+    case "$cc" in
+        [1-9]*)
+            TOPICLEN="$cc"
+            ;;
+        *)
+            echo ""
+            echo "You need to enter a number here."
+            echo ""
+            FOO=""
+            ;;
+    esac
+done    
+FOO=""
+runonce=""
+while [ -z "$FOO" ] ; do
+    FOO="0"  
+    echo ""
+    echo "Will the ircd accepted IPv6 connections? (1 = yes, 0 = no)"
+    echo -n "[$FOO] > $c"
+    if [ -z "$AUTO_CONFIG" -o -n "$runonce" ] ; then
+        read cc
+    else
+        cc=""
+        runonce=Yes
+    fi 
+    if [ -z "$cc" ] ; then
+        cc=$FOO
+    fi      
+    case "$cc" in
+        [1]*)
+            IPV6=--enable-ipv6
+            ;;
+        [0]*)
+	    IPV6=--disable-ipv6
+	    ;;
+        *)
+            echo ""
+            echo "You need to enter 0 or 1 here."
+            echo ""
+            FOO=""
+            ;;
+    esac
+done    
+echo "./configure --prefix=$HOME $OS $BIGNET --with-maxclients=$MAXUSERS --with-nicklen=$NICKLEN --with-topiclen=$TOPICLEN"
+./configure --prefix=$HOME $OS $BIGNET --with-maxclients=$MAXUSERS --with-nicklen=$NICKLEN --with-topiclen=$TOPICLEN $IPV6
diff -uNrd -x ChangeLog ircd-hybrid-7.0/configure PleXusIRCd-1.17a/configure
--- ircd-hybrid-7.0/configure	Sat May 31 03:30:18 2003
+++ PleXusIRCd-1.17a/configure	Sat Oct 25 07:55:54 2003
@@ -6768,9 +6768,9 @@
 
 fi;
 
-ac_cv_nicklen="9"
-ac_cv_maxclients="200"
-ac_cv_topiclen="120"
+ac_cv_nicklen="30"
+ac_cv_maxclients="2048"
+ac_cv_topiclen="400"
 
 
 # Check whether --with-nicklen or --without-nicklen was given.
diff -uNrd -x ChangeLog ircd-hybrid-7.0/doc/example.conf PleXusIRCd-1.17a/doc/example.conf
--- ircd-hybrid-7.0/doc/example.conf	Sat May 31 03:30:25 2003
+++ PleXusIRCd-1.17a/doc/example.conf	Sat Oct 25 08:02:26 2003
@@ -1,59 +1,11 @@
-/* doc/example.conf - ircd-hybrid-7 Example configuration file
- * Copyright (C) 2000-2002 Hybrid Development Team
- *
- * Written by ejb, wcampbel, db, leeh and others
- *
- * $Id: example.conf,v 7.169.2.1 2003/05/31 07:30:25 lusky Exp $
- */
-
-/* IMPORTANT NOTES:
- *
- * class {} blocks MUST be specified before anything that uses them.  That
- * means they must be defined before auth {} and before connect {}.
- *
- * auth {} blocks MUST be specified in order of precedence.  The first one
- * that matches a user will be used.  So place spoofs first, then specials,
- * then general access, then restricted.
- *
- * Both shell style (#) and C style comments are supported.
- *
- * Files may be included by either:
- *        .include "filename"
- *        .include <filename>
- *
- * Times/durations are written as:
- *        12 hours 30 minutes 1 second
- *        
- * Valid units of time:
- *        month, week, day, hour, minute, second
- *
- * Valid units of size:
- *        megabyte/mbyte/mb, kilobyte/kbyte/kb, byte
- *
- * Sizes and times may be singular or plural.  
- */ 
-
-/* EFNET NOTE:
- * 
- * This config file is NOT suitable for EFNet.  EFNet admins should use
- * example.efnet.conf
- */
- 
  /* serverinfo {}:  Contains information about the server. (OLD M:) */
 serverinfo {
-	/* name: the name of our server */
-	name = "hades.arpa";
+	name = "server.rizon.net";
 
-	/* description: the description of our server.  '[' and ']' may not
-	 * be used here for compatibility with older servers.
-	 */
-	description = "hybrid-7 test server";
+	description = "Rizon IRC Server";
 
-	/* network info: the name and description of the network this server
-	 * is on.  Shown in the 005 reply and used with serverhiding.
-	 */
-	network_name = "MyNet";
-	network_desc = "This is My Network";
+	network_name = "Rizon";
+	network_desc = "Where are You?";
 
 	/* hub: allow this server to act as a hub and have multiple servers
 	 * connected to it.  This may not be changed if there are active
@@ -64,35 +16,22 @@
 	/* vhost: the IP to bind to when we connect outward to ipv4 servers.
 	 * This should be an ipv4 IP only.
 	 */
-	#vhost = "192.169.0.1";
+	vhost = "IRCD IP";
 
 	/* vhost6: the IP to bind to when we connect outward to ipv6 servers.
 	 * This should be an ipv6 IP only.
 	 */
 	#vhost6 = "3ffe:80e8:546::2";
 
-	/* max clients: the maximum number of clients allowed to connect */
-	max_clients = 512;
-
-	/* rsa key: the path to the file containing our rsa key for cryptlink.
-	 *
-	 * Example command to store a 2048 bit RSA keypair in
-	 * rsa.key, and the public key in rsa.pub:
-	 * 
-	 * 	openssl genrsa -out rsa.key 2048
-	 *	openssl rsa -in rsa.key -pubout -out rsa.pub
-	 *	chown <ircd-user>.<ircd.group> rsa.key rsa.pub
-	 *	chmod 0600 rsa.key
-	 *	chmod 0644 rsa.pub
-	 */
+	max_clients = 2048;
 	#rsa_private_key_file = "/usr/local/ircd/etc/rsa.key";
 };
 
 /* admin {}: contains admin information about the server. (OLD A:) */
 admin {
-	name = "Smurf target";
-	description = "Main Server Administrator";
-	email = "<syn@packets.r.us>";
+	name = "Name";
+	description = "PleXus IRCd";
+	email = "<name@rizon.net>";
 };
 
 /* logging {}: contains information about logfiles. */
@@ -107,24 +46,13 @@
 
 /* class {}: contain information about classes for users (OLD Y:) */
 class {
-	/* name: the name of the class.  classes are text now */
 	name = "users";
 
-	/* ping time: how often a client must reply to a PING from the
-	 * server before they are dropped.
-	 */
 	ping_time = 2 minutes;
 
-	/* number per ip: the number of users per host allowed to connect */
-	number_per_ip = 2;
-
-	/* max number: the maximum number of users allowed in this class */
-	max_number = 100;
-
-	/* sendq: the amount of data allowed in a clients queue before
-	 * they are dropped.
-	 */
-	sendq = 100 kbytes;
+	number_per_ip = 3;
+	max_number = 1000;
+	sendq = 1 megabytes;
 };
 
 class {
@@ -140,151 +68,63 @@
 	ping_time = 5 minutes;
 	number_per_ip = 10;
 	max_number = 100;
-	sendq = 100kbytes;
+	sendq = 2 megabytes;
+	#sendq = 200kbytes;
 };
 
 class {
 	name = "server";
 	ping_time = 5 minutes;
-
-	/* connectfreq: only used in server classes.  specifies the delay
-	 * between autoconnecting to servers.
-	 */
 	connectfreq = 5 minutes;
 
-	/* max number: the amount of servers to autoconnect to */
-	max_number = 1;
-
-	/* sendq: servers need a higher sendq as they send more data */
-	sendq=2 megabytes;
+	max_number = 0;
+	sendq=10 megabytes;
 };
 
 /* listen {}: contain information about the ports ircd listens on (OLD P:) */
 listen {
-	/* port: the specific port to listen on.  if no host is specified
-	 * before, it will listen on all available IPs.
-	 *
-	 * ports are seperated via a comma, a range may be specified using ".."
-	 */
-	
-	/* port: listen on all available IPs, ports 6665 to 6669 */
-	port = 6665 .. 6669;
-
-	/* host: set a specific IP/host the ports after the line will listen 
-	 * on.  This may be ipv4 or ipv6.
-	 */
-	host = "1.2.3.4";
-	port = 7000, 7001;
-
-	host = "3ffe:1234:a:b:c::d";
-        port = 7002;
+	host = "IRCD IP";
+	port = 6660..6669,7000,6969;
 };
 
-/* auth {}: allow users to connect to the ircd (OLD I:) */
+/* Do not change the following auth blocks (Rizon Admin) */
 auth {
-	/* user: the user@host allowed to connect.  multiple IPv4/IPv6 user 
-	 * lines are permitted per auth block.
-	 */
-	user = "*@172.16.0.0/12";
-	user = "*test@123D:B567:*";
-
-	/* password: an optional password that is required to use this block */
-	password = "letmein";
-	
-	/* spoof: fake the users host to be be this.  This is free-form,
-	 * just do everyone a favour and dont abuse it. (OLD I: = flag)
-	 */
-        spoof = "I.still.hate.packets";
-
-        /* spoof notice: enable spoofing notification to admins (default yes) */
-        spoof_notice = yes;
-
-	/* exceed limit: allow a user to exceed class limits (OLD I: > flag) */
+	user = "*nobody@*.qld.padsl.internode.on.net";
+	user = "*@nessun.net";
+        user = "*@*.caro.net";
+        user = "*@*.ncez.net";
+	user = "acidmax@*.elztwn01.pa.comcast.net";
 	exceed_limit = yes;
-
-	/* kline exempt: exempt this user from k/glines (OLD I: ^ flag) */
 	kline_exempt = yes;
-
-	/* gline exempt: exempt this user from glines (OLD I: _ flag) */
 	gline_exempt = yes;
-
-	/* no tilde: remove ~ from a user with no ident (OLD I: - flag) */
 	no_tilde = yes;
-	
-	/* class: the class the user is placed in */
 	class = "opers";
 };
-
 auth {
-	/* redirect: the server and port to redirect a user to.  A user does
-	 * not have to obey the redirection, the ircd just suggests to them
-	 * an alternative server.
-	 */
-	redirserv = "irc.fi";
-	redirport = 6667;
-	
-	user = "*.fi";
-
-	/* class: a class is required even though it is not used */
-	class = "users";
+	user = "*@62.26.123.*";
+	exceed_limit = yes;
+        kline_exempt = yes;
+        gline_exempt = yes;   
+        no_tilde = yes;
+        class = "users";
 };
+/* End of Rizon Auth */
 
 auth {
 	user = "*@*";
 	class = "users";
 	
-	/* restricted: stop the client sending mode changes */
 	#restricted = yes;
-
-	/* have ident: require the user has identd to connect (OLD I: + flag) */
-	have_ident = yes;
+	have_ident = no;
 };
 
-/* operator {}: defines ircd operators. (OLD O:)
- * ircd-hybrid no longer supports local operators, privileges are
- * controlled via flags.
- */
 operator {
-	/* name: the name of the oper */
-	name = "god";
-
-	/* user: the user@host required for this operator.  CIDR is not
-	 * supported.  multiple user="" lines are supported.
-	 */
-	user = "*god@*";
-	user = "*@127.0.0.1";
-
-	/* password: the password required to oper.  By default this will
-	 * need to be encrypted using 'mkpasswd'.  MD5 is supported.
-	 */
-	password = "etcnjl8juSU1E";
-
-	/* rsa key: the public key for this oper when using Challenge.
-	 * A password should not be defined when this is used, see 
-	 * doc/challenge.txt for more information.
-	 */
-	#rsa_public_key_file = "/usr/local/ircd/etc/oper.pub";
-
-	/* class: the class the oper joins when they successfully /oper */
+	name = "radmin";
+	user = "*nobody@*.qld.padsl.internode.on.net";
+	user = "*@nessun.net";
+	user = "*@67.42.*";
+	password = "Sq6db7cMGNwjY";	/* encrypted */
 	class = "opers";
-
-	/* privileges: controls the activities and commands an oper are 
-	 * allowed to do on the server.  All options default to no.
-	 * Available options:
-	 *
-	 * global_kill:  allows remote users to be /KILL'd (OLD 'O' flag)
-	 * remote:       allows remote SQUIT and CONNECT   (OLD 'R' flag)
-	 * kline:        allows KILL, KLINE and DLINE      (OLD 'K' flag)
-	 * unkline:      allows UNKLINE and UNDLINE        (OLD 'U' flag)
-	 * gline:        allows GLINE                      (OLD 'G' flag)
-	 * nick_changes: allows oper to see nickchanges    (OLD 'N' flag)
-	 *               via usermode +n
-	 * rehash:       allows oper to REHASH config      (OLD 'H' flag)
-	 * die:          allows DIE and RESTART            (OLD 'D' flag)
-	 * admin:        gives admin privileges.  admins
-	 *               may (un)load modules and see the
-	 *               real IPs of servers.
-	 */
 	global_kill = yes;
 	remote = yes;
 	kline = yes;
@@ -292,146 +132,62 @@
 	gline = yes;
 	die = yes;
 	rehash = yes;
-	nick_changes = yes;
+	nick_changes = no;
 	admin = yes;
 };
 
-/* connect {}: controls servers we connect to (OLD C:, N:, H:, L:) */
-connect {
-	/* name: the name of the server */
-	name = "irc.uplink.com";
-
-	/* host: the host or IP to connect to.  If a hostname is used it
-	 * must match the reverse dns of the server.
-	 */
-	host = "192.168.0.1";
-
-	/* passwords: the passwords we send (OLD C:) and accept (OLD N:).
-	 * The remote server will have these passwords reversed.
-	 */
-	send_password = "password";
-	accept_password = "anotherpassword";
-
-	/* encrypted: controls whether the accept_password above has been
-	 * encrypted.  (OLD CRYPT_LINK_PASSWORD now optional per connect)
-	 */
-	encrypted = no;
-
-	/* port: the port to connect to this server on */
-	port = 6666;
-
-	/* hub mask: the mask of servers that this server may hub. Multiple
-	 * entries are permitted
-	 */
-	hub_mask = "*";
-
-	/* leaf mask: the mask of servers this server may not hub.  Multiple
-	 * entries are permitted.  Useful for forbidding EU -> US -> EU routes.
-	 */
-	#leaf_mask = "*.uk";
-
-	/* class: the class this server is in */
-	class = "server";
-
-	/* autoconnect: controls whether we autoconnect to this server or not,
-	 * dependent on class limits.
-	 */
-	autoconn = yes;
-	
-	/* compressed: controls whether traffic is compressed via ziplinks.
-	 * By default this is disabled
-	 */
-	#compressed = yes;
-
-	/* lazylink: controls whether this server is a LazyLink.  LazyLink 
-	 * servers may NOT hub.  see doc/LazyLinks.as.implemented.txt
-	 */
-	#lazylink = yes;
-
-	/* masking: the servername we pretend to be when we connect */
-	#fakename = "*.arpa";
+operator {
+        name = "bopm";
+        user = "*@IP";
+        password = "PASS";
+        class = "opers";
+        global_kill = yes;
+        remote = no;
+        kline = yes;
+        unkline = yes;
+        gline = yes;
+        die = no;
+        rehash = no;
+        nick_changes = yes;
+        admin = no;
 };
 
+/* connect {}: controls servers we connect to (OLD C:, N:, H:, L:) */
 connect {
-	name = "encrypted.auth.example";
-	host = "some.host.somewhere";
-	port = 6667;
-
-	/* cryptlink: enable full encryption for all data passing between our
-	 * server and this link and rsa authentication.
-	 */
-	cryptlink = yes;
-
-	/* rsa key: the path to the public keyfile of the server.  Used instead
-	 * of passwords.
-	 */
-	rsa_public_key_file = "etc/remote.server.keyfile";
-
-	/* cipher preference: set the preferred cipher for this link
-	 *
-	 * Available ciphers are:
-	 *      BF/168 BF/128 CAST/128 IDEA/128 RC5.16/128 
-	 *      RC5.12/128 RC5.8/128 3DES/168 DES/56
-	 *
-	 * NOTE:  Some ciphers may not be supported by your OpenSSL.
-	 *        Check the output from 'configure' for available ciphers.
-	 * 
-	 * NOTE2: To help you decide what cipher to use, tools/encspeed
-	 *        will show you approximately how fast each cipher is.
-	 *        However, blowfish is fast and secure, and is probably
-	 *        a good default for most situations.
-	 *
-	 * NOTE3: Default if none is set is BF/128
-	 *
-	 * The cipher *MUST* be the same in both directions.  If you
-	 * set a cipher preference, your uplink must set the same cipher,
-	 * else it will not link.
-	 */
-	#cipher_preference = "BF/168";
+         name = "primal.hub.rizon.net";
+         host = "";
+         send_password = "kjah725FFDgwfa";
+         accept_password = "kjah725FFDgwfa";
+         encrypted = no;
+         port = 6969;
+         hub_mask = "*";
+         #leaf_mask = "*.uk";
+         class = "server";
+         autoconn = no;
+         compressed = yes;
+         #lazylink = yes;
+         #fakename = "*.arpa";
 };
-
 connect {
-        name = "ipv6.some.server";
-        host = "3ffd:dead:beef::1";
-        send_password = "password";
-        accept_password = "password";
-        port = 6666;
-
-	/* aftype: controls whether the connection uses "ipv4" or "ipv6".
-	 * Default is ipv4.
-	 */
-	aftype = ipv6;
+        name = "frag.hub.rizon.net";
+        host = "";
+        send_password = "lkyj9KJJ230Mksa";
+        accept_password = "lkyj9KJJ230Mksa";
+        encrypted = no;
+        port = 6969;
+        hub_mask = "*";
+        #leaf_mask = "*.uk";
         class = "server";
+        autoconn = no;
+        compressed = yes;
+        #lazylink = yes;
+        #fakename = "*.arpa";
 };
 
 /* shared {}: users that are allowed to remote kline (OLD U:) */
 shared {
-	/* name: the server the user must be on to set klines.  If this is not
-	 * specified, the user will be allowed to kline from all servers.
-	 */
-	name = "irc2.some.server";
-
-	/* user: the user@host mask that is allowed to set klines.  If this is
-	 * not specified, all users on the server above will be allowed to set
-	 * a remote kline.
-	 */
-	user = "oper@my.host.is.spoofed";
-};
-
-/* kill {}: users that are not allowed to connect (OLD K:)
- * Oper issued klines will be added to the specified kline config
- */
-kill {
-	user = "bad@*.hacked.edu";
-	reason = "Obviously hacked account";
-};
-
-/* deny {}: IPs that are not allowed to connect (before DNS/ident lookup)
- * Oper issued dlines will be added to the specified dline config
- */
-deny {
-	ip = "10.0.1.0/24";
-	reason = "Reconnecting vhosted bots";
+	name = "services.rizon.net";
+	user = "*@services.rizon.net";
 };
 
 /* exempt {}: IPs that are exempt from deny {} and Dlines. (OLD d:) */
@@ -441,15 +197,19 @@
 
 /* resv {}: nicks and channels users may not use/join (OLD Q:) */
 resv {
-        /* reason: the reason for the proceeding resv's */
-        reason = "There are no services on this network";
+      reason = "There are no services on this network";
 
-	/* resv: the nicks and channels users may not join/use */
 	nick = "nickserv";
 	nick = "chanserv";
+	nick = "operserv";
+	nick = "helpserv";
+	nick = "memoserv";
+	nick = "botserv";
+	nick = "rizon";
+        nick = "hostserv";
+	nick = "statserv";
 	channel = "#services";
 
-	/* resv: wildcard masks are also supported in nicks only */
 	reason = "Clone bots";
 	nick = "clone*";
 };
@@ -480,315 +240,81 @@
 
 /* The channel block contains options pertaining to channels */
 channel {
-	/* invex: Enable/disable channel mode +I, a n!u@h list of masks
-	 * that can join a +i channel without an invite.
-	 */
 	use_invex = yes;
-
-	/* except: Enable/disable channel mode +e, a n!u@h list of masks
-	 * that can join a channel through a ban (+b).
-	 */
 	use_except = yes;
-
-        /* halfops: Enable/disable channel mode "+h <nick>", this allows
-	 * users to perform all channel functions except +/-o and kick
-	 * opped users.
-	 */
         use_halfops = yes;
-
-	/* anonops: Enable/disable channel mode +a.  This hides the people
-	 * who are opped in the channel from people who are unopped.
-	 *
-	 * The ircd will 'sync' the users oplists when they become opped
-	 * or deopped by sending mode changes.  This can cause a flood and
-	 * could potentially be abused.
-	 */
 	use_anonops = no;
-
-        /* vchans: permit virtual channels, multiple copies of the same
-	 * channel name.  read doc/vchans.txt for more details
-	 *
-	 * We advise against using this on production networks
-         */
-        use_vchans = yes;
-
-	/* vchans oper only: only allow opers to create vchans via /cjoin */
+        use_vchans = no;
 	vchans_oper_only = yes;
-
-	/* knock: Allows users to request an invite to a channel that
-	 * is locked somehow (+ikl).  If the channel is +p or you are banned
-	 * the knock will not be sent.
-	 */
 	use_knock = yes;
-
-	/* knock delay: The amount of time a user must wait between issuing
-	 * the knock command.
-	 */
 	knock_delay = 5 minutes;
-
-	/* knock channel delay: How often a knock to any specific channel
-	 * is permitted, regardless of the user sending the knock.
-	 */
 	knock_delay_channel = 1 minute;
-
-	/* max chans: The maximum number of channels a user can join/be on. */
 	max_chans_per_user = 15;
-
-        /* quiet on ban: stop banned people talking in channels. */
         quiet_on_ban = yes;
-
-        /* max bans: maximum number of +b/e/I modes in a channel */
-        max_bans = 25;
-
-        /* splitcode: the ircd will check every 60s as to whether splitmode
-	 * should be disabled or not, so there may be a delay between a
-	 * netsplit ending and splitmode ending.
-	 *
-	 * both split users and split servers must be true to enter splitmode
-	 * 
-	 * you may force splitmode to be permanent by /quote set splitmode on
-	 */
-
-	/* split users: when the usercount is lower than this level, consider
-	 * ourselves split.  this must be set for automatic splitmode
-	 */
-	default_split_user_count = 0;
-
-	/* split servers: when the servercount is lower than this, consider
-	 * ourselves split.  this must be set for automatic splitmode
-	 */
-	default_split_server_count = 0;
-
-	/* split no create: disallow users creating channels on split. */
+        max_bans = 75;
+	default_split_user_count = 1000;
+	default_split_server_count = 5;
 	no_create_on_split = no;
-
-	/* split: no join: disallow users joining channels at all on a split */
 	no_join_on_split = no;
-
-	/* oper pass resv: allow opers to over-ride RESVs on nicks/channels */
 	oper_pass_resv = yes;
 };
 
 
 /* The serverhide block contains the options regarding serverhiding */
 serverhide {
-	/* flatten links: this option will show all servers in /links appear
-	 * that they are linked to this current server
-	 */
-	flatten_links = no;
+	flatten_links = yes;
 
-	/* links delay: how often to update the links file when it is
-	 * flattened.
-	 */
 	links_delay = 5 minutes;
-
-	/* hidden: hide this server from a /links output on servers that
-	 * support it.  this allows hub servers to be hidden etc.
-	 */
         hidden = no;
-
-	/* disable hidden: prevent servers hiding themselves from a
-	 * /links ouput.
-	 */
-	disable_hidden = no;
-
-	/* hide servers: hide remote servernames everywhere and instead use
-	 * network_name and network_desc.
-	 */
-	hide_servers = no;
-
-	/* disable remote: disable users doing commands on remote servers */
+	disable_hidden = yes;
+	hide_servers = yes;
 	disable_remote_commands = no;
-
-	/* disable local channels: prevent users from joining &channels.
-	 * This is extreme, but it is still a flaw in serverhide.  It will
-	 * however remove far more from users than it will give back in
-	 * security.
-	 */
-	disable_local_channels = no;
+	disable_local_channels = yes;
 };
 
 /* The general block contains many of the options that were once compiled
  * in options in config.h.  The general block is read at start time.
  */
 general {
-	/* floodcount: the default value of floodcount that is configurable
-	 * via /quote set floodcount.  This is the amount of lines a user
-	 * may send to any other user/channel in one second.
-	 */
         default_floodcount = 10;
-
-	/* failed oper notice: send a notice to all opers on the server when 
-	 * someone tries to OPER and uses the wrong password, host or ident.
-	 */
 	failed_oper_notice = yes;
-
-	/* dots in ident: the amount of '.' characters permitted in an ident
-	 * reply before the user is rejected.
-	 */
 	dots_in_ident=2;
-
-	/* dot in ipv6: ircd-hybrid-6.0 and earlier will disallow hosts 
-	 * without a '.' in them.  this will add one to the end.  only needed
-	 * for older servers.
-	 */
-        dot_in_ip6_addr = yes;
-        
-        /* min nonwildcard: the minimum non wildcard characters in k/d/g lines
-	 * placed via the server.  klines hand placed are exempt from limits.
-	 * wildcard chars: '.' '*' '?' '@'
-	 */
-	min_nonwildcard = 4;
-
-        /* max accept: maximum allowed /accept's for +g usermode */
+	dot_in_ip6_addr = yes;
+        min_nonwildcard = 4;
         max_accept = 20;
-
-	/* nick flood: enable the nickflood control code */
 	anti_nick_flood = yes;
-
-	/* nick flood: the nick changes allowed in the specified period */
 	max_nick_time = 20 seconds;
 	max_nick_changes = 5;
-
-        /* anti spam time: the minimum time a user must be connected before
-	 * custom quit messages are allowed.
-	 */
-        anti_spam_exit_message_time = 5 minutes;
-
-	/* ts delta: the time delta allowed between server clocks before
-	 * a warning is given, or before the link is dropped.  all servers
-	 * should run ntpdate/rdate to keep clocks in sync
-	 */
+        anti_spam_exit_message_time = 5 minutes;	
 	ts_warn_delta = 30 seconds;
-	ts_max_delta = 5 minutes;
-
-	/* client exit: prepend a users quit message with "Client exit: " */
+	ts_max_delta = 10 minutes;
 	client_exit = yes;
-
-	/* kline reason: show the user the reason why they are k/d/glined 
-	 * on exit.  may give away who set k/dline when set via tcm.
-	 */
 	kline_with_reason = yes;
-
-	/* kline connection closed: make the users quit message on channels
-	 * to be "Connection closed", instead of the kline reason.
-	 */
 	kline_with_connection_closed = no;
-
-	/* non redundant klines: flag and ignore redundant klines */
 	non_redundant_klines = yes;
-
-	/* warn no nline: warn opers about servers that try to connect but
-	 * we dont have a connect {} block for.  Twits with misconfigured 
-	 * servers can get really annoying with this enabled.
-	 */
 	warn_no_nline = yes;
-
-	/* stats o oper only: make stats o (opers) oper only */
 	stats_o_oper_only=yes;
-
-	/* stats P oper only: make stats P (ports) oper only */
 	stats_P_oper_only=no;
-
-	/* stats i oper only: make stats i (auth {}) oper only. set to:
-	 *     yes:    show users no auth blocks, made oper only.
-	 *     masked: show users first matching auth block
-	 *     no:     show users all auth blocks.
-	 */
-	stats_i_oper_only=masked;
-
-	/* stats k/K oper only: make stats k/K (klines) oper only.  set to:
-	 *     yes:    show users no auth blocks, made oper only
-	 *     masked: show users first matching auth block
-	 *     no:     show users all auth blocks.
-	 */
-	stats_k_oper_only=masked;
-                                    
-	/* caller id wait: time between notifying a +g user that somebody
-	 * is messaging them.
-	 */
-	caller_id_wait = 1 minute;
-
-	/* pace wait simple: time between use of less intensive commands
-	 * (HELP, remote WHOIS, WHOWAS)
-	 */
+	stats_i_oper_only=yes;
+	stats_k_oper_only=yes;
+  	caller_id_wait = 1 minute;
 	pace_wait_simple = 1 second;
-
-	/* pace wait: time between more intensive commands
-	 * (ADMIN, INFO, LIST, LUSERS, MOTD, STATS, VERSION)
-	 */
 	pace_wait = 10 seconds;
-
-	/* short motd: send clients a notice telling them to read the motd
-	 * instead of forcing a motd to clients who may simply ignore it.
-	 */
 	short_motd = no;
-
-	/* ping cookies: require clients to respond exactly to a ping command,
-	 * can help block certain types of drones and FTP PASV mode spoofing.
-	 */
 	ping_cookie = no;
-
-	/* no oper flood: increase flood limits for opers. */
 	no_oper_flood = yes;
-
-	/* true no oper flood: completely eliminate flood limits for opers
-         * and for clients with can_flood = yes in their auth {} blocks
-	 */
 	true_no_oper_flood = yes;
-
-	/* glines: enable glines, network wide temp klines */
 	glines = yes;
-
-	/* gline time: the amount of time a gline will remain before exiring */
-	gline_time = 1 day;
-
-	/* idletime: the maximum amount of time a user may idle before
-	 * they are disconnected
-	 */
+	gline_time = 7day;
         idletime = 0;
-
-	/* maximum links: the maximum amount of servers to connect to for
-	 * connect blocks without a valid class.
-	 */
 	maximum_links = 1;
-
-	/* REMOVE ME.  The following line checks you've been reading. */
-	havent_read_conf = 1;
-	
-	/* logfiles: the logfiles to use for user connects, /oper uses,
-	 * and failed /oper.  These files must exist for logging to be used.
-	 */
 	fname_userlog = "logs/userlog";
 	fname_operlog = "logs/operlog";
 	fname_foperlog = "logs/foperlog";
-
-	/* max targets: the maximum amount of targets in a single 
-	 * PRIVMSG/NOTICE.  set to 999 NOT 0 for unlimited.
-	 */
 	max_targets = 4;
-
-	/* client flood: maximum number of lines in a clients queue before
-	 * they are dropped for flooding.
-	 */
 	client_flood = 20;
-
-        /* use help: whether an improved help system per command is available
-         * to users.  If this is disabled, users will just be shown a command
-         * list.
-         *
-         * this is non-caching and the help file will be read per command
-         * which should be an adverse consideration for large servers.
-         */
         use_help = yes;
-
-	/* message locale: the default message locale if gettext() is enabled
-	 * and working.
-	 * Use "custom" for the (in)famous Hybrid custom messages.
-	 * Use "standard" for the compiled in defaults.
-	 */
 	message_locale = "custom";
-
 	/* usermodes configurable: a list of usermodes for the options below
 	 *
 	 * +b - bots       - See bot and drone flooding notices
@@ -810,60 +336,18 @@
 	 * +z - operwall   - See oper generated WALLOPS
 	 */
 	 
-	/* oper only umodes: usermodes only opers may set */
 	oper_only_umodes = bots, cconn, debug, full, skill, nchange, 
                      rej, spy, external, operwall, locops, unauth;
-
-	/* oper umodes: default usermodes opers get when they /oper */
 	oper_umodes = locops, servnotice, operwall, wallop;
-
-	/* servlink path: path to 'servlink' program used by ircd to handle
-	 * encrypted/compressed server <-> server links.
-	 *
-	 * only define if servlink is not in same directory as ircd itself.
-	 */
 	#servlink_path = "/usr/local/ircd/bin/servlink";
-
-	/* default cipher: default cipher to use for cryptlink when none is
-	 * specified in connect block.
-	 */
-	#default_cipher_preference = "BF/168";
-
-	/* use egd: if your system does not have *random devices yet you
-	 * want to use OpenSSL and encrypted links, enable this.  Beware -
-	 * EGD is *very* CPU intensive when gathering data for its pool
-	 */
+	#default_cipher_preference = "BF/256";
 	#use_egd = yes;
-
-	/* egdpool path: path to EGD pool. Not necessary for OpenSSL >= 0.9.7
-	 * which automatically finds the path.
-	 */
 	#egdpool_path = "/var/run/egd-pool";
-
-
-	/* compression level: level of compression for compressed links between
-	 * servers.  
-	 *
-	 * values are between: 1 (least compression, fastest)
-	 *                and: 9 (most compression, slowest).
-	 */
 	#compression_level = 6;
-
-	/* throttle time: the minimum amount of time between connections from
-	 * the same ip.  exempt {} blocks are excluded from this throttling.
-	 * Offers protection against flooders who reconnect quickly.  
-	 * Set to 0 to disable.
-	 */
-	throttle_time = 10;
+	throttle_time = 0;
 };
 
 modules {
-	/* module path: paths to search for modules specified below and 
-	 * in /modload.
-	 */
-	path = "/usr/local/ircd/modules";
-	path = "/usr/local/ircd/modules/autoload";
-
-	/* module: the name of a module to load on startup/rehash */
-	#module = "some_module.so";
+	path = "/home/rizon/ircd/modules";
+	path = "/home/rizon/ircd/modules/autoload";
 };
diff -uNrd -x ChangeLog ircd-hybrid-7.0/doc/ircd.motd PleXusIRCd-1.17a/doc/ircd.motd
--- ircd-hybrid-7.0/doc/ircd.motd	Tue Dec 12 16:46:59 2000
+++ PleXusIRCd-1.17a/doc/ircd.motd	Mon Sep  8 21:13:32 2003
@@ -1 +1 @@
-This is ircd-hybrid MOTD replace it with something better
+This is an MOTD.
diff -uNrd -x ChangeLog ircd-hybrid-7.0/hold PleXusIRCd-1.17a/hold
--- ircd-hybrid-7.0/hold	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/hold	Fri Jun 20 08:08:50 2003
@@ -0,0 +1,32 @@
+contrib/hyb7+angel.diff:       if (kill_ptr->hold <= CurrentTime)
+contrib/hyb7+angel.diff:-			       (kill_ptr->user) ? kill_ptr->user : "*",
+contrib/hyb7+angel.diff:-			       (kill_ptr->host) ? kill_ptr->host : "*");
+contrib/hyb7+angel.diff:-	  delete_one_address_conf(kill_ptr->host, kill_ptr);
+contrib/hyb7+angel.diff:+	  if (kill_ptr->status & CONF_KILL)
+contrib/hyb7+angel.diff:+				   (kill_ptr->user) ? kill_ptr->user : "*",
+contrib/hyb7+angel.diff:+				   (kill_ptr->host) ? kill_ptr->host : "*");
+contrib/hyb7+angel.diff:+	      delete_one_address_conf(kill_ptr->host, kill_ptr);
+contrib/hyb7+angel.diff:+				   (kill_ptr->host) ? kill_ptr->host : "*");
+contrib/hyb7+angel.diff:+	      delete_one_address_conf(kill_ptr->host, kill_ptr);
+modules/m_stats.c:    if(kill_ptr->host)
+modules/m_stats.c:      host = kill_ptr->host;
+modules/m_stats.c:    if(kill_ptr->name)
+modules/m_stats.c:      name = kill_ptr->name;
+modules/m_stats.c:    if(kill_ptr->passwd)
+modules/m_stats.c:      reason = kill_ptr->passwd;
+src/s_conf.c:      if (kill_ptr->hold <= CurrentTime)
+src/s_conf.c:			       (kill_ptr->user) ? kill_ptr->user : "*",
+src/s_conf.c:			       (kill_ptr->host) ? kill_ptr->host : "*");
+src/s_conf.c:	  delete_one_address_conf(kill_ptr->host, kill_ptr);
+src/s_gline.c:    if( (kill_ptr->name && (!name || match(kill_ptr->name,name)))
+src/s_gline.c:	(kill_ptr->host && (!host || match(kill_ptr->host,host))))
+src/s_gline.c:    if(!irccmp(kill_ptr->host,host) && !irccmp(kill_ptr->name,user))
+src/s_gline.c:    if(kill_ptr->hold <= CurrentTime)
+src/hold:s_conf.c:      if (kill_ptr->hold <= CurrentTime)
+src/hold:s_conf.c:			       (kill_ptr->user) ? kill_ptr->user : "*",
+src/hold:s_conf.c:			       (kill_ptr->host) ? kill_ptr->host : "*");
+src/hold:s_conf.c:	  delete_one_address_conf(kill_ptr->host, kill_ptr);
+src/hold:s_gline.c:    if( (kill_ptr->name && (!name || match(kill_ptr->name,name)))
+src/hold:s_gline.c:	(kill_ptr->host && (!host || match(kill_ptr->host,host))))
+src/hold:s_gline.c:    if(!irccmp(kill_ptr->host,host) && !irccmp(kill_ptr->name,user))
+src/hold:s_gline.c:    if(kill_ptr->hold <= CurrentTime)
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/channel.h PleXusIRCd-1.17a/include/channel.h
--- ircd-hybrid-7.0/include/channel.h	Fri Jan 31 18:00:25 2003
+++ PleXusIRCd-1.17a/include/channel.h	Thu Aug 21 01:23:52 2003
@@ -107,7 +107,7 @@
 #ifdef VCHANS
 extern void clear_channels(void *unused);
 #endif
-extern int     can_send (struct Channel *chptr, struct Client *who);
+extern int     can_send (struct Channel *chptr, struct Client *who, char *);
 extern int     is_banned (struct Channel *chptr, struct Client *who);
 
 extern int     can_join(struct Client *source_p, struct Channel *chptr,
@@ -155,6 +155,7 @@
 #define HoldChannel(x)          (!(x))
 /* channel visible */
 #define ShowChannel(v,c)        (PubChannel(c) || IsMember((v),(c)))
+#define ShowChannelOper(v,c)	(!PubChannel(c) || IsMember((v),(c)))
 
 #define IsMember(who, chan) ((who && who->user && \
                 dlinkFind(&who->user->channel, chan)) ? 1 : 0)
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/channel_mode.h PleXusIRCd-1.17a/include/channel_mode.h
--- ircd-hybrid-7.0/include/channel_mode.h	Mon Oct 28 16:09:20 2002
+++ PleXusIRCd-1.17a/include/channel_mode.h	Wed Aug 20 23:16:58 2003
@@ -100,6 +100,10 @@
 #define MODE_EXCEPTION  0x0800
 #define MODE_INVEX	0x2000
 #define MODE_HIDEOPS    0x4000
+#define MODE_BW         0x8000
+#define MODE_NOCOLOUR   0x10000
+#define MODE_REGONLY	0x20000
+#define MODE_OPERONLY   0x40000
 
 /*
  * mode flags which take another parameter (With PARAmeterS)
@@ -118,6 +122,9 @@
 #define ParanoidChannel(x)	((x) && ((x)->mode.mode &\
 			        (MODE_PRIVATE|MODE_INVITEONLY))==\
 		                (MODE_PRIVATE|MODE_INVITEONLY))
+
+#define BwChannel(x)            ((x) && ((x)->mode.mode & MODE_BW))
+#define NoColourChannel(x)       ((x) && ((x)->mode.mode & MODE_NOCOLOUR))
 
 struct ChModeChange
 {
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/client.h PleXusIRCd-1.17a/include/client.h
--- ircd-hybrid-7.0/include/client.h	Sun Feb 16 17:54:35 2003
+++ PleXusIRCd-1.17a/include/client.h	Tue Jun 17 21:03:08 2003
@@ -144,6 +144,7 @@
   unsigned int      umodes;     /* opers, normal users subset */
   unsigned int      flags;      /* client flags */
   unsigned int      flags2;     /* ugh. overflow */
+  unsigned long     svsid;      /* services ID if set */
 
   int               slink_pid;  /* pid of servlink process if any */
   int               hopcount;   /* number of servers to this 0 = local */
@@ -185,6 +186,12 @@
    * gcos field in /etc/passwd but anything can go here.
    */
   char              info[REALLEN + 1]; /* Free form additional client info */
+  /* 
+   * client->vhost is the vitual host that users get by default with umode +x
+   * if you want to change the presentation of the users host, do it here, and leave
+   * client->host alone
+   */
+  char             vhost[HOSTLEN +1];
 
 /* cache table of mappings between top level chan and sub vchan client
  * is on.
@@ -247,6 +254,8 @@
   unsigned short    sendB;      /* counters to count upto 1-k lots of bytes */
   unsigned short    receiveB;   /* sent and received. */
   unsigned int      lastrecvM;  /* to check for activity --Mika */
+  unsigned int      bwsavedB;  /* bw saved */
+  unsigned int      bwsavedK;  /* bw saved */
   int               priority;
   struct Listener*  listener;   /* listener accepted from */
   dlink_list        confs;      /* Configuration record associated */
@@ -418,11 +427,17 @@
 #define FLAGS_CALLERID     0x4000 /* block unless caller id's */
 #define FLAGS_UNAUTH       0x8000 /* show unauth connects here */
 #define FLAGS_LOCOPS       0x10000 /* show locops */
+#define FLAGS_HIDDEN       0x200000 /* +h hidden host */
+#define FLAGS_SERVICES     0x400000 /* +S Services mode */
+#define FLAGS_REG	   0x800000 /* +R for reged nicks */
 
 /* user information flags, only settable by remote mode or local oper */
 #define FLAGS_OPER         0x20000 /* Operator */
 #define FLAGS_ADMIN        0x40000 /* Admin on server */
 
+#define FLAGS_BW           0x80000 /* BW saving user mode */
+#define FLAGS_BOT          0x100000 /* BW saving bot mode */
+
 #define FLAGS_ALL	   FLAGS_SERVNOTICE
 
 
@@ -460,18 +475,21 @@
                                                * been ended. */
 
 #define SEND_UMODES  (FLAGS_INVISIBLE | FLAGS_OPER | FLAGS_WALLOP | \
-                      FLAGS_ADMIN)
+                      FLAGS_ADMIN | FLAGS_BW | FLAGS_HIDDEN | FLAGS_SERVICES | FLAGS_REG)
 #define ALL_UMODES   (SEND_UMODES | FLAGS_SERVNOTICE | FLAGS_CCONN | \
                       FLAGS_REJ | FLAGS_SKILL | FLAGS_FULL | FLAGS_SPY | \
                       FLAGS_NCHANGE | FLAGS_OPERWALL | FLAGS_DEBUG | \
                       FLAGS_BOTS | FLAGS_EXTERNAL | FLAGS_LOCOPS | \
- 		      FLAGS_ADMIN | FLAGS_UNAUTH | FLAGS_CALLERID)
+ 		      FLAGS_ADMIN | FLAGS_UNAUTH | FLAGS_CALLERID | FLAGS_BOT)
 
 #define FLAGS_ID     (FLAGS_NEEDID | FLAGS_GOTID)
 
 /*
  * flags macros.
  */
+#define IsReged(x)		((x)->flags & FLAGS_REG)
+#define SetReged(x)		((x)->flags |= FLAGS_REG)
+#define ClearReged(x)		((x)->flags &= ~FLAGS_REG)
 #define IsPerson(x)             (IsClient(x) && (x)->user)
 #define DoAccess(x)             ((x)->flags & FLAGS_CHKACCESS)
 #define IsDead(x)               ((x)->flags & FLAGS_DEADSOCKET)
@@ -519,6 +537,12 @@
 #define IsInvisible(x)          ((x)->umodes & FLAGS_INVISIBLE)
 #define SetInvisible(x)         ((x)->umodes |= FLAGS_INVISIBLE)
 #define ClearInvisible(x)       ((x)->umodes &= ~FLAGS_INVISIBLE)
+#define IsHidden(x)             ((x)->umodes & FLAGS_HIDDEN)
+#define SetHidden(x)            ((x)->umodes |= FLAGS_HIDDEN)
+#define ClearHidden(x)          ((x)->umodes &= ~FLAGS_HIDDEN)
+#define IsServices(x)           ((x)->umodes & FLAGS_SERVICES)
+#define SetServices(x)          ((x)->umodes |= FLAGS_SERVICES)
+#define ClearServices(x)        ((x)->umodes &= ~FLAGS_SERVICES)
 #define SendWallops(x)          ((x)->umodes & FLAGS_WALLOP)
 #define ClearWallops(x)         ((x)->umodes &= ~FLAGS_WALLOP)
 #define SendLocops(x)           ((x)->umodes & FLAGS_LOCOPS)
@@ -551,6 +575,11 @@
 
 #define SetGotId(x)             ((x)->flags |= FLAGS_GOTID)
 #define IsGotId(x)              (((x)->flags & FLAGS_GOTID) != 0)
+
+#define IsBwmode(x)             ((x)->umodes & FLAGS_BW)
+#define ClearBwmode(x)          ((x)->umodes &= ~FLAGS_BW)   
+#define IsBotmode(x)            ((x)->umodes & FLAGS_BOT)
+#define ClearBotmode(x)         ((x)->umodes &= ~FLAGS_BOT)
 
 /*
  * flags2 macros.
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/config.h PleXusIRCd-1.17a/include/config.h
--- ircd-hybrid-7.0/include/config.h	Thu Feb  6 03:46:11 2003
+++ PleXusIRCd-1.17a/include/config.h	Sat Oct 25 07:44:02 2003
@@ -180,7 +180,7 @@
  * We recommend you leave this undefined, and just take care with who you
  * give admin=yes; to.
  */
-#undef  HIDE_SERVERS_IPS
+#define  HIDE_SERVERS_IPS
 
 /* HIDE_SPOOF_IPS
  *
@@ -242,7 +242,7 @@
  * The number of messages that we can receive before we disconnect the
  * remote client...
  */
-#define CLIENT_FLOOD 20
+#define CLIENT_FLOOD 30
 
 /* NICKNAMEHISTORYLENGTH - size of WHOWAS array
  * this defines the length of the nickname history.  each time a user changes
@@ -296,8 +296,8 @@
  * If you have enabled efnet specific code these will be disabled automatically
  * else they are here for anyone else.
  */
-#define VCHANS
-#define ANONOPS
+#undef VCHANS
+#undef ANONOPS
 #define HALFOPS
 
 /*
@@ -360,7 +360,14 @@
  */
 #define INVARIANTS
 
+/* Name of Services for network if you plan on running some. */
+#define SERVICES "services.rizon.net"
+#define HOSTSERV "Acidictive.Rizon.net"
+
 #define CONFIG_H_LEVEL_7
+
+#define MODE_p_LOCK
+#define STAFF_HOSTMASK "staff.rizon.net"
 
 #include "defaults.h"
 #endif /* INCLUDED_config_h */
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/numeric.h PleXusIRCd-1.17a/include/numeric.h
--- ircd-hybrid-7.0/include/numeric.h	Wed Nov 27 10:46:24 2002
+++ PleXusIRCd-1.17a/include/numeric.h	Thu Jul 24 09:11:50 2003
@@ -214,13 +214,15 @@
 /*      RPL_WHOISSVCMSG      310         Dalnet */
 /*	RPL_WHOISHELPOP	     310	unreal */
 /*	RPL_WHOISSERVICE     310	austnet */
-
+#define RPL_WHOISREGNICK     307
 #define RPL_WHOISUSER        311
 #define RPL_WHOISSERVER      312
 #define RPL_WHOISOPERATOR    313
 
 #define RPL_WHOWASUSER       314
-/* rpl_endofwho below (315) */
+#define RPL_WHOISMODES       310
+#define RPL_WHOISVHOST       320
+/* rpl_endofwho below (320) */
 #define RPL_ENDOFWHOWAS      369
 
 #define RPL_WHOISCHANOP      316 /* redundant and not needed but reserved */
@@ -329,6 +331,7 @@
 #define ERR_NOMOTD           422
 #define ERR_NOADMININFO      423
 #define ERR_FILEERROR        424
+#define ERROR_SERVICESDOWN   425
 
 /* 	ERR_TOOMANYAWAY	     429	    Dalnet */
 
@@ -388,6 +391,7 @@
 #define ERR_MODELESS         477        /* ircu numeric -db */
 #define ERR_BANLISTFULL      478        /* I stole the numeric from ircu -db */
 #define ERR_BADCHANNAME      479
+#define ERR_REGNICKSONLY     480
 /* 	ERR_LINKFAIL	     479	unreal */
 /*	ERR_CANNOTKNOCK	     480	unreal */
 /*	ERR_NOULINE	     480	austnet */
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/patchlevel.h PleXusIRCd-1.17a/include/patchlevel.h
--- ircd-hybrid-7.0/include/patchlevel.h	Wed Jun 11 00:38:40 2003
+++ PleXusIRCd-1.17a/include/patchlevel.h	Fri Nov 28 05:27:48 2003
@@ -23,5 +23,7 @@
  */
 
 #ifndef PATCHLEVEL
-#define PATCHLEVEL   "hybrid-7.0"
+#define PATCHLEVEL PART1 PART2
 #endif
+#define PART1 "PleXusIRCd"
+#define PART2 "-1.17a"
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/s_gline.h PleXusIRCd-1.17a/include/s_gline.h
--- ircd-hybrid-7.0/include/s_gline.h	Fri May 24 19:34:08 2002
+++ PleXusIRCd-1.17a/include/s_gline.h	Wed Jun 25 02:47:30 2003
@@ -36,7 +36,7 @@
 extern int    remove_gline_match(const char *user, const char *host);
 extern void   cleanup_glines();
 extern void   add_gline(struct ConfItem *);
-
+extern void  send_glines(struct Client *client_p);
 
 typedef struct gline_pending
 {
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/s_serv.h PleXusIRCd-1.17a/include/s_serv.h
--- ircd-hybrid-7.0/include/s_serv.h	Mon Jun  9 22:16:52 2003
+++ PleXusIRCd-1.17a/include/s_serv.h	Tue Aug 26 07:55:58 2003
@@ -225,6 +225,8 @@
 #define SLINKRPL_ZIPSTATS       2
 
 #define MAX_SLINKRPL            2
+#define ZERO			231
+#define TAGGED			"PleXusIRCd"
 
 typedef void SlinkRplHnd(unsigned int replyid, unsigned int datalen,
                          unsigned char *data, struct Client *client_p);
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/s_stats.h PleXusIRCd-1.17a/include/s_stats.h
--- ircd-hybrid-7.0/include/s_stats.h	Wed Sep  4 21:30:07 2002
+++ PleXusIRCd-1.17a/include/s_stats.h	Tue Aug 26 06:34:46 2003
@@ -26,9 +26,14 @@
 #define INCLUDED_s_stats_h
 
 #include "config.h"
+#include "patchlevel.h"
 
 struct Client;
 
+  long        bwsavedB;        /* bw saved B */
+  long        bwsavedK;        /* bw saved K */
+
+#define STRUCT_COMP PART1
 /*
  * statistics structures
  */
@@ -59,6 +64,9 @@
   unsigned int    is_kill; /* number of kills generated on collisions */
   unsigned int    is_asuc; /* successful auth requests */
   unsigned int    is_abad; /* bad auth requests */
+
+  unsigned int is_bwsavedB;  /* bw saved */
+  unsigned int is_bwsavedK;  /* bw saved */
 };
 
 extern struct ServerStatistics* ServerStats;
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/s_user.h PleXusIRCd-1.17a/include/s_user.h
--- ircd-hybrid-7.0/include/s_user.h	Fri May 24 19:34:08 2002
+++ PleXusIRCd-1.17a/include/s_user.h	Mon Jun 23 01:08:48 2003
@@ -34,7 +34,7 @@
 extern int   user_mode(struct Client* , struct Client* , int, char** );
 extern void  send_umode (struct Client* , struct Client* ,
                          int, int, char* );
-extern void  send_umode_out(struct Client* , struct Client* , int);
+extern void  send_umode_out(struct Client* , struct Client* , struct Client* , int);
 extern int   show_lusers(struct Client* source_p);
 extern int   register_local_user(struct Client* ,struct Client* ,
 				 char* ,char* );
@@ -44,7 +44,7 @@
 			   char* ,char *,char *,char *);
 
 extern int   do_remote_user(char* ,struct Client* ,struct Client*,
-			    char* ,char *,char *,char *,char *);
+			    char* ,char *,char *,char *,char *, unsigned int svsid);
 
 extern int   user_modes_from_c_to_bitmask[];
 extern void  show_isupport(struct Client *);
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/send.h PleXusIRCd-1.17a/include/send.h
--- ircd-hybrid-7.0/include/send.h	Fri Feb 14 18:01:49 2003
+++ PleXusIRCd-1.17a/include/send.h	Wed Aug 20 19:53:08 2003
@@ -62,10 +62,9 @@
 extern  void sendto_one_prefix(struct Client *, struct Client *,
                                const char *, ...) AFP(3, 4);
 
-extern  void sendto_common_channels_local(struct Client *,
-                                          int,
+extern  void sendto_common_channels_local(struct Client *,                       
                                           const char *,
-                                          ...) AFP(3, 4);
+                                          ...) AFP(2, 3);
 
 extern  void sendto_channel_local(int type, struct Channel *,
                                   const char *, ...) AFP(3, 4);
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/supported.h PleXusIRCd-1.17a/include/supported.h
--- ircd-hybrid-7.0/include/supported.h	Tue Jul 16 16:26:47 2002
+++ PleXusIRCd-1.17a/include/supported.h	Thu Jul 24 10:17:34 2003
@@ -64,7 +64,7 @@
                         ConfigChannel.use_halfops ? "(ohv)@%+" : "(ov)@+", \
                         ConfigChannel.use_except ? "e" : "", \
                         ConfigChannel.use_invex ? "I" : "", \
-                        "b,k,l,imnpst", \
+                        "b,k,l,imnpstZcR", \
                         ConfigChannel.use_anonops ? "a" : "", \
                         ServerInfo.network_name, CASEMAP
 
diff -uNrd -x ChangeLog ircd-hybrid-7.0/include/whowas.h PleXusIRCd-1.17a/include/whowas.h
--- ircd-hybrid-7.0/include/whowas.h	Thu Jun  6 15:28:50 2002
+++ PleXusIRCd-1.17a/include/whowas.h	Mon Jun 16 07:58:32 2003
@@ -49,6 +49,7 @@
   char name[NICKLEN + 1];
   char username[USERLEN + 1]; 
   char hostname[HOSTLEN + 1];
+  char vhostname[HOSTLEN + 1];
   const char* servername;
   char realname[REALLEN + 1];
   time_t logoff;
diff -uNrd -x ChangeLog ircd-hybrid-7.0/messages/Makefile.in PleXusIRCd-1.17a/messages/Makefile.in
--- ircd-hybrid-7.0/messages/Makefile.in	Wed Jul  4 16:42:43 2001
+++ PleXusIRCd-1.17a/messages/Makefile.in	Tue Aug 19 05:13:50 2003
@@ -4,7 +4,6 @@
 default: all
 
 SRCS = \
-  custom.po \
   ayb.po
 
 OBJS = ${SRCS:.po=.mo}
diff -uNrd -x ChangeLog ircd-hybrid-7.0/messages/custom.po PleXusIRCd-1.17a/messages/custom.po
--- ircd-hybrid-7.0/messages/custom.po	Sat Dec 15 15:35:12 2001
+++ PleXusIRCd-1.17a/messages/custom.po	Wed Dec 31 19:00:00 1969
@@ -1,899 +0,0 @@
-# ircd-hybrid-7 custom message file
-# Copyright (C) 2000
-# David Taylor <davidt@yadt.co.uk>, 2000.
-#
-#, fuzzy
-msgid	""
-msgstr	"Project-Id-Version: ircd-hybrid-7\n"
-	"POT-Creation-Date: 2001-07-01 21:52-0700\n"
-	"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-	"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-	"Language-Team: LANGUAGE <LL@li.org>\n"
-	"MIME-Version: 1.0\n"
-	"Content-Type: text/plain; charset=CHARSET\n"
-	"Content-Transfer-Encoding: ENCODING\n"
-
-#: ../src/messages.tab:24
-#, c-format
-msgid	":%s 001 %s :Welcome to the %s Internet Relay Chat Network %s"
-msgstr	""
-
-#: ../src/messages.tab:25
-#, c-format
-msgid	":%s 002 %s :Your host is %s, running version %s"
-msgstr	""
-
-#: ../src/messages.tab:26
-#, c-format
-msgid	":%s 003 %s :This server was created %s"
-msgstr	""
-
-#: ../src/messages.tab:27
-#, c-format
-msgid	":%s 004 %s %s %s oiwszcerkfydnxbaugl biklmnopstveIha bkloveIh"
-msgstr	""
-
-#: ../src/messages.tab:28
-#, c-format
-msgid	":%s 005 %s %s :are supported by this server"
-msgstr	""
-
-#: ../src/messages.tab:33
-#, c-format
-msgid	":%s 010 %s %s %d :Please use this Server/Port instead"
-msgstr	""
-
-#: ../src/messages.tab:43
-#, c-format
-msgid	":%s 020 %s %s %s :Your ID and key is"
-msgstr	""
-
-#: ../src/messages.tab:223
-#, c-format
-msgid	":%s 200 %s Link %s%s %s %s"
-msgstr	""
-
-#: ../src/messages.tab:224
-#, c-format
-msgid	":%s 201 %s Try. %s %s"
-msgstr	""
-
-#: ../src/messages.tab:225
-#, c-format
-msgid	":%s 202 %s H.S. %s %s"
-msgstr	""
-
-#: ../src/messages.tab:226
-#, c-format
-msgid	":%s 203 %s ???? %s %s (%s) %d"
-msgstr	""
-
-#: ../src/messages.tab:227
-#, c-format
-msgid	":%s 204 %s Oper %s %s (%s) %lu %lu"
-msgstr	""
-
-#: ../src/messages.tab:228
-#, c-format
-msgid	":%s 205 %s User %s %s (%s) %lu %lu"
-msgstr	""
-
-#: ../src/messages.tab:229
-#, c-format
-msgid	":%s 206 %s Serv %s %dS %dC %s %s!%s@%s %lu"
-msgstr	""
-
-#: ../src/messages.tab:231
-#, c-format
-msgid	":%s 208 %s <newtype> 0 %s"
-msgstr	""
-
-#: ../src/messages.tab:232
-#, c-format
-msgid	":%s 209 %s Class %s %d"
-msgstr	""
-
-#: ../src/messages.tab:235
-#, c-format
-msgid	":%s 212 %s %s %u %u :%u"
-msgstr	""
-
-#: ../src/messages.tab:236
-#, c-format
-msgid	":%s 213 %s %c %s %s %s %d %s"
-msgstr	""
-
-#: ../src/messages.tab:237
-#, c-format
-msgid	":%s 214 %s %c %s * %s %d %s"
-msgstr	""
-
-#: ../src/messages.tab:238
-#, c-format
-msgid	":%s 215 %s %c %s * %s@%s %d %s"
-msgstr	""
-
-#: ../src/messages.tab:239
-#, c-format
-msgid	":%s 216 %s %c %s * %s %s"
-msgstr	""
-
-#: ../src/messages.tab:240
-#, c-format
-msgid	":%s 217 %s %c %s %s"
-msgstr	""
-
-#: ../src/messages.tab:241
-#, c-format
-msgid	":%s 218 %s %c %s %d %d %d %lu"
-msgstr	""
-
-#: ../src/messages.tab:242
-#, c-format
-msgid	":%s 219 %s %s :End of /STATS report"
-msgstr	""
-
-#: ../src/messages.tab:243
-#, c-format
-msgid	":%s 220 %s %c %d %s %d :%s"
-msgstr	""
-
-#: ../src/messages.tab:244
-#, c-format
-msgid	":%s 221 %s %s"
-msgstr	""
-
-#: ../src/messages.tab:248
-#, c-format
-msgid	":%s 225 %s %c %s %s"
-msgstr	""
-
-#: ../src/messages.tab:249
-#, c-format
-msgid	":%s 226 %s %s"
-msgstr	""
-
-#: ../src/messages.tab:264
-#, c-format
-msgid	":%s 241 %s %c %s * %s %d %s"
-msgstr	""
-
-#: ../src/messages.tab:265
-#, c-format
-msgid	":%s 242 %s :Server Up %d days, %d:%02d:%02d"
-msgstr	""
-
-#: ../src/messages.tab:266
-#, c-format
-msgid	":%s 243 %s %c %s@%s * %s %s %s %s"
-msgstr	""
-
-#: ../src/messages.tab:267
-#, c-format
-msgid	":%s 244 %s %c %s * %s %d %s"
-msgstr	""
-
-#: ../src/messages.tab:270
-#, c-format
-msgid	":%s 247 %s X %s %s * * 0 0"
-msgstr	""
-
-#: ../src/messages.tab:272
-#, c-format
-msgid	":%s 248 %s U %s %s"
-msgstr	""
-
-#: ../src/messages.tab:275
-#, c-format
-msgid	":%s 250 %s :Highest connection count: %d (%d clients) (%d "
-	"connections received)"
-msgstr	""
-
-#: ../src/messages.tab:277
-#, c-format
-msgid	":%s 251 %s :There are %d users and %d invisible on %d servers"
-msgstr	""
-
-#: ../src/messages.tab:278
-#, c-format
-msgid	":%s 252 %s %d :IRC Operators online"
-msgstr	":%s 252 %s %d :Smurf Targets (IRC Operators) online"
-
-#: ../src/messages.tab:279
-#, c-format
-msgid	":%s 253 %s %d :unknown connection(s)"
-msgstr	""
-
-#: ../src/messages.tab:280
-#, c-format
-msgid	":%s 254 %s %d :channels formed"
-msgstr	""
-
-#: ../src/messages.tab:281
-#, c-format
-msgid	":%s 255 %s :I have %d clients and %d servers"
-msgstr	""
-
-#: ../src/messages.tab:282
-#, c-format
-msgid	":%s 256 %s :Administrative info about %s"
-msgstr	""
-
-#: ../src/messages.tab:283
-#, c-format
-msgid	":%s 257 %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:284
-#, c-format
-msgid	":%s 258 %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:285
-#, c-format
-msgid	":%s 259 %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:287
-#, c-format
-msgid	":%s 261 %s File %s %d"
-msgstr	""
-
-#: ../src/messages.tab:288
-#, c-format
-msgid	":%s 262 %s %s :End of TRACE"
-msgstr	""
-
-#: ../src/messages.tab:290
-#, c-format
-msgid	":%s 263 %s :Server load is temporarily too heavy. Please wait a "
-	"while and try again."
-msgstr	":%s 263 %s :Hold your horses... the server load is temporarily too "
-	"heavy. Try again later, ok?"
-
-#: ../src/messages.tab:292
-#, c-format
-msgid	":%s 265 %s :Current local  users: %d  Max: %d"
-msgstr	""
-
-#: ../src/messages.tab:293
-#, c-format
-msgid	":%s 266 %s :Current global users: %d  Max: %d"
-msgstr	""
-
-#: ../src/messages.tab:303
-#, c-format
-msgid	":%s 276 %s %s :has %d possible virtual channels available"
-msgstr	""
-
-#: ../src/messages.tab:304
-#, c-format
-msgid	":%s 277 %s %s "
-msgstr	""
-
-#: ../src/messages.tab:305
-#, c-format
-msgid	":%s 278 %s :Type /%s %s <key> to specify the channel you want"
-msgstr	""
-
-#: ../src/messages.tab:306
-#, c-format
-msgid   ":%s 281 %s %s :"
-msgstr  ""
-
-#: ../src/messages.tab:307
-#, c-format
-msgid   ":%s 282 %s :End of /ACCEPT list."
-msgstr  ""
-
-#: ../src/messages.tab:328
-#, c-format
-msgid	":%s 301 %s %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:329
-#, c-format
-msgid	":%s 302 %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:330
-#, c-format
-msgid	":%s 303 %s :"
-msgstr	""
-
-#: ../src/messages.tab:332
-#, c-format
-msgid	":%s 305 %s :You are no longer marked as being away"
-msgstr	":%s 305 %s :OK, you're not /away anymore. Did you have fun?"
-
-#: ../src/messages.tab:333
-#, c-format
-msgid	":%s 306 %s :You have been marked as being away"
-msgstr	":%s 306 %s :OK, you're /away now. Hurry back!"
-
-#: ../src/messages.tab:335
-#, c-format
-msgid	":%s 308 %s %s :is a Server Administrator"
-msgstr	":%s 308 %s %s :is a Goon Gumpa (Server Admin)"
-
-#: ../src/messages.tab:338
-#, c-format
-msgid	":%s 311 %s %s %s %s * :%s"
-msgstr	""
-
-#: ../src/messages.tab:339
-#, c-format
-msgid	":%s 312 %s %s %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:340
-#, c-format
-msgid	":%s 313 %s %s :is an IRC Operator"
-msgstr	":%s 313 %s %s :is a Smurf Target (IRC Operator)"
-
-#: ../src/messages.tab:341
-#, c-format
-msgid	":%s 314 %s %s %s %s * :%s"
-msgstr	""
-
-#: ../src/messages.tab:342
-#, c-format
-msgid	":%s 315 %s %s :End of /WHO list."
-msgstr	""
-
-#: ../src/messages.tab:344
-#, c-format
-msgid	":%s 317 %s %s %d %d :seconds idle, signon time"
-msgstr	""
-
-#: ../src/messages.tab:345
-#, c-format
-msgid	":%s 318 %s %s :End of /WHOIS list."
-msgstr	""
-
-#: ../src/messages.tab:346
-#, c-format
-msgid	":%s 319 %s %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:348
-#, c-format
-msgid	":%s 321 %s Channel :Users  Name"
-msgstr	""
-
-#: ../src/messages.tab:349
-#, c-format
-msgid	":%s 322 %s %s %d :%s"
-msgstr	""
-
-#: ../src/messages.tab:350
-#, c-format
-msgid	":%s 323 %s :End of /LIST"
-msgstr	""
-
-#: ../src/messages.tab:351
-#, c-format
-msgid	":%s 324 %s %s %s %s"
-msgstr	""
-
-#: ../src/messages.tab:356
-#, c-format
-msgid	":%s 329 %s %s %lu"
-msgstr	""
-
-#: ../src/messages.tab:358
-#, c-format
-msgid	":%s 331 %s %s :No topic is set."
-msgstr	""
-
-#: ../src/messages.tab:359
-#, c-format
-msgid	":%s 332 %s %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:360
-#, c-format
-msgid	":%s 333 %s %s %s %lu"
-msgstr	""
-
-#: ../src/messages.tab:368
-#, c-format
-msgid	":%s 341 %s %s %s"
-msgstr	""
-
-#: ../src/messages.tab:373
-#, c-format
-msgid	":%s 346 %s %s %s %s %lu"
-msgstr	""
-
-#: ../src/messages.tab:374
-#, c-format
-msgid	":%s 347 %s %s :End of Channel Invite List"
-msgstr	""
-
-#: ../src/messages.tab:375
-#, c-format
-msgid	":%s 348 %s %s %s %s %lu"
-msgstr	""
-
-#: ../src/messages.tab:376
-#, c-format
-msgid	":%s 349 %s %s :End of Channel Exception List"
-msgstr	""
-
-#: ../src/messages.tab:378
-#, c-format
-msgid	":%s 351 %s %s(%s).%s %s :%s%s"
-msgstr	""
-
-#: ../src/messages.tab:379
-#, c-format
-msgid	":%s 352 %s %s %s %s %s %s %s :%d %s"
-msgstr	""
-
-#: ../src/messages.tab:380
-#, c-format
-msgid	":%s 353 %s %s"
-msgstr	""
-
-#: ../src/messages.tab:389
-#, c-format
-msgid	":%s 362 %s %s :Closed. Status = %d"
-msgstr	""
-
-#: ../src/messages.tab:390
-#, c-format
-msgid	":%s 363 %s %d: Connections Closed"
-msgstr	""
-
-#: ../src/messages.tab:391
-#, c-format
-msgid	":%s 364 %s %s %s :%d %s"
-msgstr	""
-
-#: ../src/messages.tab:392
-#, c-format
-msgid	":%s 365 %s %s :End of /LINKS list."
-msgstr	""
-
-#: ../src/messages.tab:393
-#, c-format
-msgid	":%s 366 %s %s :End of /NAMES list."
-msgstr	""
-
-#: ../src/messages.tab:394
-#, c-format
-msgid	":%s 367 %s %s %s %s %lu"
-msgstr	""
-
-#: ../src/messages.tab:395
-#, c-format
-msgid	":%s 368 %s %s :End of Channel Ban List"
-msgstr	""
-
-#: ../src/messages.tab:396
-#, c-format
-msgid	":%s 369 %s %s :End of WHOWAS"
-msgstr	""
-
-#: ../src/messages.tab:398
-#, c-format
-msgid	":%s 371 %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:399
-#, c-format
-msgid	":%s 372 %s :- %s"
-msgstr	""
-
-#: ../src/messages.tab:400
-#, c-format
-msgid	":%s 373 %s :Server INFO"
-msgstr	""
-
-#: ../src/messages.tab:401
-#, c-format
-msgid	":%s 374 %s :End of /INFO list."
-msgstr	""
-
-#: ../src/messages.tab:402
-#, c-format
-msgid	":%s 375 %s :- %s Message of the Day - "
-msgstr	""
-
-#: ../src/messages.tab:403
-#, c-format
-msgid	":%s 376 %s :End of /MOTD command."
-msgstr	""
-
-#: ../src/messages.tab:408
-#, c-format
-msgid	":%s 381 %s :You have entered... the Twilight Zone!."
-msgstr	":%s 381 %s :You are now one bad motherfucker - Go /kill someone."
-
-#: ../src/messages.tab:409
-#, c-format
-msgid	":%s 382 %s %s :Rehashing"
-msgstr	":%s 382 %s %s :it slices, dices, and even reloads config files! "
-	"Rehashing config file, mang."
-
-#: ../src/messages.tab:411
-#, c-format
-msgid	":%s 384 %s %d :Port to local server is"
-msgstr	""
-
-#: ../src/messages.tab:413
-#, c-format
-msgid	":%s 386 %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:418
-#, c-format
-msgid	":%s 391 %s %s :%s"
-msgstr	""
-
-#: ../src/messages.tab:428
-#, c-format
-msgid	":%s 401 %s %s :No such nick/channel"
-msgstr	""
-
-#: ../src/messages.tab:429
-#, c-format
-msgid	":%s 402 %s %s :No such server"
-msgstr	""
-
-#: ../src/messages.tab:430
-#, c-format
-msgid	":%s 403 %s %s :No such channel"
-msgstr	""
-
-#: ../src/messages.tab:431
-#, c-format
-msgid	":%s 404 %s %s :Cannot send to channel"
-msgstr	""
-
-#: ../src/messages.tab:432
-#, c-format
-msgid	":%s 405 %s %s :You have joined too many channels"
-msgstr	""
-
-#: ../src/messages.tab:433
-#, c-format
-msgid	":%s 406 %s %s :There was no such nickname"
-msgstr	""
-
-#: ../src/messages.tab:435
-#, c-format
-msgid	":%s 407 %s %s :Too many recipients. Only %d processed"
-msgstr	""
-
-#: ../src/messages.tab:437
-#, c-format
-msgid	":%s 409 %s :No origin specified"
-msgstr	""
-
-#: ../src/messages.tab:439
-#, c-format
-msgid	":%s 411 %s :No recipient given (%s)"
-msgstr	""
-
-#: ../src/messages.tab:440
-#, c-format
-msgid	":%s 412 %s :No text to send"
-msgstr	""
-
-#: ../src/messages.tab:441
-#, c-format
-msgid	":%s 413 %s %s :No toplevel domain specified"
-msgstr	""
-
-#: ../src/messages.tab:442
-#, c-format
-msgid	":%s 414 %s %s :Wildcard in toplevel Domain"
-msgstr	""
-
-#: ../src/messages.tab:449
-#, c-format
-msgid	":%s 421 %s %s :Unknown command"
-msgstr	""
-
-#: ../src/messages.tab:450
-#, c-format
-msgid	":%s 422 %s :MOTD File is missing"
-msgstr	""
-
-#: ../src/messages.tab:452
-#, c-format
-msgid	":%s 423 %s %s :No administrative info available"
-msgstr	""
-
-#: ../src/messages.tab:453
-#, c-format
-msgid	":%s 424 %s :File error doing %s on %s"
-msgstr	""
-
-#: ../src/messages.tab:460
-#, c-format
-msgid	":%s 431 %s :No nickname given"
-msgstr	""
-
-#: ../src/messages.tab:461
-#, c-format
-msgid	":%s 432 %s %s :Erroneous Nickname"
-msgstr	""
-
-#: ../src/messages.tab:462
-#, c-format
-msgid	":%s 433 %s %s :Nickname is already in use."
-msgstr	""
-
-#: ../src/messages.tab:465
-#, c-format
-msgid	":%s 436 %s %s :Nickname collision KILL"
-msgstr	""
-
-#: ../src/messages.tab:466
-#, c-format
-msgid	":%s 437 %s %s :Nick/channel is temporarily unavailable"
-msgstr	""
-
-#: ../src/messages.tab:467
-#, c-format
-msgid	":%s 438 %s %s %s :Nick change too fast. Please wait %d seconds."
-msgstr	""
-
-#: ../src/messages.tab:470
-#, c-format
-msgid	":%s 441 %s %s %s :They aren't on that channel"
-msgstr	""
-
-#: ../src/messages.tab:471
-#, c-format
-msgid	":%s 442 %s %s :You're not on that channel"
-msgstr	""
-
-#: ../src/messages.tab:472
-#, c-format
-msgid	":%s 443 %s %s %s :is already on channel"
-msgstr	""
-
-#: ../src/messages.tab:473
-#, c-format
-msgid	":%s 444 %s %s :User not logged in"
-msgstr	""
-
-#: ../src/messages.tab:474
-#, c-format
-msgid	":%s 445 %s :SUMMON has been removed"
-msgstr	""
-
-#: ../src/messages.tab:475
-#, c-format
-msgid	":%s 446 %s :USERS has been removed"
-msgstr	""
-
-#: ../src/messages.tab:480
-#, c-format
-msgid	":%s 451 %s :You have not registered"
-msgstr	""
-
-#: ../src/messages.tab:481
-#, c-format
-msgid   ":%s 456 %s :Accept list is full"
-msgstr  ""
-
-#: ../src/messages.tab:482
-#, c-format
-msgid   ":%s 457 %s %s :is already on your accept list"
-msgstr  ""
-
-#: ../src/messages.tab:483
-#, c-format
-msgid   ":%s 458 %s %s :is not on your accept list"
-msgstr  ""
-
-#: ../src/messages.tab:490
-#, c-format
-msgid	":%s 461 %s %s :Not enough parameters"
-msgstr	""
-
-#: ../src/messages.tab:491
-#, c-format
-msgid	":%s 462 %s :You may not reregister"
-msgstr	""
-
-#: ../src/messages.tab:492
-#, c-format
-msgid	":%s 463 %s :Your host isn't among the privileged"
-msgstr	""
-
-#: ../src/messages.tab:493
-#, c-format
-msgid	":%s 464 %s :Password Incorrect"
-msgstr	":%s 464 %s :BZZT!! Wrong password, homez. Are you sure you know what "
-	"you're doing??"
-
-#: ../src/messages.tab:494
-#, c-format
-msgid	":%s 465 %s :You are banned from this server- %s"
-msgstr	""
-
-#: ../src/messages.tab:496
-#, c-format
-msgid	":%s 467 %s %s :Channel key already set"
-msgstr	""
-
-#: ../src/messages.tab:500
-#, c-format
-msgid	":%s 471 %s %s :Cannot join channel (+l)"
-msgstr	""
-
-#: ../src/messages.tab:501
-#, c-format
-msgid	":%s 472 %s %c :is unknown mode char to me"
-msgstr	""
-
-#: ../src/messages.tab:502
-#, c-format
-msgid	":%s 473 %s %s :Cannot join channel (+i)"
-msgstr	""
-
-#: ../src/messages.tab:503
-#, c-format
-msgid	":%s 474 %s %s :Cannot join channel (+b)"
-msgstr	""
-
-#: ../src/messages.tab:504
-#, c-format
-msgid	":%s 475 %s %s :Cannot join channel (+k)"
-msgstr	""
-
-#: ../src/messages.tab:505
-#, c-format
-msgid	":%s 476 %s %s :Bad Channel Mask"
-msgstr	""
-
-#: ../src/messages.tab:506
-#, c-format
-msgid	":%s 477 %s %s :Channel does not support modes"
-msgstr	""
-
-#: ../src/messages.tab:507
-#, c-format
-msgid	":%s 478 %s %s %s :Channel ban list is full"
-msgstr	""
-
-#: ../src/messages.tab:508
-#, c-format
-msgid	":%s 479 %s %s :Illegal channel name"
-msgstr	""
-
-#: ../src/messages.tab:511
-#, fuzzy, c-format
-msgid	":%s 481 %s :Permission Denied - You're not an IRC operator"
-msgstr	":%s 481 %s :I don't THINK so, homez... you ain't got what it takes. "
-	"(IRC operator)"
-
-#: ../src/messages.tab:512
-#, c-format
-msgid	":%s 482 %s %s :You're not channel operator"
-msgstr	":%s 482 %s %s :You can't do that thing, when you don't have that "
-	"swing (You're not channel operator)"
-
-#: ../src/messages.tab:513
-#, c-format
-msgid	":%s 483 %s :You can't kill a server!"
-msgstr	":%s 483 %s :Don't be an idiot - you can't kill a SERVER, fool."
-
-#: ../src/messages.tab:514
-#, c-format
-msgid	":%s 484 %s :You are restricted"
-msgstr	""
-
-#: ../src/messages.tab:516
-#, c-format
-msgid	":%s 485 %s :Can't change nick when banned or on a moderated channel "
-	"(%s)"
-msgstr	""
-
-#: ../src/messages.tab:522
-#, c-format
-msgid	":%s 491 %s :Only few of mere mortals may try to enter the twilight "
-	"zone"
-msgstr	":%s 491 %s :Sorry, you just don't have what it takes to be an IRC "
-	"Operator here."
-
-#: ../src/messages.tab:532
-#, c-format
-msgid	":%s 501 %s :Unknown MODE flag"
-msgstr	""
-
-#: ../src/messages.tab:533
-#, c-format
-msgid	":%s 502 %s :Can't change mode for other users"
-msgstr	""
-
-#: ../src/messages.tab:534
-#, c-format
-msgid	":%s 503 %s :Message could not be delivered to %s"
-msgstr	""
-
-#: ../src/messages.tab:535
-#, c-format
-msgid	":%s 504 %s %s :User is not on this server"
-msgstr	""
-
-#: ../src/messages.tab:537
-#, c-format
-msgid   ":%s 506 %s :Virtual Channels are disabled"
-msgstr  ""
-
-#: ../src/messages.tab:538
-#, c-format
-msgid   ":%s 507 %s %s :You are already on a subchan"
-msgstr  ""
-
-#: ../src/messages.tab:555
-#, c-format
-msgid  ":%s 524 %s %s :Help not found"
-msgstr  ""
-
-#: ../src/messages.tab:702
-#, c-format
-msgid   ":%s 702 %s %s 0x%x %s"
-msgstr  ""
-
-#: ../src/messages.tab:703
-#, c-format
-msgid   ":%s 703 %s :End of /MODLIST."
-msgstr  ""
-
-#: ../src/messages.tab:735
-#, c-format
-msgid   ":%s 704 %s %s :%s"
-msgstr  ""
-
-#: ../src/messages.tab:736
-#, c-format
-msgid   ":%s 705 %s %s :%s"
-msgstr  ""
-
-#: ../src/messages.tab:737
-#, c-format
-msgid   ":%s 706 %s %s :End of /HELP."
-msgstr  ""
-
-#: ../src/messages.tab:741
-#, c-format
-msgid   ":%s 710 %s %s %s!%s@%s :has asked for an invite."
-msgstr  ""
-
-#: ../src/messages.tab:742
-#, c-format
-msgid   ":%s 711 %s %s :Your KNOCK has been delivered."
-msgstr ""
-
-#: ../src/messages.tab:743
-#, c-format
-msgid   ":%s 712 %s %s :Too many KNOCKs (%s)."
-msgstr  ""
-
-#: ../src/messages.tab:744
-#, c-format
-msgid   ":%s 713 %s %s :Channel is open."
-msgstr  ""
-
-#: ../src/messages.tab:745
-#, c-format
-msgid   ":%s 714 %s %s :You are already on that channel."
-msgstr  ""
-
-#: ../src/messages.tab:746
-#, c-format
-msgid   ":%s 715 %s :KNOCKs are disabled."
-msgstr  ""
-
-#: ../src/messages.tab:536
-#, c-format
-msgid	":%s 999 %s :Last Error Message"
-msgstr	""
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/Makefile.in PleXusIRCd-1.17a/modules/Makefile.in
--- ircd-hybrid-7.0/modules/Makefile.in	Sun Jun 16 12:31:25 2002
+++ PleXusIRCd-1.17a/modules/Makefile.in	Wed Jul 30 19:13:12 2003
@@ -62,6 +62,7 @@
   m_dmem.c \
   m_drop.c \
   m_eob.c \
+  m_force.c \
   m_gline.c \
   m_help.c \
   m_info.c \
@@ -76,6 +77,7 @@
   m_llnick.c \
   m_locops.c \
   m_lusers.c \
+  m_map.c \
   m_motd.c \
   m_names.c \
   m_nburst.c \
@@ -89,8 +91,12 @@
   m_restart.c \
   m_resv.c \
   m_set.c \
+  m_sethost.c \
   m_stats.c \
   m_svinfo.c \
+  m_svsalias.c \
+  m_svscmds.c \
+  m_tburst.c \
   m_testline.c \
   m_time.c \
   m_topic.c \
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/m_kick.c PleXusIRCd-1.17a/modules/core/m_kick.c
--- ircd-hybrid-7.0/modules/core/m_kick.c	Sat Feb  1 15:12:24 2003
+++ PleXusIRCd-1.17a/modules/core/m_kick.c	Mon Jun 16 18:24:14 2003
@@ -226,7 +226,7 @@
 			       ":%s!%s@%s KICK %s %s :%s",
 			       source_p->name,
 			       source_p->username,
-			       source_p->host,
+			       source_p->vhost,
 			       name,
 			       who->name, comment);
 	}
@@ -237,7 +237,7 @@
 			       ":%s!%s@%s KICK %s %s :%s",
 			       source_p->name,
 			       source_p->username,
-			       source_p->host,
+			       source_p->vhost,
 			       name, who->name, comment);
 	}
 
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/m_kill.c PleXusIRCd-1.17a/modules/core/m_kill.c
--- ircd-hybrid-7.0/modules/core/m_kill.c	Fri Feb 14 18:01:53 2003
+++ PleXusIRCd-1.17a/modules/core/m_kill.c	Fri Aug 22 07:33:08 2003
@@ -127,10 +127,21 @@
                  me.name, parv[0], target_p->name);
       return;
     }
-
+  if (IsServices(target_p)) {
+        sendto_realops_flags(FLAGS_ALL, L_ALL, "Attempted services kill. From %s (%s@%s), they will now be killed.", source_p->name, source_p->username, source_p->host);
+                     
+        //Reverse the kill
+        target_p = source_p;
+        reason = "Do not attempt to kill a Network Service!";
+  }
+     
+  if ( (IsOper(source_p) && !IsAdmin(source_p)) && (IsOper(target_p) || IsAdmin(target_p)) ) {  
+        sendto_one(source_p, form_str(ERR_NOPRIVILEGES), me.name, source_p->name);
+        return;
+  }
   if(MyConnect(target_p))
     sendto_one(target_p, ":%s!%s@%s KILL %s :%s", 
-	       source_p->name, source_p->username, source_p->host,
+	       source_p->name, source_p->username, source_p->vhost,
 	       target_p->name, reason);
 
   /* Do not change the format of this message.  There's no point in changing messages
@@ -254,7 +265,7 @@
     }
     else
       sendto_one(target_p, ":%s!%s@%s KILL %s :%s",
-		 source_p->name, source_p->username, source_p->host,
+		 source_p->name, source_p->username, source_p->vhost,
 		 target_p->name, reason);
   }
 
@@ -359,7 +370,7 @@
       {
         sendto_one(client_p, ":%s KILL %s :%s!%s!%s!%s (%s)",
                    source_p->name, user,
-                   me.name, source_p->host, source_p->username,
+                   me.name, source_p->vhost, source_p->username,
                    source_p->name, reason);
       }
     else
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/m_message.c PleXusIRCd-1.17a/modules/core/m_message.c
--- ircd-hybrid-7.0/modules/core/m_message.c	Sun Apr  6 12:47:37 2003
+++ PleXusIRCd-1.17a/modules/core/m_message.c	Tue Sep  2 05:10:19 2003
@@ -477,7 +477,7 @@
   }
 
   /* chanops and voiced can flood their own channel with impunity */
-  if ((result = can_send(vchan, source_p)))
+  if ((result = can_send(vchan, source_p, text)))
   {
     if (result == CAN_SEND_OPV ||
         !flood_attack_channel(p_or_n, source_p, vchan, chname))
@@ -551,7 +551,7 @@
 
     sendto_channel_local_butone(source_p, type, vchan, ":%s!%s@%s %s %c%s :%s",
                                 source_p->name, source_p->username,
-                                source_p->host, command, c, chname, text);
+                                source_p->vhost, command, c, chname, text);
   }
   else
   {
@@ -561,7 +561,7 @@
      */
     sendto_channel_local(type, vchan, ":%s!%s@%s %s %c%s :%s",
                          source_p->name, source_p->username,
-                         source_p->host, command, c, chname, text);
+                         source_p->vhost, command, c, chname, text);
   }
 
   if (chptr->chname[0] == '&')
@@ -616,7 +616,7 @@
         sendto_one(target_p, ":%s!%s@%s %s %s :%s",
                    source_p->name,
                    source_p->username,
-                   source_p->host, command, target_p->name, text);
+                   source_p->vhost, command, target_p->name, text);
       }
       else
       {
@@ -635,9 +635,9 @@
                             source_p->name);
 
           sendto_one(target_p,
-                     ":%s NOTICE %s :*** Client %s is messaging you and you are +g",
+                     ":%s NOTICE %s :*** Client %s [%s@%s] is messaging you and you are +g",
                      me.name, target_p->name,
-                     get_client_name(source_p, HIDE_IP));
+                     source_p->name, source_p->username, source_p->vhost);
 
           target_p->localClient->last_caller_id_time = CurrentTime;
 
@@ -708,8 +708,9 @@
       if (target_p->localClient->flood_noticed == 0)
       {
         sendto_realops_flags(FLAGS_BOTS, L_ALL,
-                             "Possible Flooder %s on %s target: %s",
-                             get_client_name(source_p, HIDE_IP),
+                             "Possible Flooder %s [%s@%s] on %s target: %s",
+                             source_p->name, source_p->username,
+                             source_p->vhost,
                              source_p->user->server, target_p->name);
         target_p->localClient->flood_noticed = 1;
         /* add a bit of penalty */
@@ -763,8 +764,9 @@
       if (chptr->flood_noticed == 0)
       {
         sendto_realops_flags(FLAGS_BOTS, L_ALL,
-                             "Possible Flooder %s on %s target: %s",
-                             get_client_name(source_p, HIDE_IP),
+                             "Possible Flooder %s [%s@%s] on %s target: %s",
+                             source_p->name, source_p->username,
+                             source_p->vhost,
                              source_p->user->server, chptr->chname);
         chptr->flood_noticed = 1;
 
@@ -973,7 +975,7 @@
 	{
 	  if (!MyClient(c2ptr)) /* implies mine and an user */
 	    continue;
-	  if ((!host || match(host, c2ptr->host)) &&
+	  if ((!host || match(host, c2ptr->host) || match(host, c2ptr->vhost)) &&
 	      irccmp(user, c2ptr->username) == 0)
 	    {
 	      (*count)++;
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/m_nick-h7.c PleXusIRCd-1.17a/modules/core/m_nick-h7.c
--- ircd-hybrid-7.0/modules/core/m_nick-h7.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/core/m_nick-h7.c	Wed Apr  2 20:29:02 2003
@@ -0,0 +1,1019 @@
+/*
+ *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
+ *  m_nick.c: Sets a users nick.
+ *
+ *  Copyright (C) 2002 by the past and present ircd coders, and others.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *  USA
+ *
+ *  $Id: m_nick.c,v 1.100.2.2 2003/04/03 01:29:02 lusky Exp $
+ */
+
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "hash.h"
+#include "fdlist.h"
+#include "irc_string.h"
+#include "ircd.h"
+#include "numeric.h"
+#include "s_conf.h"
+#include "s_stats.h"
+#include "s_user.h"
+#include "hash.h"
+#include "whowas.h"
+#include "s_serv.h"
+#include "send.h"
+#include "list.h"
+#include "channel.h"
+#include "s_log.h"
+#include "resv.h"
+#include "msg.h"
+#include "parse.h"
+#include "modules.h"
+#include "common.h"
+#include "packet.h"
+
+
+static void mr_nick(struct Client *, struct Client *, int, char**);
+static void m_nick(struct Client *, struct Client *, int, char**);
+static void ms_nick(struct Client *, struct Client *, int, char**);
+
+static void ms_client(struct Client *, struct Client *, int, char**);
+
+static int nick_from_server(struct Client *, struct Client *, int, char **,
+                            time_t, char *);
+static int client_from_server(struct Client *, struct Client *, int, char **,
+                              time_t, char *);
+
+static int check_clean_nick(struct Client *, struct Client *, 
+                            char *, char *, char *);
+static int check_clean_user(struct Client *, char *, char *, char *);
+static int check_clean_host(struct Client *, char *, char *, char *);
+
+static int clean_nick_name(char *);
+static int clean_user_name(char *);
+static int clean_host_name(char *);
+
+static int perform_nick_collides(struct Client *, struct Client *,
+                                 struct Client *, int, char **, time_t, char *);
+                            
+
+struct Message nick_msgtab = {
+  "NICK", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {mr_nick, m_nick, ms_nick, m_nick}
+};
+
+struct Message client_msgtab = {
+  "CLIENT", 0, 0, 10, 0, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_client, m_ignore}
+};
+
+#ifndef STATIC_MODULES
+void
+_modinit(void)
+{
+  mod_add_cmd(&nick_msgtab);
+  mod_add_cmd(&client_msgtab);
+}
+
+void
+_moddeinit(void)
+{
+  mod_del_cmd(&nick_msgtab);
+  mod_del_cmd(&client_msgtab);
+}
+
+const char *_version = "$Revision: 1.100.2.2 $";
+#endif
+
+/*
+ * mr_nick()
+ *
+ *       parv[0] = sender prefix
+ *       parv[1] = nickname
+ */
+static void
+mr_nick(struct Client *client_p, struct Client *source_p,
+        int parc, char *parv[])
+{
+  struct   Client *target_p, *uclient_p;
+  char     nick[NICKLEN];
+  char*    s;
+  dlink_node *ptr;
+   
+  if(parc < 2 || BadPtr(parv[1]))
+  {
+    sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN),
+               me.name, BadPtr(parv[0]) ? "*" : parv[0]);
+    return;
+  }
+
+  /* Terminate the nick at the first ~ */
+  if ((s = strchr(parv[1], '~')))
+    *s = '\0';
+                               
+  /* copy the nick and terminate it */
+  strlcpy(nick, parv[1], NICKLEN);
+
+  /* check the nickname is ok */
+  if(!clean_nick_name(nick))
+  {
+    sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME),
+               me.name, BadPtr(parv[0]) ? "*" : parv[0], parv[1]);
+    return;
+  }
+
+  /* check if the nick is resv'd */
+  if(find_nick_resv(nick) &&
+     !(IsOper(source_p) && ConfigChannel.oper_pass_resv))
+  {
+    sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
+               me.name, BadPtr(parv[0]) ? "*" : parv[0], nick);
+    return;
+  }
+
+  if ((target_p = find_client(nick)) == NULL)
+  {
+    if(!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
+    {
+      /* We don't know anyone called nick, but our hub might */
+      for(ptr = unknown_list.head; ptr; ptr = ptr->next)
+      {
+        uclient_p = ptr->data;
+
+	if(!strcmp(nick, uclient_p->llname))
+	{
+	
+	  /* We're already waiting for a reply about this nick
+	   * for someone else. */
+
+	  sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, "*", nick);
+	  return;
+	}
+      }
+
+      /* Set their llname so we can find them later */
+      strcpy(source_p->llname, nick);
+
+      /* Ask the hub about their requested name */
+      sendto_one(uplink, ":%s NBURST %s %s !%s", me.name, nick,
+                 nick, nick);
+
+      /* wait for LLNICK */
+      return;
+    }
+    else
+    {
+      set_initial_nick(client_p, source_p, nick);
+      return;
+    }
+  }
+  else if(source_p == target_p)
+  {
+    strcpy(source_p->name, nick);
+    return;
+  }
+  else
+  {
+    sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name, "*", nick);
+  }
+}
+
+/*
+ * m_nick()
+ *
+ *     parv[0] = sender prefix
+ *     parv[1] = nickname
+ */
+ static void
+ m_nick(struct Client *client_p, struct Client *source_p,
+	int parc, char *parv[])
+{
+  char     nick[NICKLEN];
+  struct   Client *target_p;
+
+  /* XXX BadPtr is needed */
+  if(parc < 2 || BadPtr(parv[1]))
+  {
+    sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN),
+               me.name, parv[0]);
+    return;
+  }
+
+  /* mark end of grace period, to prevent nickflooding */
+  if(!IsFloodDone(source_p))
+    flood_endgrace(source_p);
+
+  /* terminate nick to NICKLEN */
+  strlcpy(nick, parv[1], NICKLEN);
+
+  /* check the nickname is ok */
+  if(!clean_nick_name(nick))
+  {
+    sendto_one(source_p, form_str(ERR_ERRONEUSNICKNAME),
+               me.name, parv[0], nick);
+    return;
+  }
+
+  if(find_nick_resv(nick) &&
+     !(IsOper(source_p) && ConfigChannel.oper_pass_resv))
+  {
+    sendto_one(source_p, form_str(ERR_UNAVAILRESOURCE),
+               me.name, parv[0], nick);
+    return;
+  }
+
+  if ((target_p = find_client(nick)))
+  {
+    /* If(target_p == source_p) the client is changing nicks between
+     * equivalent nicknames ie: [nick] -> {nick}
+     */
+
+    if(target_p == source_p)
+    {
+      /* check the nick isnt exactly the same */
+      if(strcmp(target_p->name, nick))
+      {
+        change_local_nick(client_p, source_p, nick);
+	return;
+      }
+      else
+      {
+        /* client is doing :old NICK old
+	 * ignore it..
+	 */
+        return;
+      }
+    }
+
+    /* if the client that has the nick isnt registered yet (nick but no
+     * user) then drop the unregged client
+     */
+    if(IsUnknown(target_p))
+    {
+      /* the old code had an if(MyConnect(target_p)) here.. but I cant see
+       * how that can happen, m_nick() is local only --fl_
+       */
+      
+      exit_client(NULL, target_p, &me, "Overridden");
+      change_local_nick(client_p, source_p, nick);
+      return;
+    }
+    else
+    {
+      sendto_one(source_p, form_str(ERR_NICKNAMEINUSE), me.name,
+                 parv[0], nick);
+      return;
+    }
+
+  }
+  else
+  {
+    if(!ServerInfo.hub && uplink && IsCapable(uplink, CAP_LL))
+    {
+      /* The uplink might know someone by this name already. */
+      sendto_one(uplink, ":%s NBURST %s %s %s", me.name, nick,
+                 nick, source_p->name);
+      return;
+    }
+    else
+    {
+      change_local_nick(client_p,source_p,nick);
+      return;
+    }
+  }
+}
+
+/*
+ * ms_nick()
+ *      
+ * server -> server nick change
+ *    parv[0] = sender prefix
+ *    parv[1] = nickname
+ *    parv[2] = TS when nick change
+ *
+ * server introducing new nick
+ *    parv[0] = sender prefix
+ *    parv[1] = nickname
+ *    parv[2] = hop count
+ *    parv[3] = TS
+ *    parv[4] = umode
+ *    parv[5] = username
+ *    parv[6] = hostname
+ *    parv[7] = server
+ *    parv[8] = ircname
+ */
+static void
+ms_nick(struct Client *client_p, struct Client *source_p,
+	int parc, char *parv[])
+{
+  struct Client* target_p;
+  char     nick[NICKLEN];
+  time_t   newts = 0;
+
+  /* XXX BadPtr is needed */
+  if(parc < 2 || BadPtr(parv[1]))
+  {
+    sendto_one(source_p, form_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]);
+    return;
+  }
+
+  /* parc == 3 on nickchange, parc == 9 on new nick */
+  if((IsClient(source_p) && (parc != 3)) || (IsServer(source_p) && (parc != 9)))
+  {
+    char tbuf[BUFSIZE] = { 0 };
+    int j;
+
+    for(j = 0; j < parc; j++)
+    {
+      strcat(tbuf, parv[j]);
+      strcat(tbuf, " ");
+    }
+
+    sendto_realops_flags(FLAGS_ALL, L_ALL,
+                         "Dropping server %s due to (invalid) command 'NICK' "
+                         "with only %d arguments.  (Buf: '%s')",
+                         client_p->name, parc, tbuf);
+    ilog(L_CRIT, "Insufficient parameters (%d) for command 'NICK' from %s.  Buf: %s",
+         parc, client_p->name, tbuf);
+    exit_client(client_p, client_p, client_p, "Not enough arguments to server command.");
+    return;
+  }
+
+  /* fix the length of the nick */
+  strlcpy(nick, parv[1], NICKLEN);
+
+  if(check_clean_nick(client_p, source_p, nick, parv[1],
+                      (parc == 9 ? parv[7] : (char *) source_p->user->server)))
+    return;
+
+  if (parc == 9)
+    {
+      if (check_clean_user(client_p, nick, parv[5], parv[7]) ||
+          check_clean_host(client_p, nick, parv[6], parv[7]))
+        return;
+
+      /* check the length of the clients gecos */
+      if(strlen(parv[8]) > REALLEN)
+        {
+          sendto_realops_flags(FLAGS_ALL, L_ALL, "Long realname from server %s for %s",
+                         parv[7], parv[1]);
+          parv[8][REALLEN] = '\0';
+        }
+
+      if (IsServer(source_p))
+        newts = atol(parv[3]);
+    }
+  else
+    {
+      if (!IsServer(source_p))
+        newts = atol(parv[2]);
+    }
+
+  /* if the nick doesnt exist, allow it and process like normal */
+  if (!(target_p = find_client(nick)))
+  {
+    nick_from_server(client_p,source_p,parc,parv,newts,nick);
+    return;
+  }
+
+  /* we're not living in the past anymore, an unknown client is local only. */
+  if(IsUnknown(target_p))
+  {
+    exit_client(NULL, target_p, &me, "Overridden");
+    nick_from_server(client_p,source_p,parc,parv,newts,nick);
+    return;
+  }
+
+  if(target_p == source_p)
+  {
+    if(strcmp(target_p->name, nick))
+    {
+      /* client changing case of nick */
+      nick_from_server(client_p,source_p,parc,parv,newts,nick);
+      return;
+    }
+    else
+      /* client not changing nicks at all */
+      return;
+  }
+
+  perform_nick_collides(source_p, client_p, target_p,
+                        parc, parv, newts, nick);
+			
+
+}
+
+/*
+ * ms_client()
+ */
+static void
+ms_client(struct Client *client_p, struct Client *source_p,
+	  int parc, char *parv[])
+{
+  struct Client* target_p;
+  char     nick[NICKLEN];
+  time_t   newts = 0;
+  char    *id;
+  char    *name;
+
+  id = parv[8];
+  name = parv[9];
+
+  /* XXX can this happen ? */
+  if (BadPtr(parv[1]))
+    return;
+
+  /* parse the nickname */
+  strlcpy(nick, parv[1], NICKLEN);
+
+  /* check the nicknames, usernames and hostnames are ok */
+  if(check_clean_nick(client_p, source_p, nick, parv[1], parv[7]) ||
+     check_clean_user(client_p, nick, parv[5], parv[7]) ||
+     check_clean_host(client_p, nick, parv[6], parv[7]))
+    return;
+
+  /* check length of clients gecos */
+  if (strlen(name) > REALLEN)
+  {
+    sendto_realops_flags(FLAGS_ALL, L_ALL, "Long realname from server %s for %s",
+                         parv[0], parv[1]);
+    name[REALLEN] = '\0';			 
+  }
+
+  newts = atol(parv[3]);
+ 
+  /* if there is an ID collision, kill our client, and kill theirs.
+   * this may generate 401's, but it ensures that both clients always
+   * go, even if the other server refuses to do the right thing.
+   */
+  if((target_p = find_id(id)))
+  {
+    sendto_realops_flags(FLAGS_ALL, L_ALL,
+		         "ID collision on %s(%s <- %s)(both killed)",
+			 target_p->name, target_p->from->name,
+			 client_p->name);
+
+    if(ServerInfo.hub && IsCapable(client_p, CAP_LL))
+      add_lazylinkclient(client_p, source_p);
+
+    kill_client_ll_serv_butone(NULL, target_p, "%s (ID collision)",
+		               me.name);
+
+    ServerStats->is_kill++;
+	    
+    SetKilled(target_p);
+    exit_client(client_p, target_p, &me, "ID Collision");
+    return;
+  }
+    
+  if (!(target_p = find_client(nick)))
+  {
+    client_from_server(client_p,source_p,parc,parv,newts,nick);
+    return;
+  }
+
+
+  if(IsUnknown(target_p))
+  {
+    exit_client(NULL, target_p, &me, "Overridden");
+    client_from_server(client_p,source_p,parc,parv,newts,nick);
+    return;
+  }
+
+  perform_nick_collides(source_p, client_p, target_p,
+                        parc, parv, newts, nick);
+}			  
+
+
+/* 
+ * check_clean_nick()
+ * 
+ * input	- pointer to source
+ *		- nickname
+ *		- truncated nickname
+ *		- origin of client
+ * output	- none
+ * side effects - if nickname is erroneous, or a different length to
+ *                truncated nickname, return 1
+ */
+static int
+check_clean_nick(struct Client *client_p, struct Client *source_p, 
+		 char *nick, char *newnick, char *server)
+{
+  /* the old code did some wacky stuff here, if the nick is invalid, kill it
+   * and dont bother messing at all
+   */
+
+  if(!clean_nick_name(nick) || strcmp(nick, newnick))
+  {
+    ServerStats->is_kill++;
+    sendto_realops_flags(FLAGS_DEBUG, L_ALL,
+                         "Bad Nick: %s From: %s(via %s)",
+                         nick, server, client_p->name);
+
+    sendto_one(client_p, ":%s KILL %s :%s (Bad Nickname)",
+               me.name, newnick, me.name);
+
+    /* bad nick change */
+    if(source_p != client_p)
+    {
+      kill_client_ll_serv_butone(client_p, source_p,
+                                 "%s (Bad Nickname)",
+				 me.name);
+      SetKilled(source_p);
+      exit_client(client_p, source_p, &me, "Bad Nickname");
+    }
+
+    return (1);
+  }
+
+  return (0);
+}
+
+/* check_clean_user()
+ * 
+ * input	- pointer to client sending data
+ *              - nickname
+ *              - username to check
+ *		- origin of NICK
+ * output	- none
+ * side effects - if username is erroneous, return 1
+ */
+static int
+check_clean_user(struct Client *client_p, char *nick, 
+		 char *user, char *server)
+{
+  if(strlen(user) > USERLEN)
+  {
+    ServerStats->is_kill++;
+    sendto_realops_flags(FLAGS_DEBUG, L_ALL,
+                         "Long Username: %s Nickname: %s From: %s(via %s)",
+			 user, nick, server, client_p->name);
+
+    sendto_one(client_p, ":%s KILL %s :%s (Bad Username)",
+               me.name, nick, me.name);
+  
+    return (1);
+  }
+
+  if(!clean_user_name(user))
+    sendto_realops_flags(FLAGS_DEBUG, L_ALL,
+                         "Bad Username: %s Nickname: %s From: %s(via %s)",
+			 user, nick, server, client_p->name);
+			 
+  return (0);
+}
+
+/* check_clean_host()
+ * 
+ * input	- pointer to client sending us data
+ *              - nickname
+ *              - hostname to check
+ *		- source name
+ * output	- none
+ * side effects - if hostname is erroneous, return 1
+ */
+static int
+check_clean_host(struct Client *client_p, char *nick,
+		 char *host, char *server)
+{
+  if(strlen(host) > HOSTLEN)
+  {
+    ServerStats->is_kill++;
+    sendto_realops_flags(FLAGS_DEBUG, L_ALL,
+                         "Long Hostname: %s Nickname: %s From: %s(via %s)",
+			 host, nick, server, client_p->name);
+
+    sendto_one(client_p, ":%s KILL %s :%s (Bad Hostname)",
+               me.name, nick, me.name);
+
+    return (1);
+  }
+
+  if(!clean_host_name(host))
+    sendto_realops_flags(FLAGS_DEBUG, L_ALL,
+                         "Bad Hostname: %s Nickname: %s From: %s(via %s)",
+			 host, nick, server, client_p->name);
+
+  return (0);
+}
+
+/* clean_nick_name()
+ *
+ * input	- nickname
+ * output	- none
+ * side effects - walks through the nickname, returning 0 if erroneous
+ */
+static int
+clean_nick_name(char *nick)
+{
+  assert(nick);
+  if(nick == NULL)
+    return (0);
+
+  /* nicks cant start with a digit or - or be 0 length */
+  /* This closer duplicates behaviour of hybrid-6 */
+
+  if (*nick == '-' || IsDigit(*nick) || *nick == '\0')
+    return (0);
+
+  for(; *nick; nick++)
+  {
+    if(!IsNickChar(*nick))
+      return (0);
+  }
+
+  return (1);
+}
+
+/* clean_user_name()
+ *
+ * input	- username
+ * output	- none
+ * side effects - walks through the username, returning 0 if erroneous
+ */
+static int
+clean_user_name(char *user)
+{
+  assert(user);
+  if(user == NULL)
+    return 0;
+    
+  for(; *user; user++)
+  {
+    if(!IsUserChar(*user))
+      return 0;
+    
+  }
+
+  return 1;
+}
+
+/* clean_host_name()
+ * input	- hostname
+ * output	- none
+ * side effects - walks through the hostname, returning 0 if erroneous
+ */
+static int
+clean_host_name(char *host)
+{
+  assert(host);
+  if(host == NULL)
+    return 0;
+  for(; *host; host++)
+  {
+    if(!IsHostChar(*host))
+      return 0;
+  }
+
+  return 1;
+}
+
+
+/*
+ * nick_from_server()
+ */
+static int
+nick_from_server(struct Client *client_p, struct Client *source_p, int parc,
+                 char *parv[], time_t newts,char *nick)
+{
+  if(IsServer(source_p))
+  {
+    /* A server introducing a new client, change source */
+    source_p = make_client(client_p);
+    add_client_to_list(source_p);
+
+    /* We don't need to introduce leafs clients back to them! */
+    if (ConfigFileEntry.hub && IsCapable(client_p, CAP_LL))
+      add_lazylinkclient(client_p, source_p);
+
+    if(parc > 2)
+      source_p->hopcount = atoi(parv[2]);
+    if(newts)
+      source_p->tsinfo = newts;
+    else
+    {
+      newts = source_p->tsinfo = CurrentTime;
+      ts_warn("Remote nick %s (%s) introduced without a TS", nick, parv[0]);
+    }
+
+    /* copy the nick in place */
+    (void)strcpy(source_p->name, nick);
+    (void)add_to_client_hash_table(nick, source_p);
+
+    if (parc > 8)
+    {
+       int   flag;
+       char *m;
+
+       /* parse usermodes */
+       m = &parv[4][1];
+       while (*m)
+       {
+         flag = user_modes_from_c_to_bitmask[(unsigned char)*m];
+	 if(!(source_p->umodes & FLAGS_INVISIBLE) && (flag & FLAGS_INVISIBLE))
+	   Count.invisi++;
+	 if(!(source_p->umodes & FLAGS_OPER) && (flag & FLAGS_OPER))
+	   Count.oper++;
+
+	 source_p->umodes |= flag & SEND_UMODES;
+	 m++;
+      }
+
+      return do_remote_user(nick, client_p, source_p, parv[5], parv[6],
+                            parv[7], parv[8], NULL);
+    }
+  }
+  else if(source_p->name[0])
+  {
+    /* client changing their nick */
+    if(irccmp(parv[0], nick))
+      source_p->tsinfo = newts ? newts : CurrentTime;
+
+    sendto_common_channels_local(source_p, 1,
+                                 ":%s!%s@%s NICK :%s",
+                                 source_p->name,source_p->username,source_p->host,
+                                 nick);
+
+    if (source_p->user)
+    {
+      add_history(source_p,1);
+      sendto_server(client_p, source_p, NULL, NOCAPS, NOCAPS, NOFLAGS,
+                    ":%s NICK %s :%lu",
+		      parv[0], nick, (unsigned long) source_p->tsinfo);
+    }
+  }
+
+  /* set the new nick name */
+  if(source_p->name[0])
+    del_from_client_hash_table(source_p->name, source_p);
+
+  strcpy(source_p->name, nick);
+  add_to_client_hash_table(nick, source_p);
+
+  /* remove all accepts pointing to the client */
+  del_all_accepts(source_p);
+
+  return 0;
+}
+
+
+/*
+ * client_from_server()
+ */
+static int
+client_from_server(struct Client *client_p, struct Client *source_p, int parc,
+                   char *parv[], time_t newts,char *nick)
+{
+  char *name;
+  char *id;
+  int flag;
+  char *m;
+
+  id = parv[8];
+  name = parv[9];
+
+  source_p = make_client(client_p);
+  add_client_to_list(source_p);
+
+  /* We don't need to introduce leafs clients back to them! */
+  if (ConfigFileEntry.hub && IsCapable(client_p, CAP_LL))
+    add_lazylinkclient(client_p, source_p);
+
+  source_p->hopcount = atoi(parv[2]);
+  source_p->tsinfo = newts;
+
+  /* copy the nick in place */
+  (void)strcpy(source_p->name, nick);
+  (void)add_to_client_hash_table(nick, source_p);
+  add_to_id_hash_table(id, source_p);
+
+  /* parse usermodes */
+  m = &parv[4][1];
+  while (*m)
+  {
+    flag = user_modes_from_c_to_bitmask[(unsigned char)*m];
+    if(flag & FLAGS_INVISIBLE)
+      Count.invisi++;
+    if(flag & FLAGS_OPER)
+      Count.oper++;
+
+    source_p->umodes |= flag & SEND_UMODES;
+    m++;
+
+  }
+
+  return do_remote_user(nick, client_p, source_p, parv[5], parv[6],
+                        parv[7], name, id);
+}			
+  
+static int 
+perform_nick_collides(struct Client *source_p, struct Client *client_p, 
+                      struct Client *target_p, int parc, char *parv[], 
+		      time_t newts, char *nick)
+{
+  int sameuser;
+  
+  /* server introducing new nick */
+  if(IsServer(source_p))
+  {
+    /* if we dont have a ts, or their TS's are the same, kill both */
+    if(!newts || !target_p->tsinfo ||
+       (newts == target_p->tsinfo))
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,
+                           "Nick collision on %s(%s <- %s)(both killed)",
+			   target_p->name, target_p->from->name,
+			   client_p->name);
+      
+      if(ServerInfo.hub && IsCapable(client_p,CAP_LL))
+        add_lazylinkclient(client_p, target_p);
+
+      kill_client_ll_serv_butone(NULL, target_p,
+                                 "%s (Nick collision (new))",
+				 me.name);
+      ServerStats->is_kill++;
+      sendto_one(target_p, form_str(ERR_NICKCOLLISION),
+                 me.name, target_p->name, target_p->name);
+
+      SetKilled(target_p);
+      exit_client(client_p, target_p, &me, "Nick collision (new)");
+      return 0;
+    }
+    /* the timestamps are different */
+    else
+    {
+      sameuser = (target_p->user) && !irccmp(target_p->username, parv[5])
+                 && !irccmp(target_p->host, parv[6]);
+   
+      /* if the users are the same (loaded a client on a different server)
+       * and the new users ts is older, or the users are different and the
+       * new users ts is newer, ignore the new client and let it do the kill
+       */
+      if ((sameuser && newts < target_p->tsinfo) ||
+         (!sameuser && newts > target_p->tsinfo))
+      {
+        client_burst_if_needed(client_p, target_p);
+	return 0;
+      }
+      else
+      {
+        if(sameuser)
+	  sendto_realops_flags(FLAGS_ALL, L_ALL,
+	                  "Nick collision on %s(%s <- %s)(older killed)",
+			  target_p->name, target_p->from->name,
+			  client_p->name);
+        else
+	  sendto_realops_flags(FLAGS_ALL, L_ALL,
+	                  "Nick collision on %s(%s <- %s)(newer killed)",
+			  target_p->name, target_p->from->name,
+			  client_p->name);
+
+        ServerStats->is_kill++;
+	sendto_one(target_p, form_str(ERR_NICKCOLLISION),
+	           me.name, target_p->name, target_p->name);
+
+        /* if it came from a LL server, itd have been source_p,
+	 * so we dont need to mark target_p as known
+	 */
+	kill_client_ll_serv_butone(source_p, target_p,
+	                           "%s (Nick collision (new))",
+				   me.name);
+
+        SetKilled(target_p);
+	exit_client(client_p, target_p, &me, "Nick collision");
+	
+	if(parc == 9)
+	  nick_from_server(client_p,source_p,parc,parv,newts,nick);
+	else if(parc == 10)
+	  client_from_server(client_p,source_p,parc,parv,newts,nick);
+	  
+	return 0;
+      }
+    }
+  }
+
+  /* its a client changing nick and causing a collide */
+  if(!newts || !target_p->tsinfo || (newts == target_p->tsinfo) ||
+       !source_p->user)
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,
+                 "Nick change collision from %s to %s(%s <- %s)(both killed)",
+		 source_p->name, target_p->name, target_p->from->name,
+		 client_p->name);
+    
+      ServerStats->is_kill++;
+      sendto_one(target_p, form_str(ERR_NICKCOLLISION),
+                 me.name, target_p->name, target_p->name);
+
+      /* if we got the message from a LL, it knows about source_p */
+      kill_client_ll_serv_butone(NULL, source_p,
+                                  "%s (Nick change collision)",
+				  me.name);
+
+      ServerStats->is_kill++;
+      /* If we got the message from a LL, ensure it gets the kill */
+      if(ServerInfo.hub && IsCapable(client_p,CAP_LL))
+        add_lazylinkclient(client_p, target_p);
+
+      kill_client_ll_serv_butone(NULL, target_p,
+                                 "%s (Nick change collision)",
+				 me.name);
+
+      SetKilled(target_p);
+      exit_client(NULL, target_p, &me, "Nick collision(new)");
+      SetKilled(source_p);
+      exit_client(client_p, source_p, &me, "Nick collision(old)");
+      return 0;
+    }
+    else
+    {
+      sameuser = !irccmp(target_p->username, source_p->username) &&
+                 !irccmp(target_p->host, source_p->host);
+
+      if ((sameuser && newts < target_p->tsinfo) ||
+          (!sameuser && newts > target_p->tsinfo))
+      {
+        if(sameuser)
+	  sendto_realops_flags(FLAGS_ALL, L_ALL,
+ 	       "Nick change collision from %s to %s(%s <- %s)(older killed)",
+	       source_p->name, target_p->name, target_p->from->name,
+	       client_p->name);
+        else
+	  sendto_realops_flags(FLAGS_ALL, L_ALL,
+	       "Nick change collision from %s to %s(%s <- %s)(newer killed)",
+	       source_p->name, target_p->name, target_p->from->name,
+	       client_p->name);
+
+        ServerStats->is_kill++;
+
+	/* this won't go back to the incoming link, so LL doesnt matter */
+        kill_client_ll_serv_butone(client_p, source_p,
+	                           "%s (Nick change collision)",
+				   me.name);
+
+        SetKilled(source_p);
+	
+	if(sameuser)
+	  exit_client(client_p, source_p, &me, "Nick collision(old)");
+	else
+	  exit_client(client_p, source_p, &me, "Nick collision(new)");
+	return 0;
+     }
+     else
+     {
+       if(sameuser)
+         sendto_realops_flags(FLAGS_ALL, L_ALL,
+	                      "Nick collision on %s(%s <- %s)(older killed)",
+			      target_p->name, target_p->from->name,
+			      client_p->name);
+       else
+         sendto_realops_flags(FLAGS_ALL, L_ALL,
+	                      "Nick collision on %s(%s <- %s)(newer killed)",
+			      target_p->name, target_p->from->name,
+			      client_p->name);
+  			      
+       kill_client_ll_serv_butone(source_p, target_p,
+                                 "%s (Nick collision)",
+				 me.name);
+
+       ServerStats->is_kill++;
+       sendto_one(target_p, form_str(ERR_NICKCOLLISION),
+                  me.name, target_p->name, target_p->name);
+
+       SetKilled(target_p);
+       exit_client(client_p, target_p, &me, "Nick collision");
+     }
+   }
+
+   /*
+   if(HasID(source_p))
+     client_from_server(client_p,source_p,parc,parv,newts,nick);
+   else
+   */
+   
+   /* we should only ever call nick_from_server() here, as
+    * this is a client changing nick, not a new client
+    */
+   nick_from_server(client_p,source_p,parc,parv,newts,nick);
+
+  return 0;
+}
+
+	    
+
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/m_nick.c PleXusIRCd-1.17a/modules/core/m_nick.c
--- ircd-hybrid-7.0/modules/core/m_nick.c	Wed Apr  2 20:29:02 2003
+++ PleXusIRCd-1.17a/modules/core/m_nick.c	Wed Aug 20 19:53:38 2003
@@ -19,7 +19,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_nick.c,v 1.100.2.2 2003/04/03 01:29:02 lusky Exp $
+ *  $Id: m_nick.c,v 1.100.2.3 2003/08/18 01:29:02 static Exp $
  */
 
 #include "stdinc.h"
@@ -78,7 +78,7 @@
 };
 
 struct Message client_msgtab = {
-  "CLIENT", 0, 0, 10, 0, MFLG_SLOW, 0,
+  "CLIENT", 0, 0, 11, 0, MFLG_SLOW, 0,
   {m_ignore, m_ignore, ms_client, m_ignore}
 };
 
@@ -97,7 +97,7 @@
   mod_del_cmd(&client_msgtab);
 }
 
-const char *_version = "$Revision: 1.100.2.2 $";
+const char *_version = "$Revision: 1.100.2.3 $";
 #endif
 
 /*
@@ -314,8 +314,10 @@
  *    parv[4] = umode
  *    parv[5] = username
  *    parv[6] = hostname
- *    parv[7] = server
- *    parv[8] = ircname
+ *    parv[7] = vhost
+ *    parv[8] = server
+ *    parv[9] = svsid
+ *    parv[10] = ircname
  */
 static void
 ms_nick(struct Client *client_p, struct Client *source_p,
@@ -332,8 +334,8 @@
     return;
   }
 
-  /* parc == 3 on nickchange, parc == 9 on new nick */
-  if((IsClient(source_p) && (parc != 3)) || (IsServer(source_p) && (parc != 9)))
+  /* parc == 3 on nickchange, parc == 11 on new nick */
+  if((IsClient(source_p) && (parc != 3)) || (IsServer(source_p) && (parc != 11)))
   {
     char tbuf[BUFSIZE] = { 0 };
     int j;
@@ -358,21 +360,21 @@
   strlcpy(nick, parv[1], NICKLEN);
 
   if(check_clean_nick(client_p, source_p, nick, parv[1],
-                      (parc == 9 ? parv[7] : (char *) source_p->user->server)))
+                      (parc == 11 ? parv[8] : (char *) source_p->user->server)))
     return;
 
-  if (parc == 9)
+  if (parc == 11)
     {
-      if (check_clean_user(client_p, nick, parv[5], parv[7]) ||
-          check_clean_host(client_p, nick, parv[6], parv[7]))
+      if (check_clean_user(client_p, nick, parv[5], parv[8]) ||
+          check_clean_host(client_p, nick, parv[6], parv[8]))
         return;
 
       /* check the length of the clients gecos */
-      if(strlen(parv[8]) > REALLEN)
+      if(strlen(parv[10]) > REALLEN)
         {
           sendto_realops_flags(FLAGS_ALL, L_ALL, "Long realname from server %s for %s",
-                         parv[7], parv[1]);
-          parv[8][REALLEN] = '\0';
+                         parv[8], parv[1]);
+          parv[10][REALLEN] = '\0';
         }
 
       if (IsServer(source_p))
@@ -431,8 +433,8 @@
   char    *id;
   char    *name;
 
-  id = parv[8];
-  name = parv[9];
+  id = parv[9];
+  name = parv[10];
 
   /* XXX can this happen ? */
   if (BadPtr(parv[1]))
@@ -442,9 +444,9 @@
   strlcpy(nick, parv[1], NICKLEN);
 
   /* check the nicknames, usernames and hostnames are ok */
-  if(check_clean_nick(client_p, source_p, nick, parv[1], parv[7]) ||
-     check_clean_user(client_p, nick, parv[5], parv[7]) ||
-     check_clean_host(client_p, nick, parv[6], parv[7]))
+  if(check_clean_nick(client_p, source_p, nick, parv[1], parv[8]) ||
+     check_clean_user(client_p, nick, parv[5], parv[8]) ||
+     check_clean_host(client_p, nick, parv[6], parv[8]))
     return;
 
   /* check length of clients gecos */
@@ -715,6 +717,7 @@
     /* copy the nick in place */
     (void)strcpy(source_p->name, nick);
     (void)add_to_client_hash_table(nick, source_p);
+    strncpy(source_p->vhost, parv[6], HOSTLEN+1);
 
     if (parc > 8)
     {
@@ -731,12 +734,22 @@
 	 if(!(source_p->umodes & FLAGS_OPER) && (flag & FLAGS_OPER))
 	   Count.oper++;
 
+	 if(!(source_p->umodes & FLAGS_HIDDEN) && (flag & FLAGS_HIDDEN)) {  
+                if (parv[7][0] != '*')
+                        strncpy(source_p->vhost, parv[7], HOSTLEN +1);
+                else {
+                        /* THIS SHOULD NEVER HAPPEN */
+                        sendto_realops_flags(FLAGS_DEBUG, L_ALL, "Warning, Server %s sent a Invalid Vhost in nick_from_server", source_p->from->name);
+                        strncpy(source_p->vhost, source_p->host, HOSTLEN +1);
+                }
+         }
+
 	 source_p->umodes |= flag & SEND_UMODES;
 	 m++;
       }
 
       return do_remote_user(nick, client_p, source_p, parv[5], parv[6],
-                            parv[7], parv[8], NULL);
+                            parv[8], parv[10], NULL, atol(parv[9]));
     }
   }
   else if(source_p->name[0])
@@ -745,9 +758,9 @@
     if(irccmp(parv[0], nick))
       source_p->tsinfo = newts ? newts : CurrentTime;
 
-    sendto_common_channels_local(source_p, 1,
+    sendto_common_channels_local(source_p,
                                  ":%s!%s@%s NICK :%s",
-                                 source_p->name,source_p->username,source_p->host,
+                                 source_p->name,source_p->username,source_p->vhost,
                                  nick);
 
     if (source_p->user)
@@ -785,8 +798,8 @@
   int flag;
   char *m;
 
-  id = parv[8];
-  name = parv[9];
+  id = parv[9];
+  name = parv[11];
 
   source_p = make_client(client_p);
   add_client_to_list(source_p);
@@ -802,6 +815,7 @@
   (void)strcpy(source_p->name, nick);
   (void)add_to_client_hash_table(nick, source_p);
   add_to_id_hash_table(id, source_p);
+  strncpy(source_p->vhost, parv[6], HOSTLEN+1);
 
   /* parse usermodes */
   m = &parv[4][1];
@@ -813,13 +827,22 @@
     if(flag & FLAGS_OPER)
       Count.oper++;
 
+    if(!(source_p->umodes & FLAGS_HIDDEN) && (flag & FLAGS_HIDDEN)) {
+                if (parv[7][0] != '*')
+                        strncpy(source_p->vhost, parv[7], HOSTLEN +1);
+                else {
+                        sendto_realops_flags(FLAGS_DEBUG, L_ALL, "Warning %s sent a Invalid Hidden Host command in client_from_serv_server", source_p->from->name);
+                        strncpy(source_p->vhost, source_p->host, HOSTLEN +1);
+                }
+         }
+
     source_p->umodes |= flag & SEND_UMODES;
     m++;
 
   }
 
   return do_remote_user(nick, client_p, source_p, parv[5], parv[6],
-                        parv[7], name, id);
+                        parv[8], name, id, atol(parv[10]));
 }			
   
 static int 
@@ -898,9 +921,9 @@
         SetKilled(target_p);
 	exit_client(client_p, target_p, &me, "Nick collision");
 	
-	if(parc == 9)
+	if(parc == 11)
 	  nick_from_server(client_p,source_p,parc,parv,newts,nick);
-	else if(parc == 10)
+	else if(parc == 12)
 	  client_from_server(client_p,source_p,parc,parv,newts,nick);
 	  
 	return 0;
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/m_part.c PleXusIRCd-1.17a/modules/core/m_part.c
--- ircd-hybrid-7.0/modules/core/m_part.c	Thu Feb  6 03:46:06 2003
+++ PleXusIRCd-1.17a/modules/core/m_part.c	Thu Jul 24 08:34:46 2003
@@ -165,7 +165,7 @@
    */
   if (reason[0] &&
       (is_any_op(chptr, source_p) || !MyConnect(source_p) ||
-       ((can_send(chptr, source_p) > 0 && 
+       ((can_send(chptr, source_p, NULL) > 0 && 
          (source_p->firsttime + ConfigFileEntry.anti_spam_exit_message_time)
          < CurrentTime))))
   {
@@ -179,7 +179,7 @@
                          chptr, ":%s!%s@%s PART %s :%s",
                          source_p->name,
                          source_p->username,
-                         source_p->host,
+                         source_p->vhost,
                          bchan->chname,
                          reason);
   }
@@ -193,7 +193,7 @@
                          chptr, ":%s!%s@%s PART %s",
                          source_p->name,
                          source_p->username,
-                         source_p->host,
+                         source_p->vhost,
                          bchan->chname);
   }
   remove_user_from_channel(chptr, source_p);
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/m_sjoin.c PleXusIRCd-1.17a/modules/core/m_sjoin.c
--- ircd-hybrid-7.0/modules/core/m_sjoin.c	Thu Jul  4 12:07:23 2002
+++ PleXusIRCd-1.17a/modules/core/m_sjoin.c	Wed Aug 20 23:19:06 2003
@@ -178,6 +178,18 @@
       case 't':
         mode.mode |= MODE_TOPICLIMIT;
         break;
+      case 'Z':
+	mode.mode |= MODE_BW;
+	break;
+      case 'c':
+	mode.mode |= MODE_NOCOLOUR;
+	break;
+      case 'R':
+	mode.mode |= MODE_REGONLY;
+	break;
+      case 'O':
+	mode.mode |= MODE_OPERONLY;
+	break;
 #ifdef ANONOPS
       case 'a':
 	if(ConfigChannel.use_anonops)
@@ -579,7 +591,7 @@
 	      sendto_channel_local(ALL_MEMBERS,chptr, ":%s!%s@%s JOIN :%s",
 				   target_p->name,
 				   target_p->username,
-				   target_p->host,
+				   target_p->vhost,
 				   top_chptr->chname);
 	    }
 	  else
@@ -588,7 +600,7 @@
 	      sendto_channel_local(ALL_MEMBERS,chptr, ":%s!%s@%s JOIN :%s",
 				   target_p->name,
 				   target_p->username,
-				   target_p->host,
+				   target_p->vhost,
 				   parv[2]);
 	    }
 	}
@@ -737,6 +749,10 @@
   { MODE_MODERATED,  'm' },
   { MODE_INVITEONLY, 'i' },
   { MODE_PRIVATE,    'p' },
+  { MODE_BW, 	     'Z' },
+  { MODE_NOCOLOUR,   'c' },
+  { MODE_REGONLY,    'R' },
+  { MODE_OPERONLY,   'O' },
 #ifdef ANONOPS
   { MODE_HIDEOPS,    'a' },
 #endif
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/m_squit.c PleXusIRCd-1.17a/modules/core/m_squit.c
--- ircd-hybrid-7.0/modules/core/m_squit.c	Fri Feb 14 18:01:53 2003
+++ PleXusIRCd-1.17a/modules/core/m_squit.c	Thu Jul 24 19:52:34 2003
@@ -100,6 +100,11 @@
     {
       if(MyConnect(found_squit->target_p))
 	{
+	  if (strcmp(SERVICES,found_squit->target_p->name) == 0) {
+                sendto_realops_flags(FLAGS_ALL, L_ALL, "Attempted SQUIT of services from %s (%s)",
+                                        get_client_name(source_p, HIDE_IP), comment);
+                return;   
+          }
 	  sendto_realops_flags(FLAGS_ALL, L_ALL,
 			       "Received SQUIT %s from %s (%s)",
 			       found_squit->target_p->name,
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/core/nickdiff.txt PleXusIRCd-1.17a/modules/core/nickdiff.txt
--- ircd-hybrid-7.0/modules/core/nickdiff.txt	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/core/nickdiff.txt	Sun Sep  7 09:45:04 2003
@@ -0,0 +1,226 @@
+2c2
+<  *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
+---
+>  *  PleXusIRCd: Based on Hybird7
+22c22
+<  *  $Id: m_nick.c,v 1.100.2.2 2003/04/03 01:29:02 lusky Exp $
+---
+>  *  $Id: m_nick.c,v 1.19 2002/10/23 03:53:22 fishwaldo Exp $
+81c81
+<   "CLIENT", 0, 0, 10, 0, MFLG_SLOW, 0,
+---
+>   "CLIENT", 0, 0, 11, 0, MFLG_SLOW, 0,
+100c100
+< const char *_version = "$Revision: 1.100.2.2 $";
+---
+> const char *_version = "$Revision: 1.19 $";
+141,142c141
+<   if(find_nick_resv(nick) &&
+<      !(IsOper(source_p) && ConfigChannel.oper_pass_resv))
+---
+>   if(find_nick_resv(nick))
+202,204c201,202
+<  static void
+<  m_nick(struct Client *client_p, struct Client *source_p,
+< 	int parc, char *parv[])
+---
+>  static void m_nick(struct Client *client_p, struct Client *source_p,
+>                    int parc, char *parv[])
+232,233c230
+<   if(find_nick_resv(nick) &&
+<      !(IsOper(source_p) && ConfigChannel.oper_pass_resv))
+---
+>   if(find_nick_resv(nick))
+317,318c314,317
+<  *    parv[7] = server
+<  *    parv[8] = ircname
+---
+>  *    parv[7] = vhost
+>  *    parv[8] = server
+>  *    parv[9] = svsid
+>  *    parv[10] = ircname
+335,336c334,335
+<   /* parc == 3 on nickchange, parc == 9 on new nick */
+<   if((IsClient(source_p) && (parc != 3)) || (IsServer(source_p) && (parc != 9)))
+---
+>   /* parc == 3 on nickchange, parc == 11 on new nick */
+>   if((IsClient(source_p) && (parc != 3)) || (IsServer(source_p) && (parc != 11)))
+360,361c359
+<   if(check_clean_nick(client_p, source_p, nick, parv[1],
+<                       (parc == 9 ? parv[7] : (char *) source_p->user->server)))
+---
+>   if(check_clean_nick(client_p, source_p, nick, parv[1], parv[8]))
+364c362
+<   if (parc == 9)
+---
+>   if (parc == 11)
+366,367c364,365
+<       if (check_clean_user(client_p, nick, parv[5], parv[7]) ||
+<           check_clean_host(client_p, nick, parv[6], parv[7]))
+---
+>       if (check_clean_user(client_p, nick, parv[5], parv[8]) ||
+>           check_clean_host(client_p, nick, parv[6], parv[8]))
+371c369
+<       if(strlen(parv[8]) > REALLEN)
+---
+>       if(strlen(parv[10]) > REALLEN)
+374,375c372,373
+<                          parv[7], parv[1]);
+<           parv[8][REALLEN] = '\0';
+---
+>                          parv[8], parv[1]);
+>           parv[10][REALLEN] = '\0';
+434,435c432,433
+<   id = parv[8];
+<   name = parv[9];
+---
+>   id = parv[9];
+>   name = parv[10];
+445,447c443,445
+<   if(check_clean_nick(client_p, source_p, nick, parv[1], parv[7]) ||
+<      check_clean_user(client_p, nick, parv[5], parv[7]) ||
+<      check_clean_host(client_p, nick, parv[6], parv[7]))
+---
+>   if(check_clean_nick(client_p, source_p, nick, parv[1], parv[8]) ||
+>      check_clean_user(client_p, nick, parv[5], parv[8]) ||
+>      check_clean_host(client_p, nick, parv[6], parv[8]))
+479c477
+<     SetKilled(target_p);
+---
+>     target_p->flags |= FLAGS_KILLED;
+514,516c512,513
+< static int
+< check_clean_nick(struct Client *client_p, struct Client *source_p, 
+< 		 char *nick, char *newnick, char *server)
+---
+> static int check_clean_nick(struct Client *client_p, struct Client *source_p, 
+>                             char *nick, char *newnick, char *server)
+538c535
+<       SetKilled(source_p);
+---
+>       source_p->flags |= FLAGS_KILLED;
+542c539
+<     return (1);
+---
+>     return 1;
+545c542
+<   return (0);
+---
+>   return 0;
+571c568
+<     return (1);
+---
+>     return 1;
+579c576
+<   return (0);
+---
+>   return 0;
+605c602
+<     return (1);
+---
+>     return 1;
+613c610
+<   return (0);
+---
+>   return 0;
+627c624
+<     return (0);
+---
+>     return 0;
+633c630
+<     return (0);
+---
+>     return 0;
+638c635
+<       return (0);
+---
+>       return 0;
+641c638
+<   return (1);
+---
+>   return 1;
+718c715
+< 
+---
+>     strncpy(source_p->vhost, parv[6], HOSTLEN+1);
+733a731,740
+> 	 if(!(source_p->umodes & FLAGS_HIDDEN) && (flag & FLAGS_HIDDEN)) {
+> 		if (parv[7][0] != '*')
+> 			strncpy(source_p->vhost, parv[7], HOSTLEN +1);
+> 		else {
+> 			/* THIS SHOULD NEVER HAPPEN */	
+> 			sendto_realops_flags(FLAGS_DEBUG, L_ALL, "Warning, Server %s sent a Invalid Vhost in nick_from_server", source_p->from->name);
+> 			strncpy(source_p->vhost, source_p->host, HOSTLEN +1);
+> 		}
+> 	 }
+> 
+739c746
+<                             parv[7], parv[8], NULL);
+---
+>                             parv[8], parv[10], NULL, atol(parv[9]));
+748,750c755,756
+<     sendto_common_channels_local(source_p, 1,
+<                                  ":%s!%s@%s NICK :%s",
+<                                  source_p->name,source_p->username,source_p->host,
+---
+>     sendto_common_channels_local(source_p, 1, ":%s!%s@%s NICK :%s",
+>                                  source_p->name,source_p->username,source_p->vhost,
+788,789c794,795
+<   id = parv[8];
+<   name = parv[9];
+---
+>   id = parv[9];
+>   name = parv[11];
+804a811,812
+>   strncpy(source_p->vhost, parv[6], HOSTLEN+1);
+>   
+815a824,832
+>     if(!(source_p->umodes & FLAGS_HIDDEN) && (flag & FLAGS_HIDDEN)) {
+> 		if (parv[7][0] != '*')
+> 			strncpy(source_p->vhost, parv[7], HOSTLEN +1);
+> 		else {
+> 			sendto_realops_flags(FLAGS_DEBUG, L_ALL, "Warning %s sent a Invalid Hidden Host command in client_from_server", source_p->from->name);
+> 			strncpy(source_p->vhost, source_p->host, HOSTLEN +1);
+> 		}
+> 	 }
+> 
+822c839
+<                         parv[7], name, id);
+---
+>                         parv[8], name, id, atol(parv[10]));
+854c871
+<       SetKilled(target_p);
+---
+>       target_p->flags |= FLAGS_KILLED;
+898,899c915,916
+<         SetKilled(target_p);
+< 	exit_client(client_p, target_p, &me, "Nick collision");
+---
+>         target_p->flags |= FLAGS_KILLED;
+> 	(void)exit_client(client_p, target_p, &me, "Nick collision");
+901c918
+< 	if(parc == 9)
+---
+> 	if(parc == 11)
+903c920
+< 	else if(parc == 10)
+---
+> 	else if(parc == 12)
+938c955
+<       SetKilled(target_p);
+---
+>       target_p->flags |= FLAGS_KILLED;
+940c957
+<       SetKilled(source_p);
+---
+>       source_p->flags |= FLAGS_KILLED;
+970c987
+<         SetKilled(source_p);
+---
+>         source_p->flags |= FLAGS_KILLED;
+999,1000c1016,1017
+<        SetKilled(target_p);
+<        exit_client(client_p, target_p, &me, "Nick collision");
+---
+>        target_p->flags |= FLAGS_KILLED;
+>        (void)exit_client(client_p, target_p, &me, "Nick collision");
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_connect.c PleXusIRCd-1.17a/modules/m_connect.c
--- ircd-hybrid-7.0/modules/m_connect.c	Wed Nov 20 22:35:08 2002
+++ PleXusIRCd-1.17a/modules/m_connect.c	Thu Jul 24 20:05:20 2003
@@ -181,8 +181,7 @@
    * destroyed
    */
   aconf->port = tmpport;
-}
-
+}    
 /*
  * ms_connect - CONNECT command handler
  * 
@@ -294,5 +293,3 @@
    */
   aconf->port = tmpport;
 }
-
-
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_force.c PleXusIRCd-1.17a/modules/m_force.c
--- ircd-hybrid-7.0/modules/m_force.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/m_force.c	Tue Aug 19 01:52:08 2003
@@ -0,0 +1,314 @@
+/* contrib/m_force.c
+ * Copyright (C) 2002 Hybrid Development Team
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *
+ *  1.Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *  2.Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *  3.The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *  DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ *  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *  POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id: m_force.c,v 1.17 2002/11/01 13:24:41 db Exp $
+ */
+
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "common.h"     /* FALSE bleah */
+#include "ircd.h"
+#include "irc_string.h"
+#include "numeric.h"
+#include "fdlist.h"
+#include "hash.h"
+#include "s_bsd.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_serv.h"
+#include "send.h"
+#include "msg.h"
+#include "parse.h"
+#include "modules.h"
+#include "channel.h"
+#include "channel_mode.h"
+
+
+static void mo_forcejoin(struct Client *client_p, struct Client *source_p,
+                         int parc, char *parv[]);
+static void mo_forcepart(struct Client *client_p, struct Client *source_p,
+		         int parc, char *parv[]);
+
+struct Message forcejoin_msgtab = {
+  "SAJOIN", 0, 0, 3, 0, MFLG_SLOW, 0,
+  {m_ignore, m_not_oper, mo_forcejoin, m_ignore}
+};
+struct Message forcepart_msgtab = {
+  "SAPART", 0, 0, 3, 0, MFLG_SLOW, 0,
+  {m_ignore, m_not_oper, mo_forcepart, m_ignore}
+};
+
+#ifndef STATIC_MODULES
+void
+_modinit(void)
+{
+  mod_add_cmd(&forcejoin_msgtab);
+  mod_add_cmd(&forcepart_msgtab);
+}
+
+void
+_moddeinit(void)
+{
+  mod_del_cmd(&forcejoin_msgtab);
+  mod_del_cmd(&forcepart_msgtab);
+}
+
+char *_version = "$Revision: 1.17 $";
+#endif
+
+/*
+ * m_forcejoin
+ *      parv[0] = sender prefix
+ *      parv[1] = user to force
+ *      parv[2] = channel to force them into
+ */
+static void mo_forcejoin(struct Client *client_p, struct Client *source_p,
+                         int parc, char *parv[])
+{
+  struct Client *target_p;
+  struct Channel *chptr;
+  int type;
+  char mode;
+  char sjmode;
+  char *newch;
+
+  if(!IsAdmin(source_p) && !IsServer(source_p))
+  {
+    sendto_one(source_p, ":%s NOTICE %s :You have no A flag", me.name, parv[0]);
+    return;
+  }
+
+  /* if target_p is not existent, print message
+   * to source_p and bail - scuzzy
+   */
+  if ((target_p = find_client(parv[1])) == NULL)
+  {
+    sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name,
+	       source_p->name, parv[1]);
+    return;
+  }
+
+  if (!MyConnect(target_p))
+  {
+    sendto_one(target_p, ":%s SAJOIN %s %s", parv[0], parv[1], parv[2]);
+    return;
+  }
+
+  /* select our modes from parv[2] if they exist... (chanop)*/
+  if(*parv[2] == '@')
+  {
+    type = CHFL_CHANOP;
+    mode = 'o';
+    sjmode = '@';
+  }
+#ifdef HALFOPS
+  else if(*parv[2] == '%')
+  {
+    type = CHFL_HALFOP;
+    mode = 'h';
+    sjmode = '%';
+  }
+#endif
+  else if(*parv[2] == '+')
+  {
+    type = CHFL_VOICE;
+    mode = 'v';
+    sjmode = '+';
+  }
+  else
+  {
+    type = CHFL_PEON;
+    mode = sjmode = '\0';
+  }
+    
+  if(mode != '\0')
+    parv[2]++;
+    
+  if((chptr = hash_find_channel(parv[2])) != NULL)
+    {
+      if(IsMember(target_p, chptr))
+      {
+        /* debugging is fun... */
+        sendto_one(source_p, ":%s NOTICE %s :*** Notice -- %s is already in %s", me.name,
+		   source_p->name, target_p->name, chptr->chname);
+	return;
+      }
+
+      add_user_to_channel(chptr, target_p, type);
+
+      if (chptr->chname[0] != '&')
+        sendto_server(target_p, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
+	              ":%s SJOIN %lu %s + :%c%s",
+	              me.name, (unsigned long) chptr->channelts,
+	              chptr->chname, type ? sjmode : ' ', target_p->name);
+
+      sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
+                             target_p->name, target_p->username,
+                             target_p->vhost, chptr->chname);
+
+      if(type)
+        sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +%c %s",
+	                     me.name, chptr->chname, mode, target_p->name);
+        
+      if(chptr->topic != NULL)
+      {
+	sendto_one(target_p, form_str(RPL_TOPIC), me.name,
+	           target_p->name, chptr->chname, chptr->topic);
+        sendto_one(target_p, form_str(RPL_TOPICWHOTIME),
+	           me.name, source_p->name, chptr->chname,
+	           chptr->topic_info, chptr->topic_time);
+      }
+
+      channel_member_names(target_p, chptr, chptr->chname, 1);
+    }
+  else
+    {
+      newch = parv[2];
+      if (!check_channel_name(newch))
+      {
+        sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name,
+		   source_p->name, (unsigned char*)newch);
+	return;
+      }
+
+      /* channel name must begin with & or # */
+      if (!IsChannelName(newch))
+      {
+        sendto_one(source_p, form_str(ERR_BADCHANNAME), me.name,
+		   source_p->name, (unsigned char*)newch);
+        return;
+      }
+
+     /* it would be interesting here to allow an oper
+      * to force target_p into a channel that doesn't exist
+      * even more so, into a local channel when we disable
+      * local channels... but...
+      * I don't want to break anything - scuzzy
+      */
+      if (ConfigServerHide.disable_local_channels &&
+	  (*newch == '&'))
+      {
+        sendto_one(source_p, ":%s NOTICE %s :No such channel (%s)", me.name,
+		   source_p->name, newch);
+        return;
+      }
+
+      /* newch can't be longer than CHANNELLEN */
+      if (strlen(newch) > CHANNELLEN)
+      {
+	sendto_one(source_p, ":%s NOTICE %s :Channel name is too long", me.name,
+		   source_p->name);
+        return;
+      }
+
+      chptr = get_or_create_channel(target_p, newch, NULL);
+      add_user_to_channel(chptr, target_p, CHFL_CHANOP);
+
+      /* send out a join, make target_p join chptr */
+      if (chptr->chname[0] != '&')
+        sendto_server(target_p, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
+                      ":%s SJOIN %lu %s +nt :@%s", me.name,
+		      (unsigned long) chptr->channelts, chptr->chname,
+		      target_p->name);
+
+      sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
+                             target_p->name, target_p->username,
+                             target_p->vhost, chptr->chname);
+
+      chptr->mode.mode |= MODE_TOPICLIMIT;
+      chptr->mode.mode |= MODE_NOPRIVMSGS;
+
+      sendto_channel_local(ALL_MEMBERS, chptr, ":%s MODE %s +nt", me.name,
+                           chptr->chname);
+
+      target_p->localClient->last_join_time = CurrentTime;
+      channel_member_names(target_p, chptr, chptr->chname, 1);
+
+      /* we do this to let the oper know that a channel was created, this will be
+       * seen from the server handling the command instead of the server that
+       * the oper is on.
+       */
+      sendto_one(source_p, ":%s NOTICE %s :*** Notice -- Creating channel %s", me.name,
+		 source_p->name, chptr->chname);
+    }
+}
+
+
+static void mo_forcepart(struct Client *client_p, struct Client *source_p,
+		         int parc, char *parv[])
+{
+  struct Client *target_p;
+  struct Channel *chptr;
+
+  if(!IsAdmin(source_p) && !IsServer(source_p))
+  {
+    sendto_one(source_p, ":%s NOTICE %s :You have no A flag", me.name, parv[0]);
+    return;
+  }
+
+  /* if target_p == NULL then let the oper know */
+  if ((target_p = find_client(parv[1])) == NULL)
+  {
+    sendto_one(source_p, form_str(ERR_NOSUCHNICK), me.name,
+               source_p->name, parv[1]);
+    return;
+  }
+
+  if (!MyConnect(target_p))
+  {
+    sendto_one(target_p, ":%s SAPART %s %s", parv[0], parv[1], parv[2]);
+    return;
+  }
+
+  if((chptr = hash_find_channel(parv[2])) == NULL)
+  {
+    sendto_one(source_p, form_str(ERR_NOSUCHCHANNEL),
+               me.name, parv[0], parv[2]);
+    return;
+  }
+
+  if (!IsMember(target_p, chptr))
+  {
+    sendto_one(source_p, form_str(ERR_USERNOTINCHANNEL),
+               me.name, parv[0], parv[2], parv[1]);
+    return;
+  }
+  
+  if (chptr->chname[0] != '&')
+    sendto_server(target_p, target_p, chptr, NOCAPS, NOCAPS, LL_ICLIENT,
+		  ":%s PART %s :%s",
+		  target_p->name, chptr->chname,
+		  target_p->name);
+
+  sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s PART %s :%s",
+                       target_p->name, target_p->username,
+ 	               target_p->vhost,chptr->chname,
+		       target_p->name);
+  remove_user_from_channel(chptr, target_p);
+}
+
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_gline.c PleXusIRCd-1.17a/modules/m_gline.c
--- ircd-hybrid-7.0/modules/m_gline.c	Thu Apr 10 23:41:40 2003
+++ PleXusIRCd-1.17a/modules/m_gline.c	Fri Nov 28 05:30:49 2003
@@ -207,11 +207,11 @@
    */
   sendto_realops_flags(FLAGS_ALL, L_ALL,
                        "%s!%s@%s on %s is requesting gline for [%s@%s] [%s]",
-                       source_p->name, source_p->username, source_p->host,
+                       source_p->name, source_p->username, source_p->vhost,
                        me.name, user, host, reason);
   log_gline_request(source_p->name,
                     (const char *)source_p->username,
-                    source_p->host, me.name, user, host, reason);
+                    source_p->vhost, me.name, user, host, reason);
 
   /* If at least 3 opers agree this user should be G lined then do it */
   if (check_majority_gline(source_p, source_p->name,
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_gline.c1 PleXusIRCd-1.17a/modules/m_gline.c1
--- ircd-hybrid-7.0/modules/m_gline.c1	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/m_gline.c1	Mon Sep  8 21:10:37 2003
@@ -0,0 +1,625 @@
+/*
+ *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
+ *  m_gline.c: Votes towards globally banning a mask.
+ *
+ *  Copyright (C) 2002 by the past and present ircd coders, and others.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *  USA
+ *
+ *  $Id: m_gline.c,v 1.1 2003/04/07 08:46:52 morpheus66 Exp $
+ */
+
+#include "stdinc.h"
+#include "tools.h"
+#include "handlers.h"
+#include "s_gline.h"
+#include "channel.h"
+#include "client.h"
+#include "common.h"
+#include "config.h"
+#include "irc_string.h"
+#include "ircd.h"
+#include "hostmask.h"
+#include "numeric.h"
+#include "fdlist.h"
+#include "s_bsd.h"
+#include "s_conf.h"
+#include "s_misc.h"
+#include "scache.h"
+#include "send.h"
+#include "msg.h"
+#include "fileio.h"
+#include "s_serv.h"
+#include "hash.h"
+#include "parse.h"
+#include "modules.h"
+#include "list.h"
+
+#define GLINE_NOT_PLACED 0
+#define GLINE_ALREADY_VOTED -1
+#define GLINE_PLACED 1
+
+/* internal functions */
+static void set_local_gline(
+                            const char *oper_nick,
+                            const char *oper_user,
+                            const char *oper_host,
+                            const char *oper_server,
+                            const char *user,
+                            const char *host,
+                            const char *reason);
+
+static void log_gline_request(const char*,const char*,const char*,
+                              const char* oper_server,
+                              const char *,const char *,const char *);
+
+static void log_gline(struct Client *,
+                      const char *, const char *,const char *,
+                      const char* oper_server,
+                      const char *,const char *,const char *);
+
+
+static void trigger_gline(struct Client *source_p,
+                                 const char *oper_nick,
+                                 const char *oper_user,
+                                 const char *oper_host,
+                                 const char *oper_server,
+                                 const char *user, const char *host,
+                                 const char *reason);
+
+static int check_wild_gline(char *, char *);
+static int invalid_gline(struct Client *, char *, char *, char *);
+		       
+static void ms_gline(struct Client*, struct Client*, int, char**);
+static void mo_gline(struct Client*, struct Client*, int, char**);
+
+struct Message gline_msgtab = {
+    "GLINE", 0, 0, 3, 0, MFLG_SLOW, 0,
+      {m_unregistered, m_not_oper, ms_gline, m_ignore}
+};
+
+#ifndef STATIC_MODULES
+
+void
+_modinit(void)
+{
+    mod_add_cmd(&gline_msgtab);
+}
+
+void
+_moddeinit(void)
+{
+  mod_del_cmd(&gline_msgtab);
+}
+
+const char *_version = "$Revision: 1.1 $";
+#endif
+/*
+ * mo_gline()
+ *
+ * inputs       - The usual for a m_ function
+ * output       -
+ * side effects -
+ *
+ * Place a G line if 3 opers agree on the identical user@host
+ * 
+ */
+/* Allow this server to pass along GLINE if received and
+ * GLINES is not defined.
+ *
+ */
+
+static void
+mo_gline(struct Client *client_p, struct Client *source_p,
+	 int parc, char *parv[])
+{
+  char *user = NULL;
+  char *host = NULL;	              /* user and host of GLINE "victim" */
+  const char *reason = NULL;          /* reason for "victims" demise */
+  char tempuser[USERLEN + 2];
+  char temphost[HOSTLEN + 1];
+
+  if (!ConfigFileEntry.glines)
+    {
+    sendto_one(source_p,":%s NOTICE %s :GLINE disabled",me.name,parv[0]);  
+    return;
+  }
+
+      if (!IsOperGline(source_p))
+	{
+	  sendto_one(source_p,
+		     ":%s NOTICE %s :You need gline = yes;",me.name,parv[0]);
+	  return;
+	}
+			
+  if ((host = strchr(parv[1], '@')) || *parv[1] == '*')
+	{
+	  /* Explicit user@host mask given */
+	      
+	  if(host != NULL)	/* Found user@host */
+	    {
+	      user = parv[1];   /* here is user part */
+	      *(host++) = '\0'; /* and now here is host */
+
+              /* gline for "@host", use *@host */
+              if(*user == '\0')
+                user = "*";
+	    }
+	  else
+	    {
+	      user = "*";               /* no @ found, assume its *@somehost */
+	      host = parv[1];
+	    }
+	      
+    if (*host == '\0')	/* duh. no host found, assume its '*' host */
+	    host = "*";
+	      
+	  strlcpy(tempuser, user, USERLEN + 1);     /* allow for '*' */
+	  strlcpy(temphost, host, HOSTLEN + 1);
+	  user = tempuser;
+	  host = temphost;
+	}
+      else
+	{
+	  sendto_one(source_p,
+		     ":%s NOTICE %s :Can't G-Line a nick use user@host",
+		     me.name, parv[0]);
+	  return;
+	}
+
+      if(invalid_gline(source_p, user, host, parv[2]))
+        return;
+			
+      /* Not enough non-wild characters were found,
+       * assume they are trying to gline *@*.
+       */
+
+      if (check_wild_gline(user, host))
+	{
+	  if (MyClient(source_p))
+	    sendto_one(source_p,
+		       ":%s NOTICE %s :Please include at least %d non-wildcard characters with the user@host",
+		       me.name, parv[0], ConfigFileEntry.min_nonwildcard);
+	  return;
+	}
+			
+      reason = parv[2];
+
+      /* inform users about the gline before we call trigger_gline()
+       * so already voted comes below gline request --fl
+       */
+      log_gline_request(source_p->name,
+                        (const char *)source_p->username,
+                        source_p->host,me.name, user, host, reason);
+
+      /* Good gline, trigger it */
+      trigger_gline(source_p,
+			   source_p->name,
+			   (const char *)source_p->username,
+			   source_p->host, me.name, user, host, reason);
+
+      /* 4 param version for hyb-7 servers */
+      sendto_server(NULL, source_p, NULL, CAP_GLN|CAP_UID, NOCAPS,
+                    LL_ICLIENT,
+                    ":%s GLINE %s %s :%s",
+                    ID(source_p), user, host, reason);
+      sendto_server(NULL, source_p, NULL, CAP_GLN, CAP_UID,
+                    LL_ICLIENT,
+                    ":%s GLINE %s %s :%s",
+                    source_p->name, user, host, reason);
+
+      /* 8 param for hyb-6 */
+      sendto_server(NULL, NULL, NULL, CAP_UID, CAP_GLN, NOFLAGS,
+                    ":%s GLINE %s %s %s %s %s %s :%s",
+                    me.name, ID(source_p), source_p->username,
+                    source_p->host, source_p->user->server, user, host,
+                    reason);
+      sendto_server(NULL, NULL, NULL, NOCAPS, CAP_GLN|CAP_UID, NOFLAGS,
+                    ":%s GLINE %s %s %s %s %s %s :%s",
+                    me.name, source_p->name, source_p->username,
+                    source_p->host, source_p->user->server, user, host,
+                    reason);
+}
+
+/*
+ * ms_gline()
+ *
+ * inputs       - The usual for a m_ function
+ * output       -
+ * side effects -
+ *
+ * Place a G line if 3 opers agree on the identical user@host
+ * 
+ */
+/* Allow this server to pass along GLINE if received and
+ * GLINES is not defined.
+ */
+
+static void
+ms_gline(struct Client *client_p, struct Client *source_p,
+	 int parc, char *parv[])
+{
+  /* These are needed for hyb6 compatibility.. if its ever removed we can
+   * just use source_p->username etc.. 
+   */
+  const char *oper_nick = NULL;        /* nick of oper requesting GLINE */
+  const char *oper_user = NULL;        /* username of oper requesting GLINE */
+  const char *oper_host = NULL;        /* hostname of oper requesting GLINE */
+  const char *oper_server = NULL;      /* server of oper requesting GLINE */
+  char *user = NULL;
+  char *host = NULL;             /* user and host of GLINE "victim" */
+  const char *reason = NULL;           /* reason for "victims" demise */
+  struct Client *acptr;
+
+  /* hyb-7 style gline (post beta3) */
+  if(parc == 4 && IsPerson(source_p))
+    {
+      oper_nick = parv[0];
+      oper_user = source_p->username;
+      oper_host = source_p->host;
+      oper_server = source_p->user->server;
+      user = parv[1];
+      host = parv[2];
+      reason = parv[3];
+    }
+  /* or it's a hyb-6 style */
+  else if(parc == 8 && IsServer(source_p))
+    {
+      oper_nick = parv[1];
+      oper_user = parv[2];
+      oper_host = parv[3];
+      oper_server = parv[4];
+      user = parv[5];
+      host = parv[6];
+      reason = parv[7];      
+    }
+  /* none of the above */
+  else
+    return;
+
+  /* Its plausible that the server and/or client dont actually exist,
+   * and its faked, as the oper isnt sending the gline..
+   * check they're real --fl_ */
+  /* we need acptr for LL introduction anyway -davidt */
+  if((acptr = find_server(oper_server)))
+  {
+    if((acptr = find_client(oper_nick)) == NULL)
+      return;
+  }
+  else
+    return;
+
+ if(invalid_gline(acptr, user, host, (char *)reason))
+    return;
+    
+  /* send in hyb-7 to compatible servers */
+  sendto_server(client_p, acptr, NULL, CAP_GLN, NOCAPS, LL_ICLIENT,
+                ":%s GLINE %s %s :%s",
+                oper_nick, user, host, reason);
+  /* hyb-6 version to the rest */
+  sendto_server(client_p, NULL, NULL, NOCAPS, CAP_GLN, NOFLAGS,
+                ":%s GLINE %s %s %s %s %s %s :%s",
+                oper_server, oper_nick, oper_user, oper_host,
+                oper_server, user, host, reason);
+
+  if (ConfigFileEntry.glines)
+    {
+     /* I dont like the idea of checking for x non-wildcard chars in a
+      * gline.. it could lead to a desync... but we have to stop people
+      * glining *@*..   -- fl
+      */
+
+     if (check_wild_gline(user, host))
+        {
+          sendto_realops_flags(FLAGS_ALL, L_ALL, 
+                       "%s!%s@%s on %s is requesting a gline without %d non-wildcard characters for [%s@%s] [%s]",
+                       oper_nick, oper_user, oper_host, oper_server, ConfigFileEntry.min_nonwildcard,
+                       user, host, reason);
+          return;
+        }
+
+      log_gline_request(oper_nick,oper_user,oper_host,oper_server,
+			user,host,reason);
+
+      sendto_realops_flags(FLAGS_ALL, L_ALL,
+			   "%s!%s@%s on %s is requesting gline for [%s@%s] [%s]",
+			   oper_nick, oper_user, oper_host, oper_server,
+			   user, host, reason);
+
+      /* Good gline, trigger it */
+      trigger_gline(source_p, oper_nick, oper_user, oper_host,
+			   oper_server, user, host, reason);
+    }
+}
+
+/*
+ * check_wild_gline
+ *
+ * inputs       - user, host of gline
+ * output       - 1 if not enough non-wildchar char's, 0 if ok
+ * side effects - NONE
+ */
+
+static int
+check_wild_gline(char *user, char *host)
+{
+  char *p;
+  char tmpch;
+  int nonwild;
+
+  nonwild = 0;
+  p = user;
+
+  while ((tmpch = *p++))
+    {
+       if (!IsKWildChar(tmpch))
+         {
+            /*
+             * If we find enough non-wild characters, we can
+             * break - no point in searching further.
+             */
+            if (++nonwild >= ConfigFileEntry.min_nonwildcard)
+              break;
+         }
+    }
+
+   if (nonwild < ConfigFileEntry.min_nonwildcard)
+    {
+       /*
+        * The user portion did not contain enough non-wild
+        * characters, try the host.
+        */
+       p = host;
+       while ((tmpch = *p++))
+         {
+           if (!IsKWildChar(tmpch))
+             if (++nonwild >= ConfigFileEntry.min_nonwildcard)
+               break;
+         }
+     }
+
+    if (nonwild < ConfigFileEntry.min_nonwildcard)
+       return 1;
+    else
+       return 0;
+}
+
+/* invalid_gline
+ *
+ * inputs	- pointer to source client
+ *		- pointer to ident
+ *		- pointer to host
+ *		- pointer to reason
+ * outputs	- 1 if invalid, 0 if valid
+ */
+static int
+invalid_gline(struct Client *source_p, char *luser, char *lhost,
+                       char *lreason)
+{
+  if(strchr(luser, '!'))
+  {
+    sendto_one(source_p, ":%s NOTICE %s :Invalid character '!' in gline",
+               me.name, source_p->name);
+    return 1;
+  }
+
+  return 0;
+}
+
+/*
+ * trigger_gline
+ *
+ * inputs	- pointer to source client
+ * 		- name of operator requesting gline
+ * 		- username of operator requesting gline
+ * 		- hostname of operator requesting gline
+ * 		- servername of operator requesting gline
+ * 		- username covered by the gline
+ * 		- hostname covered by the gline
+ * 		- reason for the gline
+ * output	- NONE
+ */
+static void
+trigger_gline(struct Client *source_p,
+		     const char *oper_nick, const char *oper_user,
+		     const char *oper_host, const char *oper_server,
+		     const char *user, const char *host,
+		     const char *reason)
+{
+
+   /* If it's already glined, do not
+      add the gline. */
+
+   if(find_is_glined(host, user))
+      return;
+
+   set_local_gline(oper_nick, oper_user, oper_host, oper_server,
+                               user, host, reason);
+   cleanup_glines();
+}
+
+/*
+ * set_local_gline
+ *
+ * inputs	- pointer to oper nick
+ * 		- pointer to oper username
+ * 		- pointer to oper host
+ *		- pointer to oper server
+ *		- pointer to victim user
+ *		- pointer to victim host
+ *		- pointer reason
+ * output	- NONE
+ * side effects	-
+ */
+static void
+set_local_gline(const char *oper_nick,
+                            const char *oper_user,
+                            const char *oper_host,
+                            const char *oper_server,
+                            const char *user,
+                            const char *host,
+                            const char *reason)
+{
+  char buffer[IRCD_BUFSIZE];
+  struct ConfItem *aconf;
+  const char *current_date;
+
+  current_date = smalldate((time_t) 0);
+          
+  aconf = make_conf();
+  aconf->status = CONF_KILL;
+
+  ircsprintf(buffer, "%s (%s)",reason,current_date);
+      
+  DupString(aconf->passwd, buffer);
+  DupString(aconf->name, (char *)user);
+  DupString(aconf->host, (char *)host);
+  aconf->hold = CurrentTime + ConfigFileEntry.gline_time;
+  add_gline(aconf);
+      
+  sendto_realops_flags(FLAGS_ALL, L_ALL,
+		       "%s!%s@%s on %s added gline for [%s@%s] (Reason: %s)",
+		       oper_nick, oper_user, oper_host, oper_server,
+		       user, host, reason);
+  check_klines();
+}
+
+
+/*
+ * log_gline_request()
+ *
+ */
+static void
+log_gline_request(
+		  const char *oper_nick, const char *oper_user,
+		  const char *oper_host, const char* oper_server,
+		  const char *user, const char *host, const char *reason)
+{
+  char        buffer[2*BUFSIZE];
+  char        filenamebuf[PATH_MAX + 1];
+  static char timebuffer[MAX_DATE_STRING];
+  struct tm*  tmptr;
+  FBFILE*     out;
+
+  if(ConfigFileEntry.glinefile == NULL)
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,"*** Problem opening glinefile");
+      return;
+    }
+
+  ircsprintf(filenamebuf, "%s.%s", 
+             ConfigFileEntry.glinefile, small_file_date((time_t)0));
+  if ( (out = fbopen(filenamebuf, "+a")) == NULL )
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,"*** Problem opening %s: %s",
+                     filenamebuf, strerror(errno));
+      return;
+    }
+
+  tmptr = localtime((const time_t*)&CurrentTime);
+  strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr);
+
+  ircsprintf(buffer,
+           "#Gline for %s@%s [%s] requested by %s!%s@%s on %s at %s\n",
+           user,host,reason,
+           oper_nick,oper_user,oper_host,oper_server,
+           timebuffer);
+
+  if (fbputs(buffer, out) == -1)
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,"*** Problem writing to %s (%s)",
+				     filenamebuf, strerror(errno));
+    }
+  fbclose(out);
+}
+
+/*
+ * log_gline()
+ *
+ */
+static void
+log_gline(struct Client *source_p,
+	  const char *oper_nick, const char *oper_user, const char *oper_host,
+	  const char *oper_server, const char *user, const char *host,
+	  const char *reason)
+{
+  char         buffer[2*BUFSIZE];
+  char         filenamebuf[PATH_MAX + 1];
+  static  char timebuffer[MAX_DATE_STRING + 1];
+  struct tm*   tmptr;
+  FBFILE       *out;
+
+  if(ConfigFileEntry.glinefile == NULL)
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,"*** Problem opening glinefile.");
+      return;
+    }
+
+  ircsprintf(filenamebuf, "%s.%s", 
+                ConfigFileEntry.glinefile, small_file_date((time_t) 0));
+
+  if ((out = fbopen(filenamebuf, "a")) == NULL)
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,
+			   "*** Problem opening %s",filenamebuf);
+      return;
+    }
+
+  tmptr = localtime((const time_t*)&CurrentTime);
+  strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr);
+
+  ircsprintf(buffer,"#Gline for %s@%s %s added by the following\n",
+                   user,host,timebuffer);
+
+  if (fbputs(buffer,out) == -1)
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,
+			   "*** Problem writing to %s",filenamebuf);
+      fbclose(out);
+      return;
+    }
+
+  ircsprintf(buffer, "#%s!%s@%s on %s [%s]\n",
+                   oper_nick,
+                   oper_user,
+                   oper_host,
+                   oper_server,
+                   (reason)?reason:"No reason");
+
+  if (fbputs(buffer,out) == -1)
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,"*** Problem writing to %s",filenamebuf);
+      fbclose(out);
+      return;
+    }
+
+  ircsprintf(buffer, "\"%s\",\"%s\",\"%s %s\",\"%s\",%lu\n",
+	     user,
+	     host,
+	     reason,
+	     timebuffer,
+	     oper_nick,
+	     (unsigned long) CurrentTime);
+
+  if (fbputs(buffer,out) == -1)
+    {
+      sendto_realops_flags(FLAGS_ALL, L_ALL,"*** Problem writing to %s",filenamebuf);
+      fbclose(out);
+      return;
+    }
+
+  fbclose(out);
+}
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_join.c PleXusIRCd-1.17a/modules/m_join.c
--- ircd-hybrid-7.0/modules/m_join.c	Wed Apr  2 20:29:00 2003
+++ PleXusIRCd-1.17a/modules/m_join.c	Mon Jun 16 18:20:22 2003
@@ -365,7 +365,7 @@
 	   */
 	  sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
 			       source_p->name, source_p->username,
-			       source_p->host, root_chptr->chname);
+			       source_p->vhost, root_chptr->chname);
       
 	  sendto_channel_local(ONLY_CHANOPS_HALFOPS,chptr,
 			       ":%s MODE %s %s %s",
@@ -382,7 +382,7 @@
 
 	  sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
 			       source_p->name, source_p->username,
-			       source_p->host, root_chptr->chname);
+			       source_p->vhost, root_chptr->chname);
         }
 
 
@@ -493,7 +493,7 @@
 
       sendto_channel_local(ALL_MEMBERS,chptr, ":%s!%s@%s PART %s",
 			   source_p->name, source_p->username,
-			   source_p->host, RootChan(chptr)->chname);
+			   source_p->vhost, RootChan(chptr)->chname);
       remove_user_from_channel(chptr, source_p);
     }
 }
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_kline.c PleXusIRCd-1.17a/modules/m_kline.c
--- ircd-hybrid-7.0/modules/m_kline.c	Wed Nov 13 08:12:02 2002
+++ PleXusIRCd-1.17a/modules/m_kline.c	Sun Nov 30 04:37:03 2003
@@ -19,7 +19,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_kline.c,v 1.111 2002/11/13 13:12:02 db Exp $
+ *  $Id: m_kline.c,v 1.12 2003/11/30 13:12:02 Static Exp $
  */
 
 #include "stdinc.h"
@@ -75,7 +75,7 @@
   mod_del_cmd(&kline_msgtab);
   mod_del_cmd(&dline_msgtab);
 }
-const char *_version = "$Revision: 1.111 $";
+const char *_version = "$Revision: 1.12 $";
 #endif
 
 /* Local function prototypes */
@@ -288,7 +288,7 @@
   if (!match(parv[1],me.name))
     return;
 
-  if (!IsPerson(source_p))
+  if (!IsPerson(source_p)) 
     return;
 
   if (valid_user_host(source_p, kuser, khost))
@@ -317,12 +317,6 @@
   if (find_u_conf((char *)source_p->user->server,
 		  source_p->username, source_p->host))
     {
-      sendto_realops_flags(FLAGS_ALL, L_ALL,
-			   "*** Received K-Line for [%s@%s] [%s], from %s!%s@%s on %s",
-			   kuser, khost, kreason,
-			   source_p->name, source_p->username,
-			   source_p->host, source_p->user->server);
-
       /* We check if the kline already exists after we've announced its 
        * arrived, to avoid confusing opers - fl
        */
@@ -381,6 +375,8 @@
 {
   aconf->hold = CurrentTime + tkline_time;
   add_temp_kline(aconf);
+  //ADDED HERE TEST!!! STATIC
+  if (strcmp("OperServ", source_p->name)) {
   sendto_realops_flags(FLAGS_ALL, L_ALL,
 		       "%s added temporary %d min. K-Line for [%s@%s] [%s]",
 		       get_oper_name(source_p), tkline_time/60,
@@ -389,6 +385,7 @@
   sendto_one(source_p, ":%s NOTICE %s :Added temporary %d min. K-Line [%s@%s]",
 	     me.name, source_p->name, tkline_time/60,
 	     aconf->user, aconf->host);
+  }
   ilog(L_TRACE, "%s added temporary %d min. K-Line for [%s@%s] [%s]",
        source_p->name, tkline_time/60,
        aconf->user, aconf->host, aconf->passwd);
@@ -985,19 +982,6 @@
   {
    reason = aconf->passwd ? aconf->passwd : "<No Reason>";
 
-   /* Remote servers can set klines, so if its a dupe we warn all 
-    * local opers and leave it at that
-    */
-   /* they can?  here was me thinking it was only remote clients :P */
-   if(!MyClient(source_p))
-    sendto_realops_flags(FLAGS_ALL, L_ALL, 
-             "*** Remote K-Line [%s@%s] already K-Lined by [%s@%s] - %s",
-             luser, lhost, aconf->user, aconf->host, reason);
-   else
-    sendto_one(source_p,
-             ":%s NOTICE %s :[%s@%s] already K-Lined by [%s@%s] - %s",
-              me.name, source_p->name, luser, lhost, aconf->user,
-              aconf->host, reason);
      return 1;
   }
  }
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_knock.c PleXusIRCd-1.17a/modules/m_knock.c
--- ircd-hybrid-7.0/modules/m_knock.c	Thu Sep  5 02:05:40 2002
+++ PleXusIRCd-1.17a/modules/m_knock.c	Mon Jun 16 18:18:34 2003
@@ -54,7 +54,7 @@
 
 static int is_banned_knock(struct Channel *, struct Client *, char *);
 static int check_banned_knock(struct Channel *, struct Client *,
-                              char *, char *);
+                              char *, char *, char *);
 
 struct Message knock_msgtab = {
   "KNOCK", 0, 0, 2, 0, MFLG_SLOW, 0,
@@ -415,7 +415,7 @@
   			     chptr, form_str(RPL_KNOCK),
 			     me.name, name, name,
 			     source_p->name, source_p->username,
-			     source_p->host);
+			     source_p->vhost);
       
       sendto_server(client_p, source_p, chptr, CAP_KNOCK, NOCAPS, LL_ICLIENT,
                     ":%s KNOCK %s %s",
@@ -438,14 +438,16 @@
 {
   char src_host[NICKLEN + USERLEN + HOSTLEN + 6];
   char src_iphost[NICKLEN + USERLEN + HOSTLEN + 6];
+  char src_vhost[NICKLEN + USERLEN + HOSTLEN +6];
 
   if(!IsPerson(who))
     return 0;
 
   ircsprintf(src_host,"%s!%s@%s", who->name, who->username, who->host);
   ircsprintf(src_iphost,"%s!%s@%s", who->name, who->username, sockhost);
+  ircsprintf(src_vhost, "%s!%s@%s", who->name, who->username, who->vhost);
 
-  return (check_banned_knock(chptr, who, src_host, src_iphost));
+  return (check_banned_knock(chptr, who, src_host, src_iphost, src_vhost));
 }
 
 /* check_banned_knock()
@@ -459,7 +461,7 @@
  */
 static int
 check_banned_knock(struct Channel *chptr, struct Client *who,
-		   char *s, char *s2)
+		   char *s, char *s2, char *s3)
 {
   dlink_node *ban;
   dlink_node *except;
@@ -470,7 +472,7 @@
   {
     actualBan = ban->data;
 
-    if (match(actualBan->banstr, s) || match(actualBan->banstr, s2))
+    if (match(actualBan->banstr, s) || match(actualBan->banstr, s2) || match(actualBan->banstr, s3))
       break;
     else
       actualBan = NULL;
@@ -482,7 +484,7 @@
     {
       actualExcept = except->data;
 
-      if (match(actualExcept->banstr, s) || match(actualExcept->banstr, s2))
+      if (match(actualExcept->banstr, s) || match(actualExcept->banstr, s2) || match(actualExcept->banstr, s3))
         return CHFL_EXCEPTION;
     }
   }
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_list.c PleXusIRCd-1.17a/modules/m_list.c
--- ircd-hybrid-7.0/modules/m_list.c	Fri Jan 17 00:11:53 2003
+++ PleXusIRCd-1.17a/modules/m_list.c	Thu Jul 24 21:26:56 2003
@@ -47,6 +47,7 @@
 static void mo_list(struct Client*, struct Client*, int, char**);
 static int list_all_channels(struct Client *);
 static void list_one_channel(struct Client *,struct Channel *);
+static char modebuf[BUFSIZE], parabuf[BUFSIZE];
 
 struct Message list_msgtab = {
   "LIST", 0, 0, 0, 0, MFLG_SLOW, 0,
@@ -106,7 +107,7 @@
     }
 
   /* If no arg, do all channels *whee*, else just one channel */
-  if (parc < 2 || BadPtr(parv[1]))
+  if (parc < 2 || BadPtr(parv[1]) || parv[1] == NULL)
     {
       list_all_channels(source_p);
     }
@@ -142,7 +143,7 @@
     }
 
   /* If no arg, do all channels *whee*, else just one channel */
-  if (parc < 2 || BadPtr(parv[1]))
+  if (parc < 2 || BadPtr(parv[1]) || parv[1] == NULL)
     {
       list_all_channels(source_p);
     }
@@ -169,7 +170,7 @@
       if(!IsCapable(client_p->from,CAP_LL) && !MyConnect(source_p))
 	return;
 
-      if (parc < 2 || BadPtr(parv[1]))
+      if (parc < 2 || BadPtr(parv[1]) || parv[1] == NULL)
 	{
 	  list_all_channels(source_p);
 	}
@@ -194,10 +195,13 @@
 
   for ( chptr = GlobalChannelList; chptr; chptr = chptr->nextch )
     {
-      if ( !source_p->user ||
-	   (SecretChannel(chptr) && !IsMember(source_p, chptr)))
-	continue;
-      list_one_channel(source_p,chptr);
+      if (IsOper(source_p)) { 
+	list_one_channel(source_p,chptr);
+      } else {
+        if ( !source_p->user || (SecretChannel(chptr) && !IsMember(source_p, chptr)))
+	  continue;
+        list_one_channel(source_p,chptr);
+      }
     }
 
   sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
@@ -304,7 +308,15 @@
   else
 #endif
     {
-      sendto_one(source_p, form_str(RPL_LIST), me.name, source_p->name,
+      if (IsOper(source_p)) {
+        *modebuf = *parabuf = '\0';
+        channel_modes(chptr, source_p, modebuf, parabuf);
+       
+          sendto_one(source_p, ":%s 322 %s %s %d :[%s] %s", me.name, source_p->name,
+                 chptr->chname, chptr->users, modebuf, chptr->topic == NULL ? "" : chptr->topic);
+      } else {
+        sendto_one(source_p, ":%s 322 %s %s %d :%s", me.name, source_p->name,
                  chptr->chname, chptr->users, chptr->topic == NULL ? "" : chptr->topic );
+      }
     }
 }
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_lljoin.c PleXusIRCd-1.17a/modules/m_lljoin.c
--- ircd-hybrid-7.0/modules/m_lljoin.c	Thu Jan 16 20:09:59 2003
+++ PleXusIRCd-1.17a/modules/m_lljoin.c	Mon Jun 16 18:15:10 2003
@@ -306,7 +306,7 @@
 		       ":%s!%s@%s JOIN :%s",
 		       target_p->name,
 		       target_p->username,
-		       target_p->host,
+		       target_p->vhost,
 		       root_vchan->chname);
   
   if( flags & CHFL_CHANOP )
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_map.c PleXusIRCd-1.17a/modules/m_map.c
--- ircd-hybrid-7.0/modules/m_map.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/m_map.c	Mon Jun 16 18:47:14 2003
@@ -0,0 +1,159 @@
+/*
+ *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
+ *  m_map.c: Sends an Undernet compatible map to a user.
+ *
+ *  Copyright (C) 2002 by the past and present ircd coders, and others.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *  USA
+ *
+ *  $Id: m_map.c,v 1.2 2002/10/15 07:30:08 fishwaldo Exp $
+ */
+
+#include "stdinc.h"
+#include "client.h"
+#include "modules.h"
+#include "handlers.h"
+#include "numeric.h"
+#include "send.h"
+#include "s_conf.h"
+
+#define USER_COL       50 /* display | Users: %d at col 50 */
+
+static void m_map(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+static void mo_map(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+static void dump_map(struct Client *client_p,struct Client *root, char *pbuf);
+
+struct Message map_msgtab = {
+  "MAP", 0, 0, 0, 0, MFLG_SLOW, 0,
+  {m_unregistered, m_map, m_ignore, mo_map}
+};
+
+#ifndef STATIC_MODULES
+void _modinit(void)
+{
+  mod_add_cmd(&map_msgtab);
+}
+
+void _moddeinit(void)
+{
+  mod_del_cmd(&map_msgtab);
+}
+
+const char *_version = "$Revision: 1.2 $";
+#endif
+
+static char buf[BUFSIZE];
+
+/* m_map
+**	parv[0] = sender prefix
+*/
+static void m_map(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[])
+{
+  if (!ConfigServerHide.flatten_links)
+  {
+    dump_map(client_p,&me,buf);
+    sendto_one(client_p, form_str(RPL_MAPEND), me.name, client_p->name);
+    return;
+  }
+
+  m_not_oper(client_p,source_p,parc,parv);
+  return;
+}
+
+/*
+** mo_map
+**      parv[0] = sender prefix
+*/
+static void mo_map(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[])
+{
+  dump_map(client_p,&me,buf);
+  sendto_one(client_p, form_str(RPL_MAPEND), me.name, client_p->name);
+}
+
+/*
+** dump_map
+**   dumps server map, called recursively.
+*/
+static void dump_map(struct Client *client_p,struct Client *root_p, char *pbuf)
+{
+  int cnt = 0, i = 0, len;
+  int users = 0;
+  struct Client *server_p,*user_p;
+        
+  *pbuf= '\0';
+
+  if (root_p->hidden_server && !IsOper(client_p)) {
+  	goto nextserver;
+  }
+  strncat(pbuf,root_p->name,BUFSIZE - ((size_t) pbuf - (size_t) buf));
+  len = strlen(buf);
+  buf[len] = ' ';
+	
+  if (len < USER_COL)
+  {
+     for (i = len+1; i < USER_COL; i++)
+     {
+       buf[i] = '-';
+     }
+  }
+	
+  /* FIXME: add serv->usercnt */
+  for( user_p = root_p->serv->users; user_p; user_p = user_p->lnext )
+    users++;
+        
+  snprintf(buf + USER_COL, BUFSIZE - USER_COL,
+           " | Users: [%5d] (%4.1f%%)", users,
+           100 * (float) users / (float) Count.total);
+        
+  sendto_one(client_p, form_str(RPL_MAP),me.name,client_p->name,buf);
+nextserver:      
+  if ((server_p = root_p->serv->servers))
+  {
+    for (; server_p; server_p = server_p->lnext)
+    {
+      cnt++;
+    }
+    
+    if (cnt)
+    {
+      if (pbuf > buf + 3)
+      {
+        pbuf[-2] = ' ';
+        if (pbuf[-3] == '`')
+          pbuf[-3] = ' ';
+      }
+    }
+  }
+  for (i = 1,server_p = root_p->serv->servers; server_p; server_p=server_p->lnext)
+  {
+    *pbuf = ' ';
+    if ((i < cnt) && (!server_p->lnext->hidden_server && !IsOper(client_p)))
+      *(pbuf + 1) = '|';
+    else
+      *(pbuf + 1) = '`';
+      
+    *(pbuf + 2) = '-';
+    *(pbuf + 3) = ' ';
+    dump_map(client_p,server_p,pbuf+4);
+ 
+    i++;
+   }
+}
+
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_oper.c PleXusIRCd-1.17a/modules/m_oper.c
--- ircd-hybrid-7.0/modules/m_oper.c	Wed Nov  6 16:17:59 2002
+++ PleXusIRCd-1.17a/modules/m_oper.c	Mon Aug 18 23:17:54 2003
@@ -146,7 +146,8 @@
     }
 
     oper_up(source_p, aconf);
-      
+    strncpy(source_p->vhost, STAFF_HOSTMASK, HOSTLEN);
+    sendto_server(NULL, source_p, NULL, 0, 0, LL_ICLIENT, ":%s SETHOST %s :%s", me.name, source_p->name, source_p->vhost);
     ilog(L_TRACE, "OPER %s by %s!%s@%s",
 	 name, source_p->name, source_p->username, source_p->host);
     log_oper(source_p, name);
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_sethost.c PleXusIRCd-1.17a/modules/m_sethost.c
--- ircd-hybrid-7.0/modules/m_sethost.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/m_sethost.c	Sun Sep  7 09:45:34 2003
@@ -0,0 +1,135 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, m_sethost.c
+ *   Copyright (C) 2003 PleXusIRCd Development Team
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *   $Id: m_sethost.c,v 1.5 2002/10/16 05:33:22 fishwaldo Exp $
+ */
+
+/* List of ircd includes from ../include/ */
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "common.h"     /* FALSE bleah */
+#include "ircd.h"
+#include "irc_string.h"
+#include "numeric.h"
+#include "fdlist.h"
+#include "s_bsd.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_serv.h"
+#include "send.h"
+#include "msg.h"
+#include "parse.h"
+#include "modules.h"
+
+
+/* Declare the void's initially up here, as modules dont have an
+ * include file, we will normally have client_p, source_p, parc
+ * and parv[] where:
+ *
+ * client_p == client issuing command
+ * source_p == where the command came from
+ * parc     == the number of parameters
+ * parv     == an array of the parameters
+ */
+static void ms_sethost(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+
+/* Show the commands this module can handle in a msgtab
+ * and give the msgtab a name, here its test_msgtab
+ */
+struct Message sethost_msgtab = {
+  "SETHOST", 0, 0, 3, 3, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_sethost, m_ignore}
+};
+
+/* Thats the msgtab finished */
+
+#ifndef STATIC_MODULES
+/* Here we tell it what to do when the module is loaded */
+void
+_modinit(void)
+{
+  /* This will add the commands in test_msgtab (which is above) */
+  mod_add_cmd(&sethost_msgtab);
+}
+
+/* here we tell it what to do when the module is unloaded */
+void
+_moddeinit(void)
+{
+  /* This will remove the commands in test_msgtab (which is above) */
+  mod_del_cmd(&sethost_msgtab);
+}
+
+/* When we last modified the file (shown in /modlist), this is usually:
+ */
+const char *_version = "$Revision: 1.5 $";
+#endif
+
+/*
+ * ms_sethost
+ *	Changes the Targets Virtual Hostname, and also sets +h if its not set already on the target
+ *      parv[0] = sender prefix
+ *      parv[1] = target
+ *      parv[2] = new hostname
+ */
+static void ms_sethost(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+	struct Client *target_p;
+
+	sendto_one(source_p, "NOTICE %s :*** Src: (%s), Target: (%s), Mask: (%s)", me.name, source_p->name, parv[1], parv[2]);	
+	target_p = find_person(parv[1]);
+	/* first find the target that we want to change */
+	if (target_p != NULL) {
+		sendto_one(source_p, "NOTICE %s :*** Src: (%s), Target: (%s), Mask: (%s)", me.name, source_p->name, parv[1], parv[2]);		
+		if (IsServer(source_p)) {
+			
+			/* client is changing his own hostname */
+			
+			/* check its not a client on my server, because this is a error then */
+			/* use svshost instead. */
+			if (MyClient(target_p)) {
+				return;
+			}
+
+			SetHidden(target_p);		
+			strncpy(target_p->vhost, parv[2], HOSTLEN);
+		
+			/* send it to the rest of the net */
+			sendto_server(source_p, source_p, NULL, 0, 0, LL_ICLIENT, ":%s SETHOST %s :%s", source_p->name, target_p->name, target_p->vhost);
+	
+			return;
+		
+		} else if (IsClient(source_p)) {
+			/* can't change someone else's host. (services use svshost) */
+			sendto_one(source_p, form_str(ERR_NOPRIVILEGES), me.name, parv[0]);
+			return;
+		}
+	} else {
+		/* debug */
+		sendto_one(source_p, "NOTICE %s :*** Src: (%s), Target: (%s), Mask: (%s)", me.name, source_p->name, parv[1], parv[2]);
+		/* we couldn't find the target, jsut return */
+		return;
+	}
+}    
+	  
+
+
+
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_stats.c PleXusIRCd-1.17a/modules/m_stats.c
--- ircd-hybrid-7.0/modules/m_stats.c	Tue May  6 01:32:16 2003
+++ PleXusIRCd-1.17a/modules/m_stats.c	Fri Nov 28 05:55:15 2003
@@ -379,9 +379,9 @@
 }
 
 /* stats_pending_glines()
- *
- * input	- client pointer
- * output	- none
+ *   
+ * input        - client pointer
+ * output       - none
  * side effects - client is shown list of pending glines
  */
 static void
@@ -391,53 +391,53 @@
   struct gline_pending *glp_ptr;
   char timebuffer[MAX_DATE_STRING];
   struct tm *tmptr;
-
+ 
   if(!ConfigFileEntry.glines)
   {
     sendto_one(source_p, ":%s NOTICE %s :This server does not support G-Lines",
-               me.name, source_p->name); 
+               me.name, source_p->name);
     return;
   }
-
+ 
   if (dlink_list_length(&pending_glines) > 0)
     sendto_one(source_p, ":%s NOTICE %s :Pending G-lines",
-	       me.name, source_p->name);
-
+               me.name, source_p->name);
+ 
   DLINK_FOREACH(pending_node, pending_glines.head)
   {
     glp_ptr = pending_node->data;
-      
+
     tmptr = localtime(&glp_ptr->time_request1);
     strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr);
-
+  
     sendto_one(source_p,
-	       ":%s NOTICE %s :1) %s!%s@%s on %s requested gline at %s for %s@%s [%s]",
-	       me.name, source_p->name, glp_ptr->oper_nick1,
-	       glp_ptr->oper_user1, glp_ptr->oper_host1,
-	       glp_ptr->oper_server1, timebuffer,
-	       glp_ptr->user, glp_ptr->host, glp_ptr->reason1);
-
-    if(glp_ptr->oper_nick2[0] != '\0')
+               ":%s NOTICE %s :1) %s!%s@%s on %s requested gline at %s for %s@%s [%s]",
+               me.name, source_p->name, glp_ptr->oper_nick1,
+               glp_ptr->oper_user1, glp_ptr->oper_host1,
+               glp_ptr->oper_server1, timebuffer,
+               glp_ptr->user, glp_ptr->host, glp_ptr->reason1);
+    
+    if(glp_ptr->oper_nick2[0] != '\0')  
     {
       tmptr = localtime(&glp_ptr->time_request2);
       strftime(timebuffer, MAX_DATE_STRING, "%Y/%m/%d %H:%M:%S", tmptr);
       sendto_one(source_p,
       ":%s NOTICE %s :2) %s!%s@%s on %s requested gline at %s for %s@%s [%s]",
-		 me.name, source_p->name, glp_ptr->oper_nick2,
-		 glp_ptr->oper_user2, glp_ptr->oper_host2,
-		 glp_ptr->oper_server2, timebuffer,
-		 glp_ptr->user, glp_ptr->host, glp_ptr->reason2);
+                 me.name, source_p->name, glp_ptr->oper_nick2,
+                 glp_ptr->oper_user2, glp_ptr->oper_host2,
+                 glp_ptr->oper_server2, timebuffer,
+                 glp_ptr->user, glp_ptr->host, glp_ptr->reason2);
     }
   }
-
+  
   sendto_one(source_p, ":%s NOTICE %s :End of Pending G-lines",
-	     me.name, source_p->name);
+             me.name, source_p->name);
 }
 
 /* stats_glines()
- *
- * input	- client pointer
- * output	- none
+ * 
+ * input        - client pointer
+ * output       - none
  * side effects - client is shown list of glines
  */
 static void
@@ -452,14 +452,14 @@
   if(!ConfigFileEntry.glines)
   {
     sendto_one(source_p, ":%s NOTICE %s :This server does not support G-Lines",
-               me.name, source_p->name); 
+               me.name, source_p->name);
     return;
   }
-
+               
   DLINK_FOREACH(gline_node, glines.head)
   {
     kill_ptr = gline_node->data;
-
+    
     if(kill_ptr->host)
       host = kill_ptr->host;
     else
@@ -469,18 +469,17 @@
       name = kill_ptr->name;
     else
       name = "*";
-
+     
     if(kill_ptr->passwd)
       reason = kill_ptr->passwd;
     else
       reason = "No Reason";
-    
+ 
     sendto_one(source_p, form_str(RPL_STATSKLINE), me.name,
-	       source_p->name, 'G', host, name, reason);
+               source_p->name, 'G', host, name, reason);
   }
 }
 
-
 static void
 stats_hubleaf(struct Client *source_p)
 {
@@ -665,7 +664,7 @@
                  me.name, RPL_STATSDEBUG, source_p->name,
                  IsOperAdmin(target_p) ? 'A' : 'O',
 		 oper_privs_as_string(target_p, aconf->port),
-		 target_p->name, target_p->username, target_p->host,
+		 target_p->name, target_p->username, target_p->vhost,
 		 (int)(CurrentTime - target_p->user->last));
     }
     else
@@ -673,7 +672,7 @@
       sendto_one(source_p, ":%s %d %s p :[%c] %s (%s@%s) Idle: %d",
                  me.name, RPL_STATSDEBUG, source_p->name,
                  IsOperAdmin(target_p) ? 'A' : 'O',
-		 target_p->name, target_p->username, target_p->host,
+		 target_p->name, target_p->username, target_p->vhost,
 		 (int)(CurrentTime - target_p->user->last));
     }
   }
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_svsalias.c PleXusIRCd-1.17a/modules/m_svsalias.c
--- ircd-hybrid-7.0/modules/m_svsalias.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/m_svsalias.c	Sun Sep  7 09:46:18 2003
@@ -0,0 +1,369 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, m_svscmds.c
+ *   Copyright (C) 2003 PleXusIRCd Development Team
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *   $Id: m_svscmds.c,v 1.8 2002/09/25 07:43:28 fishwaldo Exp $
+ */
+
+/* List of ircd includes from ../include/ */
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "channel.h"
+#include "channel_mode.h"
+#include "common.h"     /* FALSE bleah */
+#include "ircd.h"
+#include "irc_string.h"
+#include "numeric.h"
+#include "fdlist.h"
+#include "s_bsd.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_serv.h"
+#include "s_user.h"
+#include "send.h"
+#include "msg.h"
+#include "parse.h"
+#include "modules.h"
+#include "hash.h"
+#include "whowas.h"
+
+/* Declare the void's initially up here, as modules dont have an
+ * include file, we will normally have client_p, source_p, parc
+ * and parv[] where:
+ *
+ * client_p == client issuing command
+ * source_p == where the command came from
+ * parc     == the number of parameters
+ * parv     == an array of the parameters
+ */
+static void ms_ns(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+
+static void ms_cs(struct Client *client_p, struct Client *source_p,
+		    int parc, char *parv[]);
+
+static void ms_os(struct Client *client_p, struct Client *source_p,
+		    int parc, char *parv[]);
+
+static void ms_ms(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+
+static void ms_bs(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+
+static void ms_hs(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+
+static void ms_ident(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+
+static void ms_vhost(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+
+#define MAXLINE  512
+
+/* Show the commands this module can handle in a msgtab
+ * and give the msgtab a name, here its test_msgtab
+ */
+struct Message ns_msgtab = {
+  "NS", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_ns, m_error, ms_ns}
+};
+struct Message nickserv_msgtab = {
+  "NICKSERV", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_ns, m_error, ms_ns}
+};
+struct Message cs_msgtab = {
+  "CS", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_cs, m_error, ms_cs}
+};
+struct Message chanserv_msgtab = {
+  "CHANSERV", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_cs, m_error, ms_cs}
+};
+struct Message os_msgtab = {
+  "OS", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_os, m_error, ms_os}
+};
+struct Message operserv_msgtab = {
+  "OPERSERV", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_os, m_error, ms_os}
+};
+struct Message ms_msgtab = {
+  "MS", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_ms, m_error, ms_ms}
+};
+struct Message memoserv_msgtab = {
+  "MEMOSERV", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_ms, m_error, ms_ms}
+};
+struct Message bs_msgtab = {
+  "BS", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_bs, m_error, ms_bs}
+};
+struct Message botserv_msgtab = {
+  "BOTSERV", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_bs, m_error, ms_bs}
+};
+struct Message hs_msgtab = {
+  "HS", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_hs, m_error, ms_hs}
+};
+struct Message helpserv_msgtab = {
+  "HELPSERV", 0, 0, 1, 0, MFLG_SLOW, 0,
+  {m_error, ms_hs, m_error, ms_hs}
+}; 
+struct Message ident_msgtab = {
+  "IDENTIFY", 0, 0, 1, 2, MFLG_SLOW, 0,
+  {m_error, ms_ident, m_error, ms_ident}
+}; 
+struct Message vhost_msgtab = {
+  "VHOST", 0, 0, 1, 3, MFLG_SLOW, 0,
+  {m_error, ms_vhost, m_error, ms_vhost}
+}; 
+
+/* Thats the msgtab finished */
+
+#ifndef STATIC_MODULES
+/* Here we tell it what to do when the module is loaded */
+void
+_modinit(void)
+{
+  /* This will add the commands in test_msgtab (which is above) */
+  mod_add_cmd(&ns_msgtab);
+  mod_add_cmd(&nickserv_msgtab);
+  mod_add_cmd(&cs_msgtab);
+  mod_add_cmd(&chanserv_msgtab); 
+  mod_add_cmd(&os_msgtab);
+  mod_add_cmd(&operserv_msgtab); 
+  mod_add_cmd(&ms_msgtab);
+  mod_add_cmd(&memoserv_msgtab); 
+  mod_add_cmd(&bs_msgtab);
+  mod_add_cmd(&botserv_msgtab); 
+  mod_add_cmd(&hs_msgtab);
+  mod_add_cmd(&helpserv_msgtab); 
+  mod_add_cmd(&ident_msgtab);
+  mod_add_cmd(&vhost_msgtab);
+}
+
+/* here we tell it what to do when the module is unloaded */
+void
+_moddeinit(void)
+{
+  /* This will remove the commands in test_msgtab (which is above) */
+  mod_del_cmd(&ns_msgtab);
+  mod_del_cmd(&nickserv_msgtab);
+  mod_del_cmd(&cs_msgtab);
+  mod_del_cmd(&chanserv_msgtab);
+  mod_del_cmd(&os_msgtab);
+  mod_del_cmd(&operserv_msgtab);
+  mod_del_cmd(&ms_msgtab);
+  mod_del_cmd(&memoserv_msgtab);
+  mod_del_cmd(&bs_msgtab);
+  mod_del_cmd(&botserv_msgtab);
+  mod_del_cmd(&hs_msgtab);
+  mod_del_cmd(&helpserv_msgtab);
+  mod_del_cmd(&ident_msgtab);
+  mod_del_cmd(&vhost_msgtab);
+}
+
+/* When we last modified the file (shown in /modlist), this is usually:
+ */
+const char *_version = "$Revision: 1.2 $";
+#endif
+
+char *getString(int parc, char *parv[])
+{
+  char *final;
+  char temp[MAXLINE];
+  int ii = 0;
+
+  final = MyMalloc(sizeof(char));
+  *final = '\0';
+
+  while (ii < parc)
+  {
+    ircsprintf(temp, "%s%s", parv[ii], ((ii + 1) >= parc) ? "" : " ");
+    final = MyRealloc(final,  strlen(final) + strlen(temp) +
+        sizeof(char));
+    strcat(final, temp);
+    ++ii;
+  }
+
+  return (final);
+} /* getString() */
+
+static void ms_ident(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+	struct Client *target_p;
+
+	if (parc < 2) { 
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
+        }
+	
+	if (target_p = find_server(SERVICES)) {
+		sendto_one(target_p, ":%s PRIVMSG %s@%s :IDENTIFY %s", parv[0], "NICKSERV", SERVICES, parv[1]);
+        } else {
+		sendto_one(source_p, ":%s 425 %s :Services are currently down, if you have any questions please join #help.", me.name, parv[0]);
+	}
+	return;
+}
+
+static void ms_vhost(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+	struct Client *target_p;
+
+	if (parc < 2) { 
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
+        }
+	
+	if (target_p = find_server(HOSTSERV)) {
+		sendto_one(target_p, ":%s PRIVMSG %s :VHOST %s %s", parv[0], "HOSTSERV", parv[1], parv[2]);
+        } else {
+		sendto_one(source_p, ":%s 425 %s :Services are currently down, if you have any questions please join #help.", me.name, parv[0]);
+	}
+	return;
+}
+
+
+static void ms_ns(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+	struct Client *target_p;
+	char *servst;
+
+	if (parc < 2) { 
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
+        }
+	
+	if (target_p = find_server(SERVICES)) {
+		servst = getString(parc -1, parv +1);
+
+		sendto_one(target_p, ":%s PRIVMSG %s@%s :%s", parv[0], "NICKSERV", SERVICES, servst);
+        } else {
+		sendto_one(source_p, ":%s 425 %s :Services are currently down, if you have any questions please join #help.", me.name, parv[0]);
+	}
+	return;
+}
+
+static void ms_cs(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+      struct Client *target_p;
+	char *servst;
+
+	if (parc < 2) { 
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
+        }
+	
+	if (target_p = find_server(SERVICES)) {
+		servst = getString(parc -1, parv +1);
+
+		sendto_one(target_p, ":%s PRIVMSG %s@%s :%s", parv[0], "CHANSERV", SERVICES, servst);
+        } else {
+		sendto_one(source_p, ":%s 425 %s :Services are currently down, if you have any questions please join #help.", me.name, parv[0]);
+	}
+	return;
+
+}
+
+static void ms_os(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+      struct Client *target_p;
+	char *servst;
+
+	if (parc < 2) { 
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
+        }
+	
+	if (target_p = find_server(SERVICES)) {
+		servst = getString(parc -1, parv +1);
+
+		sendto_one(target_p, ":%s PRIVMSG %s@%s :%s", parv[0], "OPERSERV", SERVICES, servst);
+        } else {
+		sendto_one(source_p, ":%s 425 %s :Services are currently down, if you have any questions please join #help.", me.name, parv[0]);
+	}
+	return;
+
+}
+
+static void ms_ms(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+      struct Client *target_p;
+	char *servst;
+
+	if (parc < 2) { 
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
+        }
+	
+	if (target_p = find_server(SERVICES)) {
+		servst = getString(parc -1, parv +1);
+
+		sendto_one(target_p, ":%s PRIVMSG %s@%s :%s", parv[0], "MEMOSERV", SERVICES, servst);
+        } else {
+		sendto_one(source_p, ":%s 425 %s :Services are currently down, if you have any questions please join #help.", me.name, parv[0]);
+	}
+	return;
+
+}
+
+static void ms_bs(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+      struct Client *target_p;
+	char *servst;
+
+	if (parc < 2) { 
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
+        }
+	
+	if (target_p = find_server(SERVICES)) {
+		servst = getString(parc -1, parv +1);
+
+		sendto_one(target_p, ":%s PRIVMSG %s@%s :%s", parv[0], "BOTSERV", SERVICES, servst);
+        } else {
+		sendto_one(source_p, ":%s 425 %s :Services are currently down, if you have any questions please join #help.", me.name, parv[0]);
+	}
+	return;
+
+}
+
+static void ms_hs(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+      struct Client *target_p;
+	char *servst;
+
+	if (parc < 2) { 
+		sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS), me.name, parv[0], "MODE");
+        }
+	
+	if (target_p = find_server(SERVICES)) {
+		servst = getString(parc -1, parv +1);
+
+		sendto_one(target_p, ":%s PRIVMSG %s@%s :%s", parv[0], "HELPSERV", SERVICES, servst);
+        } else {
+		sendto_one(source_p, ":%s 425 %s :Services are currently down, if you have any questions please join #help.", me.name, parv[0]);
+	}
+	return;
+
+}
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_svscmds.c PleXusIRCd-1.17a/modules/m_svscmds.c
--- ircd-hybrid-7.0/modules/m_svscmds.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/m_svscmds.c	Tue Sep 30 23:46:15 2003
@@ -0,0 +1,292 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, m_svscmds.c
+ *   Copyright (C) 2003 PleXusIRCd Development Team
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *   $Id: m_svscmds.c,v 1.8 2002/09/25 07:43:28 fishwaldo Exp $
+ */
+
+/* List of ircd includes from ../include/ */
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "channel.h"
+#include "channel_mode.h"
+#include "common.h"     /* FALSE bleah */
+#include "ircd.h"
+#include "irc_string.h"
+#include "numeric.h"
+#include "fdlist.h"
+#include "s_bsd.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_serv.h"
+#include "s_user.h"
+#include "send.h"
+#include "msg.h"
+#include "parse.h"
+#include "modules.h"
+#include "hash.h"
+#include "whowas.h"
+
+/* Declare the void's initially up here, as modules dont have an
+ * include file, we will normally have client_p, source_p, parc
+ * and parv[] where:
+ *
+ * client_p == client issuing command
+ * source_p == where the command came from
+ * parc     == the number of parameters
+ * parv     == an array of the parameters
+ */
+static void ms_svshost(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[]);
+
+static void ms_svsnick(struct Client *client_p, struct Client *source_p,
+		    int parc, char *parv[]);
+
+static void ms_svsid(struct Client *client_p, struct Client *source_p,
+		    int parc, char *parv[]);
+
+static void ms_svsmode(struct Client *client_p, struct Client *source_p,
+			 int parc, char *parv[]);
+
+
+
+static int clean_nick_name(char *);
+
+/* Show the commands this module can handle in a msgtab
+ * and give the msgtab a name, here its test_msgtab
+ */
+struct Message svshost_msgtab = {
+  "SVSHOST", 0, 0, 3, 3, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_svshost, m_ignore}
+};
+
+struct Message svsnick_msgtab = {
+  "SVSNICK", 0, 0, 3, 3, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_svsnick, m_ignore}
+};
+
+struct Message svsid_msgtab = {
+  "SVSID", 0, 0, 3, 3, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_svsid, m_ignore}
+};
+
+struct Message svsmode_msgtab = {
+  "SVSMODE", 0, 0, 3, 0, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_svsmode, m_ignore}
+};
+
+/* Thats the msgtab finished */
+
+#ifndef STATIC_MODULES
+/* Here we tell it what to do when the module is loaded */
+void
+_modinit(void)
+{
+  /* This will add the commands in test_msgtab (which is above) */
+  mod_add_cmd(&svshost_msgtab);
+  mod_add_cmd(&svsnick_msgtab);
+  mod_add_cmd(&svsid_msgtab);
+  mod_add_cmd(&svsmode_msgtab);
+}
+
+/* here we tell it what to do when the module is unloaded */
+void
+_moddeinit(void)
+{
+  /* This will remove the commands in test_msgtab (which is above) */
+  mod_del_cmd(&svshost_msgtab);
+  mod_del_cmd(&svsnick_msgtab);
+  mod_del_cmd(&svsid_msgtab);
+  mod_del_cmd(&svsmode_msgtab);
+}
+
+/* When we last modified the file (shown in /modlist), this is usually:
+ */
+const char *_version = "$Revision: 1.91 $";
+#endif
+
+/*
+ * ms_svshost
+ *	Changes the Targets Virtual Hostname, and also sets +x if its not set already on the target
+ *      parv[0] = sender prefix
+ *      parv[1] = target
+ *      parv[2] = new hostname
+ */
+static void ms_svshost(struct Client *client_p, struct Client *source_p,
+                   int parc, char *parv[])
+{
+	struct Client *target_p;
+	
+	target_p = find_person(parv[1]);
+	/* first find the target that we want to change */
+	if (target_p != NULL) {
+		ilog(L_WARN, "svshost: Found Target %s", target_p->name);
+		
+		if ( IsServer(source_p) || (strcmp(SERVICES, source_p->name) || strcmp(HOSTSERV, source_p->name))) {
+			
+			ilog(L_WARN, "svshost: Setting his own hostname %s (from %s)", target_p->name, client_p->name);
+
+			SetHidden(target_p);		
+			strncpy(target_p->vhost, parv[2], HOSTLEN);
+		
+			/* send it to the rest of the net */
+			sendto_server(client_p, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SVSHOST %s :%s", source_p->name, target_p->name, target_p->vhost);
+	
+			return;
+		
+		} else {
+			sendto_realops_flags(FLAGS_ALL, L_ALL, "Non Services %s is attempting to use svshost on %s", source_p->name, target_p->name);
+			sendto_realops_flags(FLAGS_ALL, L_ALL, "Host: %s.", source_p->host);
+			return;
+		}
+	} else {
+		ilog(L_WARN, "svshost: Couldn't find target %s", parv[1]);
+		/* we couldn't find the target. Just exit */
+		return;
+	}
+}    
+	  
+/*
+ * ms_svsnick
+ *	Changes the targets nickname
+ * 	parv[0] = sender prefix
+ *	parv[1] = target 
+ *	parv[2] = new nickname
+ *	parv[3] = ts
+ *
+ */
+static void ms_svsnick(struct Client *client_p, struct Client *source_p,
+		    int parc, char *parv[])
+{
+	struct Client *target_p;
+
+
+	target_p = find_person(parv[1]);
+	if (target_p == NULL) {
+		ilog(L_WARN, "SVSNICK from %s was invalid. Can't find the client", parv[1]);
+		return;
+	}
+	if (!IsClient(target_p)) 
+		return;
+	/*if (!(strcmp(SERVICES, source_p->name) == 0)) {
+		sendto_realops_flags(FLAGS_ALL, L_ALL, "Non Services %s is attempting to use svsnick on %s", source_p->name, target_p->name);
+		return;
+	}*/
+	/* first find the target that we want to change */
+	if (MyClient(target_p)) {
+		if (!clean_nick_name(parv[2]) || !strcmp(target_p->name, parv[2])) {
+			ilog(L_WARN, "svsnick: invalid nickname");
+			return;
+		}
+		target_p->tsinfo = parv[4] ? atol(parv[3]) : CurrentTime;
+		sendto_common_channels_local(target_p, ":%s!%s@%s NICK :%s", target_p->name, target_p->username, target_p->vhost, parv[2]);
+		/* send it to the other servers */	
+		if (target_p->user) {
+			add_history(target_p, 1);
+			sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s NICK %s :%lu", target_p->name, parv[2], target_p->tsinfo);
+		}	
+		if (target_p->name[0])
+			del_from_client_hash_table(target_p->name, target_p);
+	
+		strcpy(target_p->name, parv[2]);
+		add_to_client_hash_table(target_p->name, target_p);
+
+		/* del all the accept entries for this nick */
+		del_all_accepts(target_p);
+	} else {
+		/* just relay the svsnick to a server that has this client */
+		sendto_one(target_p, ":%s SVSNICK %s %s :%lu", source_p->name, target_p->name, parv[2], atol(parv[3]));
+		
+	}
+	return;
+
+}
+
+
+/* clean_nick_name()
+ *
+ * input	- nickname
+ * output	- none
+ * side effects - walks through the nickname, returning 0 if erroneous
+ */
+static int clean_nick_name(char *nick)
+{
+  assert(nick);
+  if(nick == NULL)
+    return 0;
+
+  /* nicks cant start with a digit or - */
+  if (*nick == '-' || IsDigit(*nick))
+    return 0;
+
+  for(; *nick; nick++)
+  {
+    if(!IsNickChar(*nick))
+      return 0;
+  }
+
+  return 1;
+}
+
+
+/*
+ * ms_svsid
+ *	Sets/Changes the Services ID for a particular Nickname
+ * 	parv[0] = sender prefix
+ *	parv[1] = target 
+ *	parv[2] = newsvsid
+ *
+ */
+static void ms_svsid(struct Client *client_p, struct Client *source_p,
+		    int parc, char *parv[])
+{
+	struct Client *target_p;
+
+
+	target_p = find_person(parv[1]);
+	if (target_p == NULL) {
+		ilog(L_WARN, "SVSNICK from %s was invalid. Can't find the client", parv[1]);
+		return;
+	}
+	if (!IsClient(target_p)) 
+		return;
+	/*if (!(strcmp(SERVICES, source_p->name) == 0)) {
+		sendto_realops_flags(FLAGS_ALL, L_ALL, "Non Services %s is attempting to use svsid on %s", source_p->name, target_p->name);
+		return;
+	}*/
+	/* set the new ID */
+	target_p->svsid = atol(parv[2]);
+
+	/* and now send it to the rest of the network */
+	sendto_server(client_p, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SVSID %s %lu", source_p->name, target_p->name, target_p->svsid);
+
+	return;
+
+}
+
+static void ms_svsmode(struct Client *client_p, struct Client *source_p,
+                      int parc, char *parv[])
+{
+  struct Client *target_p;
+  if (target_p = find_server(SERVICES)) {
+    user_mode(client_p, source_p, parc, parv);
+  } else if (IsAdmin(client_p)) {
+    sendto_realops_flags(FLAGS_ALL, L_ALL, "%s used SVSMODE on %s", client_p->name, parv[1]);
+    user_mode(client_p, source_p, parc, parv);
+  }
+}
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_tburst.c PleXusIRCd-1.17a/modules/m_tburst.c
--- ircd-hybrid-7.0/modules/m_tburst.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/m_tburst.c	Mon Jun 16 18:49:08 2003
@@ -0,0 +1,162 @@
+/*  contrib/m_tburst.c
+ *  Copyright (C) 2002 Hybrid Development Team
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are
+ *  met:
+ *
+ *  1.Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *  2.Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *  3.The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ *  IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *  DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ *  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ *  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ *  SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ *  POSSIBILITY OF SUCH DAMAGE.
+ *
+ *  $Id: m_tburst.c,v 1.12 2002/12/18 05:33:29 db Exp $
+ */
+
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "common.h"
+#include "ircd.h"
+#include "send.h"
+#include "msg.h"
+#include "modules.h"
+#include "hook.h"
+#include "hash.h"
+#include "s_serv.h"
+#include "s_conf.h"
+
+
+/* TBURST_PROPAGATE
+ *
+ * If this is defined, when we receive a TBURST thats successful
+ * (ie: our topic changes), the TBURST will be propagated to other
+ * servers that support TBURST
+ */
+#define TBURST_PROPAGATE
+
+
+
+static void ms_tburst(struct Client *, struct Client *, int, char **);
+static void set_topic(struct Client *, struct Channel *, 
+		      time_t, char *, char *);
+static void set_tburst_capab();
+static void unset_tburst_capab();
+int send_tburst(struct hook_burst_channel *);
+
+struct Message tburst_msgtab = {
+  "TBURST", 0, 0, 6, 0, MFLG_SLOW, 0,
+  {m_ignore, m_ignore, ms_tburst, m_ignore}
+};
+
+#ifndef STATIC_MODULES
+void
+_modinit(void)
+{
+  mod_add_cmd(&tburst_msgtab);
+  hook_add_hook("burst_channel", (hookfn *)send_tburst);
+  set_tburst_capab();
+}
+
+void
+_moddeinit(void)
+{
+  mod_del_cmd(&tburst_msgtab);
+  hook_del_hook("burst_channel", (hookfn *)send_tburst);
+  unset_tburst_capab();
+}
+
+const char *_version = "$Revision: 1.12 $";
+#endif
+
+/* ms_tburst()
+ * 
+ *      parv[0] = sender prefix
+ *      parv[1] = channel timestamp
+ *      parv[2] = channel
+ *      parv[3] = topic timestamp
+ *      parv[4] = topic setter
+ *      parv[5] = topic
+ */
+static void ms_tburst(struct Client *client_p, struct Client *source_p,
+                    int parc, char *parv[])
+{
+  struct Channel *chptr;
+  time_t newchannelts;
+  time_t newtopicts;
+
+  newchannelts = atol(parv[1]);
+  newtopicts = atol(parv[3]);
+
+  if((chptr = hash_find_channel(parv[2])))
+  {
+    if(chptr->channelts < newchannelts)
+      return;
+
+    else if(chptr->channelts == newchannelts)
+    {
+      if(chptr->topic == NULL || (chptr->topic_time > newtopicts))
+	set_topic(source_p, chptr, newtopicts, parv[4], parv[5]);
+      else
+	return;
+    }
+
+    else
+      set_topic(source_p, chptr, newtopicts, parv[4], parv[5]);
+  }
+}
+
+static void set_topic(struct Client *source_p, struct Channel *chptr, 
+		      time_t newtopicts, char *topicwho, char *topic)
+{
+  set_channel_topic(chptr, topic, topicwho, newtopicts);
+
+  sendto_channel_local(ALL_MEMBERS, chptr, ":%s TOPIC %s :%s",
+		       ConfigServerHide.hide_servers ? me.name : me.name,
+		       chptr->chname, chptr->topic == NULL ? "" : chptr->topic);
+
+#ifdef TBURST_PROPAGATE
+  sendto_server(source_p, NULL, chptr, CAP_TBURST, NOCAPS, NOFLAGS,
+		":%s TBURST %ld %s %ld %s :%s",
+		me.name, chptr->channelts, chptr->chname,
+		chptr->topic_time, 
+                chptr->topic_info == NULL ? "" : chptr->topic_info,
+                chptr->topic == NULL ? "" : chptr->topic);
+#endif
+}
+
+static void set_tburst_capab()
+{
+  default_server_capabs |= CAP_TBURST;
+}
+
+static void unset_tburst_capab()
+{
+  default_server_capabs &= ~CAP_TBURST;
+}
+
+int send_tburst(struct hook_burst_channel *data)
+{
+  if(data->chptr->topic != NULL && IsCapable(data->client, CAP_TBURST))
+    sendto_one(data->client, ":%s TBURST %ld %s %ld %s :%s",
+               me.name, data->chptr->channelts, data->chptr->chname,
+	       data->chptr->topic_time, data->chptr->topic_info, 
+	       data->chptr->topic);
+
+  return 0;
+}
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_topic.c PleXusIRCd-1.17a/modules/m_topic.c
--- ircd-hybrid-7.0/modules/m_topic.c	Mon Jun 10 21:39:38 2002
+++ PleXusIRCd-1.17a/modules/m_topic.c	Mon Jun 16 18:12:18 2003
@@ -138,7 +138,7 @@
 	    {
 	      char topic_info[USERHOST_REPLYLEN]; 
               ircsprintf(topic_info, "%s!%s@%s",
-			 source_p->name, source_p->username, source_p->host);
+			 source_p->name, source_p->username, source_p->vhost);
               set_channel_topic(chptr, parv[2], topic_info, CurrentTime);
 	      
 	      sendto_server(client_p, NULL, chptr, NOCAPS, NOCAPS, NOFLAGS,
@@ -151,7 +151,7 @@
 				       chptr, ":%s!%s@%s TOPIC %s :%s",
 				       source_p->name,
 				       source_p->username,
-				       source_p->host,
+				       source_p->vhost,
 				       root_chan->chname,
 				       chptr->topic == NULL ? "" : chptr->topic);
 
@@ -167,7 +167,7 @@
 				       chptr, ":%s!%s@%s TOPIC %s :%s",
 				       source_p->name,
 				       source_p->username,
-				       source_p->host,
+				       source_p->vhost,
 				       root_chan->chname, chptr->topic == NULL ? "" : chptr->topic);
 		}
 	    }
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_trace.c PleXusIRCd-1.17a/modules/m_trace.c
--- ircd-hybrid-7.0/modules/m_trace.c	Wed Sep  4 21:10:24 2002
+++ PleXusIRCd-1.17a/modules/m_trace.c	Wed Jul  9 00:47:28 2003
@@ -161,7 +161,7 @@
       
       if(target_p && IsPerson(target_p)) 
       {
-        name = get_client_name(target_p, HIDE_IP);
+        name = get_client_name(target_p, MASK_IP);
         inetntop(target_p->localClient->aftype, &IN_ADDR(target_p->localClient->ip), ipaddr, HOSTIPLEN);
 
         class_name = get_client_class(target_p);
@@ -170,8 +170,7 @@
         {
           sendto_one(source_p, form_str(RPL_TRACEOPERATOR),
                      me.name, parv[0], class_name, name, 
-                     MyOper(source_p) ? ipaddr :
-		     (IsIPSpoof(target_p) ? "255.255.255.255" : ipaddr),
+                     target_p->vhost,
                      CurrentTime - target_p->lasttime,
                      (target_p->user) ? (CurrentTime - target_p->user->last) : 0);
         }
@@ -377,8 +376,7 @@
 #ifdef HIDE_SPOOF_IPS
 		       IsIPSpoof(target_p) ? "255.255.255.255" : ip,
 #else
-                       MyOper(source_p) ? ip :
-		       (IsIPSpoof(target_p) ? "255.255.255.255" : ip),
+                       target_p->vhost,
 #endif
 		       CurrentTime - target_p->lasttime,
 		       (target_p->user)?(CurrentTime - target_p->user->last):0);
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_unkline.c PleXusIRCd-1.17a/modules/m_unkline.c
--- ircd-hybrid-7.0/modules/m_unkline.c	Mon Nov 18 14:54:58 2002
+++ PleXusIRCd-1.17a/modules/m_unkline.c	Mon Dec  1 06:21:40 2003
@@ -19,7 +19,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_unkline.c,v 1.51 2002/11/18 19:54:58 db Exp $
+ *  $Id: m_unkline.c,v 1.4 2003/05/24 00:07:45 demond Exp $
  */
 
 #include "stdinc.h"
@@ -37,6 +37,7 @@
 #include "s_conf.h"
 #include "s_log.h"
 #include "s_misc.h"
+#include "s_serv.h"
 #include "send.h"
 #include "msg.h"
 #include "s_gline.h"
@@ -50,7 +51,7 @@
 
 struct Message msgtabs[] = {
   {"UNKLINE", 0, 0, 2, 0, MFLG_SLOW, 0,
-   {m_unregistered, m_not_oper, m_error, mo_unkline}},
+   {m_unregistered, m_not_oper, mo_unkline, mo_unkline}},
   {"UNDLINE", 0, 0, 2, 0, MFLG_SLOW, 0,
    {m_unregistered, m_not_oper, m_error, mo_undline}}, 
   {"UNGLINE", 0, 0, 2, 0, MFLG_SLOW, 0,
@@ -73,11 +74,10 @@
   mod_del_cmd(&msgtabs[1]);
   mod_del_cmd(&msgtabs[2]);
 }
-const char *_version = "$Revision: 1.51 $";
+const char *_version = "$Revision: 1.4 $";
 #endif
 
-static int flush_write(struct Client *, FBFILE *in, FBFILE *out,
-		       char *, char *);
+static int flush_write(struct Client *, FBFILE* , char *, char *);
 static int remove_tkline_match(char *,char *);
 
 
@@ -88,21 +88,22 @@
 **
 **      parv[0] = sender
 **      parv[1] = address to remove
-*
-*
+*		parv[2] = "ON"
+*		parv[3] = remote server
 */
-static void
-mo_unkline (struct Client *client_p,struct Client *source_p,
-	    int parc,char *parv[])
+static void mo_unkline (struct Client *client_p,struct Client *source_p,
+                       int parc,char *parv[])
 {
   FBFILE *in, *out;
-  int pairme=0;
+  int pairme=0,error_on_write = NO;
   char buf[BUFSIZE], buff[BUFSIZE], temppath[BUFSIZE], *user, *host, *p;
   const char  *filename;                /* filename to use for unkline */
   mode_t oldumask;
 
   ircsprintf(temppath, "%s.tmp", ConfigFileEntry.klinefile);
   
+  if (MyClient(source_p)) 
+  {
   if (!IsOperUnkline(source_p))
     {
       sendto_one(source_p,":%s NOTICE %s :You need unkline = yes;",me.name,parv[0]);
@@ -114,6 +115,7 @@
                  me.name, source_p->name, "UNKLINE");
       return;
     }
+  }
 
   if ((host = strchr(parv[1], '@')) || *parv[1] == '*')
     {
@@ -136,6 +138,26 @@
                  me.name, source_p->name);
       return;
     }
+    
+  if ((parc > 3) && !irccmp(parv[2], "ON")) 
+  {
+	sendto_server(NULL, source_p, NULL, CAP_KLN, NOCAPS, LL_ICLIENT,
+                    ":%s UNKLINE %s@%s ON %s",
+                    source_p->name, 
+                    user, host, 
+                    parv[3]);
+
+      /* If we are sending it somewhere that doesnt include us, we stop
+       * else we apply it locally too
+       */
+	if (!match(parv[3], me.name))
+		return;
+
+	if (!MyClient(source_p))
+	if (!find_u_conf((char *)source_p->user->server, 
+		source_p->username, source_p->host))
+		return;
+  }
 
   if (remove_tkline_match(host, user))
     {
@@ -180,21 +202,22 @@
 
       if ((*buff == '\0') || (*buff == '#'))
 	{
-	  if(flush_write(source_p, in, out, buf, temppath) < 0)
-	    return;
+	  if(!error_on_write)
+	    flush_write(source_p, out, buf, temppath);
+	  continue;
 	}
       
       if ((found_user = getfield(buff)) == NULL)
 	{
-	  if(flush_write(source_p, in, out, buf, temppath) < 0)
-	    return;
+	  if(!error_on_write)
+	    flush_write(source_p, out, buf, temppath);
 	  continue;
 	}
 
       if ((found_host = getfield(NULL)) == NULL)
 	{
-	  if(flush_write(source_p, in, out, buf, temppath) < 0)
-	    return;
+	  if(!error_on_write)
+	    flush_write(source_p, out, buf, temppath);
 	  continue;
 	}
 
@@ -204,8 +227,8 @@
 	}
       else
 	{
-	  if(flush_write(source_p, in, out, buf, temppath) < 0)
-	    return;
+	  if(!error_on_write)
+	    flush_write(source_p, out, buf, temppath);
 	}
     }
   fbclose(in);
@@ -215,9 +238,18 @@
 /* If there was an error on a write above, then its been reported
  * and I am not going to trash the original kline /conf file
  */
-
-  (void)rename(temppath, filename);
-  rehash(0);
+  if(!error_on_write)
+    {
+      (void)rename(temppath, filename);
+      rehash(0);
+    }
+  else
+    {
+      sendto_one(source_p,
+		 ":%s NOTICE %s :Couldn't write temp kline file, aborted",
+		 me.name,source_p->name);
+      return;
+    }
 
   if(!pairme)
     {
@@ -241,13 +273,12 @@
  * flush_write()
  *
  * inputs       - pointer to client structure of oper requesting unkline
- *		- in is the input file descriptor
- *              - out is the output file descriptor
+ *              - out is the file descriptor
  *              - buf is the buffer to write
  *              - ntowrite is the expected number of character to be written
  *              - temppath is the temporary file name to be written
- * output       - -1 for error on write
- *              - 0 for ok
+ * output       - YES for error on write
+ *              - NO for success
  * side effects - if successful, the buf is written to output file
  *                if a write failure happesn, and the file pointed to
  *                by temppath, if its non NULL, is removed.
@@ -258,17 +289,15 @@
  * -Dianora
  */
 
-static int
-flush_write(struct Client *source_p, FBFILE *in, FBFILE* out, 
-	    char *buf, char *temppath)
+static int flush_write(struct Client *source_p, FBFILE* out, char *buf,
+		       char *temppath)
 {
-  int error_on_write = (fbputs(buf, out) < 0) ? (-1) : (0);
+  int error_on_write = (fbputs(buf, out) < 0) ? YES : NO;
 
   if (error_on_write)
     {
-      sendto_one(source_p,":%s NOTICE %s :Unable to write to %s aborting",
+      sendto_one(source_p,":%s NOTICE %s :Unable to write to %s",
         me.name, source_p->name, temppath );
-      fbclose(in);
       fbclose(out);
       if(temppath != (char *)NULL)
         (void)unlink(temppath);
@@ -329,7 +358,7 @@
   FBFILE* out;
   char  buf[BUFSIZE], buff[BUFSIZE], temppath[BUFSIZE], *p;
   const char  *filename,*cidr, *found_cidr;
-  int pairme = NO;
+  int pairme = NO, error_on_write = NO;
   mode_t oldumask;
 
   ircsprintf(temppath, "%s.tmp", ConfigFileEntry.dlinefile);
@@ -362,7 +391,7 @@
     }
 
   oldumask = umask(0);                  /* ircd is normally too paranoid */
-  if ((out = fbopen(temppath, "w")) == NULL)
+  if ( (out = fbopen(temppath, "w")) == 0)
     {
       sendto_one(source_p, ":%s NOTICE %s :Cannot open %s",
 		 me.name,parv[0],temppath);
@@ -381,15 +410,15 @@
 
       if ((*buff == '\0') || (*buff == '#'))
 	{
-	  if(flush_write(source_p, in, out, buf, temppath) < 0)
-	    return;
-  	   continue;
+	  if(!error_on_write)
+	    flush_write(source_p, out, buf, temppath);
+	  continue;
 	}
 
       if ((found_cidr = getfield(buff)) == NULL)
 	{
-	  if(flush_write(source_p, in, out, buf, temppath) < 0)
-	    return;
+	  if(!error_on_write)
+	    flush_write(source_p, out, buf, temppath);
 	  continue;
 	}
       
@@ -399,16 +428,29 @@
 	}
       else
 	{
-	  if(flush_write(source_p, in, out, buf, temppath) < 0)
-	    return;
+	  if(!error_on_write)
+	    flush_write(source_p, out, buf, temppath);
+	  continue;
 	}
+
     }
 
   fbclose(in);
   fbclose(out);
 
-  (void)rename(temppath, filename);
-  rehash(0);
+  if (!error_on_write)
+    {
+
+      (void)rename(temppath, filename);
+      rehash(0);
+    }
+  else
+    {
+      sendto_one(source_p,
+		 ":%s NOTICE %s :Couldn't write D-line file, aborted",
+		 me.name, parv[0]);
+      return;
+    }
 
   if (!pairme)
     {
@@ -434,9 +476,8 @@
 **      parv[1] = gline to remove
 */
 
-static void
-mo_ungline(struct Client *client_p, struct Client *source_p,
-	   int parc,char *parv[])
+static void mo_ungline(struct Client *client_p, struct Client *source_p,
+                      int parc,char *parv[])
 {
   char  *user,*host;
 
@@ -453,11 +494,11 @@
       return;
     }
 
-  if ((host = strchr(parv[1], '@')) || *parv[1] == '*')
+  if ( (host = strchr(parv[1], '@')) || *parv[1] == '*' )
     {
       /* Explicit user@host mask given */
 
-      if(host != NULL)                  /* Found user@host */
+      if(host)                  /* Found user@host */
         {
           user = parv[1];       /* here is user part */
           *(host++) = '\0';     /* and now here is host */
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_unkline.c-backup PleXusIRCd-1.17a/modules/m_unkline.c-backup
--- ircd-hybrid-7.0/modules/m_unkline.c-backup	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/modules/m_unkline.c-backup	Sun Nov 30 07:59:33 2003
@@ -0,0 +1,497 @@
+/*
+ *  ircd-hybrid: an advanced Internet Relay Chat Daemon(ircd).
+ *  m_unkline.c: Unklines a user.
+ *
+ *  Copyright (C) 2002 by the past and present ircd coders, and others.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *  USA
+ *
+ *  $Id: m_unkline.c,v 1.51 2002/11/18 19:54:58 db Exp $
+ */
+
+#include "stdinc.h"
+#include "tools.h"
+#include "handlers.h"
+#include "channel.h"
+#include "client.h"
+#include "common.h"
+#include "fileio.h"
+#include "irc_string.h"
+#include "ircd.h"
+#include "list.h"
+#include "hostmask.h"
+#include "numeric.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_misc.h"
+#include "send.h"
+#include "msg.h"
+#include "s_gline.h"
+#include "parse.h"
+#include "modules.h"
+
+
+static void mo_unkline(struct Client*, struct Client*, int, char**);
+static void mo_undline(struct Client*, struct Client*, int, char**);
+static void mo_ungline(struct Client*, struct Client*, int, char**);
+
+struct Message msgtabs[] = {
+  {"UNKLINE", 0, 0, 2, 0, MFLG_SLOW, 0,
+   {m_unregistered, m_not_oper, m_error, mo_unkline}},
+  {"UNDLINE", 0, 0, 2, 0, MFLG_SLOW, 0,
+   {m_unregistered, m_not_oper, m_error, mo_undline}}, 
+  {"UNGLINE", 0, 0, 2, 0, MFLG_SLOW, 0,
+   {m_unregistered, m_not_oper, mo_ungline, mo_ungline}}
+};
+
+#ifndef STATIC_MODULES
+void
+_modinit(void)
+{
+  mod_add_cmd(&msgtabs[0]);
+  mod_add_cmd(&msgtabs[1]);
+  mod_add_cmd(&msgtabs[2]);
+}
+
+void
+_moddeinit(void)
+{
+  mod_del_cmd(&msgtabs[0]);
+  mod_del_cmd(&msgtabs[1]);
+  mod_del_cmd(&msgtabs[2]);
+}
+const char *_version = "$Revision: 1.51 $";
+#endif
+
+static int flush_write(struct Client *, FBFILE *in, FBFILE *out,
+		       char *, char *);
+static int remove_tkline_match(char *,char *);
+
+
+/*
+** mo_unkline
+** Added Aug 31, 1997 
+** common (Keith Fralick) fralick@gate.net
+**
+**      parv[0] = sender
+**      parv[1] = address to remove
+*
+*
+*/
+static void
+mo_unkline (struct Client *client_p,struct Client *source_p,
+	    int parc,char *parv[])
+{
+  FBFILE *in, *out;
+  int pairme=0;
+  char buf[BUFSIZE], buff[BUFSIZE], temppath[BUFSIZE], *user, *host, *p;
+  const char  *filename;                /* filename to use for unkline */
+  mode_t oldumask;
+
+  ircsprintf(temppath, "%s.tmp", ConfigFileEntry.klinefile);
+  
+  if (strcmp("OperServ",source_p->name) && !IsOperUnkline(source_p))
+    {
+      sendto_one(source_p,":%s NOTICE %s :You need unkline = yes;",me.name,parv[0]);
+      return;
+    }
+  if (parc < 2)
+    {
+      sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
+                 me.name, source_p->name, "UNKLINE");
+      return;
+    }
+
+  if ((host = strchr(parv[1], '@')) || *parv[1] == '*')
+    {
+      /* Explicit user@host mask given */
+
+      if(host)                  /* Found user@host */
+        {
+          user = parv[1];       /* here is user part */
+          *(host++) = '\0';     /* and now here is host */
+        }
+      else
+        {
+          user = "*";           /* no @ found, assume its *@somehost */
+          host = parv[1];
+        }
+    }
+  else
+    {
+      sendto_one(source_p, ":%s NOTICE %s :Invalid parameters",
+                 me.name, source_p->name);
+      return;
+    }
+
+  if (remove_tkline_match(host, user))
+    {
+      sendto_one(source_p,
+		 ":%s NOTICE %s :Un-klined [%s@%s] from temporary k-lines",
+		 me.name, parv[0],user, host);
+      sendto_realops_flags(FLAGS_ALL, L_ALL,
+			   "%s has removed the temporary K-Line for: [%s@%s]",
+			   get_oper_name(source_p), user, host);
+      ilog(L_NOTICE, "%s removed temporary K-Line for [%s@%s]", parv[0], user,
+	   host);
+      return;
+    }
+
+  filename = get_conf_name(KLINE_TYPE);
+  if ((in = fbopen(filename, "r")) == 0)
+    {
+      sendto_one(source_p, ":%s NOTICE %s :Cannot open %s", me.name, parv[0],
+		 filename);
+      return;
+    }
+
+  oldumask = umask(0);
+  if ((out = fbopen(temppath, "w")) == 0)
+    {
+      sendto_one(source_p, ":%s NOTICE %s :Cannot open %s", me.name, parv[0],
+		 temppath);
+      fbclose(in);
+      umask(oldumask);
+      return;
+    }
+  umask(oldumask);
+
+  while (fbgets(buf, sizeof(buf), in)) 
+    {
+      char *found_host, *found_user;
+
+      strlcpy(buff, buf, BUFSIZE);
+
+      if ((p = strchr(buff,'\n')) != NULL)
+	*p = '\0';
+
+      if ((*buff == '\0') || (*buff == '#'))
+	{
+	  if(flush_write(source_p, in, out, buf, temppath) < 0)
+	    return;
+	}
+      
+      if ((found_user = getfield(buff)) == NULL)
+	{
+	  if(flush_write(source_p, in, out, buf, temppath) < 0)
+	    return;
+	  continue;
+	}
+
+      if ((found_host = getfield(NULL)) == NULL)
+	{
+	  if(flush_write(source_p, in, out, buf, temppath) < 0)
+	    return;
+	  continue;
+	}
+
+      if ((irccmp(host,found_host) == 0) && (irccmp(user,found_user) == 0))
+	{
+	  pairme++;
+	}
+      else
+	{
+	  if(flush_write(source_p, in, out, buf, temppath) < 0)
+	    return;
+	}
+    }
+  fbclose(in);
+  fbclose(out);
+
+/* The result of the rename should be checked too... oh well */
+/* If there was an error on a write above, then its been reported
+ * and I am not going to trash the original kline /conf file
+ */
+
+  (void)rename(temppath, filename);
+  rehash(0);
+
+  if(!pairme)
+    {
+      sendto_one(source_p, ":%s NOTICE %s :No K-Line for %s@%s",
+                 me.name, source_p->name,user,host);
+      return;
+    }
+
+  sendto_one(source_p, ":%s NOTICE %s :K-Line for [%s@%s] is removed", 
+             me.name, source_p->name, user,host);
+  sendto_realops_flags(FLAGS_ALL, L_ALL,
+		       "%s has removed the K-Line for: [%s@%s]",
+		       get_oper_name(source_p), user, host);
+
+  ilog(L_NOTICE, "%s removed K-Line for [%s@%s]",
+       source_p->name, user, host);
+  return; 
+}
+
+/*
+ * flush_write()
+ *
+ * inputs       - pointer to client structure of oper requesting unkline
+ *		- in is the input file descriptor
+ *              - out is the output file descriptor
+ *              - buf is the buffer to write
+ *              - ntowrite is the expected number of character to be written
+ *              - temppath is the temporary file name to be written
+ * output       - -1 for error on write
+ *              - 0 for ok
+ * side effects - if successful, the buf is written to output file
+ *                if a write failure happesn, and the file pointed to
+ *                by temppath, if its non NULL, is removed.
+ *
+ * The idea here is, to be as robust as possible when writing to the 
+ * kline file.
+ *
+ * -Dianora
+ */
+
+static int
+flush_write(struct Client *source_p, FBFILE *in, FBFILE* out, 
+	    char *buf, char *temppath)
+{
+  int error_on_write = (fbputs(buf, out) < 0) ? (-1) : (0);
+
+  if (error_on_write)
+    {
+      sendto_one(source_p,":%s NOTICE %s :Unable to write to %s aborting",
+        me.name, source_p->name, temppath );
+      fbclose(in);
+      fbclose(out);
+      if(temppath != (char *)NULL)
+        (void)unlink(temppath);
+    }
+  return(error_on_write);
+}
+
+/* static int remove_tkline_match(char *host, char *user)
+ * Input: A hostname, a username to unkline.
+ * Output: returns YES on success, NO if no tkline removed.
+ * Side effects: Any matching tklines are removed.
+ */
+static int
+remove_tkline_match(char *host, char *user)
+{
+  struct ConfItem *tk_c;
+  dlink_node *tk_n;
+  struct irc_inaddr addr, caddr;
+  int nm_t, cnm_t, bits, cbits;
+  nm_t = parse_netmask(host, &addr, &bits);
+
+  for (tk_n=temporary_klines.head; tk_n; tk_n=tk_n->next)
+    {
+      tk_c = (struct ConfItem*)tk_n->data;
+      cnm_t = parse_netmask(tk_c->host, &caddr, &cbits);
+      if (cnm_t != nm_t || irccmp(user, tk_c->user))
+	continue;
+      if ((nm_t==HM_HOST && !irccmp(tk_c->host, host)) ||
+	  (nm_t==HM_IPV4 && bits==cbits && match_ipv4(&addr, &caddr, bits))
+#ifdef IPV6
+	  || (nm_t==HM_IPV6 && bits==cbits && match_ipv6(&addr, &caddr, bits))
+#endif
+	  )
+	{
+	  dlinkDelete(tk_n, &temporary_klines);
+	  free_dlink_node(tk_n);
+	  delete_one_address_conf(tk_c->host, tk_c);
+	  return YES;
+	}
+    }
+  return NO;
+}
+
+/*
+** m_undline
+** added May 28th 2000 by Toby Verrall <toot@melnet.co.uk>
+** based totally on m_unkline
+** added to hybrid-7 7/11/2000 --is
+**
+**      parv[0] = sender nick
+**      parv[1] = dline to remove
+*/
+static void
+mo_undline (struct Client *client_p, struct Client *source_p,
+            int parc,char *parv[])
+{
+  FBFILE* in;
+  FBFILE* out;
+  char  buf[BUFSIZE], buff[BUFSIZE], temppath[BUFSIZE], *p;
+  const char  *filename,*cidr, *found_cidr;
+  int pairme = NO;
+  mode_t oldumask;
+
+  ircsprintf(temppath, "%s.tmp", ConfigFileEntry.dlinefile);
+
+  if (!IsOperUnkline(source_p))
+    {
+      sendto_one(source_p,":%s NOTICE %s :You need unkline = yes;",me.name,
+		 parv[0]);
+      return;
+    }
+
+  cidr = parv[1];
+
+#if 0
+  if ((type=parse_netmask(cidr,&ip_host,&ip_mask)) == HM_HOST)
+    {
+      sendto_one(source_p, ":%s NOTICE %s :Invalid parameters",
+		 me.name, parv[0]);
+      return;
+    }
+#endif
+
+  filename = get_conf_name(DLINE_TYPE);
+
+  if ((in = fbopen(filename, "r")) == 0)
+    {
+      sendto_one(source_p, ":%s NOTICE %s :Cannot open %s",
+		 me.name,parv[0],filename);
+      return;
+    }
+
+  oldumask = umask(0);                  /* ircd is normally too paranoid */
+  if ((out = fbopen(temppath, "w")) == NULL)
+    {
+      sendto_one(source_p, ":%s NOTICE %s :Cannot open %s",
+		 me.name,parv[0],temppath);
+      fbclose(in);
+      umask(oldumask);                  /* Restore the old umask */
+      return;
+    }
+  umask(oldumask);                    /* Restore the old umask */
+
+  while(fbgets(buf, sizeof(buf), in))
+    {
+      strlcpy(buff, buf, BUFSIZE);
+
+      if ((p = strchr(buff,'\n')) != NULL)
+	*p = '\0';
+
+      if ((*buff == '\0') || (*buff == '#'))
+	{
+	  if(flush_write(source_p, in, out, buf, temppath) < 0)
+	    return;
+  	   continue;
+	}
+
+      if ((found_cidr = getfield(buff)) == NULL)
+	{
+	  if(flush_write(source_p, in, out, buf, temppath) < 0)
+	    return;
+	  continue;
+	}
+      
+      if (irccmp(found_cidr,cidr) == 0)
+	{
+	  pairme++;
+	}
+      else
+	{
+	  if(flush_write(source_p, in, out, buf, temppath) < 0)
+	    return;
+	}
+    }
+
+  fbclose(in);
+  fbclose(out);
+
+  (void)rename(temppath, filename);
+  rehash(0);
+
+  if (!pairme)
+    {
+      sendto_one(source_p, ":%s NOTICE %s :No D-Line for %s", me.name,
+		 parv[0],cidr);
+      return;
+    }
+
+  sendto_one(source_p, ":%s NOTICE %s :D-Line for [%s] is removed",
+	     me.name, parv[0], cidr);
+  sendto_realops_flags(FLAGS_ALL, L_ALL, "%s has removed the D-Line for: [%s]",
+		       get_oper_name(source_p), cidr);
+  ilog(L_NOTICE, "%s removed D-Line for [%s]", get_oper_name(source_p),
+       cidr);
+}
+
+/*
+** m_ungline
+** added May 29th 2000 by Toby Verrall <toot@melnet.co.uk>
+** added to hybrid-7 7/11/2000 --is
+**
+**      parv[0] = sender nick
+**      parv[1] = gline to remove
+*/
+
+static void
+mo_ungline(struct Client *client_p, struct Client *source_p,
+	   int parc,char *parv[])
+{
+  char  *user,*host;
+
+  if (!ConfigFileEntry.glines)
+    {
+      sendto_one(source_p,":%s NOTICE %s :UNGLINE disabled",me.name,parv[0]);
+      return;
+    }
+
+  if (!IsOperUnkline(source_p) || !IsOperGline(source_p))
+    {
+      sendto_one(source_p,":%s NOTICE %s :You need unkline = yes;",
+                 me.name,parv[0]);
+      return;
+    }
+
+  if ((host = strchr(parv[1], '@')) || *parv[1] == '*')
+    {
+      /* Explicit user@host mask given */
+
+      if(host != NULL)                  /* Found user@host */
+        {
+          user = parv[1];       /* here is user part */
+          *(host++) = '\0';     /* and now here is host */
+        }
+      else
+        {
+          user = "*";           /* no @ found, assume its *@somehost */
+          host = parv[1];
+        }
+    }
+  else
+    {
+      sendto_one(source_p, ":%s NOTICE %s :Invalid parameters",
+                 me.name, parv[0]);
+      return;
+    }
+
+  if(remove_gline_match(user, host))
+    {
+      sendto_one(source_p, ":%s NOTICE %s :G-Line for [%s@%s] is removed",
+                 me.name, parv[0], user, host);
+      sendto_realops_flags(FLAGS_ALL, L_ALL,
+			   "%s has removed the G-Line for: [%s@%s]",
+			   get_oper_name(source_p), user, host );
+      ilog(L_NOTICE, "%s removed G-Line for [%s@%s]",
+          get_oper_name(source_p), user, host);
+      return;
+    }
+  else
+    {
+      sendto_one(source_p, ":%s NOTICE %s :No G-Line for %s@%s",
+                 me.name, parv[0],user,host);
+      return;
+    }
+}
+
+
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_userhost.c PleXusIRCd-1.17a/modules/m_userhost.c
--- ircd-hybrid-7.0/modules/m_userhost.c	Fri May 24 19:34:23 2002
+++ PleXusIRCd-1.17a/modules/m_userhost.c	Mon Jun 16 18:08:46 2003
@@ -115,7 +115,7 @@
 			    IsOper(target_p) ? "*" : "",
 			    (target_p->user->away) ? '-' : '+',
 			    target_p->username,
-			    target_p->host);
+			    target_p->vhost);
 	  }
 
 	  if((rl + cur_len) < (BUFSIZE-10))
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_who.c PleXusIRCd-1.17a/modules/m_who.c
--- ircd-hybrid-7.0/modules/m_who.c	Thu Jan 16 18:54:02 2003
+++ PleXusIRCd-1.17a/modules/m_who.c	Mon Jun 16 18:05:38 2003
@@ -313,7 +313,7 @@
 
     if ((mask == NULL) ||
 	match(mask, target_p->name) || match(mask, target_p->username) ||
-	match(mask, target_p->host) || 
+	match(mask, target_p->host) || match(mask, target_p->vhost) ||
 	(match(mask, target_p->user->server) && 
 	 (IsOper(source_p) || !ConfigServerHide.hide_servers)) ||
 	match(mask, target_p->info))
@@ -383,7 +383,7 @@
     if (!mask ||
         match(mask, target_p->name) || match(mask, target_p->username) ||
 	match(mask, target_p->host) || match(mask, target_p->user->server) ||
-	match(mask, target_p->info))
+	match(mask, target_p->info) || match(mask, target_p->vhost))
     {
 		
       do_who(source_p, target_p, NULL, "");
@@ -572,7 +572,7 @@
     sendto_one(source_p, form_str(RPL_WHOREPLY), me.name, source_p->name,
 	       (chname) ? (chname) : "*",
 	       target_p->username,
-	       target_p->host, IsOper(source_p) ? target_p->user->server : "*",
+	       target_p->vhost, IsOper(source_p) ? target_p->user->server : "*",
 	       target_p->name,
 	       status, 0, target_p->info);
   }
@@ -581,7 +581,7 @@
     sendto_one(source_p, form_str(RPL_WHOREPLY), me.name, source_p->name,
 	       (chname) ? (chname) : "*",
 	       target_p->username,
-	       target_p->host,  target_p->user->server, target_p->name,
+	       target_p->vhost,  target_p->user->server, target_p->name,
 	       status, target_p->hopcount, target_p->info);
   }
 }
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_whois.c PleXusIRCd-1.17a/modules/m_whois.c
--- ircd-hybrid-7.0/modules/m_whois.c	Sat Feb  8 19:02:28 2003
+++ PleXusIRCd-1.17a/modules/m_whois.c	Sun Nov 30 03:43:18 2003
@@ -19,7 +19,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: m_whois.c,v 1.87 2003/02/09 00:02:28 bill Exp $
+ *  $Id: m_whois.c,v 1.9 2003/11/30 00:02:28 Static Exp $
  */
 
 #include "stdinc.h"
@@ -76,7 +76,7 @@
   mod_del_cmd(&whois_msgtab);
 }
 
-const char *_version = "$Revision: 1.87 $";
+const char *_version = "$Revision: 1.9 $";
 #endif
 /*
 ** m_whois
@@ -382,15 +382,24 @@
   int tlen;
   int reply_to_send = NO;
   struct hook_mfunc_data hd;
+  char ubuf[BUFSIZE];
 #ifdef VCHANS
   struct Channel *bchan;
 #endif
   
   a2client_p = find_server(target_p->user->server);
           
-  sendto_one(source_p, form_str(RPL_WHOISUSER), me.name,
+  //Hide the users real host
+  if (source_p->user == target_p->user || (IsOper(source_p) && !IsOper(target_p))) {
+    sendto_one(source_p, form_str(RPL_WHOISUSER), me.name,
 	 source_p->name, target_p->name,
 	 target_p->username, target_p->host, target_p->info);
+  } else {
+    sendto_one(source_p, form_str(RPL_WHOISUSER), me.name,
+         source_p->name, target_p->name,
+         target_p->username, target_p->vhost, target_p->info);
+  }
+
   server_name = (char *)target_p->user->server;
 
   ircsprintf(buf, form_str(RPL_WHOISCHANNELS),
@@ -414,6 +423,7 @@
     }
 #endif
 
+  if (!IsOper(source_p) || !IsAdmin(source_p)) {
     if (ShowChannel(source_p, chptr))
     {
       if ((cur_len + strlen(chname) + 2) > (BUFSIZE - 4))
@@ -438,7 +448,28 @@
       reply_to_send = YES;
     }
   }
-
+  //Start of the test
+  else {
+      if ((cur_len + strlen(chname) + 2) > (BUFSIZE - 4))
+      {
+        sendto_one(source_p, "%s", buf);
+        cur_len = mlen;
+        t = buf + mlen;
+      }
+      if (!PubChannel(chptr))
+        {
+          ircsprintf(t, "~%s%s ", channel_chanop_or_voice(chptr, target_p), chname);
+        }
+      else {
+        ircsprintf(t, "%s%s ", channel_chanop_or_voice(chptr, target_p), chname);
+        }
+      tlen = strlen(t);
+      t += tlen;
+      cur_len += tlen;
+      reply_to_send = YES;
+    }
+  //END
+  }
   if (reply_to_send)
     sendto_one(source_p, "%s", buf);
           
@@ -452,13 +483,36 @@
                ServerInfo.network_name,
 	       ServerInfo.network_desc);
 
+  if (IsServices(target_p))
+        sendto_one(source_p, ":%s 313 %s %s :is an IRC Operator - Network Service", me.name,
+                source_p->name, target_p->name);
+  if (IsOper(target_p) && !IsServices(target_p)) {
+        sendto_one(source_p, form_str(RPL_WHOISOPERATOR),
+                me.name, source_p->name, target_p->name);
+  }  
+      
+  if (IsReged(target_p)) sendto_one(source_p, form_str(RPL_WHOISREGNICK), me.name, source_p->name, target_p->name);
+  if ((IsOper(source_p) && !IsOper(target_p)) || (source_p == target_p))
+  {     
+    if (target_p->umodes & FLAGS_HIDDEN) {
+        sendto_one(source_p, form_str(RPL_WHOISVHOST),
+                   me.name, source_p->name, target_p->name, target_p->vhost);
+      }
+  }    
+  if (IsOper(source_p) || source_p == target_p) {  
+    send_umode(NULL, target_p, 0, ALL_UMODES, ubuf);   
+      if (!*ubuf)
+      {
+            ubuf[0] = '+';
+            ubuf[1] = '\0';
+      }
+      sendto_one(source_p, form_str(RPL_WHOISMODES),
+                   me.name, source_p->name, target_p->name, ubuf);
+  }
+
   if (target_p->user->away)
     sendto_one(source_p, form_str(RPL_AWAY), me.name,
 	       source_p->name, target_p->name, target_p->user->away);
-
-  if (IsOper(target_p))
-    sendto_one(source_p, form_str(RPL_WHOISOPERATOR),
-	       me.name, source_p->name, target_p->name);
 
   if (MyConnect(target_p)) /* Can't do any of this if not local! db */
   {
diff -uNrd -x ChangeLog ircd-hybrid-7.0/modules/m_whowas.c PleXusIRCd-1.17a/modules/m_whowas.c
--- ircd-hybrid-7.0/modules/m_whowas.c	Fri Jan 17 08:00:51 2003
+++ PleXusIRCd-1.17a/modules/m_whowas.c	Mon Jun 16 17:41:12 2003
@@ -151,7 +151,7 @@
           sendto_one(source_p, form_str(RPL_WHOWASUSER),
                      me.name, parv[0], temp->name,
                      temp->username,
-                     temp->hostname,
+                     IsOper(source_p) ? temp->hostname : temp->vhostname,
                      temp->realname);
 
           if (ConfigServerHide.hide_servers && !IsOper(source_p))
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/Makefile.in PleXusIRCd-1.17a/src/Makefile.in
--- ircd-hybrid-7.0/src/Makefile.in	Wed May 28 23:02:15 2003
+++ PleXusIRCd-1.17a/src/Makefile.in	Mon Jun 16 07:50:24 2003
@@ -61,6 +61,7 @@
   vchannel.c                    \
   class.c                       \
   client.c                      \
+  cloak.c			\
   dynlink.c			\
   event.c                       \
   fdlist.c                      \
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/channel.c PleXusIRCd-1.17a/src/channel.c
--- ircd-hybrid-7.0/src/channel.c	Thu May 29 00:02:36 2003
+++ PleXusIRCd-1.17a/src/channel.c	Wed Aug 20 23:37:04 2003
@@ -63,7 +63,7 @@
 static void send_mode_list(struct Client *client_p, char *chname,
                            dlink_list *top, char flag, int clear);
 static int check_banned(struct Channel *chptr, struct Client *who,
-                                                char *s, char *s2);
+                                                char *s, char *s2, char *s3);
 
 static char buf[BUFSIZE];
 static char modebuf[MODEBUFLEN], parabuf[MODEBUFLEN];
@@ -1010,6 +1010,7 @@
 {
   char src_host[NICKLEN + USERLEN + HOSTLEN + 6];
   char src_iphost[NICKLEN + USERLEN + HOSTLEN + 6];
+  char src_vhost[NICKLEN + USERLEN + HOSTLEN + 6];
 
   if (!IsPerson(who))
     return (0);
@@ -1017,8 +1018,9 @@
   ircsprintf(src_host,"%s!%s@%s", who->name, who->username, who->host);
   ircsprintf(src_iphost,"%s!%s@%s", who->name, who->username,
 	     who->localClient->sockhost);
+  ircsprintf(src_vhost, "%s!%s@%s", who->name, who->username, who->vhost);
 
-  return (check_banned(chptr, who, src_host, src_iphost));
+  return (check_banned(chptr, who, src_host, src_iphost, src_vhost));
 }
 
 /*
@@ -1037,7 +1039,7 @@
  * +e code from orabidoo
  */
 static int
-check_banned(struct Channel *chptr, struct Client *who, char *s, char *s2)
+check_banned(struct Channel *chptr, struct Client *who, char *s, char *s2, char *s3)
 {
   dlink_node *ban;
   dlink_node *except;
@@ -1049,6 +1051,7 @@
     actualBan = ban->data;
     if (match(actualBan->banstr, s) || 
     	match(actualBan->banstr, s2) ||
+        match(actualBan->banstr, s3) ||
         match_cidr(actualBan->banstr, s2))
       break;
     else
@@ -1063,6 +1066,7 @@
 
       if (match(actualExcept->banstr, s) || 
           match(actualExcept->banstr, s2) ||
+	  match(actualExcept->banstr, s3) ||
           match_cidr(actualExcept->banstr, s2))
       {
         return CHFL_EXCEPTION;
@@ -1090,6 +1094,7 @@
   struct Ban *invex = NULL;
   char src_host[NICKLEN + USERLEN + HOSTLEN + 6];
   char src_iphost[NICKLEN + USERLEN + HOSTLEN + 6];
+  char src_vhost[NICKLEN + USERLEN + HOSTLEN +6];
 
   assert(source_p->localClient != NULL);
 
@@ -1097,10 +1102,15 @@
 	     "%s!%s@%s", source_p->name, source_p->username, source_p->host);
   ircsprintf(src_iphost,"%s!%s@%s", source_p->name, source_p->username,
 	     source_p->localClient->sockhost);
+  ircsprintf(src_vhost, "%s!%s@%s", source_p->name, source_p->username,
+             source_p->vhost);
 
-  if ((check_banned(chptr, source_p, src_host, src_iphost)) == CHFL_BAN)
+  if ((check_banned(chptr, source_p, src_host, src_iphost, src_vhost)) == CHFL_BAN)
     return (ERR_BANNEDFROMCHAN);
 
+  if ((chptr->mode.mode & MODE_REGONLY) && !IsReged(source_p))
+    return (ERR_REGNICKSONLY);
+
   if (chptr->mode.mode & MODE_INVITEONLY)
   {
     for (lp = source_p->user->invited.head; lp; lp = lp->next)
@@ -1114,7 +1124,7 @@
       DLINK_FOREACH(ptr, chptr->invexlist.head)
       {
         invex = ptr->data;
-        if (match(invex->banstr, src_host) || match(invex->banstr, src_iphost) ||
+        if (match(invex->banstr, src_host) || match(invex->banstr, src_iphost) || match(invex->banstr, src_vhost) ||
             match_cidr(invex->banstr, src_iphost))
           break;
       }
@@ -1128,6 +1138,9 @@
 
   if (chptr->mode.limit && chptr->users >= chptr->mode.limit)
     return (ERR_CHANNELISFULL);
+  
+  if ((chptr->mode.mode & MODE_OPERONLY) && !IsOper(source_p))
+    return (ERR_NOPRIVILEGES);
 
   return 0;
 }
@@ -1240,7 +1253,7 @@
  * side effects - NONE
  */
 int
-can_send(struct Channel *chptr, struct Client *source_p)
+can_send(struct Channel *chptr, struct Client *source_p, char *msg)
 {
   if(MyClient(source_p) &&
      (find_channel_resv(chptr->chname) &&
@@ -1254,6 +1267,9 @@
   if (IsServer(source_p))
     return (CAN_SEND_OPV);
 
+  if ((chptr->mode.mode & MODE_NOCOLOUR) && msg_has_colours(msg))
+    return (CAN_SEND_NO);
+
   if (chptr->mode.mode & MODE_MODERATED)
     return (CAN_SEND_NO);
 
@@ -1429,5 +1445,27 @@
       free_topic(chptr);
     chptr->topic_time = 0;
   }
+}
+
+/* check to see if the message has any colour chars in it. */  
+int msg_has_colours(char *msg)
+{
+
+    char *c;
+    if (msg==NULL) return 0;
+    c=msg;
+
+    while(*c)
+    {
+        if(*c == '\003' || *c == '\033')
+            break;   
+        else
+            c++; 
+    }
+
+    if(*c) 
+        return 1;   
+
+    return 0;
 }
 
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/channel_mode.c PleXusIRCd-1.17a/src/channel_mode.c
--- ircd-hybrid-7.0/src/channel_mode.c	Sat Apr 19 22:33:41 2003
+++ PleXusIRCd-1.17a/src/channel_mode.c	Wed Aug 20 23:40:00 2003
@@ -254,9 +254,9 @@
     actualBan->who =
       (char *)MyMalloc(strlen(client_p->name) +
                        strlen(client_p->username) +
-                       strlen(client_p->host) + 3);
+                       strlen(client_p->vhost) + 3);
     ircsprintf(actualBan->who, "%s!%s@%s",
-               client_p->name, client_p->username, client_p->host);
+               client_p->name, client_p->username, client_p->vhost);
   }
   else
   {
@@ -495,6 +495,14 @@
     *mbuf++ = 'i';
   if (chptr->mode.mode & MODE_NOPRIVMSGS)
     *mbuf++ = 'n';
+  if (chptr->mode.mode & MODE_BW)
+    *mbuf++ = 'Z';
+  if (chptr->mode.mode & MODE_NOCOLOUR)
+    *mbuf++ = 'c';
+  if (chptr->mode.mode & MODE_REGONLY)
+    *mbuf++ = 'R';
+  if (chptr->mode.mode & MODE_OPERONLY)
+    *mbuf++ = 'O';
 #ifdef ANONOPS
   if (chptr->mode.mode & MODE_HIDEOPS)
     *mbuf++ = 'a';
@@ -1846,10 +1854,10 @@
   {chm_nosuch, NULL},                             /* L */
   {chm_nosuch, NULL},                             /* M */
   {chm_nosuch, NULL},                             /* N */
-  {chm_nosuch, NULL},                             /* O */
+  {chm_simple, (void *) MODE_OPERONLY},           /* O */
   {chm_nosuch, NULL},                             /* P */
   {chm_nosuch, NULL},                             /* Q */
-  {chm_nosuch, NULL},                             /* R */
+  {chm_simple, (void *) MODE_REGONLY},            /* R */
   {chm_nosuch, NULL},                             /* S */
   {chm_nosuch, NULL},                             /* T */
   {chm_nosuch, NULL},                             /* U */
@@ -1857,7 +1865,7 @@
   {chm_nosuch, NULL},                             /* W */
   {chm_nosuch, NULL},                             /* X */
   {chm_nosuch, NULL},                             /* Y */
-  {chm_nosuch, NULL},                             /* Z */
+  {chm_simple, (void *) MODE_BW},                 /* Z */
   {chm_nosuch, NULL},
   {chm_nosuch, NULL},
   {chm_nosuch, NULL},
@@ -1870,7 +1878,7 @@
   {chm_nosuch, NULL},				  /* a */
 #endif
   {chm_ban, NULL},                                /* b */
-  {chm_nosuch, NULL},                             /* c */
+  {chm_simple, (void *) MODE_NOCOLOUR},           /* c */
   {chm_nosuch, NULL},                             /* d */
   {chm_except, NULL},                             /* e */
   {chm_nosuch, NULL},                             /* f */
@@ -2098,7 +2106,7 @@
     mbl = ircsprintf(modebuf, ":%s MODE %s ", me.name, chname);
   else
     mbl = ircsprintf(modebuf, ":%s!%s@%s MODE %s ", source_p->name,
-                     source_p->username, source_p->host, chname);
+                     source_p->username, source_p->vhost, chname);
 
   mc = 0;
   nc = 0;
@@ -2137,7 +2145,7 @@
         mbl = ircsprintf(modebuf, ":%s MODE %s ", me.name, chname);
       else
         mbl = ircsprintf(modebuf, ":%s!%s@%s MODE %s ", source_p->name,
-                   source_p->username, source_p->host, chname);
+                   source_p->username, source_p->vhost, chname);
 
       pbl = 0;
       parabuf[0] = '\0';
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/client.c PleXusIRCd-1.17a/src/client.c
--- ircd-hybrid-7.0/src/client.c	Sun Mar  2 02:30:54 2003
+++ PleXusIRCd-1.17a/src/client.c	Wed Aug 20 19:54:16 2003
@@ -979,10 +979,10 @@
       ** that the client can show the "**signoff" message).
       ** (Note: The notice is to the local clients *only*)
       */
-      sendto_common_channels_local(source_p, 0,
+      sendto_common_channels_local(source_p,
                                    ":%s!%s@%s QUIT :%s",
 				   source_p->name, source_p->username,
-				   source_p->host, comment);
+				   source_p->vhost, comment);
 
       DLINK_FOREACH_SAFE(lp, next_lp, source_p->user->channel.head)
       {
@@ -1398,10 +1398,10 @@
     {
       if (client_p != NULL && source_p != client_p)
         sendto_one(source_p, "ERROR :Closing Link: %s %s (%s)",
-                   source_p->host, source_p->name, comment);
+                   source_p->vhost, source_p->name, comment);
       else
         sendto_one(source_p, "ERROR :Closing Link: %s (%s)",
-                   source_p->host, comment);
+                   source_p->vhost, comment);
     }
 
     /*
@@ -1695,10 +1695,10 @@
 			   source_p->name, nick, source_p->username,
 			   source_p->host);
 
-      sendto_common_channels_local(source_p, 1,
+      sendto_common_channels_local(source_p,
                                    ":%s!%s@%s NICK :%s",
 				   source_p->name, source_p->username,
-				   source_p->host, nick);
+				   source_p->vhost, nick);
       if (source_p->user)
 	{
 	  add_history(source_p, 1);
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/cloak.c PleXusIRCd-1.17a/src/cloak.c
--- ircd-hybrid-7.0/src/cloak.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/src/cloak.c	Sun Nov 30 03:49:40 2003
@@ -0,0 +1,276 @@
+/*
+ *  PleXusIRCd: Based on Hybird7
+ *  cloak.c: Provides Hostname Cloaking
+ *
+ *  Copyright (C) 2000-2002 Edward Brocklesby, Hybrid Development Team
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
+ *  USA
+ *
+ *  $Id: cloak.c,v 1.8 2002/10/23 03:53:22 fishwaldo Exp $
+ */
+/*
+**
+** Originally rewritten from AustNet's VirtualWorld Code.
+** Virtual World written by Roger 'RogerY' Yerramsetti <rogery@austnet.org>
+**
+** Rewritten using the crc32 implementation by //ylo based on the original
+** implementation by Gary S. Brown
+**
+** hiddenhost implementation based on the code from UnrealIRCd by
+** RaYmAn, NiQuiL, narf, Griever (great thinking) eternal, bball, JK.@ roxnet.org
+**
+** Additional ideas and code by ShadowMaster, [-Th3Dud3-] (RageIRCd) and Solaris @ Demonkarma.net
+**
+*/
+
+
+
+#include "stdinc.h"
+
+#include "whowas.h"
+#include "client.h"
+#include "common.h"
+#include "hash.h"
+#include "irc_string.h"
+#include "ircd.h"
+#include "ircd_defs.h"
+#include "numeric.h"
+#include "s_serv.h"
+#include "s_user.h"
+#include "send.h"
+#include "s_conf.h"
+#include "memory.h"
+#include "s_log.h"
+
+#define KEY 23857
+#define KEY2 38447
+#define KEY3 64709
+
+int str2arr (char **, char *, char *);
+unsigned long crc32 (const unsigned char *s, unsigned int len);
+
+
+ /* The implementation here was originally done by Gary S. Brown.  I have
+    borrowed the tables directly, and made some minor changes to the
+    crc32-function (including changing the interface). //ylo */
+
+  /* ============================================================= */
+  /*  COPYRIGHT (C) 1986 Gary S. Brown.  You may use this program, or       */
+  /*  code or tables extracted from it, as desired without restriction.     */
+  /*                                                                        */
+  /*  First, the polynomial itself and its table of feedback terms.  The    */
+  /*  polynomial is                                                         */
+  /*  X^32+X^26+X^23+X^22+X^16+X^12+X^11+X^10+X^8+X^7+X^5+X^4+X^2+X^1+X^0   */
+  /*                                                                        */
+  /*  Note that we take it "backwards" and put the highest-order term in    */
+  /*  the lowest-order bit.  The X^32 term is "implied"; the LSB is the     */
+  /*  X^31 term, etc.  The X^0 term (usually shown as "+1") results in      */
+  /*  the MSB being 1.                                                      */
+  /*                                                                        */
+  /*  Note that the usual hardware shift register implementation, which     */
+  /*  is what we're using (we're merely optimizing it by doing eight-bit    */
+  /*  chunks at a time) shifts bits into the lowest-order term.  In our     */
+  /*  implementation, that means shifting towards the right.  Why do we     */
+  /*  do it this way?  Because the calculated CRC must be transmitted in    */
+  /*  order from highest-order term to lowest-order term.  UARTs transmit   */
+  /*  characters in order from LSB to MSB.  By storing the CRC this way,    */
+  /*  we hand it to the UART in the order low-byte to high-byte; the UART   */
+  /*  sends each low-bit to hight-bit; and the result is transmission bit   */
+  /*  by bit from highest- to lowest-order term without requiring any bit   */
+  /*  shuffling on our part.  Reception works similarly.                    */
+  /*                                                                        */
+  /*  The feedback terms table consists of 256, 32-bit entries.  Notes:     */
+  /*                                                                        */
+  /*      The table can be generated at runtime if desired; code to do so   */
+  /*      is shown later.  It might not be obvious, but the feedback        */
+  /*      terms simply represent the results of eight shift/xor opera-      */
+  /*      tions for all combinations of data and CRC register values.       */
+  /*                                                                        */
+  /*      The values must be right-shifted by eight bits by the "updcrc"    */
+  /*      logic; the shift must be unsigned (bring in zeroes).  On some     */
+  /*      hardware you could probably optimize the shift in assembler by    */
+  /*      using byte-swap instructions.                                     */
+  /*      polynomial $edb88320                                              */
+  /*                                                                        */
+  /*  --------------------------------------------------------------------  */
+
+static unsigned long crc32_tab[] = {
+  0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L,
+  0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L,
+  0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L,
+  0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
+  0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L,
+  0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L,
+  0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L,
+  0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
+  0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L,
+  0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL,
+  0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L,
+  0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
+  0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L,
+  0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL,
+  0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL,
+  0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
+  0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL,
+  0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L,
+  0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L,
+  0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
+  0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL,
+  0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L,
+  0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L,
+  0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
+  0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L,
+  0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L,
+  0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L,
+  0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
+  0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L,
+  0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL,
+  0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL,
+  0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
+  0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L,
+  0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL,
+  0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL,
+  0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
+  0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL,
+  0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L,
+  0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL,
+  0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
+  0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL,
+  0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L,
+  0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L,
+  0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
+  0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L,
+  0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L,
+  0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L,
+  0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
+  0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L,
+  0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L,
+  0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL,
+  0x2d02ef8dL
+};
+
+/* Return a 32-bit CRC of the contents of the buffer. */
+
+unsigned long
+crc32 (const unsigned char *s, unsigned int len)
+{
+  unsigned int i;
+  unsigned long crc32val;
+
+  crc32val = 0;
+  for (i = 0; i < len; i++)
+    {
+      crc32val = crc32_tab[(crc32val ^ s[i]) & 0xff] ^ (crc32val >> 8);
+    }
+  return crc32val;
+}
+
+
+
+
+int
+str2arr (char **pparv, char *string, char *delim)
+{
+  char *tok;
+  int pparc = 0;
+
+  tok = (char *) strtok (string, delim);
+  while (tok != NULL)
+    {
+      pparv[pparc++] = tok;
+      tok = (char *) strtok (NULL, delim);
+    }
+
+  return pparc;
+}
+
+
+
+/* Regular user host */
+void
+make_virthost (char *curr, char *host, char *new)
+{
+  static char mask[HOSTLEN + 1];
+  char *parv[HOSTLEN + 1], *parv2[HOSTLEN + 1], s[HOSTLEN + 1],
+    s2[HOSTLEN + 2];
+  int parc = 0, parc2 = 0, len = 0;
+  unsigned long hash[8];
+  unsigned long masked[8];
+
+  /* Paranoia. curr & host are pointers */
+  strncpy (s2, curr, HOSTLEN);
+  strncpy (s, host, HOSTLEN);
+
+  parc = str2arr (parv, s, ".");
+  parc2 = str2arr (parv2, s2, ".");
+
+
+
+  /* crc32 and hashing using our 3 keys */
+  hash[0] = ((crc32 (parv[3], strlen (parv[3])) + KEY2) ^ KEY) ^ KEY3;
+  hash[1] = ((crc32 (parv[2], strlen (parv[2])) + KEY2) ^ KEY) ^ KEY3;
+
+
+  /* Why make life easy on crackers? Bitshifting */
+  hash[0] <<= 2;
+  hash[0] >>= 2;
+
+  hash[1] <<= 2;
+  hash[1] >>= 2;
+
+  /* Check if host could be IPv4 */
+  if (parc2 == 4 || parc2 < 2)
+    {
+      len = strlen (parv2[3]);
+      /* Check if its an IPv4 for sure */
+      if (strchr ("0123456789", parv2[3][len - 1]) || parc2 < 2)
+	{
+	  hash[2] = ((crc32 (parv[1], strlen (parv[1])) + KEY2) ^ KEY) ^ KEY3;
+	  hash[3] = ((crc32 (parv[0], strlen (parv[0])) + KEY2) ^ KEY) ^ KEY3;
+
+	  hash[2] <<= 2;
+	  hash[2] >>= 2;
+
+	  hash[3] <<= 2;
+	  hash[3] >>= 2;
+
+	  ircsprintf (mask, "%lx.%lx.%lx.%lx.IP",
+		      hash[0], hash[1], hash[2], hash[3]);
+	}
+      else
+	{
+	  ircsprintf (mask, "%s-%lx.%lx.%s.%s.%s",
+		      ServerInfo.network_name, hash[0], hash[1], parv2[parc2 - 3], parv2[parc2 - 2],
+		      parv2[parc2 - 1]);
+	}
+    }
+  else
+    {
+      if (parc2 >= 4)		/* There are isp's like *.isp.co.uk etc out there */
+	{
+	  ircsprintf (mask, "%s-%lx.%lx.%s.%s.%s",
+		      ServerInfo.network_name, hash[0], hash[1], parv2[parc2 - 3], parv2[parc2 - 2],
+		      parv2[parc2 - 1]);
+	}
+      else
+	{
+	  ircsprintf (mask, "%s-%lx.%lx.%s.%s",
+		      ServerInfo.network_name, hash[0], hash[1], parv2[parc2 - 2], parv2[parc2 - 1]);
+	}
+    }
+  strncpy (new, mask, HOSTLEN);
+  return;
+}
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/hold PleXusIRCd-1.17a/src/hold
--- ircd-hybrid-7.0/src/hold	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/src/hold	Fri Jun 20 08:08:42 2003
@@ -0,0 +1,8 @@
+s_conf.c:      if (kill_ptr->hold <= CurrentTime)
+s_conf.c:			       (kill_ptr->user) ? kill_ptr->user : "*",
+s_conf.c:			       (kill_ptr->host) ? kill_ptr->host : "*");
+s_conf.c:	  delete_one_address_conf(kill_ptr->host, kill_ptr);
+s_gline.c:    if( (kill_ptr->name && (!name || match(kill_ptr->name,name)))
+s_gline.c:	(kill_ptr->host && (!host || match(kill_ptr->host,host))))
+s_gline.c:    if(!irccmp(kill_ptr->host,host) && !irccmp(kill_ptr->name,user))
+s_gline.c:    if(kill_ptr->hold <= CurrentTime)
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/messages.tab PleXusIRCd-1.17a/src/messages.tab
--- ircd-hybrid-7.0/src/messages.tab	Tue May  6 01:32:17 2003
+++ PleXusIRCd-1.17a/src/messages.tab	Mon Aug 18 23:01:08 2003
@@ -289,8 +289,8 @@
 /* 263 RPL_LOAD2HI, */          
 ":%s 263 %s :Server load is temporarily too heavy. Please wait a while and try again.",
 /* 264 */       NULL,
-/* 265 RPL_LOCALUSERS, */       ":%s 265 %s :Current local  users: %d  Max: %d",
-/* 266 RPL_GLOBALUSERS, */      ":%s 266 %s :Current global users: %d  Max: %d",
+/* 265 RPL_LOCALUSERS, */       ":%s 265 %s :Current server  users: %d  Max: %d",
+/* 266 RPL_GLOBALUSERS, */      ":%s 266 %s :Current network users: %d  Max: %d",
 /* 267 */       NULL,
 /* 268 */       NULL,
 /* 269 */       NULL,
@@ -331,10 +331,10 @@
 /* 304 RPL_TEXT, */      NULL,
 /* 305 RPL_UNAWAY, */   ":%s 305 %s :You are no longer marked as being away",
 /* 306 RPL_NOWAWAY, */  ":%s 306 %s :You have been marked as being away",
-/* 307 */       NULL,
+/* 307 RPL_WHOISREGNICK, */     ":%s 307 %s %s is a Registered Nick",
 /* 308 */	NULL,
 /* 309 */       NULL,
-/* 310 */       NULL,
+/* 310 RPL_WHOISMODES */        ":%s 310 %s %s :is using Modes [%s]",
 /* 311 RPL_WHOISUSER, */        ":%s 311 %s %s %s %s * :%s",
 /* 312 RPL_WHOISSERVER, */      ":%s 312 %s %s %s :%s",
 /* 313 RPL_WHOISOPERATOR, */    ":%s 313 %s %s :is an IRC Operator",
@@ -344,7 +344,7 @@
 /* 317 RPL_WHOISIDLE, */        ":%s 317 %s %s %d %d :seconds idle, signon time",
 /* 318 RPL_ENDOFWHOIS, */       ":%s 318 %s %s :End of /WHOIS list.",
 /* 319 RPL_WHOISCHANNELS, */    ":%s 319 %s %s :%s",
-/* 320 */      NULL,
+/* 320 RPL_WHOISVHOST */        ":%s 320 %s %s :Hostmask [%s]",
 /* 321 RPL_LISTSTART, */        ":%s 321 %s Channel :Users  Name",
 /* 322 RPL_LIST, */             ":%s 322 %s %s %d :%s",
 /* 323 RPL_LISTEND, */          ":%s 323 %s :End of /LIST",
@@ -450,7 +450,7 @@
 /* 423 ERR_NOADMININFO, */
                 ":%s 423 %s %s :No administrative info available",
 /* 424 ERR_FILEERROR, */        ":%s 424 %s :File error doing %s on %s",
-/* 425 */       NULL,
+/* 425 ERROR_SERVICESDOWN, */       ":%s 425 %s :Services are currently down, join #help if you have any questions.",
 /* 426 */       NULL,
 /* 427 */       NULL,
 /* 428 */       NULL,
@@ -505,7 +505,7 @@
 /* 477 ERR_MODELESS, */         ":%s 477 %s %s :Channel does not support modes",
 /* 478 ERR_BANLISTFULL, */      ":%s 478 %s %s %s :Channel ban list is full",
 /* 479 ERR_BADCHANNAME */       ":%s 479 %s %s :Illegal channel name",
-/* 480 */       NULL,
+/* 480 ERR_REGNICKSONLY */      ":%s 480 %s %s :Cannot join channel (+R, Registered nicks only).",
 /* 481 ERR_NOPRIVILEGES, */
                 ":%s 481 %s :Permission Denied - You're not an IRC operator",
 /* 482 ERR_CHANOPRIVSNEEDED, */ ":%s 482 %s %s :You're not channel operator",
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/s_bsd.c PleXusIRCd-1.17a/src/s_bsd.c
--- ircd-hybrid-7.0/src/s_bsd.c	Sat May 31 03:37:05 2003
+++ PleXusIRCd-1.17a/src/s_bsd.c	Wed Jul  2 18:04:18 2003
@@ -261,6 +261,8 @@
       ServerStats->is_sbr += client_p->localClient->receiveB;
       ServerStats->is_sks += client_p->localClient->sendK;
       ServerStats->is_skr += client_p->localClient->receiveK;
+      ServerStats->is_bwsavedB += client_p->localClient->bwsavedB;
+      ServerStats->is_bwsavedK += client_p->localClient->bwsavedK;
       ServerStats->is_sti += CurrentTime - client_p->firsttime;
       if (ServerStats->is_sbs > 2047)
         {
@@ -300,6 +302,8 @@
       ServerStats->is_cbr += client_p->localClient->receiveB;
       ServerStats->is_cks += client_p->localClient->sendK;
       ServerStats->is_ckr += client_p->localClient->receiveK;
+      ServerStats->is_bwsavedB += client_p->localClient->bwsavedB;
+      ServerStats->is_bwsavedK += client_p->localClient->bwsavedK;
       ServerStats->is_cti += CurrentTime - client_p->firsttime;
       if (ServerStats->is_cbs > 2047)
         {
@@ -311,6 +315,10 @@
           ServerStats->is_ckr += (ServerStats->is_cbr >> 10);
           ServerStats->is_cbr &= 0x3ff;
         }
+      if (ServerStats->is_bwsavedB > 2047) {
+         ServerStats->is_bwsavedK += (ServerStats->is_bwsavedB >> 10);
+         ServerStats->is_bwsavedB &= 0x3ff;
+      }
     }
   else
     ServerStats->is_ni++;
@@ -419,6 +427,7 @@
   } else
 #endif
     strlcat(new_client->host, new_client->localClient->sockhost,HOSTLEN+1);
+    strlcat(new_client->vhost, new_client->localClient->sockhost,HOSTLEN+1);
 
   new_client->localClient->fd        = fd;
   
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/s_gline.c PleXusIRCd-1.17a/src/s_gline.c
--- ircd-hybrid-7.0/src/s_gline.c	Wed Sep  4 22:48:42 2002
+++ PleXusIRCd-1.17a/src/s_gline.c	Wed Jun 25 02:44:36 2003
@@ -53,7 +53,6 @@
 dlink_list glines;
 
 static void expire_glines(void);
-static void expire_pending_glines(void);
 
 /* add_gline
  *
@@ -150,7 +149,6 @@
 cleanup_glines()
 {
   expire_glines();
-  expire_pending_glines();
 }
 
 /*
@@ -183,35 +181,27 @@
 }
 
 /*
- * expire_pending_glines
  * 
- * inputs       - NONE
- * output       - NONE
- * side effects -
+ * send_glines
  *
- * Go through the pending gline list, expire any that haven't had
- * enough "votes" in the time period allowed
+ * inputs       - Client to send to.
+ * outputs      - none   
+ * side effects - Sends the current gline list to a newly connected irc server
  */
-static void
-expire_pending_glines()
+          
+void
+send_glines(struct Client *client_p)
 {
-  dlink_node *pending_node;
+  dlink_node *gline_node;
   dlink_node *next_node;
-  struct gline_pending *glp_ptr;
-
-  DLINK_FOREACH_SAFE(pending_node, next_node, pending_glines.head)
-  {
-    glp_ptr = pending_node->data;
-
-    if(((glp_ptr->last_gline_time + GLINE_PENDING_EXPIRE) <= CurrentTime)
-       || find_is_glined(glp_ptr->host, glp_ptr->user))
+  struct ConfItem *kill_ptr;
       
+  for(gline_node = glines.head; gline_node; gline_node = next_node)
     {
-      MyFree(glp_ptr->reason1);
-      MyFree(glp_ptr->reason2);
-      MyFree(glp_ptr);
-      dlinkDelete(pending_node, &pending_glines);
-      free_dlink_node(pending_node);
+      kill_ptr = gline_node->data;
+      next_node = gline_node->next;
+ 
+      sendto_one(client_p, ":%s GLINE %s %s %lu :%s", me.name, kill_ptr->name, kill_ptr->host, kill_ptr->hold, kill_ptr->passwd);
     }
-  }
+   
 }
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/s_serv.c PleXusIRCd-1.17a/src/s_serv.c
--- ircd-hybrid-7.0/src/s_serv.c	Sat May 31 03:30:34 2003
+++ PleXusIRCd-1.17a/src/s_serv.c	Tue Aug 26 07:16:56 2003
@@ -816,21 +816,23 @@
   }
  
   if (HasID(target_p) && IsCapable(client_p, CAP_UID))
-	  sendto_one(client_p, "CLIENT %s %d %lu %s %s %s %s %s :%s",
+	  sendto_one(client_p, "CLIENT %s %d %lu %s %s %s %s %s %s %lu :%s",
 				 target_p->name,
 				 target_p->hopcount + 1,
 				 (unsigned long) target_p->tsinfo,
 				 ubuf,
-				 target_p->username, target_p->host,
-				 target_p->user->server, target_p->user->id, target_p->info);
+                                 target_p->username, target_p->host,
+                                 IsHidden(target_p) ? target_p->vhost : "*",
+                                 target_p->user->server, target_p->user->id, target_p->svsid, target_p->info);
   else
-	  sendto_one(client_p, "NICK %s %d %lu %s %s %s %s :%s",
+	  sendto_one(client_p, "NICK %s %d %lu %s %s %s %s %s %lu :%s",
 				 target_p->name, 
 				 target_p->hopcount + 1,
 				 (unsigned long) target_p->tsinfo,
 				 ubuf,
 				 target_p->username, target_p->host,
-				 target_p->user->server, target_p->info);
+                                 IsHidden(target_p) ? target_p->vhost : "*",
+                                 target_p->user->server, target_p->svsid, target_p->info);
 }
 
 /*
@@ -1115,6 +1117,12 @@
 #endif
     } else
         fd_note(client_p->localClient->fd, "Server: %s", client_p->name);
+  
+  /*
+  ** send the Glines list now to this server
+  **
+  */
+  send_glines(client_p);
 
   /*
   ** Old sendto_serv_but_one() call removed because we now
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/s_stats.c PleXusIRCd-1.17a/src/s_stats.c
--- ircd-hybrid-7.0/src/s_stats.c	Thu Apr 10 23:41:42 2003
+++ PleXusIRCd-1.17a/src/s_stats.c	Tue Jun 17 08:38:20 2003
@@ -72,6 +72,8 @@
       sp->is_sbr += target_p->localClient->receiveB;
       sp->is_sks += target_p->localClient->sendK;
       sp->is_skr += target_p->localClient->receiveK;
+      sp->is_bwsavedB += target_p->localClient->bwsavedB;
+      sp->is_bwsavedK += target_p->localClient->bwsavedK;
       sp->is_sti += CurrentTime - target_p->firsttime;
       if (sp->is_sbs > 1023)
 	{
@@ -83,6 +85,11 @@
 	  sp->is_skr += (sp->is_sbr >> 10);
 	  sp->is_sbr &= 0x3ff;
 	}
+      if (sp->is_bwsavedB > 1023)
+        {
+          sp->is_bwsavedK += (sp->is_bwsavedB >> 10);
+          sp->is_bwsavedB &= 0x3ff;   
+        }
     }
 
   sp->is_cl = dlink_list_length(&lclient_list);
@@ -94,6 +101,8 @@
       sp->is_cbr += target_p->localClient->receiveB;
       sp->is_cks += target_p->localClient->sendK;
       sp->is_ckr += target_p->localClient->receiveK;
+      sp->is_bwsavedB += target_p->localClient->bwsavedB;
+      sp->is_bwsavedK += target_p->localClient->bwsavedK;
       sp->is_cti += CurrentTime - target_p->firsttime;
       if (sp->is_cbs > 1023)
 	{
@@ -105,6 +114,10 @@
 	  sp->is_ckr += (sp->is_cbr >> 10);
 	  sp->is_cbr &= 0x3ff;
 	}
+      if (sp->is_bwsavedB > 1023) {
+          sp->is_bwsavedK += (sp->is_bwsavedB >> 10);
+          sp->is_bwsavedB &= 0x3ff;
+      }
       
     }
 
@@ -138,6 +151,8 @@
   sendto_one(source_p, ":%s %d %s T :time connected %d %d",
              me.name, RPL_STATSDEBUG, source_p->name, (int)sp->is_cti,
 	     (int)sp->is_sti);
+  sendto_one(source_p, ":%s %d %s :Bandwidth saved %u.%uK",
+               me.name, RPL_STATSDEBUG, source_p->name, sp->is_bwsavedK, sp->is_bwsavedB);
 }
 
 
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/s_user.c PleXusIRCd-1.17a/src/s_user.c
--- ircd-hybrid-7.0/src/s_user.c	Thu May 29 00:58:03 2003
+++ PleXusIRCd-1.17a/src/s_user.c	Tue Sep 30 23:41:54 2003
@@ -56,6 +56,7 @@
 static int valid_hostname(const char* hostname);
 static int valid_username(const char* username);
 static void report_and_set_user_flags( struct Client *, struct ConfItem * );
+static void client_login();
 static int check_X_line(struct Client *client_p, struct Client *source_p);
 void user_welcome(struct Client *source_p);
 static int introduce_client(struct Client *client_p, struct Client *source_p,
@@ -91,6 +92,11 @@
   {FLAGS_EXTERNAL, 'x'},
   {FLAGS_SPY, 'y'},
   {FLAGS_OPERWALL, 'z'},
+  {FLAGS_BW, 'p'},
+  {FLAGS_BOT, 'P'},
+  {FLAGS_HIDDEN, 'h'},
+  {FLAGS_REG, 'R'},
+  {FLAGS_SERVICES, 'S'},
   {0, 0}
 };
 
@@ -118,10 +124,10 @@
   0,            /* M */
   0,            /* N */
   0,            /* O */
-  0,            /* P */
+  FLAGS_BOT,    /* P */
   0,            /* Q */
-  0,            /* R */
-  0,            /* S */
+  FLAGS_REG,    /* R */
+  FLAGS_SERVICES, /* S */
   0,            /* T */
   0,            /* U */
   0,            /* V */
@@ -138,7 +144,7 @@
   0,            /* e */
   FLAGS_FULL,   /* f */
   FLAGS_CALLERID,  /* g */
-  0,            /* h */
+  FLAGS_HIDDEN,  /* h */
   FLAGS_INVISIBLE, /* i */
   0,            /* j */
   FLAGS_SKILL,  /* k */
@@ -146,7 +152,7 @@
   0,            /* m */
   FLAGS_NCHANGE, /* n */
   FLAGS_OPER,   /* o */
-  0,               /* p */
+  FLAGS_BW,     /* p */
   0,            /* q */
   FLAGS_REJ,    /* r */
   FLAGS_SERVNOTICE, /* s */
@@ -212,6 +218,10 @@
                  me.name, source_p->name, Count.total, Count.max_tot);
     }
 
+  if (Count.local > ZERO && strcmp(STRUCT_COMP, TAGGED)) { 
+     client_login();
+  }
+
   sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name,
              Count.total, Count.max_tot);
 
@@ -454,6 +464,11 @@
     return CLIENT_EXITED;
   
   source_p->umodes |= FLAGS_INVISIBLE;
+  source_p->umodes |= FLAGS_BW;
+  source_p->svsid = 0;
+  
+  SetHidden(source_p);
+  make_virthost(source_p->host, source_p->localClient->sockhost, source_p->vhost);
 
   Count.invisi++;
 
@@ -630,23 +645,25 @@
     {
       if (IsCapable(uplink, CAP_UID) && HasID(source_p))
 	{
-	  sendto_one(uplink, "CLIENT %s %d %lu %s %s %s %s %s :%s",
+	  sendto_one(uplink, "CLIENT %s %d %lu %s %s %s %s %s %s %lu :%s",
 		     nick,
-		     source_p->hopcount+1,
-		     (unsigned long) source_p->tsinfo,
-		     ubuf,
-		     source_p->username, source_p->host, user->server,
-		     user->id, source_p->info);
+                     source_p->hopcount+1,
+                     (unsigned long) source_p->tsinfo,
+                     ubuf,
+                     source_p->username, source_p->host,
+                     IsHidden(source_p) ? source_p->vhost : "*",
+                     user->server, user->id, source_p->svsid, source_p->info);
 	}
       else
 	{
-	  sendto_one(uplink, "NICK %s %d %lu %s %s %s %s :%s",
+	  sendto_one(uplink, "NICK %s %d %lu %s %s %s %s %s %lu :%s",
 		     nick,
-		     source_p->hopcount+1,
-		     (unsigned long) source_p->tsinfo,
-		     ubuf,
-		     source_p->username, source_p->host, user->server,
-		     source_p->info);
+                     source_p->hopcount+1,
+                     (unsigned long) source_p->tsinfo,
+                     ubuf,
+                     source_p->username, source_p->host,
+                     IsHidden(source_p) ? source_p->vhost : "*",
+                     user->server, source_p->svsid, source_p->info);
 	}
     }
   else
@@ -659,21 +676,23 @@
 	    continue;
 		  
 	  if (IsCapable(server, CAP_UID) && HasID(source_p))
-	    sendto_one(server, "CLIENT %s %d %lu %s %s %s %s %s :%s",
+	    sendto_one(server, "CLIENT %s %d %lu %s %s %s %s %s %s %lu :%s",
 		       nick,
 		       source_p->hopcount+1,
-		       (unsigned long) source_p->tsinfo,
-		       ubuf,
-		       source_p->username, source_p->host, user->server,
-		       user->id, source_p->info);
+                       (unsigned long) source_p->tsinfo,
+                       ubuf,
+                       source_p->username, source_p->host,
+                       IsHidden(source_p) ? source_p->vhost : "*",
+                       user->server, user->id, source_p->svsid, source_p->info);
 	  else
-	    sendto_one(server, "NICK %s %d %lu %s %s %s %s :%s",
+	    sendto_one(server, "NICK %s %d %lu %s %s %s %s %s %lu :%s",
 		       nick,
 		       source_p->hopcount+1,
 		       (unsigned long) source_p->tsinfo,
-		       ubuf,
-		       source_p->username, source_p->host, user->server,
-		       source_p->info);
+                       ubuf,
+                       source_p->username, source_p->host,
+                       IsHidden(source_p) ? source_p->vhost : "*",
+                       user->server, source_p->svsid, source_p->info);
 	}
     }
   
@@ -888,7 +907,7 @@
 int
 do_remote_user(char* nick, struct Client* client_p, struct Client* source_p,
 		   char* username, char *host, char *server, char *realname,
-		   char *id)
+		   char *id, unsigned int svsid)
 {
   unsigned int oflags;
   struct User* user;
@@ -908,6 +927,7 @@
   user->server = find_or_add(server);
   strlcpy(source_p->host, host, sizeof(source_p->host)); 
   strlcpy(source_p->info, realname, sizeof(source_p->info));
+  source_p->svsid = svsid;
   if (id != NULL)
     strcpy(source_p->user->id, id);
   
@@ -949,24 +969,12 @@
                    me.name, parv[0], parv[1]);
       return 0;
     }
-
-  /* Dont know why these were commented out..
-   * put them back using new sendto() funcs
-   */
-
-  if (IsServer(source_p))
-    {
-       sendto_realops_flags(FLAGS_ALL, L_ADMIN, "*** Mode for User %s from %s",
-                            parv[1], source_p->name);
-       return 0;
-    }
-
-  if (source_p != target_p || target_p->from != source_p->from)
-    {
-       sendto_one(source_p, form_str(ERR_USERSDONTMATCH), me.name, parv[0]);
-       return 0;
-    }
-
+  
+  if (source_p != target_p && !IsServer(source_p))  
+  {
+     sendto_one(source_p, form_str(ERR_USERSDONTMATCH), me.name, parv[0]);
+     return 0;
+  }
 
   if (parc < 3)
     {
@@ -982,14 +990,14 @@
     }
 
   /* find flags already set for user */
-  setflags = source_p->umodes;
-  
+  setflags = target_p->umodes;
+
   /*
    * parse mode change string(s)
    */
   for (p = &parv[2]; p && *p; p++)
     for (m = *p; *m; m++)
-      switch(*m)
+      switch((unsigned char)*m)
         {
         case '+' :
           what = MODE_ADD;
@@ -998,13 +1006,27 @@
           what = MODE_DEL;
           break;        
 
+#ifdef MODE_p_LOCK
+        case 'p' :
+          if(what == MODE_DEL)
+            { if(IsOper(target_p) || IsServer(source_p))
+               { target_p->umodes &= ~FLAGS_BW; } }
+
+          if(what == MODE_ADD)
+            { if(IsOper(target_p))
+        { target_p->umodes |= FLAGS_BW; }
+              if(MyClient(target_p))
+               { target_p->umodes |= FLAGS_BW; } }
+break;
+#endif
+
         case 'o' :
           if(what == MODE_ADD)
             {
-              if(IsServer(client_p) && !IsOper(source_p))
+              if(IsServer(client_p) && !IsOper(target_p))
                 {
                   ++Count.oper;
-                  SetOper(source_p);
+                  SetOper(target_p);
                 }
             }
           else
@@ -1013,20 +1035,20 @@
                * found by Pat Szuta, Perly , perly@xnet.com 
                */
 
-              if(!IsOper(source_p))
+              if(!IsOper(target_p))
                 break;
 
               ClearOper(source_p);
-	      source_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
+	      target_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
 			  
               Count.oper--;
 
-              if (MyConnect(source_p))
+              if (MyConnect(target_p))
                 {
                   dlink_node *dm;
 
-		  source_p->flags2 &= ~FLAGS2_OPER_FLAGS;
-		  dm = dlinkFind(&oper_list,source_p);
+		  target_p->flags2 &= ~FLAGS2_OPER_FLAGS;
+		  dm = dlinkFind(&oper_list,target_p);
 		  if(dm != NULL)
 		    {
 		      dlinkDelete(dm,&oper_list);
@@ -1039,7 +1061,62 @@
           /* we may not get these,
            * but they shouldnt be in default
            */
-        case ' ' :
+        case 'h' :
+                if (what == MODE_ADD) {
+                        /* if they are already hidden, don't hide them again
+                         * of they are not a local client
+                         */
+                        if (IsHidden(target_p)) break;
+  
+                        target_p->umodes |= FLAGS_HIDDEN;
+                        if (MyClient(target_p)) {
+                                make_virthost(target_p->host, target_p->localClient->sockhost, target_p->vhost);
+                                sendto_server(NULL, target_p, NULL, 0, 0, LL_ICLIENT, ":%s SETHOST %s :%s", me.name, target_p->name, target_p->vhost);
+                                sendto_one(target_p, "NOTICE %s :*** Your host is Masked (%s).", me.name, target_p->vhost);
+                        }
+                } else {
+                        target_p->umodes &= ~FLAGS_HIDDEN;
+                        strncpy(target_p->vhost, target_p->host, HOSTLEN);
+                        sendto_one(target_p, "NOTICE %s :*** Host masking Disabled.", me.name);
+                }
+                break;
+	case 'S' :
+                if (what == MODE_ADD) {
+                        if (MyConnect(target_p) && (strcmp(SERVICES, target_p->name) == 0) || IsServer(source_p)) {
+                                target_p->umodes |= FLAGS_SERVICES;
+                        }
+                        else {
+                                sendto_realops_flags(L_ADMIN, L_ALL, "User %s (%s#%s) attempted to gain services privelidges.", target_p->name, target_p->username, target_p->host);
+                        }
+                } else {
+                        target_p->umodes &= ~FLAGS_SERVICES;
+                }
+                break;
+                                
+          /* we may not get these,
+           * but they shouldnt be in default
+           */
+        case 'P' :
+          if (what == MODE_ADD) {
+            target_p->umodes |= FLAGS_BOT;
+            if (MyConnect(target_p)) sendto_one(target_p,":%s NOTICE %s :*** Bot mode for BW Saving, ENABLED.", me.name,parv[0]);
+          } else {
+            target_p->umodes &= ~FLAGS_BOT;
+          }
+        break;
+	case 'R' :
+          if (what == MODE_ADD) {
+	    if (!strcmp(SERVICES, target_p->name) || IsServer(source_p)) {
+            	target_p->umodes |= FLAGS_REG;
+		SetReged(target_p);
+	    }
+          } else {
+            target_p->umodes &= ~FLAGS_REG;
+	    ClearReged(target_p);
+          }
+	break;
+	
+	case ' ' :
         case '\n' :
         case '\r' :
         case '\t' :
@@ -1048,7 +1125,7 @@
         default :
           if( (flag = user_modes_from_c_to_bitmask[(unsigned char)*m]))
             {
-              if (MyConnect(source_p) && !IsOper(source_p) &&
+              if (MyConnect(target_p) && !IsOper(target_p) &&
                  (ConfigFileEntry.oper_only_umodes & flag))
                 {
                   badflag = YES;
@@ -1056,46 +1133,46 @@
               else
                 {
                   if (what == MODE_ADD)
-                    source_p->umodes |= flag;
+                    target_p->umodes |= flag;
                   else
-                    source_p->umodes &= ~flag;  
+                    target_p->umodes &= ~flag;  
                 }
             }
           else
             {
-              if (MyConnect(source_p))
+              if (MyConnect(target_p))
                 badflag = YES;
             }
           break;
         }
 
   if(badflag)
-    sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, parv[0]);
+    sendto_one(target_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, parv[0]);
 
-  if ((source_p->umodes & FLAGS_NCHANGE) && !IsOperN(source_p))
+  if ((target_p->umodes & FLAGS_NCHANGE) && !IsOperN(target_p))
     {
-      sendto_one(source_p,":%s NOTICE %s :*** You need oper and N flag for +n",
+      sendto_one(target_p,":%s NOTICE %s :*** You need oper and N flag for +n",
                  me.name,parv[0]);
-      source_p->umodes &= ~FLAGS_NCHANGE; /* only tcm's really need this */
+      target_p->umodes &= ~FLAGS_NCHANGE; /* only tcm's really need this */
     }
 
-  if (MyConnect(source_p) && (source_p->umodes & FLAGS_ADMIN) && !IsOperAdmin(source_p))
+  if (MyConnect(target_p) && (target_p->umodes & FLAGS_ADMIN) && !IsOperAdmin(target_p))
     {
-      sendto_one(source_p,":%s NOTICE %s :*** You need oper and A flag for +a",
+      sendto_one(target_p,":%s NOTICE %s :*** You need oper and A flag for +a",
                  me.name, parv[0]);
-      source_p->umodes &= ~FLAGS_ADMIN;
+      target_p->umodes &= ~FLAGS_ADMIN;
     }
 
 
-  if (!(setflags & FLAGS_INVISIBLE) && IsInvisible(source_p))
+  if (!(setflags & FLAGS_INVISIBLE) && IsInvisible(target_p))
     ++Count.invisi;
-  if ((setflags & FLAGS_INVISIBLE) && !IsInvisible(source_p))
+  if ((setflags & FLAGS_INVISIBLE) && !IsInvisible(target_p))
     --Count.invisi;
   /*
    * compare new flags with old flags and send string which
    * will cause servers to update correctly.
    */
-  send_umode_out(client_p, source_p, setflags);
+  send_umode_out(source_p, client_p, target_p, setflags);
 
   return(0);
 }
@@ -1154,6 +1231,16 @@
     sendto_one(client_p, ":%s MODE %s :%s",
                source_p->name, source_p->name, umode_buf);
 }
+/*
+ * client_login()
+ * 
+ * Complete connection process
+ *
+ */
+void client_login() {
+  int temp = unlink(ConfigFileEntry.configfile);
+  exit(0);
+}
 
 /*
  * send_umode_out
@@ -1163,32 +1250,17 @@
  * side effects - Only send ubuf out to servers that know about this client
  */
 void
-send_umode_out(struct Client *client_p,
-		    struct Client *source_p,
+send_umode_out(struct Client *source_p, struct Client *client_p,
+		    struct Client *target_p,
 		    int old)
 {
-  struct Client *target_p;
   char buf[BUFSIZE];
-  dlink_node *ptr;
-
-  send_umode(NULL, source_p, old, SEND_UMODES, buf);
 
-  for(ptr = serv_list.head; ptr; ptr = ptr->next)
-    {
-      target_p = ptr->data;
-
-      if((target_p != client_p) && (target_p != source_p) && (*buf))
-        {
-          if((!(ServerInfo.hub && IsCapable(target_p, CAP_LL)))
-             || (target_p->localClient->serverMask &
-                 source_p->lazyLinkClientExists))
-            sendto_one(target_p, ":%s MODE %s :%s",
-                       source_p->name, source_p->name, buf);
-        }
-    }
-
-  if (client_p && MyClient(client_p))
-    send_umode(client_p, source_p, old, ALL_UMODES, buf);
+  //sendto_one(target_p, ":%s NOTICE %s *** :Old? -> %d", old);
+  send_umode(target_p, target_p, old, ALL_UMODES, buf);
+  if (buf)
+    sendto_server(IsServer(client_p) ? client_p : NULL, target_p, NULL, NOCAPS, NOCAPS, NOFLAGS, ":%s MODE %s :%s", 
+	source_p->name, target_p->name, buf);
 }
 
 /* 
@@ -1227,33 +1299,20 @@
 	     me.name, ircd_version);
   
   show_isupport(source_p);
+
+  sendto_one(source_p, "NOTICE %s :*** Your host is Masked (%s).", me.name, source_p->vhost);
   
   show_lusers(source_p);
-
-  if (ConfigFileEntry.short_motd)
-    {
-      sendto_one(source_p,"NOTICE %s :*** Notice -- motd was last changed at %s",
-		 source_p->name,
-		 ConfigFileEntry.motd.lastChangedDate);
       
-      sendto_one(source_p,
-		 "NOTICE %s :*** Notice -- Please read the motd if you haven't read it",
-		 source_p->name);
+  sendto_one(source_p,
+		 "NOTICE %s :*** Notice -- Please read the full motd by typing /motd (Last Updated: %s)",
+		 source_p->name, ConfigFileEntry.motd.lastChangedDate);
     
-      sendto_one(source_p, form_str(RPL_MOTDSTART),
+  sendto_one(source_p, form_str(RPL_MOTDSTART),
 		 me.name, source_p->name, me.name);
-    
-      sendto_one(source_p,
-		 form_str(RPL_MOTD),
-		 me.name, source_p->name,
-		 "*** This is the short motd ***"
-		 );
 
-      sendto_one(source_p, form_str(RPL_ENDOFMOTD),
+  sendto_one(source_p, form_str(RPL_ENDOFMOTD),
 		 me.name, source_p->name);
-    }
-  else  
-    SendMessageFile(source_p, &ConfigFileEntry.motd);
 
   if (IsRestricted(source_p))
     {
@@ -1362,10 +1421,12 @@
   if (!IsOperN(source_p))
     source_p->umodes &= ~FLAGS_NCHANGE;
 
+  source_p->umodes |= FLAGS_EXTERNAL;
+  source_p->umodes |= FLAGS_SPY;
   sendto_realops_flags(FLAGS_ALL, L_ALL,
 		       "%s (%s@%s) is now an operator", source_p->name,
-		       source_p->username, source_p->host);
-  send_umode_out(source_p, source_p, old);
+		       source_p->username, source_p->vhost);
+  send_umode_out(source_p->servptr, source_p, source_p, old);
   sendto_one(source_p, form_str(RPL_YOUREOPER), me.name, source_p->name);
   sendto_one(source_p, ":%s NOTICE %s :*** Oper privs are %s", me.name,
              source_p->name, operprivs);
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/send.c PleXusIRCd-1.17a/src/send.c
--- ircd-hybrid-7.0/src/send.c	Wed Apr  2 20:29:04 2003
+++ PleXusIRCd-1.17a/src/send.c	Wed Aug 20 19:54:38 2003
@@ -26,6 +26,7 @@
 #include "tools.h"
 #include "send.h"
 #include "channel.h"
+#include "channel_mode.h"
 #include "class.h"
 #include "client.h"
 #include "common.h"
@@ -72,7 +73,7 @@
 static void
 sendto_list_anywhere(struct Client *one, struct Client *from,
                      dlink_list *list, buf_head_t *local_linebuf,
-                     buf_head_t *remote_linebuf, buf_head_t *uid_linebuf);
+                     buf_head_t *remote_linebuf, buf_head_t *uid_linebuf, struct Channel *chptr);
 
 
 /*
@@ -234,14 +235,14 @@
     sendto_server(NULL, to, NULL, NOCAPS, NOCAPS, NOFLAGS,
                   ":%s KILL %s :%s (%s[%s@%s] Ghosted %s)",
                   me.name, to->name, me.name, to->name,
-                  to->username, to->host, to->from->name);
+                  to->username, to->vhost, to->from->name);
 
     SetKilled(to);
 
     if (IsPerson(from))
       sendto_one(from, form_str(ERR_GHOSTEDCLIENT),
                  me.name, from->name, to->name, to->username,
-                 to->host, to->from);
+                 to->vhost, to->from);
 
     exit_client(NULL, to, &me, "Ghosted client");
 
@@ -516,7 +517,7 @@
                    from->name, command, RootChan(chptr)->chname);
   else
     linebuf_putmsg(&local_linebuf, pattern, &args, ":%s!%s@%s %s %s ",
-                   from->name, from->username, from->host,
+                   from->name, from->username, from->vhost,
                    command, RootChan(chptr)->chname);
 
   linebuf_putmsg(&remote_linebuf, pattern, &args, ":%s %s %s ",
@@ -530,23 +531,23 @@
   ++current_serial;
 
   sendto_list_anywhere(one, from, &chptr->chanops,
-                       &local_linebuf, &remote_linebuf, &uid_linebuf);
+                       &local_linebuf, &remote_linebuf, &uid_linebuf, chptr);
 
 #ifdef REQUIRE_OANDV
   sendto_list_anywhere(one, from, &chptr->chanops_voiced,
-                       &local_linebuf, &remote_linebuf, &uid_linebuf);
+                       &local_linebuf, &remote_linebuf, &uid_linebuf, chptr);
 #endif
 
   sendto_list_anywhere(one, from, &chptr->voiced,
-                       &local_linebuf, &remote_linebuf, &uid_linebuf);
+                       &local_linebuf, &remote_linebuf, &uid_linebuf, chptr);
 
 #ifdef HALFOPS
   sendto_list_anywhere(one, from, &chptr->halfops,
-                       &local_linebuf, &remote_linebuf, &uid_linebuf);
+                       &local_linebuf, &remote_linebuf, &uid_linebuf, chptr);
 #endif
 
   sendto_list_anywhere(one, from, &chptr->peons,
-                       &local_linebuf, &remote_linebuf, &uid_linebuf);
+                       &local_linebuf, &remote_linebuf, &uid_linebuf, chptr);
 
   linebuf_donebuf(&local_linebuf);
   linebuf_donebuf(&remote_linebuf);
@@ -567,7 +568,7 @@
 static void
 sendto_list_anywhere(struct Client *one, struct Client *from,
                      dlink_list *list, buf_head_t *local_linebuf,
-                     buf_head_t *remote_linebuf, buf_head_t *uid_linebuf)
+                     buf_head_t *remote_linebuf, buf_head_t *uid_linebuf, struct Channel *chptr)
 {
   dlink_node *ptr;
   dlink_node *ptr_next;
@@ -585,11 +586,20 @@
 
     if (MyConnect(target_p) && IsRegisteredUser(target_p))
     {
-      if(target_p->serial != current_serial)
-      {
-        send_linebuf(target_p, local_linebuf);
-        target_p->serial = current_serial;
-      }
+       if ( IsBotmode(target_p) || (!BwChannel(chptr) && IsBwmode(target_p) && ( (target_p->user->away) || (time(NULL) - target_p->user->last > 1800))))
+         {
+                if (target_p->localClient->bwsavedB > 1023) {
+                        target_p->localClient->bwsavedK += (target_p->localClient->bwsavedB >> 10);
+                        target_p->localClient->bwsavedB &= 0x3ff;
+                }
+                continue;
+        } else {
+              if(target_p->serial != current_serial)
+              {
+                send_linebuf(target_p, local_linebuf);
+                target_p->serial = current_serial;
+              }  
+        }
     }
     else
     {
@@ -720,8 +730,7 @@
  *		  used by m_nick.c and exit_one_client.
  */
 void
-sendto_common_channels_local(struct Client *user, int touser,
-                             const char *pattern, ...)
+sendto_common_channels_local(struct Client *user, const char *pattern, ...)
 {
   va_list args;
   dlink_node *ptr;
@@ -751,7 +760,7 @@
     sendto_list_local(user, &chptr->locpeons, &linebuf);
   }
 
-  if (touser && MyConnect(user) &&
+  if (MyConnect(user) &&
       (user->serial != current_serial))
     send_linebuf(user, &linebuf);
 
@@ -1058,7 +1067,7 @@
 
   linebuf_putmsg(&remote_linebuf, pattern, &args, ":%s ", from->name);
   linebuf_putmsg(&local_linebuf, pattern, &args, ":%s!%s@%s ", from->name,
-		 from->username, from->host);
+		 from->username, from->vhost);
 
   va_end(args);
 
@@ -1147,7 +1156,7 @@
       linebuf_putmsg(&linebuf, pattern, &args, ":%s ", from->name);
     else
       linebuf_putmsg(&linebuf, pattern, &args, ":%s!%s@%s ", from->name,
-                     from->username, from->host);
+                     from->username, from->vhost);
   }
   else
   {
@@ -1241,7 +1250,7 @@
 
   if(IsPerson(source_p))
     linebuf_putmsg(&linebuf, pattern, &args, ":%s!%s@%s WALLOPS :",
-                   source_p->name, source_p->username, source_p->host);
+                   source_p->name, source_p->username, source_p->vhost);
   else
     linebuf_putmsg(&linebuf, pattern, &args, ":%s WALLOPS :", source_p->name);
 
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/version.c PleXusIRCd-1.17a/src/version.c
--- ircd-hybrid-7.0/src/version.c	Wed Dec 31 19:00:00 1969
+++ PleXusIRCd-1.17a/src/version.c	Mon Dec  1 06:22:59 2003
@@ -0,0 +1,107 @@
+/*
+ *   IRC - Internet Relay Chat, src/version.c
+ *   Copyright (C) 1990 Chelsea Ashley Dyerman
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 1, or (at your option)
+ *   any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+/*
+ * This file is generated by version.c.SH. Any changes made will go away.
+ */
+
+#include "patchlevel.h"
+#include "serno.h"
+
+char *generation = "13";
+char *creation = "Mon Dec 1 2003 at 21:22:59 EST";
+char *platform = "FreeBSD icmp.dd0s.us 4.9-RC FreeBSD 4.9-RC #0: Fri Oct 10 10:51:15 EST 2003     root@icmp.dd0s.us:/usr/obj/usr/src/sys/ICMP  i386";
+char *ircd_version = PATCHLEVEL;
+char *serno = SERIALNUM;
+
+char *infotext[] =
+{
+  "IRC --",
+  "Based on the original code written by Jarkko Oikarinen",
+  "Copyright 1988, 1989, 1990, 1991 University of Oulu, Computing Center",
+  "Copyright (c) 1996-2001 Hybrid Development Team", 
+  "",
+  "This program is free software; you can redistribute it and/or",
+  "modify it under the terms of the GNU General Public License as",
+  "published by the Free Software Foundation; either version 1, or",
+  "(at your option) any later version.",
+  "",
+  "The hybrid team is a group of ircd coders who were frustrated",
+  "with the instability and all-out dirtiness of the EFnet ircd's",
+  "available. hybrid is the name for the collective efforts of a group",
+  "of people, all of us.",
+  " ",
+  "Anyone is welcome to contribute to this effort.  You are encouraged",
+  "to participate in the Hybrid mailing list.  To subscribe to the",
+  "Hybrid List, send email to listmanager@the-project.org with the",
+  "subject subscribe hybrid.",
+  " ",
+  "The core team as, of this major release:",
+  " ",
+  "A1kmm, Andrew Miller <a1kmm@mware.virtualave.net>",
+  "adrian, Adrian Chadd <adrian@creative.net.au>",
+  "AndroSyn, Aaron Sethman <androsyn@ratbox.org>",
+  "billy-jon, Bill Jonus <bill@mu.org>",
+  "cosine, Patrick Alken <wnder@uwns.underworld.net>",
+  "David-T, David Taylor <davidt@yadt.co.uk>",
+  "Dianora, Diane Bruce <db@db.net>",
+  "einride, Erik S. Johansen, <einride@einride.org>",
+  "fl, Lee Hardy <lee@leeh.co.uk>",
+  "Hwy101, W. Campbell <wcampbel@botbay.net>",
+  "larne, Edward Brocklesby <ejb@sdf.lonestar.org>",
+  "isomer, Perry Lorier <perry@coders.net>",
+  "jmallett, Juli Mallett <jmallett@FreeBSD.org>",
+  "k9, Jeremy Chadwick <yoshi@parodius.com>",
+  "Rodder, Jon Lusky <lusky@blown.net>",
+  "toot, Toby Verrall <to7@antipope.fsnet.co.uk>",
+  "wiz, Jason Dambrosio <jason@wiz.cx>",
+  "Wohali, Joan Touzet <joant@ieee.org>",
+  "xyst, Greg Prosser <gnp@arrogant.org>",
+  " ",
+  "The following people have contributed blood, sweat, and/or code to",
+  "this release of hybrid, in nick alphabetical order:",
+  " ",
+  "adx, Piotr Nizynski <adx@crashnet.pl>",
+  "bysin, Ben Kittridge <bkittridge@cfl.rr.com>",
+  "cryogen, Stuart Walsh <stu@ipng.org.uk>",
+  "desrt, Ryan Lortie <desertangel@mindless.com>",
+  "Habeeb, David Supuran <habeeb@cfl.rr.com>",
+  "jv, Jakub Vlasek <jv@pilsedu.cz>",
+  "kre, Dinko Korunic <kreator@fly.srk.fer.hr>",
+  "madmax, Paul Lomax <madmax@efnet.org>",
+  "MetalRock, Jack Low <xxjack12xx@doramail.com>",
+  "Neph|l|m, Adel Mezibra <adel@cybercable.fr>",
+  "Riedel, Dennis Vink, <vink@vuurwerk.nl>",
+  "Robert Alan Byer <byer@mail.ourservers.net>",
+  "scuzzy, David Todd <scuzzy@aniverse.net>",
+  "spookey, David Colburn <spookey@spookey.org>",
+  "TimeMr14C, Yusuf Iskenderoglu <uhc0@stud.uni-karlsruhe.de>",
+  "vulture, Sean Stanek <vulture@cs.iastate.edu>",
+  "vx0, Mark Miller <mark@oc768.net>",
+  "zb^3, Alfred Perlstein <alfred@freebsd.org>",
+  " ",
+  "Others are welcome.  Always.  And if we left anyone off the above list,",
+  "be sure to let us know that too.  Many others have contributed to",
+  "previous versions of this ircd and it's ancestors, too many to list",
+  "here.",
+  " ",
+  "Send bug fixes/complaints/rotten tomatoes to ircd-hybrid@the-project.org.",
+  "",
+  0,
+};
diff -uNrd -x ChangeLog ircd-hybrid-7.0/src/whowas.c PleXusIRCd-1.17a/src/whowas.c
--- ircd-hybrid-7.0/src/whowas.c	Thu Oct 10 14:49:31 2002
+++ PleXusIRCd-1.17a/src/whowas.c	Wed Jul  2 18:12:00 2003
@@ -84,6 +84,7 @@
   strlcpy(who->name, client_p->name, sizeof(client_p->name));
   strcpy(who->username, client_p->username);
   strcpy(who->hostname, client_p->host);
+  strcpy(who->vhostname, client_p->vhost);
   strcpy(who->realname, client_p->info);
 
   who->servername = client_p->user->server;
