void match_here(void) { if (md.confidence >= CON_DBREF) { return; } if ( Good_obj(md.player) && Has_location(md.player)) { dbref loc = Location(md.player); if (Good_obj(loc)) { if (loc == md.absolute_form) { promote_match(loc, CON_DBREF | CON_LOCAL); } else if (!string_compare(md.string, T("here"))) { promote_match(loc, CON_TOKEN | CON_LOCAL); } else if (!string_compare(md.string, PureName(loc))) { promote_match(loc, CON_COMPLETE | CON_LOCAL); } } } }
void match_list(dbref first, int local) { char *namebuf; if (md.confidence >= CON_DBREF) { return; } DOLIST(first, first) { if (first == md.absolute_form) { promote_match(first, CON_DBREF | local); return; } /* * Warning: make sure there are no other calls to Name() in * promote_match or its called subroutines; they * would overwrite Name()'s static buffer which is * needed by string_match(). */ namebuf = (char *) PureName(first); if (!string_compare(namebuf, md.string)) { promote_match(first, CON_COMPLETE | local); } else if (string_match(namebuf, md.string)) { promote_match(first, local); } } }
void match_player(void) { if (md.confidence >= CON_DBREF) { return; } if (Good_obj(md.absolute_form) && isPlayer(md.absolute_form)) { promote_match(md.absolute_form, CON_DBREF); return; } if (*md.string == LOOKUP_TOKEN) { UTF8 *p; for (p = md.string + 1; mux_isspace(*p); p++) { ; // Nothing. } dbref match = lookup_player(NOTHING, p, true); if (Good_obj(match)) { promote_match(match, CON_TOKEN); } } }
void match_me(void) { if (md.confidence >= CON_DBREF) { return; } if (Good_obj(md.absolute_form) && (md.absolute_form == md.player)) { promote_match(md.player, CON_DBREF | CON_LOCAL); return; } if (!string_compare(md.string, "me")) { promote_match(md.player, CON_TOKEN | CON_LOCAL); } return; }
void match_absolute(void) { if (md.confidence >= CON_DBREF) { return; } if (Good_obj(md.absolute_form)) { promote_match(md.absolute_form, CON_DBREF); } }
static bool match_exit_internal(dbref loc, dbref baseloc, int local) { if ( !Good_obj(loc) || !Has_exits(loc)) { return true; } dbref exit; bool result = false; int key; DOLIST(exit, Exits(loc)) { if (exit == md.absolute_form) { key = 0; if (Examinable(md.player, loc)) { key |= VE_LOC_XAM; } if (Dark(loc)) { key |= VE_LOC_DARK; } if (Dark(baseloc)) { key |= VE_BASE_DARK; } if (exit_visible(exit, md.player, key)) { promote_match(exit, CON_DBREF | local); return true; } } if (matches_exit_from_list(md.string, PureName(exit))) { promote_match(exit, CON_COMPLETE | local); result = true; } } return result; }
void match_home(void) { if (md.confidence >= CON_DBREF) { return; } if (!string_compare(md.string, "home")) { promote_match(HOME, CON_TOKEN); } return; }
void match_player(void) { dbref match; if (md.confidence >= CON_DBREF) { return; } if (Good_obj(md.absolute_form) && isPlayer(md.absolute_form)) { promote_match(md.absolute_form, CON_DBREF); return; } if (*md.string == LOOKUP_TOKEN) { match = lookup_player(NOTHING, md.string, 1); if (Good_obj(match)) { promote_match(match, CON_TOKEN); } } }
static void match_numeric(void) { if (md.confidence >= CON_DBREF) { return; } dbref match = absolute_name(false); if (Good_obj(match)) { promote_match(match, CON_DBREF); } }