static char *rcsid = "$Header: /plaid/homes/zeus/Blind-2.47/cmds/RCS/y.c,v 2.47 1998/04/15 21:34:50 zeus Exp zeus $";

/*
 *
 * $Log: y.c,v $
 * Revision 2.47  1998/04/15 21:34:50  zeus
 * *** empty log message ***
 *
 * Revision 2.46  1997/04/18 12:13:56  zeus
 * *** empty log message ***
 *
 * Revision 2.45  1997/01/01  00:06:35  zeus
 *
 *
 */

#define NOTIMEB
 
#include "common.h"
#include "prototypes.h"
#include "enterturn-g.h"
#include "cmds.h"
#include "cmds-g.h"

extern char err_tmp[];

void y_cmd_rcsid (void);

void
y_cmd_rcsid (void)
{
  printf ("%s\n",rcsid);
}

#ifdef PASSWORDS
void
y_cmd (char *buf, player * P)
{
  char t[MAXTEXT];
  char newentry[2*MAXTEXT+2]; /* MAXTEXT MAXTEXT + : + \0 */
  int l;
  
  cmd_init(buf);
  hstrncpy (t, next_token (), MAXTEXT);
  if (t[0])
  {
    if (strchr(t,(int) ':'))
    {
      error("Passwords may not contain :'s\n");
      return;
    }
    /* Build new entry for races:passwords */
    hstrncpy (newentry,P->name,MAXTEXT);
    l = strlen(newentry);
    newentry[l]=':';
    newentry[l+1]='\0';
    strncat (newentry,t,MAXTEXT);
#ifndef PREPROC /* Do NOT reset if using preprocessor! */
    if (reset_password (P->name,newentry))
    {
      error (err_tmp);
      return;
    }
#endif
  }
  else
  {
#ifndef PREPROC
    if (reset_password (P->name,NULL))
    {
      error (err_tmp);
      return;
    }
#endif
    return;
  }
  extra_token();
}
#else
void
y_cmd (char *buf, player * P)
{
  error ("This command is not enabled!\n");
}
#endif
