skylib_fluffos_v3/
skylib_fluffos_v3/bin/
skylib_fluffos_v3/bin/db/
skylib_fluffos_v3/fluffos-2.9-ds2.04/
skylib_fluffos_v3/fluffos-2.9-ds2.04/ChangeLog.old/
skylib_fluffos_v3/fluffos-2.9-ds2.04/Win32/
skylib_fluffos_v3/fluffos-2.9-ds2.04/compat/
skylib_fluffos_v3/fluffos-2.9-ds2.04/compat/simuls/
skylib_fluffos_v3/fluffos-2.9-ds2.04/include/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/clone/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/command/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/data/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/etc/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/include/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/inherit/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/inherit/master/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/log/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/compiler/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/efuns/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/single/tests/operators/
skylib_fluffos_v3/fluffos-2.9-ds2.04/testsuite/u/
skylib_fluffos_v3/fluffos-2.9-ds2.04/tmp/
skylib_fluffos_v3/fluffos-2.9-ds2.04/windows/
skylib_fluffos_v3/mudlib/
skylib_fluffos_v3/mudlib/cmds/
skylib_fluffos_v3/mudlib/cmds/admin/
skylib_fluffos_v3/mudlib/cmds/guild-race/
skylib_fluffos_v3/mudlib/cmds/living/broken/
skylib_fluffos_v3/mudlib/cmds/player/group_cmds/
skylib_fluffos_v3/mudlib/cmds/playtester/
skylib_fluffos_v3/mudlib/d/admin/
skylib_fluffos_v3/mudlib/d/admin/room/
skylib_fluffos_v3/mudlib/d/admin/room/we_care/
skylib_fluffos_v3/mudlib/d/admin/save/
skylib_fluffos_v3/mudlib/d/admin/text/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/buildings/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/map/
skylib_fluffos_v3/mudlib/d/learning/TinyTown/roads/
skylib_fluffos_v3/mudlib/d/learning/chars/
skylib_fluffos_v3/mudlib/d/learning/functions/
skylib_fluffos_v3/mudlib/d/learning/handlers/
skylib_fluffos_v3/mudlib/d/learning/help_topics/
skylib_fluffos_v3/mudlib/d/learning/help_topics/npcs/
skylib_fluffos_v3/mudlib/d/learning/help_topics/objects/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rcs_demo/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rcs_demo/RCS/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/crowd/
skylib_fluffos_v3/mudlib/d/learning/help_topics/rooms/situations/
skylib_fluffos_v3/mudlib/d/learning/save/
skylib_fluffos_v3/mudlib/d/learning/school/
skylib_fluffos_v3/mudlib/d/learning/school/add_sc/
skylib_fluffos_v3/mudlib/d/learning/school/characters/
skylib_fluffos_v3/mudlib/d/learning/school/general/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/basic_commands/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/edtutor/
skylib_fluffos_v3/mudlib/d/learning/school/getting-started/unix_tutor/
skylib_fluffos_v3/mudlib/d/learning/school/items/
skylib_fluffos_v3/mudlib/d/learning/school/npc_school/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/room_basic/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/situations/
skylib_fluffos_v3/mudlib/d/learning/school/room_school/terrain_tutor/
skylib_fluffos_v3/mudlib/d/learning/text/
skylib_fluffos_v3/mudlib/d/liaison/
skylib_fluffos_v3/mudlib/d/mudlib/
skylib_fluffos_v3/mudlib/d/mudlib/changes/
skylib_fluffos_v3/mudlib/d/playtesters/
skylib_fluffos_v3/mudlib/d/playtesters/effects/
skylib_fluffos_v3/mudlib/d/playtesters/handlers/
skylib_fluffos_v3/mudlib/d/playtesters/items/
skylib_fluffos_v3/mudlib/d/sage/
skylib_fluffos_v3/mudlib/doc/
skylib_fluffos_v3/mudlib/doc/creator/
skylib_fluffos_v3/mudlib/doc/driver/
skylib_fluffos_v3/mudlib/doc/driver/efuns/arrays/
skylib_fluffos_v3/mudlib/doc/driver/efuns/buffers/
skylib_fluffos_v3/mudlib/doc/driver/efuns/calls/
skylib_fluffos_v3/mudlib/doc/driver/efuns/compile/
skylib_fluffos_v3/mudlib/doc/driver/efuns/filesystem/
skylib_fluffos_v3/mudlib/doc/driver/efuns/floats/
skylib_fluffos_v3/mudlib/doc/driver/efuns/functions/
skylib_fluffos_v3/mudlib/doc/driver/efuns/general/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mappings/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mixed/
skylib_fluffos_v3/mudlib/doc/driver/efuns/mudlib/
skylib_fluffos_v3/mudlib/doc/driver/efuns/numbers/
skylib_fluffos_v3/mudlib/doc/driver/efuns/parsing/
skylib_fluffos_v3/mudlib/doc/login/
skylib_fluffos_v3/mudlib/doc/lpc/basic_manual/
skylib_fluffos_v3/mudlib/doc/lpc/intermediate/
skylib_fluffos_v3/mudlib/doc/new/add_command/
skylib_fluffos_v3/mudlib/doc/new/events/
skylib_fluffos_v3/mudlib/doc/new/handlers/
skylib_fluffos_v3/mudlib/doc/new/living/race/
skylib_fluffos_v3/mudlib/doc/new/living/spells/
skylib_fluffos_v3/mudlib/doc/new/object/
skylib_fluffos_v3/mudlib/doc/new/player/
skylib_fluffos_v3/mudlib/doc/new/room/guild/
skylib_fluffos_v3/mudlib/doc/new/room/outside/
skylib_fluffos_v3/mudlib/doc/new/room/storeroom/
skylib_fluffos_v3/mudlib/doc/object/
skylib_fluffos_v3/mudlib/doc/playtesters/
skylib_fluffos_v3/mudlib/doc/policy/
skylib_fluffos_v3/mudlib/doc/weapons/
skylib_fluffos_v3/mudlib/global/
skylib_fluffos_v3/mudlib/global/creator/
skylib_fluffos_v3/mudlib/handlers/
skylib_fluffos_v3/mudlib/include/casino/
skylib_fluffos_v3/mudlib/include/cmds/
skylib_fluffos_v3/mudlib/include/effects/
skylib_fluffos_v3/mudlib/include/npc/
skylib_fluffos_v3/mudlib/include/room/
skylib_fluffos_v3/mudlib/include/shops/
skylib_fluffos_v3/mudlib/net/daemon/
skylib_fluffos_v3/mudlib/net/daemon/chars/
skylib_fluffos_v3/mudlib/net/inherit/
skylib_fluffos_v3/mudlib/net/obj/
skylib_fluffos_v3/mudlib/net/obj/BACKUPS/
skylib_fluffos_v3/mudlib/obj/amulets/
skylib_fluffos_v3/mudlib/obj/armours/plate/
skylib_fluffos_v3/mudlib/obj/b_day/
skylib_fluffos_v3/mudlib/obj/clothes/transport/horse/
skylib_fluffos_v3/mudlib/obj/faith/symbols/
skylib_fluffos_v3/mudlib/obj/fungi/
skylib_fluffos_v3/mudlib/obj/gatherables/
skylib_fluffos_v3/mudlib/obj/instruments/
skylib_fluffos_v3/mudlib/obj/media/
skylib_fluffos_v3/mudlib/obj/misc/player_shop/
skylib_fluffos_v3/mudlib/obj/monster/godmother/
skylib_fluffos_v3/mudlib/obj/monster/transport/
skylib_fluffos_v3/mudlib/obj/rings/
skylib_fluffos_v3/mudlib/obj/scabbards/
skylib_fluffos_v3/mudlib/obj/spells/
skylib_fluffos_v3/mudlib/obj/stationery/
skylib_fluffos_v3/mudlib/obj/stationery/envelopes/
skylib_fluffos_v3/mudlib/obj/toys/
skylib_fluffos_v3/mudlib/obj/vessels/
skylib_fluffos_v3/mudlib/obj/weapons/axes/
skylib_fluffos_v3/mudlib/obj/weapons/chains/
skylib_fluffos_v3/mudlib/obj/weapons/maces/BACKUPS/
skylib_fluffos_v3/mudlib/save/autodoc/
skylib_fluffos_v3/mudlib/save/book_handler/
skylib_fluffos_v3/mudlib/save/books/history/calarien/
skylib_fluffos_v3/mudlib/save/mail/
skylib_fluffos_v3/mudlib/save/new_soul/data/
skylib_fluffos_v3/mudlib/save/parcels/
skylib_fluffos_v3/mudlib/save/playerinfo/
skylib_fluffos_v3/mudlib/save/players/d/
skylib_fluffos_v3/mudlib/save/players/s/
skylib_fluffos_v3/mudlib/save/random_names/
skylib_fluffos_v3/mudlib/save/random_names/data/
skylib_fluffos_v3/mudlib/save/terrains/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_desert/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_grassy_field/
skylib_fluffos_v3/mudlib/save/terrains/tutorial_mountain/
skylib_fluffos_v3/mudlib/save/todo_lists/
skylib_fluffos_v3/mudlib/secure/
skylib_fluffos_v3/mudlib/secure/cmds/admin/
skylib_fluffos_v3/mudlib/secure/cmds/lord/
skylib_fluffos_v3/mudlib/secure/config/
skylib_fluffos_v3/mudlib/secure/handlers/autodoc/
skylib_fluffos_v3/mudlib/secure/handlers/intermud/
skylib_fluffos_v3/mudlib/secure/include/global/
skylib_fluffos_v3/mudlib/secure/save/
skylib_fluffos_v3/mudlib/secure/save/handlers/
skylib_fluffos_v3/mudlib/secure/std/
skylib_fluffos_v3/mudlib/secure/std/classes/
skylib_fluffos_v3/mudlib/secure/std/modules/
skylib_fluffos_v3/mudlib/std/creator/
skylib_fluffos_v3/mudlib/std/dom/
skylib_fluffos_v3/mudlib/std/effects/
skylib_fluffos_v3/mudlib/std/effects/external/
skylib_fluffos_v3/mudlib/std/effects/fighting/
skylib_fluffos_v3/mudlib/std/effects/magic/
skylib_fluffos_v3/mudlib/std/effects/magic/BACKUPS/
skylib_fluffos_v3/mudlib/std/effects/other/BACKUPS/
skylib_fluffos_v3/mudlib/std/effects/priest/
skylib_fluffos_v3/mudlib/std/effects/room/
skylib_fluffos_v3/mudlib/std/environ/
skylib_fluffos_v3/mudlib/std/guilds/
skylib_fluffos_v3/mudlib/std/guilds/old/
skylib_fluffos_v3/mudlib/std/languages/
skylib_fluffos_v3/mudlib/std/liquids/
skylib_fluffos_v3/mudlib/std/npc/
skylib_fluffos_v3/mudlib/std/npc/goals/
skylib_fluffos_v3/mudlib/std/npc/goals/basic/
skylib_fluffos_v3/mudlib/std/npc/goals/misc/
skylib_fluffos_v3/mudlib/std/npc/plans/
skylib_fluffos_v3/mudlib/std/npc/plans/basic/
skylib_fluffos_v3/mudlib/std/npc/types/
skylib_fluffos_v3/mudlib/std/npc/types/helper/
skylib_fluffos_v3/mudlib/std/npcs/
skylib_fluffos_v3/mudlib/std/outsides/
skylib_fluffos_v3/mudlib/std/races/shadows/
skylib_fluffos_v3/mudlib/std/room/basic/BACKUPS/
skylib_fluffos_v3/mudlib/std/room/basic/topography/
skylib_fluffos_v3/mudlib/std/room/controller/
skylib_fluffos_v3/mudlib/std/room/inherit/topography/
skylib_fluffos_v3/mudlib/std/room/topography/area/
skylib_fluffos_v3/mudlib/std/room/topography/iroom/
skylib_fluffos_v3/mudlib/std/room/topography/milestone/
skylib_fluffos_v3/mudlib/std/shadows/curses/
skylib_fluffos_v3/mudlib/std/shadows/disease/
skylib_fluffos_v3/mudlib/std/shadows/fighting/
skylib_fluffos_v3/mudlib/std/shadows/healing/
skylib_fluffos_v3/mudlib/std/shadows/magic/
skylib_fluffos_v3/mudlib/std/shadows/poison/
skylib_fluffos_v3/mudlib/std/shadows/room/
skylib_fluffos_v3/mudlib/std/shops/controllers/
skylib_fluffos_v3/mudlib/std/shops/objs/
skylib_fluffos_v3/mudlib/std/shops/player_shop/
skylib_fluffos_v3/mudlib/std/socket/
skylib_fluffos_v3/mudlib/std/soul/d/
skylib_fluffos_v3/mudlib/std/soul/e/
skylib_fluffos_v3/mudlib/std/soul/i/
skylib_fluffos_v3/mudlib/std/soul/j/
skylib_fluffos_v3/mudlib/std/soul/k/
skylib_fluffos_v3/mudlib/std/soul/l/
skylib_fluffos_v3/mudlib/std/soul/n/
skylib_fluffos_v3/mudlib/std/soul/o/
skylib_fluffos_v3/mudlib/std/soul/q/
skylib_fluffos_v3/mudlib/std/soul/r/
skylib_fluffos_v3/mudlib/std/soul/u/
skylib_fluffos_v3/mudlib/std/soul/v/
skylib_fluffos_v3/mudlib/std/soul/y/
skylib_fluffos_v3/mudlib/std/soul/z/
skylib_fluffos_v3/mudlib/std/stationery/
skylib_fluffos_v3/mudlib/w/
skylib_fluffos_v3/mudlib/w/default/
skylib_fluffos_v3/mudlib/w/default/armour/
skylib_fluffos_v3/mudlib/w/default/clothes/
skylib_fluffos_v3/mudlib/w/default/item/
skylib_fluffos_v3/mudlib/w/default/npc/
skylib_fluffos_v3/mudlib/w/default/room/
skylib_fluffos_v3/mudlib/w/default/weapon/
skylib_fluffos_v3/mudlib/www/
skylib_fluffos_v3/mudlib/www/java/
skylib_fluffos_v3/mudlib/www/secure/
skylib_fluffos_v3/mudlib/www/secure/lpc/advanced/
skylib_fluffos_v3/mudlib/www/secure/lpc/intermediate/
skylib_fluffos_v3/win32/
/**
 * This file contains all the file related commands and information
 * for the creators.
 * @author Pinkfish
 */

