[IRCServices] lNick colision

root of all evil climber at rionet.com.br
Thu Oct 21 14:56:56 PDT 1999


i use this on my services:
this code i got from servicesbr, writen by wyrn
but it works very well
i have used it on a network whith 200 users whitout problems

static int nseed;


static void collide(NickInfo *ni, int from_timeout)
{
    User *u;

    u = finduser(ni->nick);

    if (!from_timeout)	
        del_ns_timeout(ni, TO_COLLIDE);

#ifdef IRC_DAL4_4_15
    if (NSForceNickChange) {
	char guestnick[NICKMAX];
	int beh;
       
        beh=time(NULL); 
        sprintf(guestnick, "%s%d%d", NSGuestNickPrefix, nseed, beh); 
        if (nseed>=9999) nseed=0;
        nseed++;
        while (finduser(guestnick) != NULL){        
        guestnick[strlen(guestnick)-1]=0;
        if(strlen(guestnick)<7) sprintf(guestnick, "%s%d%d", NSGuestNickPrefix, nseed, beh);
    }                   
        notice_lang(s_NickServ, u, FORCENICKCHANGE_NOW, guestnick);

	send_cmd(s_NickServ, "SVSNICK %s %s :%lu", ni->nick, guestnick, time(NULL));
	send_cmd(NULL,"SQLINE %s :NickServ enforcement", ni->nick);
        ni->status |= NS_KILL_HELD;
        ni->status |= NS_GUESTED;
        add_ns_timeout(ni, TO_RELEASE, NSReleaseTimeout);  
    } else {
#endif
	notice_lang(s_NickServ, u, DISCONNECT_NOW);
    	kill_user(s_NickServ, ni->nick, "Nick kill enforced");
        send_cmd(NULL, "NICK %s %ld 1 %s %s %s :%s Enforcement", ni->nick, time(NULL), NSEnforcerUser, NSEnforcerHost, ServerName, s_NickServ);  
        ni->status |= NS_KILL_HELD; 
        add_ns_timeout(ni, TO_RELEASE, NSReleaseTimeout);

#ifdef IRC_DAL4_4_15
 }
#else
}
#endif 




Please note This code use SQline, so you must have to add the code to sqlines
on release and else...

FiGhTER
ircadmin
irc.rionet.com.br
BrasIRC.com.br Network
---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.