diff -uNrd ircd-hybrid-7rc8/ChangeLog ircd-7+BgFree-p5/ChangeLog
--- ircd-hybrid-7rc8/ChangeLog	Sun Jan 26 23:42:20 2003
+++ ircd-7+BgFree-p5/ChangeLog	Thu Mar  6 17:37:22 2003
@@ -1,3 +1,25 @@
+zer0c00l	2003/03/05 23:00 GMT	(20030306_0)
+	
+	there is so much i added that i don't know where to start :-)
+  
+  Modified files:
+	include		patchlevel.h -of course
+	m_whois.c	added support for nickserv identify and hidin' serv chans so added and on whois notice
+	m_kill.c	a lit a bit modified for showing local kills
+	m_operwall.c	Only opers with O flag may talk to /operwall
+	m_wallops.c	actually the same
+	m_svshint.c	Added this new to the ircd core module supporting nickserv id users
+	m_kick.c	Protected services from being kicked
+	m_nick.c	support for showin' identified with nickserv users
+	client.c	support for operserv ident users and so nickserv users
+	s_misc.c	my favourite s_check() for protecting services
+	s_serv.c	support for nickserv and operserv id users
+	channel_modes.c	Protect services from being deopped
+	include/numeric.c Added some more numerics here
+	messages.tab	Well...
+	hash.c		a lit a bit for nickserv id users
+
+
 lusky       2003/01/26 23:42:18 EST	(20030127_0)
 
   Modified files:
@@ -3274,7 +3296,7 @@
   - thats a major stupid. spotted by wiz/stu
   
   Revision  Changes    Path
-  1.51      +12 -16    ircd-hybrid-7/modules/m_oper.c
+  1.51      +12 -16  " ircd-hybrid-7/modules/m_oper.c
 
 
 
diff -uNrd ircd-hybrid-7rc8/configure ircd-7+BgFree-p5/configure
--- ircd-hybrid-7rc8/configure	Tue Dec  3 21:42:15 2002
+++ ircd-7+BgFree-p5/configure	Thu Mar  6 16:47:34 2003
@@ -6748,7 +6748,7 @@
 
 fi;
 
-ac_cv_nicklen="9"
+ac_cv_nicklen="15"
 ac_cv_maxclients="200"
 ac_cv_topiclen="120"
 
diff -uNrd ircd-hybrid-7rc8/include/client.h ircd-7+BgFree-p5/include/client.h
--- ircd-hybrid-7rc8/include/client.h	Mon Jan 20 07:44:00 2003
+++ ircd-7+BgFree-p5/include/client.h	Sun Mar  2 14:19:16 2003
@@ -145,6 +145,8 @@
   unsigned int      flags;      /* client flags */
   unsigned int      flags2;     /* ugh. overflow */
 
+unsigned int      svsflags;   /* services flags -zer0c00l */
+
   int               slink_pid;  /* pid of servlink process if any */
   int               hopcount;   /* number of servers to this 0 = local */
   int		    hidden_server;
@@ -420,6 +422,9 @@
 #define FLAGS_OPER         0x20000 /* Operator */
 #define FLAGS_ADMIN        0x40000 /* Admin on server */
 
+#define FLAGS_SVS_IDENT    0x0001  /* client has identified with services -zer0c00l */
+#define FLAGS_SVS_ADMIN    0x0002  /* client has identified as services admin -zer0c00l */
+
 #define FLAGS_ALL	   FLAGS_SERVNOTICE
 
 
@@ -540,6 +545,14 @@
 
 #define SetGotId(x)             ((x)->flags |= FLAGS_GOTID)
 #define IsGotId(x)              (((x)->flags & FLAGS_GOTID) != 0)
+
+#define IsNSId(x)               ((x)->svsflags & FLAGS_SVS_IDENT)
+#define SetNSId(x)              ((x)->svsflags |= FLAGS_SVS_IDENT)
+#define ClearNSId(x)            ((x)->svsflags &= ~FLAGS_SVS_IDENT)
+
+#define IsOSId(x)               ((x)->svsflags & FLAGS_SVS_ADMIN)
+#define SetOSId(x)              ((x)->svsflags |= FLAGS_SVS_ADMIN)
+#define ClearOSId(x)            ((x)->svsflags &= ~FLAGS_SVS_ADMIN)
 
 /*
  * flags2 macros.
diff -uNrd ircd-hybrid-7rc8/include/modules.h ircd-7+BgFree-p5/include/modules.h
--- ircd-hybrid-7rc8/include/modules.h	Tue Nov 12 08:45:40 2002
+++ ircd-7+BgFree-p5/include/modules.h	Wed Feb 26 08:21:28 2003
@@ -138,6 +138,7 @@
 extern struct Message squit_msgtab;
 extern struct Message stats_msgtab;
 extern struct Message svinfo_msgtab;
+extern struct Message svshint_msgtab;
 extern struct Message testline_msgtab;
 extern struct Message time_msgtab;
 extern struct Message topic_msgtab;
diff -uNrd ircd-hybrid-7rc8/include/numeric.h ircd-7+BgFree-p5/include/numeric.h
--- ircd-hybrid-7rc8/include/numeric.h	Wed Nov 27 10:46:24 2002
+++ ircd-7+BgFree-p5/include/numeric.h	Thu Mar  6 16:23:15 2003
@@ -152,7 +152,11 @@
 /*	RPL_LOAD2HI	     263	   Dalnet */
 /*      RPL_CURRENT_LOCAL    265           aircd/efnet/hybrid/dalnet*/
 /*      RPL_CURRENT_GLOBAL   266           aircd/efnet/hybrid/dalnet */
