nightmare4_fluffos_v1/
nightmare4_fluffos_v1/bin/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/ChangeLog.old/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/Win32/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/compat/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/compat/simuls/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/include/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/clone/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/command/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/data/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/etc/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/include/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/inherit/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/inherit/master/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/log/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/compiler/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/efuns/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/single/tests/operators/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/testsuite/u/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/tmp/
nightmare4_fluffos_v1/fluffos-2.9-ds2.14/windows/
nightmare4_fluffos_v1/lib/cfg/
nightmare4_fluffos_v1/lib/cmds/admins/
nightmare4_fluffos_v1/lib/cmds/common/
nightmare4_fluffos_v1/lib/cmds/creators/include/
nightmare4_fluffos_v1/lib/cmds/creators/include/SCCS/
nightmare4_fluffos_v1/lib/cmds/hm/
nightmare4_fluffos_v1/lib/daemon/services/
nightmare4_fluffos_v1/lib/doc/
nightmare4_fluffos_v1/lib/doc/faq/
nightmare4_fluffos_v1/lib/doc/help/classes/
nightmare4_fluffos_v1/lib/doc/help/creators/
nightmare4_fluffos_v1/lib/doc/help/hm/
nightmare4_fluffos_v1/lib/doc/help/players/
nightmare4_fluffos_v1/lib/doc/help/races/
nightmare4_fluffos_v1/lib/doc/help/religion/
nightmare4_fluffos_v1/lib/doc/mudlib/
nightmare4_fluffos_v1/lib/doc/mudlib/cfg/
nightmare4_fluffos_v1/lib/domains/Ylsrim/
nightmare4_fluffos_v1/lib/domains/Ylsrim/adm/
nightmare4_fluffos_v1/lib/domains/Ylsrim/armour/
nightmare4_fluffos_v1/lib/domains/Ylsrim/fish/
nightmare4_fluffos_v1/lib/domains/Ylsrim/meal/
nightmare4_fluffos_v1/lib/domains/Ylsrim/npc/
nightmare4_fluffos_v1/lib/domains/Ylsrim/virtual/
nightmare4_fluffos_v1/lib/domains/Ylsrim/weapon/
nightmare4_fluffos_v1/lib/domains/Ylsrim/xtra/
nightmare4_fluffos_v1/lib/lib/comp/
nightmare4_fluffos_v1/lib/lib/lvs/
nightmare4_fluffos_v1/lib/lib/std/
nightmare4_fluffos_v1/lib/lib/user/
nightmare4_fluffos_v1/lib/news/
nightmare4_fluffos_v1/lib/obj/
nightmare4_fluffos_v1/lib/obj/include/
nightmare4_fluffos_v1/lib/save/
nightmare4_fluffos_v1/lib/save/kills/a/
nightmare4_fluffos_v1/lib/save/kills/b/
nightmare4_fluffos_v1/lib/save/kills/f/
nightmare4_fluffos_v1/lib/save/kills/m/
nightmare4_fluffos_v1/lib/save/kills/q/
nightmare4_fluffos_v1/lib/save/kills/r/
nightmare4_fluffos_v1/lib/secure/cfg/
nightmare4_fluffos_v1/lib/secure/cfg/classes/
nightmare4_fluffos_v1/lib/secure/cfg/races/SCCS/
nightmare4_fluffos_v1/lib/secure/cmds/creators/include/
nightmare4_fluffos_v1/lib/secure/cmds/players/
nightmare4_fluffos_v1/lib/secure/cmds/players/include/
nightmare4_fluffos_v1/lib/secure/daemon/include/
nightmare4_fluffos_v1/lib/secure/lib/
nightmare4_fluffos_v1/lib/secure/lib/include/
nightmare4_fluffos_v1/lib/secure/lib/net/
nightmare4_fluffos_v1/lib/secure/lib/std/
nightmare4_fluffos_v1/lib/secure/obj/
nightmare4_fluffos_v1/lib/secure/obj/include/
nightmare4_fluffos_v1/lib/secure/save/
nightmare4_fluffos_v1/lib/secure/save/boards/
nightmare4_fluffos_v1/lib/secure/save/votes/
nightmare4_fluffos_v1/lib/spells/
nightmare4_fluffos_v1/lib/verbs/admins/include/
nightmare4_fluffos_v1/lib/verbs/common/
nightmare4_fluffos_v1/lib/verbs/common/include/
nightmare4_fluffos_v1/lib/verbs/creators/
nightmare4_fluffos_v1/lib/verbs/creators/include/
nightmare4_fluffos_v1/lib/verbs/players/include/SCCS/
nightmare4_fluffos_v1/lib/verbs/rooms/
nightmare4_fluffos_v1/lib/verbs/rooms/include/
nightmare4_fluffos_v1/lib/www/
nightmare4_fluffos_v1/old/
nightmare4_fluffos_v1/old/tools/
nightmare4_fluffos_v1/win32/
/*    /secure/daemon/finger.c
 *    from the Foundation II LPC Library
 *    gives finger information about users
 *    created by Descartes of Borg 950402
 *    Version: @(#) finger.c 1.11@(#)
 *    Last modified: 96/12/14
 */
 
