2 * IRC - Internet Relay Chat, ircd/m_nick.c
3 * Copyright (C) 1990 Jarkko Oikarinen and
4 * University of Oulu, Computing Center
6 * See file AUTHORS in IRC package for additional names of
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 1, or (at your option)
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27 * m_functions execute protocol messages on this server:
29 * cptr is always NON-NULL, pointing to a *LOCAL* client
30 * structure (with an open socket connected!). This
31 * identifies the physical socket where the message
32 * originated (or which caused the m_function to be
33 * executed--some m_functions may call others...).
35 * sptr is the source of the message, defined by the
36 * prefix part of the message if present. If not
37 * or prefix not found, then sptr==cptr.
39 * (!IsServer(cptr)) => (cptr == sptr), because
40 * prefixes are taken *only* from servers...
43 * (sptr == cptr) => the message didn't
46 * (sptr != cptr && IsServer(sptr) means
47 * the prefix specified servername. (?)
49 * (sptr != cptr && !IsServer(sptr) means
50 * that message originated from a remote
55 * (!IsServer(sptr)) means that, sptr can safely
56 * taken as defining the target structure of the
57 * message in this server.
59 * *Always* true (if 'parse' and others are working correct):
61 * 1) sptr->from == cptr (note: cptr->from == cptr)
63 * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr
64 * *cannot* be a local connection, unless it's
65 * actually cptr!). [MyConnect(x) should probably
66 * be defined as (x == x->from) --msa ]
68 * parc number of variable parameter strings (if zero,
69 * parv is allowed to be NULL)
71 * parv a NULL terminated list of parameter pointers,
73 * parv[0], sender (prefix string), if not present
74 * this points to an empty string.
75 * parv[1]...parv[parc-1]
76 * pointers to additional parameters
77 * parv[parc] == NULL, *always*
79 * note: it is guaranteed that parv[0]..parv[parc-1] are all
84 * No need to include handlers.h here the signatures must match
85 * and we don't need to force a rebuild of all the handlers everytime
86 * we add a new one to the list. --Bleep
94 #include "ircd_chattr.h"
95 #include "ircd_reply.h"
96 #include "ircd_string.h"
110 * m_nick - message handler for local clients
111 * parv[0] = sender prefix
114 int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
116 struct Client* acptr;
117 char nick[NICKLEN + 2];
120 const char* client_name;
123 assert(cptr == sptr);
126 * parv[0] will be empty for clients connecting for the first time
128 client_name = (*sptr->name) ? sptr->name : "*";
131 send_reply(sptr, ERR_NONICKNAMEGIVEN);
135 * Don't let them send make us send back a really long string of
139 if (strlen(arg) > NICKLEN)
142 if ((s = strchr(arg, '~')))
148 * If do_nick_name() returns a null name OR if the server sent a nick
149 * name and do_nick_name() changed it in some way (due to rules of nick
150 * creation) then reject it. If from a server and we reject it,
151 * and KILL it. -avalon 4/4/92
153 if (0 == do_nick_name(nick)) {
154 send_reply(sptr, ERR_ERRONEUSNICKNAME, arg);
159 * Check if this is a LOCAL user trying to use a reserved (Juped)
160 * nick, if so tell him that it's a nick in use...
162 if (isNickJuped(nick)) {
163 send_reply(sptr, ERR_NICKNAMEINUSE, nick);
164 return 0; /* NICK message ignored */
167 if (!(acptr = FindClient(nick))) {
169 * No collisions, all clear...
171 return set_nick_name(cptr, sptr, nick, parc, parv);
173 if (IsServer(acptr)) {
174 send_reply(sptr, ERR_NICKNAMEINUSE, nick);
175 return 0; /* NICK message ignored */
178 * If acptr == sptr, then we have a client doing a nick
179 * change between *equivalent* nicknames as far as server
180 * is concerned (user is changing the case of his/her
181 * nickname or somesuch)
185 * If acptr == sptr, then we have a client doing a nick
186 * change between *equivalent* nicknames as far as server
187 * is concerned (user is changing the case of his/her
188 * nickname or somesuch)
190 if (0 != strcmp(acptr->name, nick)) {
192 * Allows change of case in his/her nick
194 return set_nick_name(cptr, sptr, nick, parc, parv);
197 * This is just ':old NICK old' type thing.
198 * Just forget the whole thing here. There is
199 * no point forwarding it to anywhere,
200 * especially since servers prior to this
201 * version would treat it as nick collision.
206 * Note: From this point forward it can be assumed that
207 * acptr != sptr (point to different client structures).
209 assert(acptr != sptr);
211 * If the older one is "non-person", the new entry is just
212 * allowed to overwrite it. Just silently drop non-person,
213 * and proceed with the nick. This should take care of the
214 * "dormant nick" way of generating collisions...
216 * XXX - hmmm can this happen after one is registered?
218 if (IsUnknown(acptr) && MyConnect(acptr)) {
219 ++ServerStats->is_ref;
220 ip_registry_connect_fail(acptr->ip.s_addr);
221 exit_client(cptr, acptr, &me, "Overridden by other sign on");
222 return set_nick_name(cptr, sptr, nick, parc, parv);
225 * NICK is coming from local client connection. Just
226 * send error reply and ignore the command.
228 send_reply(sptr, ERR_NICKNAMEINUSE, nick);
229 return 0; /* NICK message ignored */
234 * ms_nick - server message handler for nicks
235 * parv[0] = sender prefix
238 * If from server, source is client:
239 * parv[2] = timestamp
243 * parv[3] = timestamp
246 * parv[6] = umode (optional)
247 * parv[parc-4] = %<lastmod>:<mask> <- Only if matching GLINE
248 * parv[parc-3] = IP# <- Only Protocol >= 10
249 * parv[parc-2] = YXX, numeric nick <- Only Protocol >= 10
250 * parv[parc-1] = info
253 int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
255 struct Client* acptr;
256 char nick[NICKLEN + 2];
262 assert(IsServer(cptr));
264 if ((IsServer(sptr) && parc < 8) || parc < 3) {
265 sendto_opmask_butone(0, SNO_OLDSNO, "bad NICK param count for %s from %C",
267 return need_more_params(sptr, "NICK");
270 ircd_strncpy(nick, parv[1], NICKLEN);
271 nick[NICKLEN] = '\0';
273 if (!IsBurstOrBurstAck(sptr)) {
274 if (IsServer(sptr)) {
275 lastnick = atoi(parv[3]);
276 if (lastnick > OLDEST_TS)
277 sptr->serv->lag = TStime() - lastnick;
280 lastnick = atoi(parv[2]);
281 if (lastnick > OLDEST_TS)
282 sptr->user->server->serv->lag = TStime() - lastnick;
286 * If do_nick_name() returns a null name OR if the server sent a nick
287 * name and do_nick_name() changed it in some way (due to rules of nick
288 * creation) then reject it. If from a server and we reject it,
289 * and KILL it. -avalon 4/4/92
291 if (0 == do_nick_name(nick) || 0 != strcmp(nick, parv[1])) {
292 send_reply(sptr, ERR_ERRONEUSNICKNAME, parv[1]);
294 ++ServerStats->is_kill;
295 sendto_opmask_butone(0, SNO_OLDSNO, "Bad Nick: %s From: %s %C", parv[1],
297 sendcmdto_one(&me, CMD_KILL, cptr, "%s :%s (%s <- %s[%s])",
298 IsServer(sptr) ? parv[parc - 2] : parv[0], me.name, parv[1],
300 if (!IsServer(sptr)) {
304 sendcmdto_serv_butone(&me, CMD_KILL, 0, "%s :%s (%s <- %s!%s@%s)",
305 parv[0], me.name, cptr->name, parv[0],
306 sptr->user ? sptr->username : "",
307 sptr->user ? sptr->user->server->name :
313 * Check against nick name collisions.
315 * Put this 'if' here so that the nesting goes nicely on the screen :)
316 * We check against server name list before determining if the nickname
317 * is present in the nicklist (due to the way the below for loop is
318 * constructed). -avalon
320 if (!(acptr = FindClient(nick))) {
322 * No collisions, all clear...
324 return set_nick_name(cptr, sptr, nick, parc, parv);
328 if (IsServer(acptr)) {
330 * We have a nickname trying to use the same name as
331 * a server. Send out a nick collision KILL to remove
332 * the nickname. As long as only a KILL is sent out,
333 * there is no danger of the server being disconnected.
334 * Ultimate way to jupiter a nick ? >;-). -avalon
336 sendto_opmask_butone(0, SNO_OLDSNO, "Nick collision on %C(%C <- %C)", sptr,
338 ++ServerStats->is_kill;
340 sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (%s <- %s)", sptr, me.name,
341 acptr->from->name, cptr->name);
343 sptr->flags |= FLAGS_KILLED;
345 * if sptr is a server it is exited here, nothing else to do
347 return exit_client(cptr, sptr, &me, "Nick/Server collision");
351 * If acptr == sptr, then we have a client doing a nick
352 * change between *equivalent* nicknames as far as server
353 * is concerned (user is changing the case of his/her
354 * nickname or somesuch)
357 if (strcmp(acptr->name, nick) != 0)
359 * Allows change of case in his/her nick
361 return set_nick_name(cptr, sptr, nick, parc, parv);
364 * This is just ':old NICK old' type thing.
365 * Just forget the whole thing here. There is
366 * no point forwarding it to anywhere,
367 * especially since servers prior to this
368 * version would treat it as nick collision.
370 return 0; /* NICK Message ignored */
374 * Note: From this point forward it can be assumed that
375 * acptr != sptr (point to different client structures).
377 assert(acptr != sptr);
379 * If the older one is "non-person", the new entry is just
380 * allowed to overwrite it. Just silently drop non-person,
381 * and proceed with the nick. This should take care of the
382 * "dormant nick" way of generating collisions...
384 if (IsUnknown(acptr) && MyConnect(acptr)) {
385 ++ServerStats->is_ref;
386 ip_registry_connect_fail(acptr->ip.s_addr);
387 exit_client(cptr, acptr, &me, "Overridden by other sign on");
388 return set_nick_name(cptr, sptr, nick, parc, parv);
391 * Decide, we really have a nick collision and deal with it
394 * NICK was coming from a server connection.
395 * This means we have a race condition (two users signing on
396 * at the same time), or two net fragments reconnecting with the same nick.
397 * The latter can happen because two different users connected
398 * or because one and the same user switched server during a net break.
399 * If the TimeStamps are equal, we kill both (or only 'new'
400 * if it was a ":server NICK new ...").
401 * Otherwise we kill the youngest when user@host differ,
402 * or the oldest when they are the same.
403 * We treat user and ~user as different, because if it wasn't
404 * a faked ~user the AUTH wouldn't have added the '~'.
408 if (IsServer(sptr)) {
410 * A new NICK being introduced by a neighbouring
411 * server (e.g. message type ":server NICK new ..." received)
413 * compare IP address and username
415 differ = (acptr->ip.s_addr != htonl(base64toint(parv[parc - 3]))) ||
416 (0 != ircd_strcmp(acptr->user->username, parv[4]));
417 sendto_opmask_butone(0, SNO_OLDSNO, "Nick collision on %C (%C %Tu <- "
418 "%C %Tu (%s user@host))", acptr, acptr->from,
419 acptr->lastnick, cptr, lastnick,
420 differ ? "Different" : "Same");
424 * A NICK change has collided (e.g. message type ":old NICK new").
426 * compare IP address and username
428 differ = (acptr->ip.s_addr != sptr->ip.s_addr) ||
429 (0 != ircd_strcmp(acptr->user->username, sptr->user->username));
430 sendto_opmask_butone(0, SNO_OLDSNO, "Nick change collision from %C to "
431 "%C (%C %Tu <- %C %Tu)", sptr, acptr, acptr->from,
432 acptr->lastnick, cptr, lastnick);
435 * Now remove (kill) the nick on our side if it is the youngest.
436 * If no timestamp was received, we ignore the incoming nick
437 * (and expect a KILL for our legit nick soon ):
438 * When the timestamps are equal we kill both nicks. --Run
439 * acptr->from != cptr should *always* be true (?).
441 * This exits the client sending the NICK message
443 if (acptr->from != cptr) {
444 if ((differ && lastnick >= acptr->lastnick) || (!differ && lastnick <= acptr->lastnick)) {
445 if (!IsServer(sptr)) {
446 ++ServerStats->is_kill;
447 sendcmdto_serv_butone(&me, CMD_KILL, sptr, "%C :%s (%s <- %s (Nick "
448 "collision))", sptr, me.name, acptr->from->name,
450 assert(!MyConnect(sptr));
456 sendto_one(cptr, "%s " TOK_KILL " %s%s :%s (Ghost 2)", /* XXX DEAD */
457 NumServ(&me), NumNick(sptr), me.name);
459 sptr->flags |= FLAGS_KILLED;
460 exit_client(cptr, sptr, &me, "Nick collision (you're a ghost)");
462 * we have killed sptr off, zero out it's pointer so if it's used
463 * again we'll know about it --Bleep
467 if (lastnick != acptr->lastnick)
468 return 0; /* Ignore the NICK */
470 send_reply(acptr, ERR_NICKCOLLISION, nick);
473 ++ServerStats->is_kill;
474 acptr->flags |= FLAGS_KILLED;
476 * This exits the client we had before getting the NICK message
479 sendcmdto_serv_butone(&me, CMD_KILL, acptr, "%C :%s (%s <- %s (older "
480 "nick overruled))", acptr, me.name,
481 acptr->from->name, cptr->name);
482 if (MyConnect(acptr))
483 sendcmdto_one(acptr, CMD_QUIT, cptr, ":Local kill by %s (Ghost)",
485 exit_client(cptr, acptr, &me, "Nick collision (older nick overruled)");
488 sendcmdto_serv_butone(&me, CMD_KILL, acptr, "%C :%s (%s <- %s (nick "
489 "collision from same user@host))", acptr, me.name,
490 acptr->from->name, cptr->name);
491 if (MyConnect(acptr))
492 sendcmdto_one(acptr, CMD_QUIT, cptr, ":Local kill by %s (Ghost: ",
493 "switched servers too fast)", me.name);
494 exit_client(cptr, acptr, &me, "Nick collision (You collided yourself)");
496 if (lastnick == acptr->lastnick)
500 return set_nick_name(cptr, sptr, nick, parc, parv);
507 * parv[0] = sender prefix
510 * If from server, source is client:
511 * parv[2] = timestamp
515 * parv[3] = timestamp
518 * parv[6] = umode (optional)
519 * parv[parc-3] = IP# <- Only Protocol >= 10
520 * parv[parc-2] = YXX, numeric nick <- Only Protocol >= 10
521 * parv[parc-1] = info
524 int m_nick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
526 struct Client* acptr;
527 char nick[NICKLEN + 2];
533 sendto_one(sptr, err_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]); /* XXX DEAD */
536 else if ((IsServer(sptr) && parc < 8) || (IsServer(cptr) && parc < 3))
538 need_more_params(sptr, "NICK");
539 sendto_ops("bad NICK param count for %s from %s", parv[1], cptr->name); /* XXX DEAD */
542 if (MyConnect(sptr) && (s = strchr(parv[1], '~')))
544 ircd_strncpy(nick, parv[1], NICKLEN);
545 nick[NICKLEN] = '\0';
546 if (IsServer(cptr)) {
547 if (IsServer(sptr)) {
548 lastnick = atoi(parv[3]);
549 if (lastnick > OLDEST_TS)
550 sptr->serv->lag = TStime() - lastnick;
552 lastnick = atoi(parv[2]);
553 if (lastnick > OLDEST_TS)
554 sptr->user->server->serv->lag = TStime() - lastnick;
558 * If do_nick_name() returns a null name OR if the server sent a nick
559 * name and do_nick_name() changed it in some way (due to rules of nick
560 * creation) then reject it. If from a server and we reject it,
561 * and KILL it. -avalon 4/4/92
563 if (do_nick_name(nick) == 0 || (IsServer(cptr) && strcmp(nick, parv[1])))
565 sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME), me.name, parv[0], parv[1]); /* XXX DEAD */
569 ServerStats->is_kill++;
570 sendto_ops("Bad Nick: %s From: %s %s", /* XXX DEAD */
571 parv[1], parv[0], cptr->name);
572 sendto_one(cptr, "%s " TOK_KILL " %s :%s (%s <- %s[%s])", /* XXX DEAD */
573 NumServ(&me), IsServer(sptr) ? parv[parc - 2] : parv[0], me.name,
574 parv[1], nick, cptr->name);
575 if (!IsServer(sptr)) /* bad nick _change_ */
577 sendto_highprot_butone(&me, 10, "%s " TOK_KILL " %s :%s (%s <- %s!%s@%s)", /* XXX DEAD */
578 NumServ(&me), parv[0], me.name, cptr->name,
579 parv[0], sptr->user ? sptr->username : "",
580 sptr->user ? sptr->user->server->name : cptr->name);
587 * Check if this is a LOCAL user trying to use a reserved (Juped)
588 * nick, if so tell him that it's a nick in use...
590 if ((!IsServer(cptr)) && isNickJuped(nick))
592 sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
593 /* parv[0] is empty when connecting */
594 EmptyString(parv[0]) ? "*" : parv[0], nick);
595 return 0; /* NICK message ignored */
599 * Check against nick name collisions.
601 * Put this 'if' here so that the nesting goes nicely on the screen :)
602 * We check against server name list before determining if the nickname
603 * is present in the nicklist (due to the way the below for loop is
604 * constructed). -avalon
606 if ((acptr = FindServer(nick))) {
609 sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
610 EmptyString(parv[0]) ? "*" : parv[0], nick);
611 return 0; /* NICK message ignored */
614 * We have a nickname trying to use the same name as
615 * a server. Send out a nick collision KILL to remove
616 * the nickname. As long as only a KILL is sent out,
617 * there is no danger of the server being disconnected.
618 * Ultimate way to jupiter a nick ? >;-). -avalon
620 sendto_ops("Nick collision on %s(%s <- %s)", /* XXX DEAD */
621 sptr->name, acptr->from->name, cptr->name);
622 ServerStats->is_kill++;
623 sendto_one(cptr, "%s " TOK_KILL " %s%s :%s (%s <- %s)", /* XXX DEAD */
624 NumServ(&me), NumNick(sptr), me.name, acptr->from->name,
626 sptr->flags |= FLAGS_KILLED;
627 return exit_client(cptr, sptr, &me, "Nick/Server collision");
630 if (!(acptr = FindClient(nick)))
631 return set_nick_name(cptr, sptr, nick, parc, parv); /* No collisions, all clear... */
633 * If acptr == sptr, then we have a client doing a nick
634 * change between *equivalent* nicknames as far as server
635 * is concerned (user is changing the case of his/her
636 * nickname or somesuch)
640 if (strcmp(acptr->name, nick) != 0)
642 * Allows change of case in his/her nick
644 return set_nick_name(cptr, sptr, nick, parc, parv);
647 * This is just ':old NICK old' type thing.
648 * Just forget the whole thing here. There is
649 * no point forwarding it to anywhere,
650 * especially since servers prior to this
651 * version would treat it as nick collision.
653 return 0; /* NICK Message ignored */
657 * Note: From this point forward it can be assumed that
658 * acptr != sptr (point to different client structures).
661 * If the older one is "non-person", the new entry is just
662 * allowed to overwrite it. Just silently drop non-person,
663 * and proceed with the nick. This should take care of the
664 * "dormant nick" way of generating collisions...
666 if (IsUnknown(acptr) && MyConnect(acptr))
668 ++ServerStats->is_ref;
669 ip_registry_connect_fail(acptr->ip.s_addr);
670 exit_client(cptr, acptr, &me, "Overridden by other sign on");
671 return set_nick_name(cptr, sptr, nick, parc, parv);
674 * Decide, we really have a nick collision and deal with it
679 * NICK is coming from local client connection. Just
680 * send error reply and ignore the command.
682 sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
683 /* parv[0] is empty when connecting */
684 EmptyString(parv[0]) ? "*" : parv[0], nick);
685 return 0; /* NICK message ignored */
688 * NICK was coming from a server connection.
689 * This means we have a race condition (two users signing on
690 * at the same time), or two net fragments reconnecting with the same nick.
691 * The latter can happen because two different users connected
692 * or because one and the same user switched server during a net break.
693 * If the TimeStamps are equal, we kill both (or only 'new'
694 * if it was a ":server NICK new ...").
695 * Otherwise we kill the youngest when user@host differ,
696 * or the oldest when they are the same.
697 * We treat user and ~user as different, because if it wasn't
698 * a faked ~user the AUTH wouldn't have added the '~'.
705 * A new NICK being introduced by a neighbouring
706 * server (e.g. message type ":server NICK new ..." received)
708 differ = (acptr->ip.s_addr != htonl(base64toint(parv[parc - 3]))) ||
709 (0 != ircd_strcmp(acptr->user->username, parv[4]));
710 sendto_ops("Nick collision on %s (%s " TIME_T_FMT " <- %s " TIME_T_FMT /* XXX DEAD */
711 " (%s user@host))", acptr->name, acptr->from->name, acptr->lastnick,
712 cptr->name, lastnick, differ ? "Different" : "Same");
717 * A NICK change has collided (e.g. message type ":old NICK new").
719 lastnick = atoi(parv[2]);
720 differ = (acptr->ip.s_addr != sptr->ip.s_addr) ||
721 (0 != ircd_strcmp(acptr->user->username, sptr->user->username));
722 sendto_ops("Nick change collision from %s to %s (%s " TIME_T_FMT " <- %s " /* XXX DEAD */
723 TIME_T_FMT ")", sptr->name, acptr->name, acptr->from->name,
724 acptr->lastnick, cptr->name, lastnick);
727 * Now remove (kill) the nick on our side if it is the youngest.
728 * If no timestamp was received, we ignore the incoming nick
729 * (and expect a KILL for our legit nick soon ):
730 * When the timestamps are equal we kill both nicks. --Run
731 * acptr->from != cptr should *always* be true (?).
733 if (acptr->from != cptr)
735 if ((differ && lastnick >= acptr->lastnick) ||
736 (!differ && lastnick <= acptr->lastnick))
740 ServerStats->is_kill++;
741 sendto_highprot_butone(cptr, 10, /* Kill old from outgoing servers */ /* XXX DEAD */
742 "%s " TOK_KILL " %s%s :%s (%s <- %s (Nick collision))",
743 NumServ(&me), NumNick(sptr), me.name, acptr->from->name,
745 if (MyConnect(sptr) && IsServer(cptr) && Protocol(cptr) > 9)
746 sendto_one(cptr, "%s " TOK_KILL " %s%s :%s (Ghost2)", /* XXX DEAD */
747 NumServ(&me), NumNick(sptr), me.name);
748 sptr->flags |= FLAGS_KILLED;
749 exit_client(cptr, sptr, &me, "Nick collision (you're a ghost)");
751 if (lastnick != acptr->lastnick)
752 return 0; /* Ignore the NICK */
754 sendto_one(acptr, err_str(ERR_NICKCOLLISION), me.name, acptr->name, nick); /* XXX DEAD */
756 ServerStats->is_kill++;
757 acptr->flags |= FLAGS_KILLED;
760 sendto_highprot_butone(cptr, 10, /* Kill our old from outgoing servers */ /* XXX DEAD */
761 "%s " TOK_KILL " %s%s :%s (%s <- %s (older nick overruled))",
762 NumServ(&me), NumNick(acptr), me.name, acptr->from->name,
764 if (MyConnect(acptr) && IsServer(cptr) && Protocol(cptr) > 9)
765 sendto_one(cptr, "%s%s " TOK_QUIT " :Local kill by %s (Ghost)", /* XXX DEAD */
766 NumNick(acptr), me.name);
767 exit_client(cptr, acptr, &me, "Nick collision (older nick overruled)");
771 sendto_highprot_butone(cptr, 10, /* Kill our old from outgoing servers */ /* XXX DEAD */
772 "%s " TOK_KILL " %s%s :%s (%s <- %s (nick collision from same user@host))",
773 NumServ(&me), NumNick(acptr), me.name, acptr->from->name,
775 if (MyConnect(acptr) && IsServer(cptr) && Protocol(cptr) > 9)
776 sendto_one(cptr, /* XXX DEAD */
777 "%s%s " TOK_QUIT " :Local kill by %s (Ghost: switched servers too fast)",
778 NumNick(acptr), me.name);
779 exit_client(cptr, acptr, &me, "Nick collision (You collided yourself)");
781 if (lastnick == acptr->lastnick)
784 return set_nick_name(cptr, sptr, nick, parc, parv);