37 |
|
static char buf[IRCD_BUFSIZE]; |
38 |
|
static void m_map(struct Client *, struct Client *, int, char *[]); |
39 |
|
static void mo_map(struct Client *, struct Client *, int, char *[]); |
40 |
< |
static void dump_map(struct Client *, struct Client *, int, char *); |
40 |
> |
static void dump_map(struct Client *, const struct Client *, int, char *); |
41 |
|
|
42 |
|
struct Message map_msgtab = { |
43 |
|
"MAP", 0, 0, 0, 0, MFLG_SLOW, 0, |
70 |
|
{ |
71 |
|
static time_t last_used = 0; |
72 |
|
|
73 |
< |
if (!ConfigServerHide.flatten_links) |
73 |
> |
if (ConfigServerHide.flatten_links) |
74 |
|
{ |
75 |
< |
if (!IsOper(source_p)) |
76 |
< |
{ |
77 |
< |
if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) |
78 |
< |
{ |
79 |
< |
/* safe enough to give this on a local connect only */ |
80 |
< |
sendto_one(source_p, form_str(RPL_LOAD2HI), |
81 |
< |
me.name, source_p->name); |
82 |
< |
return; |
83 |
< |
} |
84 |
< |
|
85 |
< |
last_used = CurrentTime; |
86 |
< |
} |
75 |
> |
m_not_oper(client_p, source_p, parc, parv); |
76 |
> |
return; |
77 |
> |
} |
78 |
|
|
79 |
< |
dump_map(client_p, &me, 0, buf); |
80 |
< |
sendto_one(client_p, form_str(RPL_MAPEND), me.name, client_p->name); |
79 |
> |
if ((last_used + ConfigFileEntry.pace_wait) > CurrentTime) |
80 |
> |
{ |
81 |
> |
/* safe enough to give this on a local connect only */ |
82 |
> |
sendto_one(source_p, form_str(RPL_LOAD2HI), |
83 |
> |
me.name, source_p->name); |
84 |
|
return; |
85 |
|
} |
86 |
|
|
87 |
< |
m_not_oper(client_p, source_p, parc, parv); |
87 |
> |
last_used = CurrentTime; |
88 |
> |
|
89 |
> |
dump_map(source_p, &me, 0, buf); |
90 |
> |
sendto_one(source_p, form_str(RPL_MAPEND), me.name, source_p->name); |
91 |
|
} |
92 |
|
|
93 |
|
/* mo_map() |
97 |
|
mo_map(struct Client *client_p, struct Client *source_p, |
98 |
|
int parc, char *parv[]) |
99 |
|
{ |
100 |
< |
dump_map(client_p, &me, 0, buf); |
101 |
< |
sendto_one(client_p, form_str(RPL_MAPEND), me.name, client_p->name); |
100 |
> |
dump_map(source_p, &me, 0, buf); |
101 |
> |
sendto_one(source_p, form_str(RPL_MAPEND), me.name, source_p->name); |
102 |
|
} |
103 |
|
|
104 |
|
/* dump_map() |
105 |
|
* dumps server map, called recursively. |
106 |
|
*/ |
107 |
|
static void |
108 |
< |
dump_map(struct Client *client_p, struct Client *root_p, int start_len, |
109 |
< |
char *pbuf) |
108 |
> |
dump_map(struct Client *client_p, const struct Client *root_p, |
109 |
> |
int start_len, char *pbuf) |
110 |
|
{ |
111 |
|
int cnt = 0, i = 0, l = 0, len = start_len; |
112 |
|
int users, dashes; |
113 |
< |
dlink_node *ptr; |
113 |
> |
const dlink_node *ptr = NULL; |
114 |
|
char *pb; |
115 |
|
|
116 |
|
*pbuf= '\0'; |
164 |
|
|
165 |
|
DLINK_FOREACH(ptr, root_p->serv->server_list.head) |
166 |
|
{ |
167 |
< |
struct Client *server_p = ptr->data; |
167 |
> |
const struct Client *server_p = ptr->data; |
168 |
|
|
169 |
|
*pbuf = ' '; |
170 |
|
|