/
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>
/*
 * gwizmsg...  The global wizard chat line.
 */
string *allowed_array;

void    create()
{
    allowed_array = ({ "bing", "flame", "Discworld", "actuator" });
}				/* create() */

void    send_gwizmsg( string msg, int emoted )
{
    int     i;
    string *allowed_array;
    mapping minfo, muds;

    muds = NAMESERVER_CD->query_known_muds();
    allowed_array = keys( muds );
    msg = replace( msg, ({ "|", "", "@@@", "" }) );
    for( i = 0; i < sizeof( allowed_array ); i++ )
	if( lower_case( allowed_array[ i ] ) != lower_case( MUD_NAME ) )
	{
	    if( !mapp( muds[ allowed_array[ i ] ] ) )
		continue;
	    minfo = muds[ allowed_array[ i ] ];
	    NAMESERVER_CD->send_udp( minfo[ "HOSTADDRESS" ], minfo[ "PORTUDP" ],
				     "@@@" + UDP_GWIZMSG +
				     "||NAME:" + MUD_NAME +
				     "||PORTUDP:" + NAMESERVER_CD->query_my_port() +
				     "||WIZNAME:" + this_player()->query_cap_name() +
				     "||GWIZ:" + msg +
				     "||CHANNEL:CREATOR" +
				     (emoted ? "||EMOTE:1" : "") + "@@@\n" );
	}
}				/* send_gwizmsg() */

void    incoming_request( mapping info )
{
    mapping minfo;
    string  tmsg;

    if( info[ "NAME" ] && info[ "PORTUDP" ] )
    {
	if( lower_case( info[ "NAME" ] ) == lower_case( MUD_NAME ) )
	    return;

	minfo = NAMESERVER_CD->query_mud_info( info[ "NAME" ] );
	if( !minfo || !strlen( info[ "WIZNAME" ] ) )
	{
/* We don't accept the message.  But ping them anyway. */
	    PING_Q->send_ping_q( info[ "HOSTADDRESS" ], info[ "PORTUDP" ] );
	    return;
	}
	if( info[ "EMOTE" ] )
	    tmsg = info[ "WIZNAME" ] + "@" + info[ "NAME" ] + " " + info[ "GWIZ" ];
	else
	    tmsg = info[ "WIZNAME" ] + "@" + info[ "NAME" ] + ": " + info[ "GWIZ" ];

#ifdef PARANOID
	if( member_array( info[ "NAME" ], allowed_array ) == -1 )
	    return;
#endif

	if( info[ "HOSTADDRESS" ] != minfo[ "HOSTADDRESS" ] )
	{
/* Faked.  sheeze... */
	    log_file( "UDP_fakewizmsg", sprintf( "%s: %s\n@%s", ctime( time() ),
						 info[ "HOSTADDRESS" ], tmsg ) );
	    NAMESERVER_CD->send_udp( info[ "HOSTADDRESS" ], info[ "PORTUDP" ],
				     "@@@" + UDP_WARNING +
				     "||NAME:" + MUD_NAME +
				     "||MSG: Fake gwiz msg " + tmsg +
				     "||FAKEHOST:" + info[ "HOSTADDRESS" ] +
				     "@@@\n" );
	    return;
	}
	event( users(), "inter_creator_tell", info[ "NAME" ], info[ "WIZNAME" ],
	       info[ "GWIZ" ], this_object(), info[ "EMOTE" ] == "1" );
    }
}				/* incoming_request() */