#include <lib.h>
#include <daemons.h>
#include <marriage.h>
#include <clock.h>
#include "finger.h"
 
inherit LIB_DAEMON;
 
private int LoginTime, Level, BirthTime, CreatorBirth, WhereBlock;
private string CurrentUser, Short, CapName, RealName, Email;
private string Town, Race, Gender, HostSite;
private string Class, Guild, Long;
private string Rank, WebPage;
private string array Titles, Religion;
private class marriage array Marriages;

static void create() {
    daemon::create();
    SetNoClean(1);
}
 
varargs string GetFinger(string who, int html) {
    mapping mail_stat;
    object ob;
    string ret;
    mixed creator;
 
    if( !who ) {
        object array people;
        string array lines = ({});
        object person;
        int i, maxi;
        int array screen;
 
        screen = (int array)this_player()->GetScreen();
        if( screen && sizeof(screen) ) i = screen[0]; else i = 80;
        ret = center(mud_name(), i) + "\n\n";
        people = filter(users(), (: !((int)$1->GetInvis()) :));
        foreach(person in people) {
            string str, clas, town;
 
            str = (string)person->GetShort();
            if( !str ) str = (string)person->GetName();
            if( !str ) continue;
            if( creatorp(person) ) clas = "creator";
            else clas = (string)person->GetClass();
            if( clas ) clas = capitalize(clas);
            else clas = "Drifter";
            town = (string)person->GetTown();
            if( !town ) town = "Homeless";
            str = sprintf("%:-40s %:-11s %s", str, clas, town);
            lines += ({ str });
        }
        ret += implode(lines, "\n");
        return ret;
    }
    if( who != CurrentUser ) {
	creator = 0;
        if( !user_exists(who) )
          return capitalize(who) + " has never visited " + mud_name() + ".";
        else if( !unguarded( (: restore_object, DIR_PLAYERS "/" + who[0..0] +
                              "/" + who :)) &&
                  !(creator = unguarded( (: restore_object, DIR_CRES "/" +
                              who[0..0] + "/" + who :) ) )) return 0;
        CurrentUser = who;
    }
    else if( !strsrch(save_file(who), DIR_CRES) ) creator = 1;
    ret = "%^STRONG%^" + replace_string(GetTitle(), "$N", CapName) +
	"%^/STRONG%^BR%^\n";
    if( Long ) {
	ret += replace_string(Long, "$N", CapName) + "%^BR%^\n";
    }
    if( WebPage ) {
	ret += "Home Page: %^HREF%^" + WebPage + "%^>%^";
	if( html ) {
	    ret += WebPage + "%^/A%^BR%^\n";
	}
	else {
	    ret += "%^/A%^BR%^\n";
	}
    }
    else {
	ret += "No home page.%^BR%^\n";
    }
    if( creator ) {
	ret += CapName + " is a " + Gender + " Creator of %^I%^" + mud_name() +
	    "%^/I%^.%^BR%^\n";
	ret += "Immortality Date: " + ctime(CreatorBirth) + "%^BR%^\n";
    }
    else {
	string yrstr;
	int yr;
	
	ret += CapName+" the "+Gender+" "+Race+" "+(Class || "drifter");
	if( Guild ) ret += " of the " + pluralize(Guild);
        if( creatorp(this_player()) && Level ) ret += " ("+Level+")";
	ret += " is a " + Rank+" of " + Town + ".%^BR%^\n";
	BirthTime = BirthTime - (18 * YEAR);
	if( (yr = query_year(BirthTime)) < 0 ) yrstr = -yr + " BN";
	else yrstr = "" + yr;
	ret += sprintf("Birthday: the %d%s day of %s, %s",
		       query_date(BirthTime), ordinal(query_date(BirthTime)),
		       query_month(BirthTime), yrstr) + "%^BR%^\n";
    }
    if( !Email ) Email = "#CHANGE";
    ret += "%^TABLE%^TR%^TD%^" +
	sprintf("In real life: %:-30s %%^/TD%%^TD%%^Email: %s", RealName ,
		(Email[0]!='#' || (this_player(1) && archp(this_player(1))))
		? (Email[0] == '#' ? Email[1..] : Email) : "Unlisted") +
	"%^/TD%^/TR%^\n";
    ret += "%^TR%^TD%^" +
	sprintf("Religion: %:-34s %%^/TD%%^TD%%^Spouse: %s",
		   (!creator && Religion[1]) ? Religion[1] : "Agnostic",
		   !sizeof(Marriages) ? "Single" :
		   (((class marriage)Marriages[0])->DivorceDate ?
		    "Divorced" : ((class marriage)Marriages[0])->Spouse)) +
	"%^/TD%^/TR%^/TABLE%^\n";
    if( (ob = find_player(who)) && (!ob->GetInvis()) ) {
	if( !interactive(ob) ) ret += "Currently net-dead";
	else ret += "On since " + ctime(LoginTime);
    }
    else ret += "Last on " + ctime(LoginTime);
    if( !WhereBlock || (this_player(1) && archp(this_player(1))) )
      ret += " from " + HostSite + "%^BR%^\n";
    else ret += "%^BR%^\n";
    mail_stat = (mapping)FOLDERS_D->mail_status(who);
    if( mail_stat["unread"] )
      ret += CapName + " has " + consolidate(mail_stat["unread"],
                                             "an unread letter") + ".%^BR%^\n";
    if( unguarded( (: file_size, user_path(who) + ".project" :) ) > 0 )
      ret += "Project: %^PRE%^" +
        unguarded( (: read_file, user_path(who) + ".project" :) ) +
	  "%^/PRE%^\n";
    if( unguarded( (: file_size, user_path(who) + ".plan" :) ) > 0 )
      ret += "Plan:%^PRE%^\n" +
        unguarded( (: read_file, user_path(who) + ".plan" :) ) + "%^/PRE%^\n";
    return ret;
}
 
