[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Uncollideble Nick Patch



Hi,

I have written a small patch for preventing collides
in advance.

Ircd +2.10.2 allows servers to send out a nick
starting with a digit, but disallows a user to choose
such a nick. So by letting users safely getting access
to a unique nick beginning with a digit, we can create
a (almost) uncollideble nick.

In order to perform the above, every server in the
network using this patch, needs to define a 2 bytes
unique SERVERID = [digit][A-Z], ex 0C. That means a
user wanting to use the nick foobar, will get the nick
0Cfoobar set for him/her. Either by use of /nick
00foobar (as my patch use) or by adding a new command
like /snick foobar.

I know this is not the perfect solution for dealing
with collides. It's far from perfect. But at least it
gets less trouble when people trying to collide chans.

Accourding to http://irc.tu-ilmenau.de/all_servers/
there are currently 7 servers with 2.10.2 and less.
Before it is even possible to run this patch, thoose
servers must be upgraded.

Sincerely,

Zudden


(I also sent the patch as an attachment)

CUT HERE

--- irc2.10.3/support/config.h.dist     Mon Jul 12
00:11:17 1999
+++ irc2.10.3.anticollide/support/config.h.dist Wed
Feb 23 15:35:57 2000
@@ -17,6 +17,12 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA
02139, USA.
  */
 
+/* Settings for the 'ugly but working uncollideble
nick' patch by Zudden
+   Ex: SERVERID = 2W. Client types /nick 00foobar -->
gets nick 2Wfoobar (uncollideble nick).
+
+   The 2 bytes unique SERVERID = [0-9][A-Z] of your
server on the irc-network. /Zudden */
+#define SERVERID "0A"
+
 /*
  *  ircdwatch configuration options.
  */
--- irc2.10.3/ircd/s_user.c     Sat Jul 17 13:47:49
1999
+++ irc2.10.3.anticollide/ircd/s_user.c Wed Feb 23
15:06:13 2000
@@ -247,8 +247,15 @@
        if (*nick == '-') /* first character '-' */
                return 0;
 
-       if (isdigit(*nick) && !server) /* first
character in [0..9] */
-               return 0;
+       if (!(nick[0] == '0' && nick[1] == '0' &&
!server)) {
+               if (isdigit(*nick) && !server) /*
first character in [0..9] */
+                       return 0;
+       }
+       else
+       {
+               nick[0] = SERVERID[0]; /* Replace
leading 00 with SERVERID /Zudden */
+               nick[1] = SERVERID[1]; 
+       }
 
        if (!strcasecmp(nick, "anonymous"))
                return 0;

CUT HERE
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com
--- irc2.10.3/support/config.h.dist	Mon Jul 12 00:11:17 1999
+++ irc2.10.3.anticollide/support/config.h.dist	Wed Feb 23 15:35:57 2000
@@ -17,6 +17,12 @@
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
 
+/* Settings for the 'ugly but working uncollideble nick' patch by Zudden
+   Ex: SERVERID = 2W. Client types /nick 00foobar --> gets nick 2Wfoobar (uncollideble nick).
+
+   The 2 bytes unique SERVERID = [0-9][A-Z] of your server on the irc-network. /Zudden */
+#define SERVERID "0A"
+
 /*
  *  ircdwatch configuration options.
  */
--- irc2.10.3/ircd/s_user.c	Sat Jul 17 13:47:49 1999
+++ irc2.10.3.anticollide/ircd/s_user.c	Wed Feb 23 15:06:13 2000
@@ -247,8 +247,15 @@
 	if (*nick == '-') /* first character '-' */
 		return 0;
 
-	if (isdigit(*nick) && !server) /* first character in [0..9] */
-		return 0;
+	if (!(nick[0] == '0' && nick[1] == '0' && !server)) {
+		if (isdigit(*nick) && !server) /* first character in [0..9] */
+			return 0;
+	}
+	else
+	{
+		nick[0] = SERVERID[0]; /* Replace leading 00 with SERVERID /Zudden */
+		nick[1] = SERVERID[1]; 
+	}
 
 	if (!strcasecmp(nick, "anonymous"))
 		return 0;