-/*      RPL_START_NETSTAT    267           aircd */
+
+#define RPL_IDENTUSERS       267	/* for showing id users -zer0c00l */
+
+#define RPL_OSIDUSERS	     268
+	
 /*      RPL_NETSTAT          268           aircd */
 /*      RPL_END_NETSTAT      269           aircd */
 
@@ -204,14 +208,16 @@
 #define	RPL_USERIP	     307	/* Undernet extension */
 /*	RPL_WHOISREGNICK     307 	Numeric List: Dalnet */
 /*	RPL_SUSERHOST	     307	austnet */
-/*      RPL_NOTIFYACTION     308         aircd */
+
+#define RPL_WHOISADMIN	     308     	/* is a Server Administrator" */
+
 /*	RPL_WHOISADMIN	     308	Numeric List: Dalnet */
 /*	RPL_RULESSTART	     308	unreal */
 /*      RPL_NICKTRACE        309         aircd */
 /*	RPL_WHOISSADMIN	     309	Numeric List: Dalnet */
 /*	RPL_ENDOFRULES	     309	unreal */
 /*	RPL_WHOISHELPER	     309	austnet */
-/*      RPL_WHOISSVCMSG      310         Dalnet */
+/* 	RPL_SR_VS	     310	serv -zer0c00l */
 /*	RPL_WHOISHELPOP	     310	unreal */
 /*	RPL_WHOISSERVICE     310	austnet */
 
@@ -235,10 +241,14 @@
 #define RPL_LISTEND          323
 #define RPL_CHANNELMODEIS    324
 /*      RPL_CHANNELPASSIS    325           IRCnet extension */
-/*      RPL_UNIQOPIS         325           IRCnet extension */
-/*      RPL_NOCHANPASS       326           IRCnet extension */
-/*      RPL_CHPASSUNKNOWN    327           IRCnet extension */
-/*      RPL_CHANNEL_URL      328           dalnet, anothernet */
+
+/* define                    325				 */
+
+#define RPL_WHOISSVSHINT     326	   /* identified with services -zer0c00l */
+#define RPL_OS_ID            327	/* identified as a services admin -zer0c00l */	
+
+/* services id		     328		United Bgfree */
+
 #define RPL_CREATIONTIME     329
 /*      RPL_WHOWAS_TIME      330               ? */
 #define RPL_NOTOPIC          331
@@ -324,6 +334,9 @@
 #define ERR_NOTEXTTOSEND     412
 #define ERR_NOTOPLEVEL       413
 #define ERR_WILDTOPLEVEL     414
+
+#define ERR_SERV_NICK	     415 	/* error deoping service nick -zer0c00l */
+	
 /*	ERR_BADMASK          415           IRCnet extension */
 #define ERR_UNKNOWNCOMMAND   421
 #define ERR_NOMOTD           422
diff -uNrd ircd-hybrid-7rc8/include/patchlevel.h ircd-7+BgFree-p5/include/patchlevel.h
--- ircd-hybrid-7rc8/include/patchlevel.h	Sun Jan 26 23:42:17 2003
+++ ircd-7+BgFree-p5/include/patchlevel.h	Thu Mar  6 16:48:18 2003
@@ -23,5 +23,5 @@
  */
 
 #ifndef PATCHLEVEL
-#define PATCHLEVEL   "hybrid-7rc8"
+#define PATCHLEVEL   "ircd-7+BgFree-p5"
 #endif
diff -uNrd ircd-hybrid-7rc8/include/s_misc.h ircd-7+BgFree-p5/include/s_misc.h
--- ircd-hybrid-7rc8/include/s_misc.h	Fri May 24 19:34:08 2002
+++ ircd-7+BgFree-p5/include/s_misc.h	Sun Mar  2 16:55:38 2003
@@ -40,6 +40,8 @@
 #define _GMKv(x)  ( (x > _1TER) ? (float)(x/_1TER) : ((x > _1GIG) ? \
                (float)(x/_1GIG) : ((x > _1MEG) ? (float)(x/_1MEG) : (float)x)))
 	       
