/
lib/banish/
lib/d/
lib/doc/
lib/doc/domains/
lib/doc/efun/
lib/doc/examples/
lib/doc/examples/armour/
lib/doc/examples/contain/
lib/doc/examples/food/
lib/doc/examples/magic/
lib/doc/examples/monster/
lib/doc/examples/room/
lib/doc/examples/weapons/
lib/function/
lib/include/
lib/include/fn_specs/
lib/include/skills/
lib/info/
lib/inherit/base/
lib/log/
lib/manuals/312/
lib/news/
lib/obj/party/
lib/objects/components/
lib/open/
lib/open/library/
lib/open/party/
lib/players/
lib/players/zilanthius/
lib/room/
lib/room/city/arena/
lib/room/city/creator/
lib/room/city/garden/monst/
lib/room/city/obj/
lib/room/city/shop/
lib/room/death/
lib/room/registry/
lib/secure/
lib/secure/UDP_CMD_DIR/
lib/skills/
lib/skills/fighter/
lib/skills/thief/
lib/usr/
lib/usr/creators/
lib/usr/players/
#include <master.cfg>
#include <pad_str.h>
#include <udp.h>


int udp_tell(mapping data) {
    object ob;
    string reply_str;

    if (data[RECIPIENT] 
    && (ob = find_player(data[RECIPIENT])) 
    && interactive(ob)) {

#ifdef WIZ_ONLY
      if(ob->query_security_level() && !ob->query_edit())  
#endif /* WIZ_ONLY */
        tell_object(ob,"\n" +pad_str(capitalize(data[SENDER]) +"@"
        +data[NAME] +" tells you: ",data[DATA], 79) +"\n");
        
        if(ob->query_edit())        
          reply_str = "Sorry, that person is editing.\n";
#ifdef WIZ_ONLY
        else if(!ob->query_security_level()) 
          reply_str = "Sorry, only Creators can recieve 'tells'\n";          
#endif
        else 
          reply_str = pad_str("You tell "+ capitalize(data[RECIPIENT]) +"@"+
                      LOCAL_NAME +": ", data[DATA], 79);

        
      INETD->send_udp(data[NAME], ([
         REQUEST: REPLY,
         RECIPIENT: data[SENDER],
         ID: data[ID],
         DATA: reply_str
      ]) );
    }
    else
     INETD->send_udp(data[NAME], ([
         REQUEST: REPLY,
         RECIPIENT: data[SENDER],
         ID: data[ID],
         DATA: pad_str("Root@" + LOCAL_NAME + ": ","No such player: " 
               +capitalize(data[RECIPIENT]), 79)
     ]) );
    return 1;
}


void tell(string who, string mud, string msg) {
  if(!MASTER->valid_player_call(previous_object())) {
    log_file("ILLEGALS","Illegal call to inetd 'tell', by "+
       (string)this_player()->query_name(1)+"@"+ctime(time())+"\n");
  }
  if(INETD->send_udp(mud, ([
                     REQUEST: "tell",
                     RECIPIENT: who,
                     SENDER: (string)this_player()->query_name(1),
                     DATA:   msg, ]), 1))
    write("Message Sent.\n");
}