See also: CLIENTS, ATTRIBUTES, WILDCARDS, MUSHCODE
& @describe
+& @desc
@describe <object> [=<description>]
This command sets the description of the object, which will be seen
a - Audible b - Debug c - Connected
d - Destroy_Ok e - Enter_Ok g - Gagged
h - Halt i - Orphan j - Jury_Ok
- l - Light m - Myopic, Mistrust n - No_Command
- o - On-Vacation p - Puppet, Paranoid s - Suspect
- t - Transparent u - Uninspected v - Verbose
- w - No_Warn x - Terse, Cloudy ? - Unregistered
- ^ - Listen_Parent ~ - Noaccents " - NoSpoof
+ k - Keepalive l - Light m - Myopic, Mistrust
+ n - No_Command o - On-Vacation p - Puppet, Paranoid
+ r - Royalty s - Suspect t - Transparent
+ u - Uninspected v - Verbose w - No_Warn
+ x - Terse, Cloudy ? - Unregistered ^ - Listen_Parent
+ ~ - Noaccents " - NoSpoof
Additional Flags:
Auth_Parent WeirdPrompts
eval(<object>, <attribute>)
get_eval(<object>/<attribute>)
- Eval() works the same way as xget(), except that it performs %-substitutions
- and function evaluation on the attribute before returning the value. eval()
- does not modify the stack (%0-%9), so the attribute being evaled sees the
- same values for them that the calling code does. Unless you need this behavior,
- it is better to use u() instead, which hides the caller's stack.
+ Eval() works the same way as xget(), except that it performs
+ %-substitutions and function evaluation on the attribute before
+ returning the value. eval() changes the enactor (%#) to the object
+ executing the eval (%!). It does not modify the stack (%0-%9), so
+ the attribute being evaled sees the same values for them that the
+ calling code does. Unless you need this behavior, it is better to
+ use u() instead, which hides the caller's stack.
Example:
&TEST me=%B%B%B-[name(me)]
object is @created (or @dug, or @opened, or @pcreated, etc.), it
will have this dbref.
-& NMWHO()
- nmwho()
-
- This returns a count of all currently connected, non-hidden players.
- It's exactly the same as nwho() used by a mortal, and is suitable
- for use on privileged global objects who need an unprivileged count
- of who's online.
-
-See also: nwho(), mwho(), xmwho()
& NOR()
nor(<boolean>[, ... , <booleanN>])
nvthings(<object>) is identical to words(lvthings(<object>))
See also: ncon(), nexits(), xthings(), lthings(), lvthings()
+& NMWHO()
& NWHO()
nwho()
+ nwho(<viewer>)
+ nmwho()
- This returns a count of all currently-connected players. When
+ nwho() returns a count of all currently-connected players. When
mortals use this function, DARK wizards or royalty are NOT counted.
-See also: lwho(), nmwho(), xwho()
+ nmwho() returns a count of all currently connected, non-hidden players.
+ It's exactly the same as nwho() used by a mortal, and is suitable
+ for use on privileged global objects that always need an unprivileged
+ count of who is online.
+
+ If nwho() is given an argument, and is used by an object that can see
+ DARK and Hidden players, nwho() returns the count of online players
+ based on what <viewer> can see.
+
+See also: lwho(), mwho(), xwho(), xmwho()
& OBJ()
obj(<object>)
* when decompressing, and considerably slower when compressing.
* (But you decompress a lot more often). Compression ratio
* is worse than Huffman for small dbs (<1.5Mb of text), but
- * better for larger dbs. Win32 systems must use this.
+ * better for larger dbs.
* 4 - Raevnos's almost 8-bit clean version of the word-based algorithm.
* Prefer 3 unless you need extended characters. This algorithm
* can encode all characters except 0x06.
/* ARGSUSED */
FUNCTION(fun_nwho) {
DESC *d;
+ dbref victim;
int count = 0;
int powered = (*(called_as + 1) != 'M') && Priv_Who(executor);
+ if (nargs && args[0] && *args[0]) {
+ /* An argument was given. Find the victim and choose the lowest
+ * perms possible */
+ if (!powered) {
+ safe_str(T(e_perm), buff, bp);
+ return;
+ }
+ if ((victim = noisy_match_result(executor, args[0], NOTYPE,
+ MAT_EVERYTHING)) == 0) {
+ safe_str(T(e_notvis), buff, bp);
+ return;
+ }
+ if (!Priv_Who(victim))
+ powered = 0;
+ }
+
DESC_ITER_CONN(d) {
- if (!Hidden(d) || (powered && CanSee(executor, d->player)))
+ if (!Hidden(d) || powered) {
count++;
- }
+ }
+ }
safe_integer(count, buff, bp);
}
+
/* ARGSUSED */
FUNCTION(fun_lwho)
{
{
/* Return a longer description of message flags */
static char tbuf1[BUFFER_LEN];
+ char *tp;
- tbuf1[0] = '\0';
+ tp = tbuf1;
if (Read(mp))
- strcat(tbuf1, T("Read "));
+ safe_str(T("Read "), tbuf1, &tp);
else
- strcat(tbuf1, T("Unread "));
+ safe_str(T("Unread "), tbuf1, &tp);
if (Cleared(mp))
- strcat(tbuf1, T("Cleared "));
+ safe_str(T("Cleared "), tbuf1, &tp);
if (Urgent(mp))
- strcat(tbuf1, T("Urgent "));
+ safe_str(T("Urgent "), tbuf1, &tp);
if (Mass(mp))
- strcat(tbuf1, T("Mass "));
+ safe_str(T("Mass "), tbuf1, &tp);
if (Forward(mp))
- strcat(tbuf1, T("Fwd "));
+ safe_str(T("Fwd "), tbuf1, &tp);
if (Tagged(mp))
- strcat(tbuf1, T("Tagged"));
+ safe_str(T("Tagged"), tbuf1, &tp);
+ *tp = '\0';
return tbuf1;
}
return;
/* Handle this now so it doesn't clutter code */
- tbuf1[0] = '\0';
+ j = 0;
if (flags & M_URGENT)
- strcat(tbuf1, "U");
+ tbuf1[j++] = 'U';
if (flags & M_FORWARD)
- strcat(tbuf1, "F");
+ tbuf1[j++] = 'F';
if (flags & M_REPLY)
- strcat(tbuf1, "R");
+ tbuf1[j++] = 'R';
+ tbuf1[j] = '\0';
- arg = (char *) mush_malloc(BUFFER_LEN, "string");
- arg2 = (char *) mush_malloc(BUFFER_LEN, "string");
- arg3 = (char *) mush_malloc(BUFFER_LEN, "string");
- arg4 = (char *) mush_malloc(BUFFER_LEN, "string");
+ arg = mush_malloc(BUFFER_LEN, "string");
+ arg2 = mush_malloc(BUFFER_LEN, "string");
+ arg3 = mush_malloc(BUFFER_LEN, "string");
+ arg4 = mush_malloc(BUFFER_LEN, "string");
if (!arg4)
mush_panic("Unable to allocate memory in mailfilter");
save_global_regs("filter_mail", rsave);
process_expression(buff, &bp, &ap, player, player, player,
PE_DEFAULT, PT_DEFAULT, NULL);
*bp = '\0';
- free((Malloc_t) asave);
+ free(asave);
if (*buff) {
sprintf(buf, "0:%d", mailnumber);
do_mail_file(player, buf, buff);
}
- mush_free((Malloc_t) arg, "string");
- mush_free((Malloc_t) arg2, "string");
- mush_free((Malloc_t) arg3, "string");
- mush_free((Malloc_t) arg4, "string");
+ mush_free(arg, "string");
+ mush_free(arg2, "string");
+ mush_free(arg3, "string");
+ mush_free(arg4, "string");
restore_global_env("filter_mail", wsave);
restore_global_regs("filter_mail", rsave);
}
{"NSPEMIT", fun_pemit, 2, -2, FN_REG},
{"NSREMIT", fun_remit, 2, -2, FN_REG},
{"NSZEMIT", fun_zemit, 2, -2, FN_REG},
- {"NWHO", fun_nwho, 0, 0, FN_REG},
+ {"NWHO", fun_nwho, 0, 1, FN_REG},
{"NMWHO", fun_nwho, 0, 0, FN_REG},
{"NUM", fun_num, 1, 1, FN_REG},
{"NULL", fun_null, 1, INT_MAX, FN_REG},
for (i = 0; i < nptrs; i++) {
/* Build our %0 args */
wenv[0] = (char *) ptrs[i];
- call_ufun(&ufun, wenv, 2, result, executor, enactor, pe_info);
+ call_ufun(&ufun, wenv, 1, result, executor, enactor, pe_info);
keys[i] = mush_strdup(result, "sortkey");
}
/* The dump failed. Disk might be full or something went bad with the
compression slave. Boo! */
do_rawlog(LT_ERR, T("ERROR! Database save failed."));
+ if(f)
+ db_close(f);
#ifndef PROFILING
#ifdef HAS_ITIMER
install_sig_handler(SIGPROF, signal_cpu_limit);
epoch++;
do_rawlog(LT_ERR, "DUMPING: %s.#%d#", globals.dumpfile, epoch);
- dump_database_internal();
- do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)", globals.dumpfile, epoch);
+ if (!dump_database_internal())
+ do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)", globals.dumpfile, epoch);
}
/** Dump a database, possibly by forking the process.
_exit(status); /* !!! */
} else {
reserve_fd();
- if (DUMP_NOFORK_COMPLETE && *DUMP_NOFORK_COMPLETE)
+ if (!status && DUMP_NOFORK_COMPLETE && *DUMP_NOFORK_COMPLETE)
flag_broadcast(0, 0, "%s", DUMP_NOFORK_COMPLETE);
}
}
hash_stats_header(dbref player)
{
notify_format(player,
- "Table Buckets Entries LChain ECh 1Ch 2Ch 3Ch 4+Ch AvgCh ~Memory");
+ "Table Buckets Entries LChain ECh 1Ch 2Ch 3Ch 4+Ch AvgCh ~Memory");
}
/** Display stats on a hashtable.
for (n = 0; n < 5; n++)
lengths[n] = 0;
bytes += sizeof(HASHTAB);
- bytes += htab->entry_size * htab->entries;
if (htab->buckets) {
bytes += HASHENT_SIZE * htab->hashsize;
for (n = 0; n < htab->hashsize; n++) {
totchains += lengths[n];
notify_format(player,
- "%-10s %7d %7d %6d %4d %4d %4d %4d %4d %6.3f %7u", hname,
+ "%-11s %7d %7d %6d %4d %4d %4d %4d %4d %6.3f %7u", hname,
htab->hashsize, htab->entries, longest, lengths[0], lengths[1],
lengths[2], lengths[3], lengths[4],
totchains > 0 ? chainlens / totchains : 0.0, bytes);
return;
}
if (!alias || !*alias || !tolist || !*tolist) {
- notify(player, T("MAIL: What alias do you want to create?."));
+ notify(player, T("MAIL: What alias do you want to create?"));
return;
}
if (*alias != MALIAS_TOKEN) {
if (!GoodObject(room))
return NOTHING;
while (!IsRoom(room)) {
+ if (!GoodObject(Location(room)))
+ return room;
room = Location(room);
rec++;
if (rec > 20)
unparse_warnings(warn_type warns)
{
static char tbuf1[BUFFER_LEN];
+ char *tp;
int listsize, indexx;
- tbuf1[0] = '\0';
+ tp = tbuf1;
/* Get the # of elements in checklist */
listsize = sizeof(checklist) / sizeof(tcheck);
/* Which is to say:
* if the bits set on the_flag is a subset of the bits set on warns
*/
- strcat(tbuf1, checklist[indexx].name);
- strcat(tbuf1, " ");
+ safe_str(checklist[indexx].name, tbuf1, &tp);
+ safe_chr(' ', tbuf1, &tp);
/* If we've got a flag which subsumes smaller ones, don't
* list the smaller ones
*/