+/* for services' nicks -zer0c00l */
+extern long     s_check( char * szName );
 
 #endif
 
diff -uNrd ircd-hybrid-7rc8/include/s_serv.h ircd-7+BgFree-p5/include/s_serv.h
--- ircd-hybrid-7rc8/include/s_serv.h	Fri May 24 19:34:08 2002
+++ ircd-7+BgFree-p5/include/s_serv.h	Thu Mar  6 15:57:19 2003
@@ -253,6 +253,12 @@
 extern int MaxClientCount;     /* GLOBAL - highest number of clients */
 extern int MaxConnectionCount; /* GLOBAL - highest number of connections */
 
+extern int CurrentIdentUsers;  /* Currently identified users to services -zer0c00l */
+extern int MaxIdentUsers;  /* Max identified users to services -zer0c00l */
+
+extern int CurrentOSidUsers; /* identified S admins -zer0c00l */
+extern int MaxOSidUsers;     /* maximum value */
+
 extern int refresh_user_links;
 
 /*
diff -uNrd ircd-hybrid-7rc8/include/serno.h ircd-7+BgFree-p5/include/serno.h
--- ircd-hybrid-7rc8/include/serno.h	Sun Jan 26 23:42:19 2003
+++ ircd-7+BgFree-p5/include/serno.h	Sun Mar  2 19:31:40 2003
@@ -1 +1 @@
-#define SERIALNUM "20030127_0"
+#define SERIALNUM "20030301_0"
diff -uNrd ircd-hybrid-7rc8/messages/translations/ircd-dutch.po ircd-7+BgFree-p5/messages/translations/ircd-dutch.po
--- ircd-hybrid-7rc8/messages/translations/ircd-dutch.po	Sat Dec 15 15:35:15 2001
+++ ircd-7+BgFree-p5/messages/translations/ircd-dutch.po	Sat Dec 15 15:35:15 2001
@@ -75,7 +75,7 @@
 
 #: ../../src/messages.tab:228
 #, c-format
-msgid	":%s 205 %s User %s %s (%s) %lu %lu"
+msgid	":%s"205 %s User %s %s (%s) %lu %lu"
 msgstr	":%s 205 %s Gebruiker %s %s (%s) %lu %lu"
 
 #: ../../src/messages.tab:229
diff -uNrd ircd-hybrid-7rc8/modules/.depend ircd-7+BgFree-p5/modules/.depend
--- ircd-hybrid-7rc8/modules/.depend	Sun Jun 16 12:31:25 2002
+++ ircd-7+BgFree-p5/modules/.depend	Wed Feb 26 08:21:49 2003
@@ -570,6 +570,15 @@
  ../include/send.h ../include/s_conf.h ../include/motd.h \
  ../include/class.h ../include/s_log.h ../include/msg.h \
  ../include/parse.h ../include/modules.h
+m_svshint.o: m_svshint.c ../include/handlers.h ../include/client.h \
+ ../include/config.h ../include/setup.h ../include/ircd_defs.h \
+ ../include/ircd_handler.h ../include/linebuf.h ../include/tools.h \
+ ../include/channel.h ../include/res.h ../include/fileio.h \
+ ../include/../adns/adns.h ../include/ircd.h ../include/memory.h \
+ ../include/irc_string.h ../include/sprintf_irc.h ../include/common.h \
+ ../include/numeric.h ../include/send.h ../include/s_conf.h \
+ ../include/motd.h ../include/class.h ../include/s_log.h \
+ ../include/msg.h ../include/parse.h ../include/modules.h
 m_testline.o: m_testline.c ../include/stdinc.h ../include/config.h \
  ../include/setup.h ../include/defaults.h ../include/handlers.h \
  ../include/client.h ../include/ircd_defs.h ../include/ircd_handler.h \
diff -uNrd ircd-hybrid-7rc8/modules/Makefile.in ircd-7+BgFree-p5/modules/Makefile.in
--- ircd-hybrid-7rc8/modules/Makefile.in	Sun Jun 16 12:31:25 2002
+++ ircd-7+BgFree-p5/modules/Makefile.in	Wed Feb 26 08:22:06 2003
@@ -91,6 +91,7 @@
   m_set.c \
   m_stats.c \
   m_svinfo.c \
+  m_svshint.c \
   m_testline.c \
   m_time.c \
   m_topic.c \
diff -uNrd ircd-hybrid-7rc8/modules/core/m_kick.c ircd-7+BgFree-p5/modules/core/m_kick.c
--- ircd-hybrid-7rc8/modules/core/m_kick.c	Thu Aug 15 11:01:02 2002
+++ ircd-7+BgFree-p5/modules/core/m_kick.c	Thu Mar  6 16:40:46 2003
@@ -185,6 +185,14 @@
       return;
     }
 
+ /* if a user tries to kick services' nick halt -zer0c00l */
+
+        if (s_check(user)) {
+             sendto_one(source_p, form_str(ERR_SERV_NICK),
+                 me.name, parv[0], user);
+             return;
+        }
+
   if (IsMember(who, chptr))
     {
       /* half ops cannot kick other halfops on private channels */
diff -uNrd ircd-hybrid-7rc8/modules/core/m_kill.c ircd-7+BgFree-p5/modules/core/m_kill.c
--- ircd-hybrid-7rc8/modules/core/m_kill.c	Sat Jul 27 09:27:14 2002
+++ ircd-7+BgFree-p5/modules/core/m_kill.c	Mon Mar  3 10:51:30 2003
@@ -159,7 +159,12 @@
       target_p->flags |= FLAGS_KILLED;
     }
 