mixed array GetRemoteFinger(string who) {
    mixed array tmp;
    string plan;
    int creator;
    object ob;
 
    who = convert_name(who);
    if( who != CurrentUser ) {
	creator = 0;
        if( !user_exists(who) ) return 0;
        else if( !unguarded( (: restore_object, DIR_PLAYERS "/" + who[0..0] +
                              "/" + who :)) &&
                !(creator = unguarded( (: restore_object, DIR_CRES "/" +
					who[0..0] + "/" + who :) ) )) return 0;
        CurrentUser = who;
    }
    else if( !strsrch(save_file(who), DIR_CRES) ) creator = 1;
    ob = find_player(who);
    if( unguarded( (: file_size, user_path(who) + ".plan" :) ) > 0 ) {
        plan = unguarded( (: read_file, user_path(who) + ".plan", 1, 5 :) );
	if( strlen(plan) ) {
	    plan = "Plan: (truncated to 5 lines)\n" + plan;
	    if( plan[<1] != '\n' ) plan += "\n";
	}
	else plan = 0;
    }
    if( !Email ) Email = "#CHANGE";
    tmp = ({ CapName, GetTitle(), RealName, (Email[0] != '#' ? Email : 0),
	     ctime(LoginTime), (ob && interactive(ob) ? query_idle(ob) : -1),
	     0, (creator ? "Creator" : "" + Level), plan });
    return tmp;
}
 
string GetTitle() {
    if( Short ) return Short;
    else if( Titles && sizeof(Titles) ) return Titles[0];
    else return CapName;
}