+2000-03-30 Perry Lorier <isomer@coders.net>
+ * ircd/ircd.c: Lets see if this helps the ping problem at all.
+ * ircd/whocmds.c, /doc/readme.who: Added %l specifier to get idle
+ time for local clients. (as requested), extended who now returns all
+ the flags (@+!) so you can tell the complete state of a client.
+
2000-03-30 Thomas Helvey <tomh@inxpress.net>
* m_rping.c m_rpong.c: add Gte's rping/rpong fixes
#
# ChangeLog for ircu2.10.11
#
-# $Id: ChangeLog,v 1.58 2000-04-01 22:53:49 bleep Exp $
+# $Id: ChangeLog,v 1.59 2000-04-01 23:51:18 isomer Exp $
#
# Insert new changes at beginning of the change list.
#
f : Include flags (all of them)
h : Include hostname
i : Include IP
+ l : Include idle time (0 for remote users) [2.10.11+]
n : Include nick
r : Include real name
s : Include server name
:"source" 354 "target" ["querytype"] ["channel"] ["user"]
["IP"] ["host"] ["server"] ["nick"]
- ["flags"] ["hops"] [:"realname"]
+ ["flags"] ["hops"] ["idle"] [:"realname"]
Where only the fields specified in the %fields options are present.
Oslo-R.NO.EU.Undernet.org Niels
So that he can have in example a script that does
- "on 354 * 166" display "There is an oper ..."
+ on ^354 "% 166" display "There is an oper ..."
- The client will have to sort/format the fields by itself,
the _order_ in which flags are passed is not significant, the fields in the
recomended way for GUI based clients to get a channel's userlist and all
the infos they want about users on the channel.
+- If you use the new numeric, flags will contain all the information about
+ a user on a channel. @ for op'd, + for voiced, and ! for zombie. eg:
+ Isomer #coder-com H@+, where the old behavor of just displaying one of
+ them has been preserved for the old numeric. [2.10.11+]
+
Regards, Andrea aka Nemesi
#define WHO_FIELD_FLA 128
#define WHO_FIELD_DIS 256
#define WHO_FIELD_REN 512
+#define WHO_FIELD_IDL 1024
#define WHO_FIELD_DEF ( WHO_FIELD_NIC | WHO_FIELD_UID | WHO_FIELD_HOS | WHO_FIELD_SER )
*/
max_ping = IsRegistered(cptr) ? get_client_ping(cptr) : CONNECTTIMEOUT;
+ Debug((DEBUG_DEBUG, "check_pings(%s)=status:%s limit: %d current: %d",
+ cptr->name, (cptr->flags & FLAGS_PINGSENT) ? "[Ping Sent]" : "[]",
+ max_ping, (int)(CurrentTime - cptr->lasttime)));
+
/* Ok, the thing that will happen most frequently, is that someone will
* have sent something recently. Cover this first for speed.
*/
if (CurrentTime-cptr->lasttime < max_ping) {
expire=cptr->lasttime + max_ping;
- if (next_check<expire)
+ if (expire<next_check)
next_check=expire;
continue;
}
} /* of testing to see if ping has been sent */
/* Unregistered clients pingout after max_ping seconds, they don't
- * get given a second chance.
+ * get given a second chance - if they were then people could not quite
+ * finish registration and hold resources without being subject to k/g
+ * lines
*/
if (!IsRegistered(cptr)) {
/* Display message if they have sent a NICK and a USER but no
assert(next_check>=CurrentTime);
+ Debug((DEBUG_DEBUG, "[%i] check_pings() again in %is",CurrentTime,next_check-CurrentTime));
+
return next_check;
}
static void print_usage(void)
{
printf("Usage: ircd [-f config] [-h servername] [-x loglevel] [-ntv]\n");
+ printf("\n -n -t\t Don't detach\n -v\t display version\n\n");
printf("Server not started\n");
}
case 'I':
fields |= WHO_FIELD_NIP;
break;
+ case 'l':
+ case 'L':
+ fields |= WHO_FIELD_IDL;
case 'n':
case 'N':
fields |= WHO_FIELD_NIC;
*(p1++) = 'H';
if (IsAnOper(acptr))
*(p1++) = '*';
- if (chptr && is_chan_op(acptr, chptr))
- *(p1++) = '@';
- else if (chptr && has_voice(acptr, chptr))
- *(p1++) = '+';
- else if (chptr && is_zombie(acptr, chptr))
- *(p1++) = '!';
+ if (fields) {
+ /* If you specified flags then we assume you know how to parse
+ * multiple channel status flags, as this is currently the only
+ * way to know if someone has @'s *and* is +'d.
+ */
+ if (chptr && is_chan_op(acptr, chptr))
+ *(p1++) = '@';
+ if (chptr && has_voice(acptr, chptr))
+ *(p1++) = '+';
+ if (chptr && is_zombie(acptr, chptr))
+ *(p1++) = '!';
+ }
+ else {
+ if (chptr && is_chan_op(acptr, chptr))
+ *(p1++) = '@';
+ else if (chptr && has_voice(acptr, chptr))
+ *(p1++) = '+';
+ else if (chptr && is_zombie(acptr, chptr))
+ *(p1++) = '!';
+ }
if (IsDeaf(acptr))
*(p1++) = 'd';
if (IsAnOper(sptr))
p1 = sprintf_irc(p1, "%d", acptr->hopcount);
}
+ if (!fields || (fields & WHO_FIELD_IDL))
+ {
+ *p1++ = ' ';
+ if (!fields)
+ *p1++ = ':'; /* Place colon here for default reply */
+ if (MyUser(acptr)) {
+ p1 = sprintf_irc(p1, "%d", CurrentTime-acptr->lasttime);
+ }
+ else {
+ *p1++ = '0';
+ }
+ }
+
if (!fields || (fields & WHO_FIELD_REN))
{
char *p2 = acptr->info;