* option negotiation code for setting client-side line-editing mode
* to it. If it gets a reply, a flag in the descriptor struct is
* turned on indicated telnet-awareness.
- *
+ *
* If the reply indicates that the client supports linemode, further
* instructions as to what linemode options are to be used is sent.
* Those options: Client-side line editing, and expanding literal
* client-side-entered tabs into spaces.
- *
+ *
* Option negotation requests sent by the client are processed,
* with the only one we confirm rather than refuse outright being
* suppress-go-ahead, since a number of telnet clients try it.
static const char *shutdown_message = "Going down - Bye";
#ifndef COMPILE_CONSOLE
#ifdef HAS_OPENSSL
-static const char *ssl_shutdown_message =
+static const char *ssl_shutdown_message =
"GAME: SSL connections must be dropped, sorry.";
#endif
#endif
install_sig_handler(SIGINT, signal_shutdown);
install_sig_handler(SIGTERM, bailout);
#else
- /* Win32 stuff:
+ /* Win32 stuff:
* No support for SIGUSR2 or SIGINT.
* SIGTERM is never generated on NT-based Windows (according to MSDN)
* MSVC++ will let you get away with installing a handler anyway,
d->unidle_times++;
}
snprintf(tbuf1, BUFFER_LEN-1, "%ld %ld %d %d", (mudtime - d->connected_at),
- d->idle_total, d->unidle_times, d->cmds);
+ d->idle_total, d->unidle_times, d->cmds);
tbuf1[strlen(tbuf1)+1] = '\0';
(void) atr_add(d->player, "LASTACTIVITY", tbuf1, GOD, NOTHING);
announce_disconnect(d->player);
d->idle_total += difftime(mudtime, d->last_time);
d->unidle_times++;
}
- snprintf(tbuf1, BUFFER_LEN-1, "%ld %ld %d %d", (mudtime - d->connected_at),
- d->idle_total , d->unidle_times, d->cmds);
+ snprintf(tbuf1, BUFFER_LEN-1, "%ld %ld %d %d", (mudtime - d->connected_at),
+ d->idle_total , d->unidle_times, d->cmds);
tbuf1[strlen(tbuf1)+1] = '\0';
(void) atr_add(d->player, "LASTACTIVITY", tbuf1, GOD, NOTHING);
announce_disconnect(d->player);
}
retval = cdesc->input_handler(cdesc, (char *) t->start);
reset_cpu_timer();
- if(retval == -1 && do_su_exit(cdesc))
+ if(retval == -1 && do_su_exit(cdesc))
retval = 1;
if (retval == 0) {
(d->cmds)++;
- if(difftime(mudtime, d->last_time) >= 300) {
+ if(difftime(mudtime, d->last_time) >= 300) {
d->idle_total += difftime(mudtime, d->last_time);
d->unidle_times++;
}
{
DESC *d;
#ifdef COLOREDWHO
- int tcount = 0;
+ int tcount = 0;
#endif
int count = 0;
time_t now;
if (d->connected) {
if (!GoodObject(d->player))
continue;
- if (COUNT_ALL || (!Hidden(d) || call_by->player == d->player
- || (call_by->player && Priv_Who(call_by->player)))) {
+ if (COUNT_ALL || (!Hidden(d) || call_by->player == d->player ||
+ (call_by->player && Priv_Who(call_by->player)))) {
count++;
#ifdef COLOREDWHO
tcount++;
if (!Hidden(d)
|| call_by->player == d->player ||
(call_by->player && Priv_Who(call_by->player) && (doing))) {
- sprintf(tbuf1, "%-16s %4s %10s %4s%c %s", tprintf("%s%s", Name(d->player), InProg(d->player) ? "(P)" : ""), empabb(d->player),
- time_format_1(now - d->connected_at),
+ sprintf(tbuf1, "%-16s %4s %10s %4s%c %s", tprintf("%s%s", Name(d->player), InProg(d->player) ? "(P)" : ""),
+ empabb(d->player), time_format_1(now - d->connected_at),
time_format_2(now - d->last_time),
- (Dark(d->player) ? 'D' : (Hidden(d) ? 'H' : ' '))
- , d->doing);
+ (Dark(d->player) ? 'D' : (Hidden(d) ? 'H' : ' ')),
+ d->doing);
}
}
if (!Hidden(d) || (call_by->player && Priv_Who(call_by->player))) {
#ifdef COLOREDWHO
if(ShowAnsiColor(call_by->player))
- queue_string(call_by, tprintf("%s%s%s%s%s", ANSI_NORMAL, (tcount % 2 ? "" : ANSI_HILITE),
- (tcount % 2 ? ANSI_CYAN : ANSI_WHITE),
- tbuf1, ANSI_NORMAL));
+ queue_string(call_by, tprintf("%s%s%s%s%s", ANSI_NORMAL, (tcount % 2 ? "" : ANSI_HILITE),
+ (tcount % 2 ? ANSI_CYAN : ANSI_WHITE), tbuf1, ANSI_NORMAL));
- else
+ else
#endif
queue_string(call_by, tbuf1);
queue_newwrite(call_by, (unsigned char *) "\r\n", 2);
if(ShowAnsiColor(call_by->player))
queue_string(call_by, tprintf("%s%s%s%s%s", ANSI_NORMAL,tcount % 2 ? "" : ANSI_HILITE,
tcount % 2 ? ANSI_CYAN : ANSI_WHITE, tbuf1, ANSI_NORMAL));
- else
+ else
#endif
queue_string(call_by, tbuf1);
queue_newwrite(call_by, (unsigned char *) "\r\n", 2);
if(ShowAnsiColor(call_by->player))
queue_string(call_by, tprintf("%s%s%s%s%s", ANSI_NORMAL, (tcount+1) % 2 ? "" : ANSI_HILITE ,
(tcount+1) % 2 ? ANSI_CYAN : ANSI_WHITE, tbuf1, ANSI_NORMAL));
- else
+ else
#endif
queue_string(call_by, tbuf1);
if (SUPPORT_PUEBLO && (call_by->conn_flags & CONN_HTML)) {
/** Match the partial name of a connected player.
* \param match string to match.
- * \return dbref of a unique connected player whose name partial-matches,
+ * \return dbref of a unique connected player whose name partial-matches,
* AMBIGUOUS, or NOTHING.
*/
dbref
/** Match the partial name of a connected player the enactor can see.
* \param player the enactor
* \param match string to match.
- * \return dbref of a unique connected player whose name partial-matches,
+ * \return dbref of a unique connected player whose name partial-matches,
* AMBIGUOUS, or NOTHING.
*/
dbref
if(!Priv_Who(victim))
powered = 0;
} else victim = executor;
-
+
if(xwho) {
if (!is_strict_integer(args[0]) || !is_strict_integer(args[1])) {
safe_str(T(e_int), buff, bp);
safe_number(0, buff, bp);
else
safe_number((match->idle_total / match->unidle_times), buff, bp);
-
} else
safe_str("-1", buff, bp);
}
DESC *match = lookup_desc(executor, args[0]);
if(match) {
- safe_number((difftime(mudtime, match->last_time) >= 300) ?
+ safe_number((difftime(mudtime, match->last_time) >= 300) ?
(match->unidle_times+1) : match->unidle_times, buff, bp);
} else
safe_str("-1", buff, bp);
FUNCTION(fun_ports)
{
/* returns a list of the network descriptors that a player is
- * connected to
+ * connected to
*/
dbref target;
notify(player, T("You now appear on the WHO list."));
}
-/** Perform the periodic check of inactive descriptors, and
+/** Perform the periodic check of inactive descriptors, and
* disconnect them or autohide them as appropriate.
*/
void
idle = atoi(tbuf);
if(idle > 0)
goto after_idle_atr_check;
- }
+ }
idle = INACTIVITY_LIMIT ? INACTIVITY_LIMIT : INT_MAX;
after_idle_atr_check:
if ((d->connected) ? (idle_for > idle ) : (idle_for > unconnected_idle)) {
/* Syntax: @snoop[/list] [!]<descriptor>
- */
+ */
COMMAND(cmd_snoop) {
DESC *d;
int descn, on, n, sn;
char buf[BUFFER_LEN], *bp;
if(SW_ISSET(sw, SWITCH_LIST)) {
- descn = atoi(arg_left);
-
- bp = buf;
+ descn = atoi(arg_left);
+ bp = buf;
+ d = port_desc(descn);
- d = port_desc(descn);
+ if (LEVEL(player) <= 28) {
+ notify(player, MSG_HUH);
+ return;
+ }
+ /* make sure teh desc exists and they're connected (no spying on 'em at the connect screen!) */
+ if(!d || (d && !IsPlayer(d->player))) {
+ notify(player, "There is no one connected on that descriptor.");
+ return;
+ }
- if (LEVEL(player) <= 28) {
- notify(player, MSG_HUH);
- return;
- }
- /* make sure teh desc exists and they're connected (no spying on 'em at the connect screen!) */
- if(!d || (d && !IsPlayer(d->player))) {
- notify(player, "There is no one connected on that descriptor.");
- return;
- }
+ for(sn = 0, n = 0; n < MAX_SNOOPS; n++)
+ if(d->snooper[n] != -1) {
+ memset(snooplist[sn], '\0', BUFFER_LEN);
+ snprintf(snooplist[sn++], BUFFER_LEN-1, "%s", Name(d->snooper[n]));
+ }
- for(sn = 0, n = 0; n < MAX_SNOOPS; n++)
- if(d->snooper[n] != -1) {
- memset(snooplist[sn], '\0', BUFFER_LEN);
- snprintf(snooplist[sn++], BUFFER_LEN-1, "%s", Name(d->snooper[n]));
- }
- *snooplist[sn] = '\0';
-
- for(n = 0; n < sn; n++) {
- if(n != 0)
- safe_str(", ", buf, &bp);
- if(n == (sn-1) && sn > 1)
- safe_str("& ", buf, &bp);
- safe_str(snooplist[n], buf, &bp);
- }
- *bp = '\0';
- notify_format(player, "%s is being snooped on by: %s", Name(d->player), buf);
+ *snooplist[sn] = '\0';
+ for(n = 0; n < sn; n++) {
+ if(n != 0)
+ safe_str(", ", buf, &bp);
+ if(n == (sn-1) && sn > 1)
+ safe_str("& ", buf, &bp);
+ safe_str(snooplist[n], buf, &bp);
+ }
+ *bp = '\0';
+ notify_format(player, "%s is being snooped on by: %s", Name(d->player), buf);
} else {
- if(*arg_left== '!') {
- on = 0;
- descn = atoi(arg_left+1);
- } else {
- descn = atoi(arg_left);
- on = 1;
- }
-
- d = port_desc(descn);
- if (LEVEL(player) <= 28) {
- notify(player, MSG_HUH);
- return;
- }
- /* make sure teh desc exists and they're connected (no spying on 'em at the connect screen!) */
- if(!d || (d && !IsPlayer(d->player))) {
- notify(player, "There is no one connected on that descriptor.");
- return;
- }
-
- if(on) {
- if((d->player == player)) {
- notify(player, "You can't snoop yourself.");
- return;
- }
+ if(*arg_left== '!') {
+ on = 0;
+ descn = atoi(arg_left+1);
+ } else {
+ descn = atoi(arg_left);
+ on = 1;
+ }
- switch(set_snoop(player,d)) {
- case -1: /* Too Many */
- notify(player, "Sorry, can't snoop at this time.");
+ d = port_desc(descn);
+ if (LEVEL(player) <= 28) {
+ notify(player, MSG_HUH);
return;
- case -2: /* Already Snoopin on 'em */
- notify(player, "You can only snoop one person at a time.");
+ }
+ /* make sure the desc exists and they're connected (no spying on 'em at the connect screen!) */
+ if(!d || (d && !IsPlayer(d->player))) {
+ notify(player, "There is no one connected on that descriptor.");
return;
- default:
- notify_format(player, T("Snoop now set on %s(%d)"), Name(d->player), descn);
- }
- } else {
- for(on = n = 0; n < MAX_SNOOPS; n++)
- if(d->snooper[n] == player) {
- d->snooper[n] = -1;
- on = 1;
+ }
+
+ if(on) {
+ if((d->player == player)) {
+ notify(player, "You can't snoop yourself.");
+ return;
+ }
+
+ switch(set_snoop(player,d)) {
+ case -1: /* Too Many */
+ notify(player, "Sorry, can't snoop at this time.");
+ return;
+ case -2: /* Already Snoopin on 'em */
+ notify(player, "You can only snoop one person at a time.");
+ return;
+ default:
+ notify_format(player, T("Snoop now set on %s(%d)"), Name(d->player), descn);
}
+ } else {
+ for(on = n = 0; n < MAX_SNOOPS; n++)
+ if(d->snooper[n] == player) {
+ d->snooper[n] = -1;
+ on = 1;
+ }
notify(player, on ? "Snoop deactivated." : "Snooping Error.");
- }
+ }
}
}
continue;
if(dir == 1) /* player sees */
notify_format((dbref) d->snooper[n], T("%s%s<-%s %s"),
- object_header(d->snooper[n],d->player),
- ANSI_BLUE, ANSI_NORMAL, snstr);
+ object_header(d->snooper[n],d->player),
+ ANSI_BLUE, ANSI_NORMAL, snstr);
else /* player types */
notify_format((dbref) d->snooper[n], T("%s%s->%s %s%s"),
- object_header(d->snooper[n],d->player),
- ANSI_BLUE, ANSI_RED, snstr, ANSI_NORMAL);
+ object_header(d->snooper[n],d->player),
+ ANSI_BLUE, ANSI_RED, snstr, ANSI_NORMAL);
}
}
char is_snooped(DESC *d) {
int n;
- for(n = 0; n < MAX_SNOOPS; n++)
+ for(n = 0; n < MAX_SNOOPS; n++)
if(IsPlayer(d->snooper[n]))
return 1;
return 0;
/* Stage 1. Make sure arg_left exists */
if(arg_left && *arg_left) {
- if(!strcasecmp(cmd->name, "@SD")) {
+ if(!strcasecmp(cmd->name, "@SD")) {
target = match_result(player, arg_left, TYPE_DIVISION, MAT_EVERYTHING);
if(!GoodObject(target) || Typeof(target) != TYPE_DIVISION) {
notify(player, "No such division.");
return;
}
/* get least idle desc */
- DESC_ITER_CONN(d)
- if ((d->player == player) && (!match || (d->last_time > match->last_time)))
+ DESC_ITER_CONN(d)
+ if ((d->player == player) && (!match || (d->last_time > match->last_time)))
match = d;
/* We're only entering using a password at this moment */
#ifdef COMPILE_CONSOLE
}
do_log(LT_WIZ, player, target, "** @SU ATTEMPT **");
/* get least idle desc */
- DESC_ITER_CONN(d)
- if ((d->player == player) && (!match || (d->last_time > match->last_time)))
+ DESC_ITER_CONN(d)
+ if ((d->player == player) && (!match || (d->last_time > match->last_time)))
match = d;
/* Step 2. Find if we can get in without a pass, if
* we need a pass. Throw them into password_handler() internal