| 104 |
|
|
| 105 |
|
static int cancel_clients(struct Client *, struct Client *, char *); |
| 106 |
|
static void remove_unknown(struct Client *, char *, char *); |
| 107 |
< |
static void handle_numeric(char[], struct Client *, int, char *[]); |
| 107 |
> |
static void handle_numeric(unsigned int, struct Client *, int, char *[]); |
| 108 |
|
static void handle_command(struct Message *, struct Client *, unsigned int, char *[]); |
| 109 |
|
|
| 110 |
|
|
| 120 |
|
struct Message *msg_ptr = NULL; |
| 121 |
|
char *ch = NULL; |
| 122 |
|
char *s = NULL; |
| 123 |
< |
char *numeric = NULL; |
| 123 |
> |
unsigned int numeric = 0; |
| 124 |
|
unsigned int parc = 0; |
| 125 |
|
unsigned int paramcount; |
| 126 |
|
|
| 194 |
|
if (*(ch + 3) == ' ' && /* ok, lets see if its a possible numeric.. */ |
| 195 |
|
IsDigit(*ch) && IsDigit(*(ch + 1)) && IsDigit(*(ch + 2))) |
| 196 |
|
{ |
| 197 |
< |
numeric = ch; |
| 197 |
> |
numeric = (*ch - '0') * 100 + (*(ch + 1) - '0') * 10 + (*(ch + 2) - '0'); |
| 198 |
|
paramcount = 2; /* destination, and the rest of it */ |
| 199 |
|
++ServerStats.is_num; |
| 200 |
|
s = ch + 3; /* I know this is ' ' from above if */ |
| 468 |
|
{ |
| 469 |
|
assert(msg && msg->cmd); |
| 470 |
|
|
| 471 |
+ |
if (!msg_tree_parse(msg->cmd)) |
| 472 |
+ |
return; |
| 473 |
+ |
|
| 474 |
|
del_msg_element(&msg_tree, msg->cmd); |
| 475 |
|
} |
| 476 |
|
|
| 615 |
|
"Unknown prefix (%s) from %s, Squitting %s", |
| 616 |
|
lbuffer, client_p->name, lsender); |
| 617 |
|
sendto_one(client_p, ":%s SQUIT %s :(Unknown prefix (%s) from %s)", |
| 618 |
< |
me.name, lsender, lbuffer, client_p->name); |
| 618 |
> |
me.id, lsender, lbuffer, client_p->name); |
| 619 |
|
} |
| 620 |
|
else |
| 621 |
|
sendto_one(client_p, ":%s KILL %s :%s (Unknown Client)", |
| 622 |
< |
me.name, lsender, me.name); |
| 622 |
> |
me.id, lsender, me.name); |
| 623 |
|
} |
| 624 |
|
|
| 625 |
|
/* |
| 644 |
|
* the savvy approach is NEVER generate an error in response to an... error :) |
| 645 |
|
*/ |
| 646 |
|
static void |
| 647 |
< |
handle_numeric(char numeric[], struct Client *source_p, int parc, char *parv[]) |
| 647 |
> |
handle_numeric(unsigned int numeric, struct Client *source_p, int parc, char *parv[]) |
| 648 |
|
{ |
| 649 |
|
struct Client *target_p = NULL; |
| 650 |
|
struct Channel *chptr = NULL; |
| 679 |
|
* remotely - but the information they contain may be useful, so we |
| 680 |
|
* remap them up. Weird, but true. -- Isomer |
| 681 |
|
*/ |
| 682 |
< |
if (numeric[0] == '0') |
| 683 |
< |
numeric[0] = '1'; |
| 682 |
> |
if (numeric < 100) |
| 683 |
> |
numeric += 100; |
| 684 |
|
|
| 685 |
|
if (target_p) |
| 686 |
|
{ |
| 687 |
|
/* Fake it for server hiding, if its our client */ |
| 688 |
|
if (ConfigServerHide.hide_servers && MyClient(target_p) && |
| 689 |
|
!HasUMode(target_p, UMODE_OPER)) |
| 690 |
< |
sendto_one(target_p, ":%s %s %s %s", me.name, numeric, target_p->name, parv[2]); |
| 690 |
> |
sendto_one_numeric(target_p, &me, numeric|SND_EXPLICIT, "%s", parv[2]); |
| 691 |
|
else |
| 692 |
< |
sendto_one(target_p, ":%s %s %s %s", ID_or_name(source_p, target_p), |
| 690 |
< |
numeric, ID_or_name(target_p, target_p), parv[2]); |
| 692 |
> |
sendto_one_numeric(target_p, source_p, numeric|SND_EXPLICIT, "%s", parv[2]); |
| 693 |
|
} |
| 694 |
|
else |
| 695 |
< |
sendto_channel_butone(source_p, source_p, chptr, 0, "%s %s %s", |
| 695 |
> |
sendto_channel_butone(source_p, source_p, chptr, 0, "%u %s %s", |
| 696 |
|
numeric, chptr->chname, parv[2]); |
| 697 |
|
} |
| 698 |
|
|