+if (MyOper(source_p) && MyConnect(target_p)) {
+    ircsprintf(buf, "Local kill by %s (%s)", source_p->name, reason);
+}
+else {
   ircsprintf(buf, "Killed (%s (%s))", source_p->name, reason);
+}
   
   exit_client(client_p, target_p, source_p, buf);
 }
diff -uNrd ircd-hybrid-7rc8/modules/core/m_nick.c ircd-7+BgFree-p5/modules/core/m_nick.c
--- ircd-hybrid-7rc8/modules/core/m_nick.c	Thu Oct  3 11:33:43 2002
+++ ircd-7+BgFree-p5/modules/core/m_nick.c	Sun Mar  2 13:35:49 2003
@@ -764,7 +764,14 @@
 
   /* remove all accepts pointing to the client */
   del_all_accepts(source_p);
+if (IsNSId(source_p)) {
+	CurrentIdentUsers--;
 
+	if (CurrentIdentUsers < 0)
+		CurrentIdentUsers= 0;
+
+	}
+	ClearNSId(source_p);
   return 0;
 }
 
diff -uNrd ircd-hybrid-7rc8/modules/m_operwall.c ircd-7+BgFree-p5/modules/m_operwall.c
--- ircd-hybrid-7rc8/modules/m_operwall.c	Fri May 24 19:34:21 2002
+++ ircd-7+BgFree-p5/modules/m_operwall.c	Mon Mar  3 10:55:42 2003
@@ -76,6 +76,15 @@
       return;
     }
 
+/* only global opers can talk to /wallops -zer0c00l */
+if (!IsOperGlobalKill(source_p) && MyConnect(source_p))
+  {
+      sendto_one(source_p, ":%s NOTICE %s :You don't have O flag try locops instead",
+                 me.name, parv[0]);
+      return;
+    }
+/* end */
+
   sendto_server(NULL, source_p, NULL, NOCAPS, NOCAPS, LL_ICLIENT,
                 ":%s OPERWALL :%s", parv[0], message);
   sendto_wallops_flags(FLAGS_OPERWALL, source_p, "OPERWALL - %s", message);
@@ -100,6 +109,15 @@
                    me.name, parv[0], "OPERWALL");
       return;
     }
+
+/* only global opers can talk to /wallops -zer0c00l */
+if (!IsOperGlobalKill(source_p) && MyConnect(source_p))
+  {
+      sendto_one(source_p, ":%s NOTICE %s :You don't have O flag try locops instead",
+                 me.name, parv[0]);
+      return;
+    }
+/* end */
 
   sendto_server(client_p, source_p, NULL, NOCAPS, NOCAPS, LL_ICLIENT,
                 ":%s OPERWALL :%s", parv[0], message);
