/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
/* VERSION definition is a Dosmud hack */
#define VERSION "Dosmud"

#define TB(x) if(find_player("bannor")) tell_object(find_player("bannor"),x)
#define ROOT "Root"
#define ADMIN "Admin"

#include "/include/log.h"
#define HIGHLords ([ "newstyle"  : 2, ROOT      : 1, \
                     "Admin" : 1, ])
#define READ_MASK 1
#define WRITE_MASK 2
#define GRANT_MASK 4

#define LORD 1
#define HIGH_LORD 2

#ifdef __VERSION__
#define VERSION __VERSION__
#endif

/*
 * static inherit "std/simul_efun";
 */

mapping save_binaries;
string *preload;
string *call_out_preload;
mapping positions;
mapping permissions;
static mapping HighLords;
static int done;
static mapping checked_master;
static mapping snoop_list;

void    create()
{
#ifdef ORGLIB
    set_debug_level( 0 );
#endif
    permissions = ([ ]);
    positions = ([ ]);
  save_binaries = ([ "/secure/master.c":1 ]);
    checked_master = ([ ]);
    snoop_list = ([ ]);
    HighLords = HIGHLords;
    call_out( "load_object", 0 );
}				/* create() */

/*
 * This function is called every time a player connects.
 * input_to() can't be called from here.
 */
object  connect()
{
    object  ob;

    if( !find_object( "/secure/login" ) )
    {
	log_file( "REBOOT", "Mud rebooted at " + ctime( time() ) + "["
		  + time() + "]" + "\n" );
    }
    printf( "\nLPmud version: " + VERSION + ".\n" );
    ob = clone_object( "/secure/login" );
    printf( "\n" );
    return ob;
}				/* connet() */

int     high_programmer( string str )
{
    if( str == ROOT )
	return 1;
    return( (positions[ str ] == HIGH_LORD) || (HighLords[ str ]) );
}				/* high_programmer() */

int     query_lord( string str )
{
    return( positions[ str ] == LORD ) || high_programmer( str );
}				/* query_lord() */

int     query_only_lord( string str )
{
    return positions[ str ] == LORD;
}				/* query_only_lord() */

string *query_lords()
{
    return filter_array( keys( positions ), "query_only_lord", this_object() );
}				/* query_lords() */

int     query_player_high_lord( string str )
{
    return high_programmer( str ) && "/secure/login"->test_user( str );
}				/* query_player_high_lord() */

string  high_programmers()
{
    return filter_array( keys( positions ), "query_player_high_lord",
			 this_object() ) + keys( HIGHLords );
}				/* high_programmers() */

int     check_permission( string euid, string *path, int mask );

valid_load( path, euid, func )
{
    return 1;
}

string  get_root_uid()
{
    return ROOT;
}
string  get_bb_uid()
{
    return "Room";
}

string *define_include_dirs()
{
    return({ "/include/%s" });
}				/* define_include_dirs() */

int     valid_trace()
{
    return 1;
}

void    shut( int min )
{
    "/obj/shut"->shut( min );
}				/* shut() */

void    remove_checked_master( string name )
{
    map_delete( checked_master, name );
}				/* remove_checked_master() */

mapping query_checked_master()
{
    return checked_master;
}

#include "/secure/master/permission.c"
#include "/secure/master/crash.c"
#include "/secure/master/create_dom_creator.c"
#include "/secure/master/creator_file.c"
#include "/secure/master/dest_env.c"
#include "/secure/master/ed_stuff.c"
#include "/secure/master/logging.c"
#include "/secure/master/parse_command.c"
#include "/secure/master/preload.c"
#include "/secure/master/query_pl_level.c"
#include "/secure/master/simul_efun.c"
#include "/secure/master/snoop.c"
#include "/secure/master/valid_exec.c"
#include "/secure/master/valid_hide.c"
#include "/secure/master/valid_ident.c"
#include "/secure/master/valid_link.c"
#include "/secure/master/valid_override.c"
#include "/secure/master/valid_read.c"
#include "/secure/master/valid_seteuid.c"
#include "/secure/master/valid_shadow.c"
#include "/secure/master/valid_socket.c"
#include "/secure/master/valid_write.c"
#include "/secure/master/virtual_objects.c"
#include "/secure/master/valid_save_binaries.c"