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
86 * No need to include handlers.h here the signatures must match
87 * and we don't need to force a rebuild of all the handlers everytime
88 * we add a new one to the list. --Bleep
96 #include "ircd_chattr.h"
97 #include "ircd_reply.h"
98 #include "ircd_string.h"
101 #include "numnicks.h"
112 * m_nick - message handler for local clients
113 * parv[0] = sender prefix
116 int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
118 struct Client* acptr;
119 char nick[NICKLEN + 2];
122 const char* client_name;
125 assert(cptr == sptr);
128 * parv[0] will be empty for clients connecting for the first time
130 client_name = (*(cli_name(sptr))) ? cli_name(sptr) : "*";
133 send_reply(sptr, ERR_NONICKNAMEGIVEN);
137 * Don't let them send make us send back a really long string of
141 if (strlen(arg) > NICKLEN)
144 if ((s = strchr(arg, '~')))
150 * If do_nick_name() returns a null name OR if the server sent a nick
151 * name and do_nick_name() changed it in some way (due to rules of nick
152 * creation) then reject it. If from a server and we reject it,
153 * and KILL it. -avalon 4/4/92
155 if (0 == do_nick_name(nick)) {
156 send_reply(sptr, ERR_ERRONEUSNICKNAME, arg);
161 * Check if this is a LOCAL user trying to use a reserved (Juped)
162 * nick, if so tell him that it's a nick in use...
164 if (isNickJuped(nick)) {
165 send_reply(sptr, ERR_NICKNAMEINUSE, nick);
166 return 0; /* NICK message ignored */
169 if (!(acptr = FindClient(nick))) {
171 * No collisions, all clear...
173 return set_nick_name(cptr, sptr, nick, parc, parv);
175 if (IsServer(acptr)) {
176 send_reply(sptr, ERR_NICKNAMEINUSE, nick);
177 return 0; /* NICK message ignored */
180 * If acptr == sptr, then we have a client doing a nick
181 * change between *equivalent* nicknames as far as server
182 * is concerned (user is changing the case of his/her
183 * nickname or somesuch)
187 * If acptr == sptr, then we have a client doing a nick
188 * change between *equivalent* nicknames as far as server
189 * is concerned (user is changing the case of his/her
190 * nickname or somesuch)
192 if (0 != strcmp(cli_name(acptr), nick)) {
194 * Allows change of case in his/her nick
196 return set_nick_name(cptr, sptr, nick, parc, parv);
199 * This is just ':old NICK old' type thing.
200 * Just forget the whole thing here. There is
201 * no point forwarding it to anywhere,
202 * especially since servers prior to this
203 * version would treat it as nick collision.
208 * Note: From this point forward it can be assumed that
209 * acptr != sptr (point to different client structures).
211 assert(acptr != sptr);
213 * If the older one is "non-person", the new entry is just
214 * allowed to overwrite it. Just silently drop non-person,
215 * and proceed with the nick. This should take care of the
216 * "dormant nick" way of generating collisions...
218 * XXX - hmmm can this happen after one is registered?
220 if (IsUnknown(acptr) && MyConnect(acptr)) {
221 ++ServerStats->is_ref;
222 IPcheck_connect_fail(cli_ip(acptr));
223 exit_client(cptr, acptr, &me, "Overridden by other sign on");
224 return set_nick_name(cptr, sptr, nick, parc, parv);
227 * NICK is coming from local client connection. Just
228 * send error reply and ignore the command.
230 send_reply(sptr, ERR_NICKNAMEINUSE, nick);
231 return 0; /* NICK message ignored */
236 * ms_nick - server message handler for nicks
237 * parv[0] = sender prefix
240 * If from server, source is client:
241 * parv[2] = timestamp
245 * parv[3] = timestamp
248 * parv[6] = umode (optional)
249 * parv[parc-3] = IP# <- Only Protocol >= 10
250 * parv[parc-2] = YXX, numeric nick <- Only Protocol >= 10
251 * parv[parc-1] = info
254 int ms_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
256 struct Client* acptr;
257 char nick[NICKLEN + 2];
263 assert(IsServer(cptr));
265 if ((IsServer(sptr) && parc < 8) || parc < 3) {
266 sendto_opmask_butone(0, SNO_OLDSNO, "bad NICK param count for %s from %C",
268 return need_more_params(sptr, "NICK");
271 ircd_strncpy(nick, parv[1], NICKLEN);
272 nick[NICKLEN] = '\0';
274 if (IsServer(sptr)) {
275 lastnick = atoi(parv[3]);
276 if (lastnick > OLDEST_TS && !IsBurstOrBurstAck(sptr))
277 cli_serv(sptr)->lag = TStime() - lastnick;
280 lastnick = atoi(parv[2]);
281 if (lastnick > OLDEST_TS && !IsBurstOrBurstAck(sptr))
282 cli_serv(cli_user(sptr)->server)->lag = TStime() - lastnick;
285 * If do_nick_name() returns a null name OR if the server sent a nick
286 * name and do_nick_name() changed it in some way (due to rules of nick
287 * creation) then reject it. If from a server and we reject it,
288 * and KILL it. -avalon 4/4/92
290 if (0 == do_nick_name(nick) || 0 != strcmp(nick, parv[1])) {
291 send_reply(sptr, ERR_ERRONEUSNICKNAME, parv[1]);
293 ++ServerStats->is_kill;
294 sendto_opmask_butone(0, SNO_OLDSNO, "Bad Nick: %s From: %s %C", parv[1],
296 sendcmdto_one(&me, CMD_KILL, cptr, "%s :%s (%s <- %s[%s])",
297 IsServer(sptr) ? parv[parc - 2] : parv[0], cli_name(&me), parv[1],
298 nick, cli_name(cptr));
299 if (!IsServer(sptr)) {
303 sendcmdto_serv_butone(&me, CMD_KILL, 0, "%s :%s (%s <- %s!%s@%s)",
304 parv[0], cli_name(&me), cli_name(cptr), parv[0],
305 cli_user(sptr) ? cli_username(sptr) : "",
306 cli_user(sptr) ? cli_name(cli_user(sptr)->server) :
312 * Check against nick name collisions.
314 * Put this 'if' here so that the nesting goes nicely on the screen :)
315 * We check against server name list before determining if the nickname
316 * is present in the nicklist (due to the way the below for loop is
317 * constructed). -avalon
320 acptr = FindClient(nick);
323 * No collisions, all clear...
325 return set_nick_name(cptr, sptr, nick, parc, parv);
329 if (IsServer(acptr)) {
331 * We have a nickname trying to use the same name as
332 * a server. Send out a nick collision KILL to remove
333 * the nickname. As long as only a KILL is sent out,
334 * there is no danger of the server being disconnected.
335 * Ultimate way to jupiter a nick ? >;-). -avalon
337 sendto_opmask_butone(0, SNO_OLDSNO, "Nick collision on %C(%C <- %C)", sptr,
338 cli_from(acptr), cptr);
339 ++ServerStats->is_kill;
341 sendcmdto_one(&me, CMD_KILL, cptr, "%C :%s (%s <- %s)", sptr, cli_name(&me),
342 cli_name(cli_from(acptr)), cli_name(cptr));
344 cli_flags(sptr) |= FLAGS_KILLED;
346 * if sptr is a server it is exited here, nothing else to do
348 return exit_client(cptr, sptr, &me, "Nick/Server collision");
352 * If acptr == sptr, then we have a client doing a nick
353 * change between *equivalent* nicknames as far as server
354 * is concerned (user is changing the case of his/her
355 * nickname or somesuch)
358 if (strcmp(cli_name(acptr), nick) != 0)
360 * Allows change of case in his/her nick
362 return set_nick_name(cptr, sptr, nick, parc, parv);
365 * This is just ':old NICK old' type thing.
366 * Just forget the whole thing here. There is
367 * no point forwarding it to anywhere,
368 * especially since servers prior to this
369 * version would treat it as nick collision.
371 return 0; /* NICK Message ignored */
375 * Note: From this point forward it can be assumed that
376 * acptr != sptr (point to different client structures).
378 assert(acptr != sptr);
380 * If the older one is "non-person", the new entry is just
381 * allowed to overwrite it. Just silently drop non-person,
382 * and proceed with the nick. This should take care of the
383 * "dormant nick" way of generating collisions...
385 if (IsUnknown(acptr) && MyConnect(acptr)) {
386 ++ServerStats->is_ref;
387 IPcheck_connect_fail(cli_ip(acptr));
388 exit_client(cptr, acptr, &me, "Overridden by other sign on");
389 return set_nick_name(cptr, sptr, nick, parc, parv);
392 * Decide, we really have a nick collision and deal with it
395 * NICK was coming from a server connection.
396 * This means we have a race condition (two users signing on
397 * at the same time), or two net fragments reconnecting with the same nick.
398 * The latter can happen because two different users connected
399 * or because one and the same user switched server during a net break.
400 * If the TimeStamps are equal, we kill both (or only 'new'
401 * if it was a ":server NICK new ...").
402 * Otherwise we kill the youngest when user@host differ,
403 * or the oldest when they are the same.
404 * We treat user and ~user as different, because if it wasn't
405 * a faked ~user the AUTH wouldn't have added the '~'.
409 if (IsServer(sptr)) {
411 * A new NICK being introduced by a neighbouring
412 * server (e.g. message type ":server NICK new ..." received)
414 * compare IP address and username
416 differ = (cli_ip(acptr).s_addr != htonl(base64toint(parv[parc - 3]))) ||
417 (0 != ircd_strcmp(cli_user(acptr)->username, parv[4]));
418 sendto_opmask_butone(0, SNO_OLDSNO, "Nick collision on %C (%C %Tu <- "
419 "%C %Tu (%s user@host))", acptr, cli_from(acptr),
420 cli_lastnick(acptr), cptr, lastnick,
421 differ ? "Different" : "Same");
425 * A NICK change has collided (e.g. message type ":old NICK new").
427 * compare IP address and username
429 differ = (cli_ip(acptr).s_addr != cli_ip(sptr).s_addr) ||
430 (0 != ircd_strcmp(cli_user(acptr)->username, cli_user(sptr)->username));
431 sendto_opmask_butone(0, SNO_OLDSNO, "Nick change collision from %C to "
432 "%C (%C %Tu <- %C %Tu)", sptr, acptr, cli_from(acptr),
433 cli_lastnick(acptr), cptr, lastnick);
436 * Now remove (kill) the nick on our side if it is the youngest.
437 * If no timestamp was received, we ignore the incoming nick
438 * (and expect a KILL for our legit nick soon ):
439 * When the timestamps are equal we kill both nicks. --Run
440 * acptr->from != cptr should *always* be true (?).
442 * This exits the client sending the NICK message
444 if (cli_from(acptr) != cptr) {
445 if ((differ && lastnick >= cli_lastnick(acptr)) ||
446 (!differ && lastnick <= cli_lastnick(acptr))) {
447 if (!IsServer(sptr)) {
448 ++ServerStats->is_kill;
449 sendcmdto_serv_butone(&me, CMD_KILL, sptr, "%C :%s (Nick collision)",
450 sptr, cli_name(&me));
451 assert(!MyConnect(sptr));
453 cli_flags(sptr) |= FLAGS_KILLED;
454 exit_client(cptr, sptr, &me, "Nick collision (you're a ghost)");
456 * we have killed sptr off, zero out it's pointer so if it's used
457 * again we'll know about it --Bleep
461 if (lastnick != cli_lastnick(acptr))
462 return 0; /* Ignore the NICK */
464 send_reply(acptr, ERR_NICKCOLLISION, nick);
467 ++ServerStats->is_kill;
468 cli_flags(acptr) |= FLAGS_KILLED;
470 * This exits the client we had before getting the NICK message
473 sendcmdto_serv_butone(&me, CMD_KILL, acptr, "%C :%s (older nick "
474 "overruled)", acptr, cli_name(&me));
475 if (MyConnect(acptr))
476 sendcmdto_one(acptr, CMD_QUIT, cptr, ":Local kill by %s (Ghost)",
478 exit_client(cptr, acptr, &me, "Nick collision (older nick overruled)");
481 sendcmdto_serv_butone(&me, CMD_KILL, acptr, "%C :%s (nick collision from "
482 "same user@host)", acptr, cli_name(&me));
483 if (MyConnect(acptr))
484 sendcmdto_one(acptr, CMD_QUIT, cptr, ":Local kill by %s (Ghost: ",
485 "switched servers too fast)", cli_name(&me));
486 exit_client(cptr, acptr, &me, "Nick collision (You collided yourself)");
488 if (lastnick == cli_lastnick(acptr))
492 return set_nick_name(cptr, sptr, nick, parc, parv);
499 * parv[0] = sender prefix
502 * If from server, source is client:
503 * parv[2] = timestamp
507 * parv[3] = timestamp
510 * parv[6] = umode (optional)
511 * parv[parc-3] = IP# <- Only Protocol >= 10
512 * parv[parc-2] = YXX, numeric nick <- Only Protocol >= 10
513 * parv[parc-1] = info
516 int m_nick(struct Client *cptr, struct Client *sptr, int parc, char *parv[])
518 struct Client* acptr;
519 char nick[NICKLEN + 2];
525 sendto_one(sptr, err_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]); /* XXX DEAD */
528 else if ((IsServer(sptr) && parc < 8) || (IsServer(cptr) && parc < 3))
530 need_more_params(sptr, "NICK");
531 sendto_ops("bad NICK param count for %s from %s", parv[1], cptr->name); /* XXX DEAD */
534 if (MyConnect(sptr) && (s = strchr(parv[1], '~')))
536 ircd_strncpy(nick, parv[1], NICKLEN);
537 nick[NICKLEN] = '\0';
538 if (IsServer(cptr)) {
539 if (IsServer(sptr)) {
540 lastnick = atoi(parv[3]);
541 if (lastnick > OLDEST_TS)
542 sptr->serv->lag = TStime() - lastnick;
544 lastnick = atoi(parv[2]);
545 if (lastnick > OLDEST_TS)
546 sptr->user->server->serv->lag = TStime() - lastnick;
550 * If do_nick_name() returns a null name OR if the server sent a nick
551 * name and do_nick_name() changed it in some way (due to rules of nick
552 * creation) then reject it. If from a server and we reject it,
553 * and KILL it. -avalon 4/4/92
555 if (do_nick_name(nick) == 0 || (IsServer(cptr) && strcmp(nick, parv[1])))
557 sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME), me.name, parv[0], parv[1]); /* XXX DEAD */
561 ServerStats->is_kill++;
562 sendto_ops("Bad Nick: %s From: %s %s", /* XXX DEAD */
563 parv[1], parv[0], cptr->name);
564 sendto_one(cptr, "%s " TOK_KILL " %s :%s (%s <- %s[%s])", /* XXX DEAD */
565 NumServ(&me), IsServer(sptr) ? parv[parc - 2] : parv[0], me.name,
566 parv[1], nick, cptr->name);
567 if (!IsServer(sptr)) /* bad nick _change_ */
569 sendto_highprot_butone(&me, 10, "%s " TOK_KILL " %s :%s (%s <- %s!%s@%s)", /* XXX DEAD */
570 NumServ(&me), parv[0], me.name, cptr->name,
571 parv[0], sptr->user ? sptr->username : "",
572 sptr->user ? sptr->user->server->name : cptr->name);
579 * Check if this is a LOCAL user trying to use a reserved (Juped)
580 * nick, if so tell him that it's a nick in use...
582 if ((!IsServer(cptr)) && isNickJuped(nick))
584 sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
585 /* parv[0] is empty when connecting */
586 EmptyString(parv[0]) ? "*" : parv[0], nick);
587 return 0; /* NICK message ignored */
591 * Check against nick name collisions.
593 * Put this 'if' here so that the nesting goes nicely on the screen :)
594 * We check against server name list before determining if the nickname
595 * is present in the nicklist (due to the way the below for loop is
596 * constructed). -avalon
599 acptr = FindServer(nick);
601 if (acptr) { /* There is a nick collision with a server */
604 /* Local user trying to use a nick thats a server
605 * Return an error message and ignore the command
607 sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
608 EmptyString(parv[0]) ? "*" : parv[0], nick);
609 return 0; /* NICK message ignored */
613 * We have a nickname trying to use the same name as
614 * a server. Send out a nick collision KILL to remove
615 * the nickname. As long as only a KILL is sent out,
616 * there is no danger of the server being disconnected.
617 * Ultimate way to jupiter a nick ? >;-). -avalon
619 sendto_ops("Nick collision on %s(%s <- %s)", /* XXX DEAD */
620 sptr->name, acptr->from->name, cptr->name);
621 ServerStats->is_kill++;
622 sendto_one(cptr, "%s " TOK_KILL " %s%s :%s (%s <- %s)", /* XXX DEAD */
623 NumServ(&me), NumNick(sptr), me.name, acptr->from->name,
625 sptr->flags |= FLAGS_KILLED;
626 return exit_client(cptr, sptr, &me, "Nick/Server collision");
629 acptr = FindClient(nick);
631 /* No collisions? Set the nick name and we're done */
633 return set_nick_name(cptr, sptr, nick, parc, parv);
635 * If acptr == sptr, then we have a client doing a nick
636 * change between *equivalent* nicknames as far as server
637 * is concerned (user is changing the case of his/her
638 * nickname or somesuch)
642 if (strcmp(acptr->name, nick) != 0)
644 * Allows change of case in his/her nick
646 return set_nick_name(cptr, sptr, nick, parc, parv);
649 * This is just ':old NICK old' type thing.
650 * Just forget the whole thing here. There is
651 * no point forwarding it to anywhere,
652 * especially since servers prior to this
653 * version would treat it as nick collision.
655 return 0; /* NICK Message ignored */
659 * Note: From this point forward it can be assumed that
660 * acptr != sptr (point to different client structures).
663 * If the older one is "non-person", the new entry is just
664 * allowed to overwrite it. Just silently drop non-person,
665 * and proceed with the nick. This should take care of the
666 * "dormant nick" way of generating collisions...
668 if (IsUnknown(acptr) && MyConnect(acptr))
670 ++ServerStats->is_ref;
671 IPcheck_connect_fail(acptr->ip);
672 exit_client(cptr, acptr, &me, "Overridden by other sign on");
673 return set_nick_name(cptr, sptr, nick, parc, parv);
676 * Decide, we really have a nick collision and deal with it
681 * NICK is coming from local client connection. Just
682 * send error reply and ignore the command.
684 sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, /* XXX DEAD */
685 /* parv[0] is empty when connecting */
686 EmptyString(parv[0]) ? "*" : parv[0], nick);
687 return 0; /* NICK message ignored */
690 * NICK was coming from a server connection.
691 * This means we have a race condition (two users signing on
692 * at the same time), or two net fragments reconnecting with the same nick.
693 * The latter can happen because two different users connected
694 * or because one and the same user switched server during a net break.
695 * If the TimeStamps are equal, we kill both (or only 'new'
696 * if it was a ":server NICK new ...").
697 * Otherwise we kill the youngest when user@host differ,
698 * or the oldest when they are the same.
699 * We treat user and ~user as different, because if it wasn't
700 * a faked ~user the AUTH wouldn't have added the '~'.
707 * A new NICK being introduced by a neighbouring
708 * server (e.g. message type ":server NICK new ..." received)
710 differ = (acptr->ip.s_addr != htonl(base64toint(parv[parc - 3]))) ||
711 (0 != ircd_strcmp(acptr->user->username, parv[4]));
712 sendto_ops("Nick collision on %s (%s " TIME_T_FMT " <- %s " TIME_T_FMT /* XXX DEAD */
713 " (%s user@host))", acptr->name, acptr->from->name, acptr->lastnick,
714 cptr->name, lastnick, differ ? "Different" : "Same");
719 * A NICK change has collided (e.g. message type ":old NICK new").
721 lastnick = atoi(parv[2]);
722 differ = (acptr->ip.s_addr != sptr->ip.s_addr) ||
723 (0 != ircd_strcmp(acptr->user->username, sptr->user->username));
724 sendto_ops("Nick change collision from %s to %s (%s " TIME_T_FMT " <- %s " /* XXX DEAD */
725 TIME_T_FMT ")", sptr->name, acptr->name, acptr->from->name,
726 acptr->lastnick, cptr->name, lastnick);
729 * Now remove (kill) the nick on our side if it is the youngest.
730 * If no timestamp was received, we ignore the incoming nick
731 * (and expect a KILL for our legit nick soon ):
732 * When the timestamps are equal we kill both nicks. --Run
733 * acptr->from != cptr should *always* be true (?).
735 if (acptr->from != cptr)
737 if ((differ && lastnick >= acptr->lastnick) ||
738 (!differ && lastnick <= acptr->lastnick))
742 ServerStats->is_kill++;
743 sendto_highprot_butone(cptr, 10, /* Kill old from outgoing servers */ /* XXX DEAD */
744 "%s " TOK_KILL " %s%s :%s (%s <- %s (Nick collision))",
745 NumServ(&me), NumNick(sptr), me.name, acptr->from->name,
747 if (MyConnect(sptr) && IsServer(cptr) && Protocol(cptr) > 9)
748 sendto_one(cptr, "%s " TOK_KILL " %s%s :%s (Ghost2)", /* XXX DEAD */
749 NumServ(&me), NumNick(sptr), me.name);
750 sptr->flags |= FLAGS_KILLED;
751 exit_client(cptr, sptr, &me, "Nick collision (you're a ghost)");
753 if (lastnick != acptr->lastnick)
754 return 0; /* Ignore the NICK */
756 sendto_one(acptr, err_str(ERR_NICKCOLLISION), me.name, acptr->name, nick); /* XXX DEAD */
758 ServerStats->is_kill++;
759 acptr->flags |= FLAGS_KILLED;
762 sendto_highprot_butone(cptr, 10, /* Kill our old from outgoing servers */ /* XXX DEAD */
763 "%s " TOK_KILL " %s%s :%s (%s <- %s (older nick overruled))",
764 NumServ(&me), NumNick(acptr), me.name, acptr->from->name,
766 if (MyConnect(acptr) && IsServer(cptr) && Protocol(cptr) > 9)
767 sendto_one(cptr, "%s%s " TOK_QUIT " :Local kill by %s (Ghost)", /* XXX DEAD */
768 NumNick(acptr), me.name);
769 exit_client(cptr, acptr, &me, "Nick collision (older nick overruled)");
773 sendto_highprot_butone(cptr, 10, /* Kill our old from outgoing servers */ /* XXX DEAD */
774 "%s " TOK_KILL " %s%s :%s (%s <- %s (nick collision from same user@host))",
775 NumServ(&me), NumNick(acptr), me.name, acptr->from->name,
777 if (MyConnect(acptr) && IsServer(cptr) && Protocol(cptr) > 9)
778 sendto_one(cptr, /* XXX DEAD */
779 "%s%s " TOK_QUIT " :Local kill by %s (Ghost: switched servers too fast)",
780 NumNick(acptr), me.name);
781 exit_client(cptr, acptr, &me, "Nick collision (You collided yourself)");
783 if (lastnick == acptr->lastnick)
786 return set_nick_name(cptr, sptr, nick, parc, parv);