#include <creator.h>

inherit "/global/creator/wiz_object_comm";
inherit "/global/player";
inherit "/global/creator/wiz_info_comm";
inherit "/global/creator/wiz_inter_comm";

private int invis;
private string *allowed;
private nosave string *dir_list;
private nosave mixed last_location;

private int change_dir(string str);
private int pushd(string str);
private int popd();
private int set_home_dir(string str);
private int visible();
private int invisible(string level);
private int allow(string word);
private int disallow(string word);

protected void create() {
    player::create();
    wiz_object_comm::create();
    allowed = ({ });
} /* create() */

/**
 * This method adds in all the creator commands to the player.  This
 * will be called when the play initialy logs onto the game.
 */
protected void wiz_commands() {
    mixed lvl;

    /* Get the commands from the inherited objects. */
    wiz_object_comm::wiz_commands();
    wiz_info_comm::wiz_commands();
    wiz_inter_comm::wiz_commands();

    /* Setup our local commands. */
    add_command("cd", TO, "<string'directory'>", (: change_dir($4[0]) :) );
    add_command("cd", TO, "", (: change_dir(0) :) );
    add_command("pushd", TO, "<string'directory'>", (: pushd($4[0]) :) );
    add_command("pushd", TO, "", (: pushd(0) :) );
    add_command("popd", TO, "", (: popd() :) );
    add_command("homedir", TO, "<string'directory'>", (: set_home_dir($4[0]) :) );
    add_command("visible", TO, "", (: visible() :) );
    add_command("vis", TO, "", (: visible() :) );

    lvl = ({ });

    if( creatorp(TO) )
        lvl += ({"1"});
    if( lordp(TO) )
        lvl += ({"2"});
    if( adminp(TO) )
        lvl += ({"3"});

    if( sizeof(lvl) > 1 ) {
        lvl = "{"+implode( lvl, "|")+"}";
        add_command("invis", TO, lvl, (: invisible($4[0]) :) );
        add_command("invisible", TO, lvl, (: invisible($4[0]) :) );
    }

    add_command("invis", TO, "", (: invisible("1") :) );
    add_command("invisible", TO, "", (: invisible("1") :) );

    add_command("allow", TO, "<word'name'>", (: allow($4[0]) :) );
    add_command("allow", TO, "", (: allow(0) :) );
    add_command("disallow", TO, "<word'name'>", (: disallow($4[0]) :) );
    add_command("disallow", TO, "all", (: disallow("all") :) );

} /* wiz_commands() */

