[IRCServices] Re: Nick colision
Carlos Mendes Martini
martini at intergate.com.br
Thu Oct 21 18:36:38 PDT 1999
root of all evil wrote:
>
> 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
Hummm... I had some troubles when doing this... so, I preferred to
modify the original code, as the following:
Original code:
/****************************************************************/
#ifdef IRC_DAL4_4_15
if (NSForceNickChange) {
struct timeval tv;
char guestnick[NICKMAX];
gettimeofday(&tv, NULL);
snprintf(guestnick, sizeof(guestnick), "%s%ld%ld", NSGuestNickPrefix,
tv.tv_usec / 10000, tv.tv_sec % (60*60*24));
notice_lang(s_NickServ, u, FORCENICKCHANGE_NOW, guestnick);
/****************************************************************/
New code:
/****************************************************************/
#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++;
notice_lang(s_NickServ, u, FORCENICKCHANGE_NOW, guestnick);
/****************************************************************/
And place the line above at the top of the file, with the others
"static int":
static int nseed;
I apologize for my bad english.
Best regards,
--
=====================================================================
MARTINI - martini at brasirc.net
-------------------------------------------------------------
Coordenador de Atendimento ao Usuário
BrasIRC Webmaster - webmaster at brasirc.net
BrasIRC.NET Network - http://www.brasirc.net
=====================================================================
-
---------------------------------------------------------------
To unsubscribe, send email to majordomo at ender.shadowfire.org
with "unsubscribe ircservices" in the body, without the quotes.