diff -uNrd ircd-hybrid-7rc8/modules/m_svshint.c ircd-7+BgFree-p5/modules/m_svshint.c
--- ircd-hybrid-7rc8/modules/m_svshint.c	Wed Dec 31 19:00:00 1969
+++ ircd-7+BgFree-p5/modules/m_svshint.c	Thu Mar  6 15:59:26 2003
@@ -0,0 +1,107 @@
+/************************************************************************
+ *   IRC - Internet Relay Chat, modules/m_version.c
+ *   Copyright (C) 1990 Jarkko Oikarinen and
+ *                      University of Oulu, Computing Center
+ *
+ *   See file AUTHORS in IRC package for additional names of
+ *   the programmers. 
+ *
+ *   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_svshint.c,v 1.3 2001/09/10 03:16:20 demond Exp $
+ */
+#include "stdinc.h"
+#include "handlers.h"
+#include "client.h"
+#include "common.h"     /* TRUE bleah */
+#include "irc_string.h"
+#include "ircd.h"
+#include "hash.h"
+#include "numeric.h"
+#include "send.h"
+#include "s_conf.h"
+#include "s_log.h"
+#include "s_serv.h"
+#include "msg.h"
+#include "parse.h"
+#include "modules.h"
+
+
+static void ms_svshint(struct Client*, struct Client*, int, char**);
+
+struct Message svshint_msgtab = {
+  "SVSHINT", 0, 1, 0, 0, 0, 0,
+  {m_unregistered, m_ignore, ms_svshint, m_ignore}
+};
+
+#ifndef STATIC_MODULES
+void
+_modinit(void)
+{
+  mod_add_cmd(&svshint_msgtab);
+}
+
+void
+_moddeinit(void)
+{
+  mod_del_cmd(&svshint_msgtab);
+}
+
+char *_version = "20010826";
+#endif
+/*
+ * ms_svshint - SVSHINT command handler
+ *      parv[0] = sender prefix
+ *      parv[1] = hint flags
+ *      parv[2] = nick
+ */
+static void ms_svshint(struct Client* client_p, struct Client* source_p,
+                      int parc, char* parv[])
+{
+  struct Client *victim;
+  unsigned int hint;
+
+victim = find_client(parv[2]);
+
+/* zer0c00l was here */
+
+if (!IsServer(source_p))
+        return;
+
+  if (!strcasecmp(parv[1], "NSID") && !IsNSId(victim)) {
+                SetNSId(victim);
+                CurrentIdentUsers++;
+                
+		if (CurrentIdentUsers > MaxIdentUsers)
+                    MaxIdentUsers = CurrentIdentUsers;
+		
+  sendto_server(client_p, source_p, NULL, NOCAPS, NOCAPS, LL_ICLIENT,
+                ":%s SVSHINT NSID %s 1", me.name, victim->name);
+	   		return;
+        }
+
+  if (!strcasecmp(parv[1], "OSID") && !IsOSId(victim)) {
+                SetOSId(victim);
+		CurrentOSidUsers++;
+
+                if (CurrentOSidUsers > MaxOSidUsers)
+                    MaxOSidUsers = CurrentOSidUsers;
+               
+  sendto_server(client_p, source_p, NULL, NOCAPS, NOCAPS, LL_ICLIENT,
+                ":%s SVSHINT OSID %s 1", me.name, victim->name);
+                        return;
+        }
+
+}
diff -uNrd ircd-hybrid-7rc8/modules/m_users.c ircd-7+BgFree-p5/modules/m_users.c
--- ircd-hybrid-7rc8/modules/m_users.c	Fri May 24 19:34:23 2002
+++ ircd-7+BgFree-p5/modules/m_users.c	Thu Mar  6 16:04:50 2003
@@ -78,6 +78,13 @@
 
   sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, parv[0],
                  Count.total, Count.max_tot);
+
+    sendto_one(source_p, form_str(RPL_IDENTUSERS), me.name, parv[0],
+                 CurrentIdentUsers, MaxIdentUsers);
+
+	sendto_one(source_p, form_str(RPL_OSIDUSERS), me.name, parv[0],
+                 CurrentOSidUsers, MaxOSidUsers);
+
 }
 
 /*
@@ -93,12 +100,18 @@
       if(!IsOper(source_p) && ConfigServerHide.hide_servers)
         sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, parv[0],
                    Count.total, Count.max_tot);
-      else
+ else 
         sendto_one(source_p, form_str(RPL_LOCALUSERS), me.name, parv[0],
 	           Count.local, Count.max_loc);
 
       sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, parv[0],
                  Count.total, Count.max_tot);
+
+	    sendto_one(source_p, form_str(RPL_IDENTUSERS), me.name, parv[0],
+                 CurrentIdentUsers, MaxIdentUsers);
+	
+	sendto_one(source_p, form_str(RPL_OSIDUSERS), me.name, parv[0],
+                 CurrentOSidUsers, MaxOSidUsers);
     }
 }
 
diff -uNrd ircd-hybrid-7rc8/modules/m_wallops.c ircd-7+BgFree-p5/modules/m_wallops.c
--- ircd-hybrid-7rc8/modules/m_wallops.c	Thu Jan  9 01:20:07 2003
+++ ircd-7+BgFree-p5/modules/m_wallops.c	Thu Mar  6 17:11:46 2003
@@ -77,7 +77,16 @@
       return;
     }
 
-  sendto_wallops_flags(FLAGS_OPERWALL, source_p, "OPERWALL - %s", message);
+/* only global opers can talk to /wallops -zer0c00l */
+if (!IsOperGlobalKill(source_p) && MyConnect(source_p))
+  {
+      sendto_one(source_p, ":%s NOTICE %s :You don't have O flag try locops instead",
+                 me.name, parv[0]);
+      return;
+    }
+/* end */
+
+  sendto_wallops_flags(FLAGS_OPERWALL, source_p, "WALLOPS - %s", message);
   sendto_server(NULL, source_p, NULL, NOCAPS, NOCAPS, LL_ICLIENT,
                 ":%s WALLOPS :%s", parv[0], message);
 }
@@ -101,8 +110,17 @@
       return;
     }
 