/**
 * This method returns the current invisibility level of the object.
 * This will return 0 if the object is not invisible, 1 for creator
 * invisible, 2 for lord invisible and 3 for high lord invisible.
 * @return the current invisibility level
 */
nomask int query_invis() { return invis; }

/**
 * This method is used to set invisibility internally.
 */
protected nomask int set_invis( int level ) {
    if( PO != TO && base_name(PO) != LOGIN_OBJ )
        return 0;

    switch( level ) {
      case 3 :
        if( !adminp(TO) )
            return 0;
      break;
      case 2 :
        if( !lordp(TO) )
            return 0;
      break;
      default :
        // Seriously this could never happen. But lets be redundant.
        if( !creatorp(TO) )
            return 0;
    }

    invis = level;

    return invis;

} /* set_invis() */

/**
 * This method returns the current list of people in the allowed array for
 * the creator.
 * @return the current list of allowed people
 */
nomask string *query_allowed() { return copy(allowed); }

/**
 * This method is called by the visible command to make the creator
 * become visible.
 * @return 1 on success
 */
private int visible() {
    if( GetForced() )
        return 0;

    if( !query_invis() )
        return notify_fail("You are already visible.\n");

    if( invis >= 2 ) {
        invis = 0;
        LOGIN_H->player_logon(query_name());
    } else {
        invis = 0;
    }

    write("You appear.\n");
    return 1;

} /* visible() */

