/
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/
#include "socket.h"
#include "inet.h"
#include "udp.h"

object  pl;
string  who, message;

void    dest_me();

void    create()
{
    seteuid( getuid() );
}				/* create() */

/* Whats all this then? */
int     do_tell( string str )
{
    string  name, host, mess;
    object  ob;

    if( sscanf( str, "%s@%s %s", name, host, mess ) == 3 )
    {
	lower_case( name );
	if( name == "" )
	    name = "EVERYONE";
	if( NAMESERVER_CD->query_mud_info( host ) )
	{
	    write( "Intercre sent, it may take a while to reach some sites.\n" );
	    (UDP_PATH + "gtell")->send_gtell( name, host, mess );
	    return 1;
	}
	ob = clone_object( file_name( this_object() ) );
	ob->tell_away( name, host, mess, this_player() );
	return 1;
    }
    return 0;
}				/* do_finger() */

void    tell_away( string name, string host, string mess, object me )
{
    who = name;
    pl = me;
    message = mess;
    INETD->open_to_service( "tell", INETD_TYPE, host );
    call_out( "dest_me", 5 * 60 * 60 );
}				/* finger_away() */

void    read_callback( int fd, string mess )
{
    tell_object( pl, mess );
    pl->tell_callback( 2, mess );
}				/* read_callback() */

void    connected( int fd )
{
    previous_object()->write_fd( fd, pl->query_name() + "@" + MUD_NAME +
				 " tells " + who + ": " + message + "\n" );
}				/* write_callback() */

void    close_callback()
{
    pl->tell_callback( 0 );
    dest_me();
}				/* close_callback() */

void    failed( string reason )
{
    pl->tell_callback( 1, reason );
    tell_object( pl, "We failed for " + reason + " reason.\n" );
    dest_me();
}				/* failed() */

void    dest_me()
{
    destruct( this_object() );
}				/* dest_me() */