+/* only global opers can talk to /wallops -zer0c00l */
+if (!IsOperGlobalKill(source_p) && MyConnect(source_p))
+  {
+      sendto_one(source_p, ":%s NOTICE %s :You don't have O flag try locops instead",
+                 me.name, parv[0]);
+      return;
+    }
+/* end */
+
   if(IsClient(source_p))
-    sendto_wallops_flags(FLAGS_OPERWALL, source_p, "OPERWALL - %s", message);
+    sendto_wallops_flags(FLAGS_OPERWALL, source_p, "WALLOPS - %s", message);
   else
     sendto_wallops_flags(FLAGS_WALLOP, source_p, "%s", message); 
 
diff -uNrd ircd-hybrid-7rc8/modules/m_whois.c ircd-7+BgFree-p5/modules/m_whois.c
--- ircd-hybrid-7rc8/modules/m_whois.c	Sun Jan 26 16:12:22 2003
+++ ircd-7+BgFree-p5/modules/m_whois.c	Thu Mar  6 15:53:05 2003
@@ -36,6 +36,7 @@
 #include "numeric.h"
 #include "s_conf.h"
 #include "s_serv.h"
+#include "s_misc.h"
 #include "send.h"
 #include "list.h"
 #include "irc_string.h"
@@ -385,6 +386,25 @@
 #ifdef VCHANS
   struct Channel *bchan;
 #endif
+
+/* checkin' if target_p is a service -zer0c00l */
+
+if (s_check(target_p->name)) {
+	 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);
+
+/*	sendto_one(source_p, form_str(RPL_SR_VS),
+                      me.name, source_p->name, target_p->name); */
+
+	  sendto_one(source_p, form_str(RPL_WHOISSERVER),
+               me.name, source_p->name, target_p->name,
+               ServerInfo.network_name,
+               ServerInfo.network_desc);
+	
+	return;
+}
+
   
   a2client_p = find_server(target_p->user->server);
           
@@ -393,6 +413,16 @@
 	 target_p->username, target_p->host, target_p->info);
   server_name = (char *)target_p->user->server;
 
+if (IsNSId(target_p)) {
+	 sendto_one(source_p, form_str(RPL_WHOISSVSHINT), me.name,
+               source_p->name, target_p->name);
+}
+
+        if (IsOSId(target_p)) {
+           sendto_one(source_p, form_str(RPL_OS_ID),
+                      me.name, source_p->name, target_p->name);
+}
+
   ircsprintf(buf, form_str(RPL_WHOISCHANNELS),
 	       me.name, source_p->name, target_p->name, "");
 
@@ -459,6 +489,9 @@
   if (IsOper(target_p))
     sendto_one(source_p, form_str(RPL_WHOISOPERATOR),
 	       me.name, source_p->name, target_p->name);
+  if (IsAdmin(target_p))
+        sendto_one(source_p, form_str(RPL_WHOISADMIN),
+                   me.name, source_p->name, target_p->name);
 
   if (MyConnect(target_p)) /* Can't do any of this if not local! db */
   {
@@ -482,6 +515,16 @@
  */
   if(MyClient(source_p)) 
     hook_call_event("doing_whois", &hd);
+
+/* send /whois notice to a client if he has needed flag -zer0c00l */
+        if (target_p->umodes & FLAGS_SPY)
+        {
+           sendto_one(target_p,
+                        ":%s NOTICE %s :*** Watch Out -- %s on server %s is doing a /whois on you",
+                        me.name, source_p->name, source_p->name,
+                        source_p->user->server);
+}
+/* end */
   
   return;
 }
diff -uNrd ircd-hybrid-7rc8/src/channel_mode.c ircd-7+BgFree-p5/src/channel_mode.c
--- ircd-hybrid-7rc8/src/channel_mode.c	Fri Jan 10 22:52:29 2003
+++ ircd-7+BgFree-p5/src/channel_mode.c	Thu Mar  6 16:24:33 2003
@@ -1297,6 +1297,14 @@
 
   mode_get_status(chptr, targ_p, &t_op, &t_hop, &t_voice, 1);
 