/**
 * This method is called by the invisible command to make the creator
 * turn invisible.
 * @return 1 on success, 0 on failure
 */
private int invisible( string word ) {
    int max, type;

    if( GetForced() )
        return 0;

    if( !word ) {
       word = sprintf("%d", query_invis() );
       if( word == "0")
           word = "1";
    }

    max = 1;

    if( lordp(query_name()) )
        max++;

    if( adminp(query_name()) )
        max++;

    if( !sscanf( word, "%d", type ) || type > max || type < 1 ) {
        return notify_fail("Syntax: invisible [1"+( max > 1 ? "|2" : "")+
                          ( max > 2 ? "|3" : "")+"]\n");
    }

    word = ({"creator", "Lord", "Admin"})[type-1];

    if( type == query_invis() )
        return notify_fail("You are already "+ word +" invisible.\n");

    if( type < invis && type < 2 && invis >= 2 ) {
        invis = type;
        LOGIN_H->player_login(query_name());
    } else {
        invis = type;
    }

    write("You become "+word+" invisible.\n");
    return 1;

} /* invisible() */

/**
 * This method adds someone to the current allow list of the creator.
 * People on the allow list can see the creator while they are
 * invisible.
 * @param word the person to add to the allow string
 * @return 1 on success, 0 on failure
 */
