/*
Copyright (C) 1991, Marcus J. Ranum. All rights reserved.
*/
#ifndef lint
static char RCSid[] = "$Header: /home/mjr/hacks/umud/CMD/RCS/page.c,v 1.1 92/02/09 22:59:29 mjr Exp $";
#endif
/* configure all options BEFORE including system stuff. */
#include "config.h"
#include "mud.h"
#include "vars.h"
#include "match.h"
/*
TinyMUD-like "page" - but less stupid
*/
/* ARGSUSED */
cmd_page(ac,av,who,aswho)
int ac;
char *av[];
char *who;
char *aswho;
{
char ob[MAXOID];
int ret;
if(ac > 3) {
say(who,"usage: page user [=] message\n",(char *)0);
return(UERR_BADPARM);
}
ret = matchloggedinplayers(av[1],ob);
if(ret == MTCHRET_AMBIG) {
say(who,"\"",av[1],"\" is ambiguous.\n",(char *)0);
return(UERR_NOMATCH);
}
if(ret == MTCHRET_NONE) {
say(who,"Nobody named \"",av[1],"\" is connected.\n",(char *)0);
return(UERR_NOMATCH);
}
if(ac < 3) {
say(ob,"You sense that ",ut_name(who),
" is looking for you in ",ut_name(ut_loc(who)),
"\n",(char *)0);
if(run_level() == 0)
say(who,"You let ",ut_name(ob)," know where you are.\n",(char *)0);
return(UERR_NONE);
}
say(ob,ut_name(who)," pages, \"",av[2],"\"\n",(char *)0);
if(run_level() == 0) {
#ifdef VERBOSE_PAGE
say(who,"You page to ",ut_name(ob),", \"",av[2],"\"\n",(char *)0);
#else
say(who,"Your message has been sent.\n",(char *)0);
#endif
}
return(UERR_NONE);
}