+/* added for protecting services' nicks -zer0c00l */
+if ((dir == MODE_DEL) && s_check(opnick)) 
+{
+	sendto_one(source_p, form_str(ERR_SERV_NICK),
+                 me.name, source_p->name, opnick);
+             return;
+}
+
   if (((dir == MODE_ADD) && t_op) ||
       ((dir == MODE_DEL) && !t_op
 #ifdef HALFOPS
diff -uNrd ircd-hybrid-7rc8/src/client.c ircd-7+BgFree-p5/src/client.c
--- ircd-hybrid-7rc8/src/client.c	Sun Jan 19 14:02:37 2003
+++ ircd-7+BgFree-p5/src/client.c	Thu Mar  6 16:00:55 2003
@@ -55,6 +55,8 @@
 #include "balloc.h"
 #include "listener.h"
 
+#define SERVICESHOST    "united.bgfree.services"
+
 static void check_pings_list(dlink_list *list);
 static void check_unknowns_list(dlink_list *list);
 static void free_exited_clients(void *unused);
@@ -586,7 +588,19 @@
       --Count.oper;
     if (IsInvisible(client_p)) 
       --Count.invisi;
-  }
+ if (IsNSId(client_p)) {
+        CurrentIdentUsers--;
+	if (CurrentIdentUsers < 0) {
+        CurrentIdentUsers = 0;
+		        }
+		} 
+ if (IsOSId(client_p)) {
+        CurrentOSidUsers--;
+        if (CurrentOSidUsers < 0) {
+        CurrentOSidUsers = 0;
+                        }
+                }
+	}
 
   if(splitchecking && !splitmode)
     check_splitmode(NULL);
@@ -953,6 +967,22 @@
       if (target_p && IsServer(target_p) && target_p != client_p && !IsMe(target_p) &&
           (!IsKilled(source_p)))
         sendto_one(target_p, ":%s SQUIT %s :%s", from->name, source_p->name, comment);