private int allow( string word ) {
    if( !word ) {
        if( !sizeof(allowed) ) {
            write("You are not allowing anyone to refer to you.\n");
        } else {
            string *ret = allowed;

            if( member_array("friends", allowed ) != -1 )
                ret += map( query_friends() - allowed, (: $1+" (friend)" :) );

            if( member_array("playtesters", allowed ) != -1 )
                ret += map( PLAYTESTERS_H->query_playtesters() - allowed -
                    query_friends(), (: $1+" (PT)" :) );

            write("You are currently allowing "+query_multiple_short(
                map( sort_array( ret, 1 ), (: CAP( $1 ) :) ) )+" to refer "
                "to you.\n");
        }
        return 1;
    }

    word = lower_case(word);

    if( word != "friends" && word != "playtesters" &&
        !PLAYER_H->test_user(word) )
        return notify_fail("There is no user called "+CAP(word)+".\n");

    if( member_array( word, allowed ) != -1 )
        return notify_fail("You have already allowed "+CAP(word)+" to "
                           "refer to you.\n");

    if( member_array("friends", allowed ) != -1 && TO->query_friend(word) )
        return notify_fail("You have already allowed "+CAP(word)+" to "
                           "refer to you (as a friend).\n");

    if( member_array("friends", allowed ) != -1 && playtesterp(word) )
        return notify_fail("You have already allowed "+CAP(word)+" to "
                           "refer to you (as a playtester).\n");

    allowed += ({ word });

    write( word+" is now allowed to refer to you while invisible.\n");
    return 1;

} /* allow() */

