/
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 "udp.h"
/*
 * Tell a wiz on another mud.
 */
void    send_gtell( string wiz_to, string mud, string msg )
{
    mapping minfo;

    if( mud == MUD_NAME )
	return;
    minfo = NAMESERVER_CD->query_mud_info( mud );
    if( !minfo )
	return;
    msg = replace( msg, ({ "|", "", "@@@", "" }) );
    NAMESERVER_CD->send_udp( minfo[ "HOSTADDRESS" ], minfo[ "PORTUDP" ],
			     "@@@" + UDP_GTELL +
			     "||NAME:" + MUD_NAME +
			     "||PORTUDP:" + NAMESERVER_CD->query_my_port() +
			     "||WIZTO:" + wiz_to +
			     "||WIZFROM:" + this_player()->query_cap_name() +
			     "||MSG:" + msg + "@@@\n" );
}				/* send_gtell() */


void    incoming_request( mapping info )
{
    mapping minfo;
    object  pl;

    if( info[ "NAME" ] && info[ "PORTUDP" ] )
    {
	if( info[ "NAME" ] == MUD_NAME )
	    return;
	minfo = NAMESERVER_CD->query_mud_info( info[ "NAME" ] );
	if( !minfo )
	    PING_Q->send_ping_q( info[ "HOSTADDRESS" ], info[ "PORTUDP" ] );
	if( minfo && minfo[ "HOSTADDRESS" ] != info[ "HOSTADDRESS" ] )
	{
	    /* Its been faked! */
	    log_file( "UDP_faketell", info[ "WIZFROM" ] + "@" + info[ "NAME" ] +
		      "(" + info[ "HOSTADDRESS" ] + ") telling " + info[ "WIZTO" ] +
		      " " + info[ "MSG" ] + "\n" );
	    NAMESERVER_CD->send_udp( minfo[ "HOSTADDRESS" ], minfo[ "PORTUDP" ],
				     "@@@" + UDP_WARNING +
				     "||MSG: Faked gtell message " + info[ "WIZFROM" ] +
				     "@" + info[ "NAME" ] + "> " + info[ "WIZTO" ] +
				     " " + info[ "MSG" ] +
				     "||FAKEHOST:" + info[ "name" ] +
				     "@@@\n" );
	    return;
	}
	pl = find_player( lower_case( info[ "WIZTO" ] ) );
	if( pl )
	{
	    pl->event_person_tell( this_object(), info[ "WIZFROM" ] + "@" +
				   info[ "NAME" ] + " tells you: ", info[ "MSG" ], "common" );

	    (UDP_PATH + "affirmation_a")->send_affirmation_a( 
								 info[ "HOSTADDRESS" ], info[ "PORTUDP" ], "Gtell@" + MUD_NAME,
								 info[ "WIZFROM" ], info[ "WIZTO" ] +
								 " successfully saw the message.\n" );

	}
	else
	    (UDP_PATH + "affirmation_a")->send_affirmation_a( 
								 info[ "HOSTADDRESS" ], info[ "PORTUDP" ], "Gtell@" + MUD_NAME,
								 info[ "WIZFROM" ], info[ "WIZTO" ] +
								 " is not logged on, sorry we don't have " +
								 "an answering machine yet.\n" );
    }
}				/* incoming_request() */