]>
Commit | Line | Data |
---|---|---|
1 | make use of the SND_EXPLICIT flag to specify a pattern, reducing most output from 2 lines to 1 line | |
2 | few minor other changes: | |
3 | changed hidden to delayedjoin, | |
4 | changed no modes <none> to just + same as /MODE shows | |
5 | added zombie and delayedjoin prefix to header for check channel | |
6 | changed all (timestamp) output to [timestamp] seems more consistent with other places (e.g. snomask HACK MODEs) | |
7 | added [<remote server>] param to syntax of command in the comments | |
8 | ||
9 | diff -r 8ebea3ccdca2 ircd/m_check.c | |
10 | --- a/ircd/m_check.c Sat Jul 20 11:29:55 2013 +0100 | |
11 | +++ b/ircd/m_check.c Sat Jul 20 11:48:52 2013 +0100 | |
12 | @@ -71,7 +71,7 @@ | |
13 | */ | |
14 | ||
15 | /* | |
16 | - * Syntax: CHECK <channel|nick|server|hostmask> [-flags] | |
17 | + * Syntax: CHECK [<remote server>] <channel|nick|server|hostmask> [-flags] | |
18 | * | |
19 | * Where valid flags are: | |
20 | * -c: Show channels when checking a hostmask. | |
21 | @@ -238,7 +238,7 @@ | |
22 | char *zombie, *showlevel; | |
23 | ||
24 | if (flags & CHECK_SHOWUSERS) { | |
25 | - send_reply(sptr, RPL_DATASTR, "Users (@ = op, + = voice)"); | |
26 | + send_reply(sptr, RPL_DATASTR, ":Users (! = zombie, @ = op, + = voice, < = delayedjoin)"); | |
27 | } | |
28 | ||
29 | if (flags & CHECK_CLONES) { | |
30 | @@ -324,89 +324,72 @@ | |
31 | cntr++; | |
32 | } | |
33 | ||
34 | - send_reply(sptr, RPL_DATASTR, " "); | |
35 | + send_reply(sptr, RPL_DATASTR, ": "); | |
36 | ||
37 | if (flags & CHECK_CLONES) { | |
38 | - ircd_snprintf(0, outbuf, sizeof(outbuf), | |
39 | - "Total users:: %d (%d ops, %d voiced, %d clones, %d authed, %d hidden)", | |
40 | - cntr, opcntr, vcntr, clones, authed, delayedjoin); | |
41 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, | |
42 | + ":Total users:: %d (%d ops, %d voiced, %d clones, %d authed, %d delayedjoin)", | |
43 | + cntr, opcntr, vcntr, clones, authed, delayedjoin); | |
44 | ||
45 | for (lp = chptr->members; lp; lp = lp->next_member) { | |
46 | cli_marker(lp->user) = 0; | |
47 | } | |
48 | } else { | |
49 | - ircd_snprintf(0, outbuf, sizeof(outbuf), | |
50 | - "Total users:: %d (%d ops, %d voiced, %d authed, %d hidden)", | |
51 | - cntr, opcntr, vcntr, authed, delayedjoin); | |
52 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, | |
53 | + ":Total users:: %d (%d ops, %d voiced, %d authed, %d delayedjoin)", | |
54 | + cntr, opcntr, vcntr, authed, delayedjoin); | |
55 | } | |
56 | ||
57 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
58 | - send_reply(sptr, RPL_DATASTR, " "); | |
59 | + send_reply(sptr, RPL_DATASTR, ": "); | |
60 | ||
61 | /* Do not display bans if ! flags & CHECK_SHOWUSERS */ | |
62 | if (flags & CHECK_SHOWUSERS) { | |
63 | - send_reply(sptr, RPL_DATASTR, "Bans on channel::"); | |
64 | + send_reply(sptr, RPL_DATASTR, ":Bans on channel::"); | |
65 | ||
66 | for (ban = chptr->banlist; ban; ban = ban->next) { | |
67 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s - Set by %s, on %s (%Tu)", | |
68 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, | |
69 | + ":[%d] - %s - Set by %s, on %s [%Tu]", | |
70 | ++bans, ban->banstr, ban->who, myctime(ban->when), ban->when); | |
71 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
72 | } | |
73 | ||
74 | if (bans == 0) | |
75 | - send_reply(sptr, RPL_DATASTR, "<none>"); | |
76 | + send_reply(sptr, RPL_DATASTR, ":<none>"); | |
77 | } | |
78 | ||
79 | send_reply(sptr, RPL_ENDOFCHECK, " "); | |
80 | } | |
81 | ||
82 | void checkChannel(struct Client *sptr, struct Channel *chptr) { | |
83 | - char outbuf[TOPICLEN + MODEBUFLEN + 64], modebuf[MODEBUFLEN], parabuf[MODEBUFLEN]; | |
84 | + char modebuf[MODEBUFLEN], parabuf[MODEBUFLEN]; | |
85 | ||
86 | /* Header */ | |
87 | - send_reply(sptr, RPL_DATASTR, " "); | |
88 | + send_reply(sptr, RPL_DATASTR, ": "); | |
89 | send_reply(sptr, RPL_CHKHEAD, "channel", chptr->chname); | |
90 | - send_reply(sptr, RPL_DATASTR, " "); | |
91 | + send_reply(sptr, RPL_DATASTR, ": "); | |
92 | ||
93 | /* Creation Time */ | |
94 | - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Creation time:: %s (%Tu)", myctime(chptr->creationtime), chptr->creationtime); | |
95 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
96 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Creation time:: %s [%Tu]", | |
97 | + myctime(chptr->creationtime), chptr->creationtime); | |
98 | ||
99 | /* Topic */ | |
100 | if (strlen(chptr->topic) <= 0) | |
101 | - send_reply(sptr, RPL_DATASTR, " Topic:: <none>"); | |
102 | + send_reply(sptr, RPL_DATASTR, ": Topic:: <none>"); | |
103 | else { | |
104 | - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Topic:: %s", chptr->topic); | |
105 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
106 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Topic:: %s", chptr->topic); | |
107 | ||
108 | /* ..set by */ | |
109 | - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set by:: %s", chptr->topic_nick); | |
110 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
111 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Set by:: %s", chptr->topic_nick); | |
112 | ||
113 | - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set at:: %s (%Tu)", myctime(chptr->topic_time), chptr->topic_time); | |
114 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
115 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Set at:: %s [%Tu]", myctime(chptr->topic_time), chptr->topic_time); | |
116 | } | |
117 | ||
118 | /* Channel Modes */ | |
119 | - | |
120 | - strcpy(outbuf, "Channel mode(s):: "); | |
121 | - | |
122 | - modebuf[0] = '\0'; | |
123 | - parabuf[0] = '\0'; | |
124 | - | |
125 | - channel_modes(sptr, modebuf, parabuf, sizeof(modebuf), chptr, NULL); | |
126 | - | |
127 | - if(modebuf[1] == '\0') | |
128 | - strcat(outbuf, "<none>"); | |
129 | - else if(*parabuf) { | |
130 | - strcat(outbuf, modebuf); | |
131 | - strcat(outbuf, " "); | |
132 | - strcat(outbuf, parabuf); | |
133 | - } | |
134 | - else | |
135 | - strcat(outbuf, modebuf); | |
136 | - | |
137 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
138 | + *modebuf = '\0'; | |
139 | + *parabuf = '\0'; | |
140 | + modebuf[1] = '\0'; | |
141 | + channel_modes(sptr, modebuf, parabuf, sizeof(parabuf), chptr, NULL); | |
142 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":Channel mode(s):: %s %s", | |
143 | + modebuf ? modebuf : "+", parabuf); | |
144 | ||
145 | /* Don't send 'END OF CHECK' message, it's sent in checkUsers, which is called after this. */ | |
146 | } | |
147 | @@ -415,53 +398,45 @@ | |
148 | struct Channel *chptr; | |
149 | struct Membership *lp; | |
150 | struct irc_sockaddr sin; | |
151 | - char outbuf[BUFSIZE]; | |
152 | char *umodes; | |
153 | time_t nowr; | |
154 | ||
155 | /* Header */ | |
156 | - send_reply(sptr, RPL_DATASTR, " "); | |
157 | + send_reply(sptr, RPL_DATASTR, ": "); | |
158 | send_reply(sptr, RPL_CHKHEAD, "user", cli_name(acptr)); | |
159 | - send_reply(sptr, RPL_DATASTR, " "); | |
160 | + send_reply(sptr, RPL_DATASTR, ": "); | |
161 | ||
162 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Nick:: %s (%s%s)", cli_name(acptr), NumNick(acptr)); | |
163 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
164 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Nick:: %s (%s%s)", cli_name(acptr), NumNick(acptr)); | |
165 | ||
166 | - if (MyUser(acptr)) { | |
167 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Signed on:: %s (%Tu)", myctime(acptr->cli_firsttime), acptr->cli_firsttime); | |
168 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
169 | - } | |
170 | + if (MyUser(acptr)) | |
171 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Signed on:: %s [%Tu]", myctime(acptr->cli_firsttime), acptr->cli_firsttime); | |
172 | ||
173 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Timestamp:: %s (%d)", myctime(acptr->cli_lastnick), acptr->cli_lastnick); | |
174 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
175 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Timestamp:: %s [%d]", myctime(acptr->cli_lastnick), acptr->cli_lastnick); | |
176 | ||
177 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " User/Hostmask:: %s@%s [%s] (Clients: %hu)", cli_user(acptr)->username, cli_user(acptr)->host, | |
178 | - ircd_ntoa(&(cli_ip(acptr))), IPcheck_nr(acptr)); | |
179 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
180 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": User/Hostmask:: %s@%s [%s] (Clients: %hu)", | |
181 | + cli_user(acptr)->username, cli_user(acptr)->host, ircd_ntoa(&(cli_ip(acptr))), IPcheck_nr(acptr)); | |
182 | ||
183 | - if (IsSetHost(acptr) || HasHiddenHost(acptr)) { | |
184 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Real User/Host:: %s@%s", cli_user(acptr)->realusername, cli_user(acptr)->realhost); | |
185 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
186 | - } | |
187 | + if (IsSetHost(acptr) || HasHiddenHost(acptr)) | |
188 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real User/Host:: %s@%s", cli_user(acptr)->realusername, cli_user(acptr)->realhost); | |
189 | ||
190 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Real Name:: %s%c", cli_info(acptr), COLOR_OFF); | |
191 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
192 | + /* COLOR_OFF ? */ | |
193 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real Name:: %s", cli_info(acptr)); | |
194 | ||
195 | if( IsService(cli_user(acptr)->server)) { | |
196 | if (IsChannelService(acptr)) | |
197 | - send_reply(sptr, RPL_DATASTR, " Status:: Network Service"); | |
198 | + send_reply(sptr, RPL_DATASTR, ": Status:: Network Service"); | |
199 | else if (IsAnOper(acptr)) | |
200 | - send_reply(sptr, RPL_DATASTR, " Status:: IRC Operator (service) (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>"); | |
201 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Status:: IRC Operator (service) (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>"); | |
202 | else | |
203 | - send_reply(sptr, RPL_DATASTR, " Status:: Client (service)"); | |
204 | - } else if (IsAnOper(acptr)) { | |
205 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Status:: IRC Operator (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>"); | |
206 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
207 | - } else | |
208 | - send_reply(sptr, RPL_DATASTR, " Status:: Client"); | |
209 | + send_reply(sptr, RPL_DATASTR, ": Status:: Client (service)"); | |
210 | + } else if (IsAnOper(acptr)) | |
211 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Status:: IRC Operator (ID: %s)", | |
212 | + cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>"); | |
213 | + else | |
214 | + /* this really needed ? */ | |
215 | + send_reply(sptr, RPL_DATASTR, ": Status:: Client"); | |
216 | ||
217 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Connected to:: %s (Hops: %d)", cli_name(cli_user(acptr)->server), cli_hopcount(acptr)); | |
218 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
219 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Connected to:: %s (Hops: %d)", cli_name(cli_user(acptr)->server), cli_hopcount(acptr)); | |
220 | ||
221 | /* +s (SERV_NOTICE) is not relayed to us from remote servers, | |
222 | * so we cannot tell if a remote client has that mode set. | |
223 | @@ -471,11 +446,10 @@ | |
224 | ||
225 | /* show the usermodes and account info (but not OperID and sethost) */ | |
226 | umodes = umode_str(acptr, UMODE_AND_ACCOUNT); | |
227 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Usermode(s):: %s%s", *umodes ? "+" : "<none>", umodes); | |
228 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
229 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Usermode(s):: +%s", umodes); | |
230 | ||
231 | if (cli_user(acptr)->joined == 0) | |
232 | - send_reply(sptr, RPL_DATASTR, " Channel(s):: <none>"); | |
233 | + send_reply(sptr, RPL_DATASTR, ": Channel(s):: <none>"); | |
234 | else if (cli_user(acptr)->joined > 50) { | |
235 | ||
236 | /* NB. As a sanity check, we DO NOT show the individual channels the | |
237 | @@ -485,22 +459,21 @@ | |
238 | * they are on *that* many). | |
239 | */ | |
240 | ||
241 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Channel(s):: - (total: %u)", cli_user(acptr)->joined); | |
242 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
243 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Channel(s):: - (total: %u)", cli_user(acptr)->joined); | |
244 | } | |
245 | else { | |
246 | char chntext[BUFSIZE]; | |
247 | - int len = strlen(" Channel(s):: "); | |
248 | + int len = strlen(": Channel(s):: "); | |
249 | int mlen = strlen(me.cli_name) + len + strlen(cli_name(sptr)); | |
250 | *chntext = '\0'; | |
251 | ||
252 | - strcpy(chntext, " Channel(s):: "); | |
253 | + strcpy(chntext, ": Channel(s):: "); | |
254 | for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) { | |
255 | chptr = lp->channel; | |
256 | if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) { | |
257 | send_reply(sptr, RPL_DATASTR, chntext); | |
258 | *chntext = '\0'; | |
259 | - strcpy(chntext, " Channel(s):: "); | |
260 | + strcpy(chntext, ": Channel(s):: "); | |
261 | len = strlen(chntext); | |
262 | } | |
263 | if (IsDeaf(acptr)) | |
264 | @@ -530,39 +503,31 @@ | |
265 | ||
266 | if (MyUser(acptr)) { | |
267 | nowr = CurrentTime - cli_user(acptr)->last; | |
268 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Idle for:: %d days, %02ld:%02ld:%02ld", | |
269 | - nowr / 86400, (nowr / 3600) % 24, (nowr / 60) % 60, nowr % 60); | |
270 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
271 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Idle for:: %d days, %02ld:%02ld:%02ld", | |
272 | + nowr / 86400, (nowr / 3600) % 24, (nowr / 60) % 60, nowr % 60); | |
273 | } | |
274 | ||
275 | /* Away message (if applicable) */ | |
276 | - if (cli_user(acptr)->away) { | |
277 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Away message:: %s", cli_user(acptr)->away); | |
278 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
279 | - } | |
280 | + if (cli_user(acptr)->away) | |
281 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Away message:: %s", cli_user(acptr)->away); | |
282 | ||
283 | /* If local user.. */ | |
284 | if (MyUser(acptr)) { | |
285 | os_get_peername(con_fd(cli_connect(sptr)), &sin); | |
286 | ||
287 | - send_reply(sptr, RPL_DATASTR, " "); | |
288 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Ports:: %d -> %d (client -> server)", | |
289 | - sin.port, cli_listener(acptr)->addr.port); | |
290 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
291 | + send_reply(sptr, RPL_DATASTR, ": "); | |
292 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Ports:: %d -> %d (client -> server)", | |
293 | + sin.port, cli_listener(acptr)->addr.port); | |
294 | if (feature_bool(FEAT_EXTENDED_CHECKCMD)) { | |
295 | /* Note: sendq = receiveq for a client (it makes sense really) */ | |
296 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Data sent:: %lu.%0.3u Kb (%u protocol messages)", | |
297 | - (unsigned long)cli_receiveB(acptr) / 1024, (unsigned long)cli_receiveB(acptr) % 1024, cli_receiveM(acptr)); | |
298 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
299 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Data received:: %lu.%0.3lu Kb (%u protocol messages)", | |
300 | - (unsigned long)cli_sendB(acptr) / 1024, (unsigned long)cli_sendB(acptr) % 1024, cli_sendM(acptr)); | |
301 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
302 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " receiveQ size:: %d bytes (max. %d bytes)", | |
303 | - DBufLength(&(cli_recvQ(acptr))), feature_int(FEAT_CLIENT_FLOOD)); | |
304 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
305 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " sendQ size:: %d bytes (max. %d bytes)", | |
306 | - DBufLength(&(cli_sendQ(acptr))), get_sendq(acptr)); | |
307 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
308 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Data sent:: %lu.%0.3u Kb (%u protocol messages)", | |
309 | + (unsigned long)cli_receiveB(acptr) / 1024, (unsigned long)cli_receiveB(acptr) % 1024, cli_receiveM(acptr)); | |
310 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Data received:: %lu.%0.3lu Kb (%u protocol messages)", | |
311 | + (unsigned long)cli_sendB(acptr) / 1024, (unsigned long)cli_sendB(acptr) % 1024, cli_sendM(acptr)); | |
312 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": receiveQ size:: %d bytes (max. %d bytes)", | |
313 | + DBufLength(&(cli_recvQ(acptr))), feature_int(FEAT_CLIENT_FLOOD)); | |
314 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": sendQ size:: %d bytes (max. %d bytes)", | |
315 | + DBufLength(&(cli_sendQ(acptr))), get_sendq(acptr)); | |
316 | } | |
317 | } | |
318 | ||
319 | @@ -571,50 +536,50 @@ | |
320 | } | |
321 | ||
322 | void checkServer(struct Client *sptr, struct Client *acptr) { | |
323 | - char outbuf[BUFSIZE]; | |
324 | ||
325 | /* Header */ | |
326 | - send_reply(sptr, RPL_DATASTR, " "); | |
327 | + send_reply(sptr, RPL_DATASTR, ": "); | |
328 | send_reply(sptr, RPL_CHKHEAD, "server", acptr->cli_name); | |
329 | - send_reply(sptr, RPL_DATASTR, " "); | |
330 | + send_reply(sptr, RPL_DATASTR, ": "); | |
331 | ||
332 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Connected at:: %s (%Tu)", myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp); | |
333 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
334 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Connected at:: %s [%Tu]", | |
335 | + myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp); | |
336 | ||
337 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Server name:: %s", acptr->cli_name); | |
338 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
339 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Server name:: %s", acptr->cli_name); | |
340 | ||
341 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Numeric:: %s --> %d", NumServ(acptr), base64toint(acptr->cli_yxx)); | |
342 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
343 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Numeric:: %s --> %d", | |
344 | + NumServ(acptr), base64toint(acptr->cli_yxx)); | |
345 | ||
346 | - ircd_snprintf(0, outbuf, sizeof(outbuf), " Users:: %d / %d", (acptr == &me) ? UserStats.local_clients : cli_serv(acptr)->clients, | |
347 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Users:: %d / %d", | |
348 | + (acptr == &me) ? UserStats.local_clients : cli_serv(acptr)->clients, | |
349 | base64toint(cli_serv(acptr)->nn_capacity)); | |
350 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
351 | ||
352 | if (IsBurst(acptr)) | |
353 | - send_reply(sptr, RPL_DATASTR, " Status:: Bursting"); | |
354 | + send_reply(sptr, RPL_DATASTR, ": Status:: Bursting"); | |
355 | else if (IsBurstAck(acptr)) | |
356 | - send_reply(sptr, RPL_DATASTR, " Status:: Awaiting EOB Ack"); | |
357 | + send_reply(sptr, RPL_DATASTR, ": Status:: Awaiting EOB Ack"); | |
358 | else if (IsService(acptr)) | |
359 | - send_reply(sptr, RPL_DATASTR, " Status:: Network Service"); | |
360 | + send_reply(sptr, RPL_DATASTR, ": Status:: Network Service"); | |
361 | else if (IsHub(acptr)) | |
362 | - send_reply(sptr, RPL_DATASTR, " Status:: Network Hub"); | |
363 | + send_reply(sptr, RPL_DATASTR, ": Status:: Network Hub"); | |
364 | ||
365 | if (feature_bool(FEAT_EXTENDED_CHECKCMD)) { | |
366 | int dlinkc = 0; | |
367 | struct DLink* slink = NULL; | |
368 | ||
369 | - send_reply(sptr, RPL_DATASTR, " "); | |
370 | - send_reply(sptr, RPL_DATASTR, "Downlinks::"); | |
371 | - for (slink = cli_serv(acptr)->down; slink; slink = slink->next) { | |
372 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s%s", ++dlinkc, | |
373 | - IsBurst(slink->value.cptr) ? "*" : IsBurstAck(slink->value.cptr) ? "!" : IsService(slink->value.cptr) ? "=" : IsHub(slink->value.cptr) ? "+" : " ", | |
374 | - cli_name(slink->value.cptr)); | |
375 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
376 | - } | |
377 | + send_reply(sptr, RPL_DATASTR, ": "); | |
378 | + send_reply(sptr, RPL_DATASTR, ":Downlinks::"); | |
379 | + for (slink = cli_serv(acptr)->down; slink; slink = slink->next) | |
380 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":[%d] - %s%s", | |
381 | + ++dlinkc, | |
382 | + IsBurst(slink->value.cptr) ? "*" : | |
383 | + (IsBurstAck(slink->value.cptr) ? "!" : | |
384 | + (IsService(slink->value.cptr) ? "=" : | |
385 | + (IsHub(slink->value.cptr) ? "+" : " "))), | |
386 | + cli_name(slink->value.cptr)); | |
387 | ||
388 | if (!dlinkc) | |
389 | - send_reply(sptr, RPL_DATASTR, "<none>"); | |
390 | + send_reply(sptr, RPL_DATASTR, ":<none>"); | |
391 | } | |
392 | ||
393 | /* Send 'END OF CHECK' message */ | |
394 | @@ -626,7 +591,6 @@ | |
395 | struct Channel *chptr; | |
396 | struct Membership *lp; | |
397 | int count = 0, found = 0; | |
398 | - char outbuf[BUFSIZE]; | |
399 | char targhost[NICKLEN + USERLEN + HOSTLEN + 3], curhost[NICKLEN + USERLEN + HOSTLEN + 3]; | |
400 | char hoststr[NICKLEN + USERLEN + HOSTLEN + 3]; | |
401 | char nickm[NICKLEN + 1], userm[USERLEN + 1], hostm[HOSTLEN + 1]; | |
402 | @@ -686,8 +650,7 @@ | |
403 | break; | |
404 | ||
405 | if(count >= 500) { /* sanity stuff */ | |
406 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "More than %d results, truncating...", count); | |
407 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
408 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":More than %d results, truncating...", count); | |
409 | break; | |
410 | } | |
411 | ||
412 | @@ -718,37 +681,43 @@ | |
413 | /* Show header if we've found at least 1 record */ | |
414 | if (count == 0) { | |
415 | /* Output header */ | |
416 | - send_reply(sptr, RPL_DATASTR, " "); | |
417 | + send_reply(sptr, RPL_DATASTR, ": "); | |
418 | send_reply(sptr, RPL_CHKHEAD, "host", targhost); | |
419 | ||
420 | - send_reply(sptr, RPL_DATASTR, " "); | |
421 | + send_reply(sptr, RPL_DATASTR, ": "); | |
422 | if (flags & CHECK_SHOWMORE) | |
423 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "No. %s nick user@host [IP] (usermodes) :realname", (flags & CHECK_CLONES) ? "[clients]" : ""); | |
424 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":No. %s nick user@host [IP] (usermodes) :realname", | |
425 | + (flags & CHECK_CLONES) ? "[clients]" : ""); | |
426 | else | |
427 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s %-*s%-*s%s", "No.", (NICKLEN + 2), "Nick", | |
428 | - (USERLEN + 2), "User", "Host"); | |
429 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
430 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%s %-*s%-*s%s", "No.", | |
431 | + (NICKLEN + 2), "Nick", (USERLEN + 2), "User", "Host"); | |
432 | } | |
433 | ||
434 | if (flags & CHECK_SHOWMORE) { | |
435 | /* show more information */ | |
436 | umodes = umode_str(acptr, UMODE_AND_ACCOUNT_SHORT); | |
437 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "%-4d ", (count+1)); | |
438 | if (flags & CHECK_CLONES) | |
439 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s[%+3hu] ", outbuf, IPcheck_nr(acptr)); | |
440 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s%s %s@%s [%s] (%s%s) :%s", outbuf, | |
441 | - acptr->cli_name, | |
442 | - cli_user(acptr)->realusername, cli_user(acptr)->realhost, | |
443 | - ircd_ntoa(&(cli_ip(acptr))), | |
444 | - *umodes ? "+" : "<none>", umodes, | |
445 | - (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr)); | |
446 | - } else { | |
447 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d [%+3hu] %s %s@%s [%s] (+%s) :%s", | |
448 | + (count+1), | |
449 | + IPcheck_nr(acptr), | |
450 | + acptr->cli_name, | |
451 | + cli_user(acptr)->realusername, cli_user(acptr)->realhost, | |
452 | + ircd_ntoa(&(cli_ip(acptr))), | |
453 | + umodes, | |
454 | + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr)); | |
455 | + else | |
456 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %s %s@%s [%s] (+%s) :%s", | |
457 | + (count+1), | |
458 | + acptr->cli_name, | |
459 | + cli_user(acptr)->realusername, cli_user(acptr)->realhost, | |
460 | + ircd_ntoa(&(cli_ip(acptr))), | |
461 | + umodes, | |
462 | + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr)); | |
463 | + } else | |
464 | /* default output */ | |
465 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "%-4d %-*s%-*s%s", (count+1), (NICKLEN + 2), | |
466 | - acptr->cli_name, (USERLEN + 2), cli_user(acptr)->realusername, | |
467 | - (flags & CHECK_SHOWIPS) ? ircd_ntoa(&(cli_ip(acptr))) : cli_user(acptr)->realhost); | |
468 | - } | |
469 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
470 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %-*s%-*s%s", | |
471 | + (count+1), (NICKLEN + 2), acptr->cli_name, (USERLEN + 2), cli_user(acptr)->realusername, | |
472 | + (flags & CHECK_SHOWIPS) ? ircd_ntoa(&(cli_ip(acptr))) : cli_user(acptr)->realhost); | |
473 | ||
474 | /* Show channel output (if applicable) - the 50 channel limit sanity check | |
475 | * is specifically to prevent coredumping when someone lamely tries to /check | |
476 | @@ -757,17 +726,17 @@ | |
477 | if (flags & CHECK_CHECKCHAN) { | |
478 | if (cli_user(acptr)->joined > 0 && cli_user(acptr)->joined <= 50) { | |
479 | char chntext[BUFSIZE]; | |
480 | - int len = strlen(" on channels: "); | |
481 | + int len = strlen(": on channels: "); | |
482 | int mlen = strlen(me.cli_name) + len + strlen(sptr->cli_name); | |
483 | *chntext = '\0'; | |
484 | ||
485 | - strcpy(chntext, " on channels: "); | |
486 | + strcpy(chntext, ": on channels: "); | |
487 | for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) { | |
488 | chptr = lp->channel; | |
489 | if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) { | |
490 | send_reply(sptr, RPL_DATASTR, chntext); | |
491 | *chntext = '\0'; | |
492 | - strcpy(chntext, " on channels: "); | |
493 | + strcpy(chntext, ": on channels: "); | |
494 | len = strlen(chntext); | |
495 | } | |
496 | if (IsDeaf(acptr)) | |
497 | @@ -793,7 +762,7 @@ | |
498 | if (chntext[0] != '\0') | |
499 | send_reply(sptr, RPL_DATASTR, chntext); | |
500 | ||
501 | - send_reply(sptr, RPL_DATASTR, " "); | |
502 | + send_reply(sptr, RPL_DATASTR, ": "); | |
503 | } | |
504 | } | |
505 | count++; | |
506 | @@ -801,11 +770,8 @@ | |
507 | } | |
508 | ||
509 | if (count > 0) { | |
510 | - send_reply(sptr, RPL_DATASTR, " "); | |
511 | - | |
512 | - ircd_snprintf(0, outbuf, sizeof(outbuf), "Matching records found:: %d", count); | |
513 | - send_reply(sptr, RPL_DATASTR, outbuf); | |
514 | - | |
515 | + send_reply(sptr, RPL_DATASTR, ": "); | |
516 | + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":Matching records found:: %d", count); | |
517 | send_reply(sptr, RPL_ENDOFCHECK, " "); | |
518 | } | |
519 | ||
520 | diff -r 8ebea3ccdca2 ircd/s_err.c | |
521 | --- a/ircd/s_err.c Sat Jul 20 11:29:55 2013 +0100 | |
522 | +++ b/ircd/s_err.c Sat Jul 20 11:48:52 2013 +0100 | |
523 | @@ -612,7 +612,7 @@ | |
524 | /* 289 */ | |
525 | { 0 }, | |
526 | /* 290 */ | |
527 | - { RPL_DATASTR, ":%s", "290" }, | |
528 | + { RPL_DATASTR, "%s", "290" }, | |
529 | /* 291 */ | |
530 | { RPL_ENDOFCHECK, ":%s", "291" }, | |
531 | /* 292 */ |