/*
Copyright (C) 1991, Marcus J. Ranum. All rights reserved.
*/
#ifndef lint
static char RCSid[] = "$Header: /usr/users/mjr/hacks/umud/CMD/RCS/whisper.c,v 1.4 91/09/19 12:55:48 mjr Exp $";
#endif
/* configure all options BEFORE including system stuff. */
#include "config.h"
#include "mud.h"
#include "match.h"
#include "vars.h"
/*
TinyMUD-like "whisper"
*/
/* ARGSUSED */
cmd_whisper(argc,argv,who,aswho)
int argc;
char *argv[];
char *who;
char *aswho;
{
char ob[MAXOID];
char *xx;
int fnd = 0;
if(matchplayers(who,argv[1],ut_loc(who),MTCH_UNIQ|MTCH_MEOK,ob))
return(1);
io_rstnxtwho();
while((xx = io_nxtwho((long)0)) != (char *)0) {
if(!strcmp(xx,ob)) {
fnd++;
break;
}
}
if(!fnd) {
say(who,ut_name(ob)," isn't connected.\n",(char *)0);
return(1);
}
say(ob,ut_name(who)," whispers, \"",argv[2],"\".\n",(char *)0);
say(who,"You whisper, \"",argv[2],"\" to ",ut_name(ob),".\n",(char *)0);
return(0);
}