+
+if (!strcasecmp(SERVICESHOST, source_p->name)) {
+	   struct Client* tmpptr;
+	
+	    CurrentIdentUsers = 0;
+	    CurrentOSidUsers = 0;	
+	   for (tmpptr = GlobalClientList; tmpptr; tmpptr = tmpptr->next) {
+	       if (IsServer(tmpptr) || IsMe(tmpptr))
+	    	    continue;
+               if (IsNSId(tmpptr))
+	           ClearNSId(tmpptr);
+              if (IsOSId(tmpptr))
+	           ClearOSId(tmpptr); 
+             }
+	}
+
     }
   else if (IsPerson(source_p)) /* ...just clean all others with QUIT... */
     {
@@ -1656,7 +1686,8 @@
       sendto_common_channels_local(source_p, ":%s!%s@%s NICK :%s",
 				   source_p->name, source_p->username, source_p->host,
 				   nick);
-      if (source_p->user)
+
+	      if (source_p->user)
 	{
 	  add_history(source_p, 1);
 	  
@@ -1689,6 +1720,14 @@
    */
 
   del_all_accepts(source_p);
+if (IsNSId(source_p)) {
+        CurrentIdentUsers--;
+
+        if (CurrentIdentUsers < 0)
+                CurrentIdentUsers= 0;
+
+        }
+  ClearNSId(source_p);
 
   /* fd_desc is long enough */
   fd_note(client_p->localClient->fd, "Nick: %s", nick);
diff -uNrd ircd-hybrid-7rc8/src/messages.tab ircd-7+BgFree-p5/src/messages.tab
--- ircd-hybrid-7rc8/src/messages.tab	Thu Jan 16 18:10:56 2003
+++ ircd-7+BgFree-p5/src/messages.tab	Thu Mar  6 16:24:05 2003
@@ -291,8 +291,8 @@
 /* 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",
-/* 267 */       NULL,
-/* 268 */       NULL,
+/* 267 RPL_IDENTUSERS, */       ":%s 267 %s :Current identified users: %d  Max: %d",
+/* 268 RPL_OSIDUSERS, */        ":%s 268 %s :Current services admins: %d  Max: %d",
 /* 269 */       NULL,
 /* 270 */       NULL,
 /* 271 */       NULL,
@@ -332,7 +332,7 @@
 /* 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,
-/* 308 */	NULL,
+/* 308 RPL_WHOISADMIN,  */      ":%s 308 %s %s :is a Server Administrator",
 /* 309 */       NULL,
 /* 310 */       NULL,
 /* 311 RPL_WHOISUSER, */        ":%s 311 %s %s %s %s * :%s",
@@ -349,9 +349,9 @@
 /* 322 RPL_LIST, */             ":%s 322 %s %s %d :%s",
 /* 323 RPL_LISTEND, */          ":%s 323 %s :End of /LIST",
 /* 324 RPL_CHANNELMODEIS, */    ":%s 324 %s %s %s %s",
-/* 325 */       NULL,
-/* 326 */       NULL,
-/* 327 */       NULL,
+/* 325 */      NULL,
+/* 326 RPL_WHOISSVSHINT, */     ":%s 326 %s %s :has identified for: this nick",
+/* 327 RPL_OS_ID, */     	":%s 327 %s %s :is a Network Administrator",
 /* 328 */       NULL,
 /* 329 RPL_CREATIONTIME, */      ":%s 329 %s %s %lu", 
 /* 330 */       NULL,
@@ -439,7 +439,7 @@
 /* 412 ERR_NOTEXTTOSEND, */     ":%s 412 %s :No text to send",
 /* 413 ERR_NOTOPLEVEL, */       ":%s 413 %s %s :No toplevel domain specified",
 /* 414 ERR_WILDTOPLEVEL, */     ":%s 414 %s %s :Wildcard in toplevel Domain",
-/* 415 */       NULL,
+/* 415 ERR_SERV_NICK, */        ":%s 415 %s %s :- You can not kick/deop services",
 /* 416 */       NULL,
 /* 417 */       NULL,
 /* 418 */       NULL,
diff -uNrd ircd-hybrid-7rc8/src/modules.c ircd-7+BgFree-p5/src/modules.c
--- ircd-hybrid-7rc8/src/modules.c	Tue Jan 21 09:26:51 2003
+++ ircd-7+BgFree-p5/src/modules.c	Wed Feb 26 08:20:59 2003
@@ -615,6 +615,7 @@
 	mod_add_cmd(&squit_msgtab);
 	mod_add_cmd(&stats_msgtab);
 	mod_add_cmd(&svinfo_msgtab);
+	mod_add_cmd(&svshint_msgtab);
 	mod_add_cmd(&testline_msgtab);
 	mod_add_cmd(&time_msgtab);
 	mod_add_cmd(&topic_msgtab);
diff -uNrd ircd-hybrid-7rc8/src/s_misc.c ircd-7+BgFree-p5/src/s_misc.c
--- ircd-hybrid-7rc8/src/s_misc.c	Fri May 24 19:34:51 2002
+++ ircd-7+BgFree-p5/src/s_misc.c	Sun Mar  2 16:53:35 2003
@@ -50,6 +50,37 @@
   "Thursday", "Friday", "Saturday"
 };
 
+
+/* next few lines are the services' nicks.Modify as needed -zer0c00l */
+
+char* servnicks[] = {
+         "CS" ,
+         "OS" ,
+         "STATSERV" ,
+         "SEEN" ,
+         "SEENSERV" ,
+         "ADMINSERV" ,
+         "SPLITSERV"
+};
+#define ARR_SIZE 7 /* number of services' nicks.Increase or decrease as needed */
+
+/* s_check ()
+ * will verify that the nick to be kicked is not a service nick
+ * and stop if it is
+ *                              -zer0c00l
+ */
+
+long s_check( char * szName )
+{
+    int i = 0;
+    for( i=0;i<ARR_SIZE;i++)
+        if( !strcasecmp(szName, servnicks[i]))
+            return 1;
+    return 0;
+}
+
+/* end of s_check() */
+
 char* date(time_t lclock) 
 {
   static        char        buf[80], plus;
diff -uNrd ircd-hybrid-7rc8/src/s_serv.c ircd-7+BgFree-p5/src/s_serv.c
--- ircd-hybrid-7rc8/src/s_serv.c	Sat Jan 25 18:43:20 2003
+++ ircd-7+BgFree-p5/src/s_serv.c	Thu Mar  6 15:58:09 2003
@@ -72,6 +72,13 @@
 
 int MaxConnectionCount = 1;
 int MaxClientCount     = 1;
+
+int CurrentIdentUsers  = 0;
+int MaxIdentUsers  = 0;
+
+int CurrentOSidUsers = 0;
+int MaxOSidUsers = 0;
+
 int refresh_user_links = 0;
 
 struct Client *uplink=NULL;
@@ -849,6 +856,13 @@
 				 ubuf,
 				 target_p->username, target_p->host,
 				 target_p->user->server, target_p->info);
+
+	   if (IsNSId(target_p))
+          sendto_one(client_p, "SVSHINT NSID %s 1", target_p->name);
+	
+	if (IsOSId(target_p))
+	sendto_one(client_p, "SVSHINT OSID %s 1", target_p->name);
+
 }
 
 /*
diff -uNrd ircd-hybrid-7rc8/src/s_user.c ircd-7+BgFree-p5/src/s_user.c
--- ircd-hybrid-7rc8/src/s_user.c	Fri Jan 10 22:52:30 2003
+++ ircd-7+BgFree-p5/src/s_user.c	Thu Mar  6 16:05:43 2003
@@ -215,6 +215,12 @@
   sendto_one(source_p, form_str(RPL_GLOBALUSERS), me.name, source_p->name,
              Count.total, Count.max_tot);
 
+  sendto_one(source_p, form_str(RPL_IDENTUSERS), me.name, source_p->name,
+             CurrentIdentUsers, MaxIdentUsers);
+  
+  sendto_one(source_p, form_str(RPL_OSIDUSERS), me.name, source_p->name,
+             CurrentOSidUsers, MaxOSidUsers);
+
   if(!ConfigServerHide.hide_servers || IsOper(source_p))
     sendto_one(source_p, form_str(RPL_STATSCONN), me.name, source_p->name,
                MaxConnectionCount, MaxClientCount, Count.totalrestartcount);