/**
 * This method removes someone from the current allow list of the
 * creator.  People on the allow list can see the creator while they are
 * invisible.
 * @param word the person to remove to the allow string
 * @return 1 on success, 0 on failure
 */
private int disallow( string word ) {
    if( word == "all" ) {
        allowed = ({ });
        write("Your allow list has been cleared.\n");
    } else {
        word = lower_case(word);
        if( member_array( word, allowed ) == -1 ) {
            string him;

            switch( PLAYER_H->test_gender( word ) ) {
              case 1:  him = "him"; break;
              case 2:  him = "her"; break;
              default: him = "it";
            }

            if( member_array("friends", allowed ) != -1 &&
                TO->query_friend(word) )
                return notify_fail( word+" is allowed to refer to you as a "
                    "friend and you cannot disallow "+him+" separately.\n"
                    "Please use 'disallow friends' or remove "+him+" from "
                    "your friends list instead.\n");

            if( member_array("playtesters", allowed ) != -1 &&
                playtesterp(word) )
                return notify_fail( word+" is allowed to refer to you as a "
                    "playtester and you cannot disallow "+him+" separately.\n"
                    "Please use 'disallow playtesters' instead.\n");

            return notify_fail( word+" is already not on your allow list.\n");

        }
        allowed -= ({ word });
        write( word+" is no longer allowed to refer to you.\n");
    }

    return 1;

} /* disallow() */

/**
 * This method returns the current visibility status of this creator
 * in respect to the other object.  This does the allow level checking
 * and all sorts of exciting things.
 * <p>
 * It will return 1 for creator invisible, 2 for lord invisible, 3 for
 * high lord invisible.
 * @param thing the object to test the visibility against
 * @return 0 if not invisible, non-zero if invisible
 */
