| 44 |
|
dlink_node *ptr = NULL; |
| 45 |
|
struct Client *target_p = NULL; |
| 46 |
|
static char prompt[64]; |
| 47 |
+ |
static char buf[IRCD_BUFSIZE]; |
| 48 |
|
char *p = prompt + prompt_length; |
| 49 |
|
int cnt = 0; |
| 50 |
+ |
int bufpos = 0; |
| 51 |
|
|
| 52 |
|
*p = '\0'; |
| 53 |
|
|
| 56 |
|
client->name, prompt, server->name); |
| 57 |
|
else |
| 58 |
|
{ |
| 59 |
< |
char buf[IRC_MAXSID + 3] = ""; /* +3 for [, ], \0 */ |
| 59 |
> |
int dashes; |
| 60 |
> |
|
| 61 |
> |
bufpos += snprintf(buf + bufpos, sizeof(buf) - bufpos, "%s", server->name); |
| 62 |
|
|
| 63 |
|
if (HasUMode(client, UMODE_OPER) && server->id[0]) |
| 64 |
< |
snprintf(buf, sizeof(buf), "[%s]", server->id); |
| 64 |
> |
bufpos += snprintf(buf + bufpos, sizeof(buf) - bufpos, "[%s]", server->id); |
| 65 |
> |
|
| 66 |
> |
buf[bufpos++] = ' '; |
| 67 |
> |
dashes = 50 - bufpos - prompt_length; |
| 68 |
> |
for (; dashes > 0; --dashes) |
| 69 |
> |
buf[bufpos++] = '-'; |
| 70 |
> |
buf[bufpos++] = ' '; |
| 71 |
> |
buf[bufpos++] = '|'; |
| 72 |
|
|
| 73 |
+ |
bufpos += snprintf(buf + bufpos, sizeof(buf) - bufpos, " Users %5d (%1.2f%%)", |
| 74 |
+ |
dlink_list_length(&server->serv->client_list), 100 * |
| 75 |
+ |
(float)dlink_list_length(&server->serv->client_list) / |
| 76 |
+ |
(float)Count.total); |
| 77 |
|
sendto_one(client, form_str(RPL_MAP), me.name, client->name, |
| 78 |
< |
prompt, server->name, buf, |
| 64 |
< |
dlink_list_length(&server->serv->client_list), |
| 65 |
< |
dlink_list_length(&server->serv->client_list) * 100 / Count.total); |
| 78 |
> |
prompt, buf); |
| 79 |
|
} |
| 80 |
|
|
| 81 |
|
if (prompt_length > 0) |