[go: up one dir, main page]

Menu

[897c37]: / mlib / lib / whois.lpc  Maximize  Restore  History

Download this file

66 lines (53 with data), 1.1 kB

/*
 * WHOIS object - /lib/whois.c
 * Shattered Worlds Mudlib
 *
 * Provides an easy way to test if a player is a member of
 * a particular group.
 *
 * This file isn't as stable as we would like it to be, it
 * actually depends on the existance of other objects,
 * which may or may not exist in a given mudlib.
 */

inherit "RO/Servers";

reset() 
{
}

static conv(w)
{
    return (intp(w)?this_player()->query_real_name():
	(objectp(w)?w->query_real_name():lower_case(w)));
}

is_wizard(who) 
{
    return FINGER->query_wiz(conv(who));
}

is_player(who)
{
    return ((objectp(who)?query_ip_number(who):0) 
	|| "std/finger"->player_exists(conv(who))); 
}

is_lord(who)
{
    return PEERAGE_SERV->query_station_value(conv(who)) >= 0;
}

is_judge(who)
{
    return (conv(who) == "room/city/bounty"->query_judge());
}

is_test_char(who)
{
    return (TEST_REGISTER->query_test_char(conv(who)) != 0); 
}

is_god(who)
{
    return is_wizard(who) > 10000;
}

is_editor(who)
{
    return (conv(who) == lower_case("room/city/editor"->query_editor()));
}

is_apprentice(who)
{
    return (TEST_REGISTER->query_apprentice(conv(who)) != 0);
}