int query_visible( object thing ) {
    string word;

    if( thing == TO )
        return 1;

    // NOTE: If you change this function, then don't forget to change the
    // reference_allowed simul_efun/efun as well.
    // - Sandoz.
    word = thing->query_name();

    if( ( member_array( word, allowed ) != -1 ) ||
        ( member_array("friends", allowed ) != -1 && query_friend(word) ) ||
        ( member_array("playtesters", allowed ) != -1 && playtesterp(word) ) )
        return ::query_visible(thing);

    switch( query_invis() ) {
      case 3 :
        return adminp(word);
      case 2 :
        return lordp(word);
      case 1 :
        return creatorp(thing);
      default :
        return ::query_visible(thing);
    }

} /* query_visible() */

/**
 * This method is called by the cd command and causes the
 * creator to change their current working directory.
 * @param str the new working directory
 * @return 1 on success, 0 on failure
 */
private int change_dir( string str ) {
    string *filenames;
    object *obs;

    if( GetForced() )
        return 0;

    if( !str ) {
        if( !query_home_dir() )
            return notify_fail("You have no home directory.  "
                "Use 'homedir' to set it.\n");
        str = query_home_dir();
    }

    switch( sizeof( filenames = get_files(str) ) ) {
      case 0:
        switch( sizeof( obs = WIZ_PRESENT->wiz_present( str, TO ) ) ) {
          case 0:
            return notify_fail("No such directory.\n");
          case 1:
            filenames = map( obs, (: sprintf("/%s",
                implode( explode( file_name($1), "/")[0..<2], "/") ) :) );
          break;
          default:
            return notify_fail("Ambiguous directory.\n");
        }
      break;
      case 1:
      break;
      default:
        return notify_fail("Ambiguous directory.\n");
    }

    if( !dir_exists( str = filenames[0] ) )
        printf("cd: %s: Not a directory.\n", str );
    else
        set_current_path(str);

    printf("%s\n", query_current_path() );
    return 1;

} /* change_dir() */

/**
 * This method is called by the pushd command.
 * @return 1 on success, 0 on failure
 * @param str the new working directory
 */
private int pushd( string str ) {
    if( !dir_list )
        dir_list = ({ });

    dir_list += ({ query_current_path() });

    return change_dir(str);

} /* pushd() */

/**
 * This method is called by the popd command.
 * @return 1 on success, 0 on failure
 */
private int popd() {
    if( sizeof(dir_list) ) {
        string dest = dir_list[<1];
        dir_list = dir_list[0..<2];
        return change_dir(dest);
    }

    return 0;

} /* popd() */

/**
 * This method sets the home directory of the player.  It is called
 * by the homedir command.
 * @param str the new home directory
 * @return 0 on failure and 1 on success
 */
private int set_home_dir( string str ) {
    if( GetForced() )
        return 0;

    if( str )
        ::set_home_dir( get_path(str) );

    printf("Home directory set to %s.\n", query_home_dir() );
    return 1;

} /* set_home_dir() */

/**
 * This method returns the saved setup for the inbuild ed command.  THis
 * allows certain flag settings to be saved between sessions.
 * @return the current ed setup flags
 * @see set_ed_setup()
 */
int query_ed_setup() { return query_property("ed_setup"); }

/**
 * This method sets the current flags for the inbuild ed command.  THis
 * allows certain flag settings to be saved between sessions.
 * @param i the new flags for the ed command
 * @see query_ed_setup()
 */
void set_ed_setup( int i ) { add_property("ed_setup", i ); }

/**
 * This method prints out any interesting bits of reviewable information
 * available on the creator.  This is used by the review command.
 * @return always returns 1
 */
int review() {
    player::review();
    wiz_info_comm::review();
    return 1;
} /* review() */

/**
 * This method stores the last location of the creator for use by goback.
 * @param string location
 */
void set_last_location(mixed loc) { last_location = loc; }

/**
 * This method returns the last location of the creator for use by goback.
 * @return string last location.
 */
mixed query_last_location() { return last_location; }