static char *rcsid = "$Header: /sanguine/homes/zeus/Blind-2.48/cmds/RCS/q.c,v 2.48 1999/03/14 00:48:48 zeus Exp zeus $";

/*
 *
 * $Log: q.c,v $
 * Revision 2.48  1999/03/14 00:48:48  zeus
 * *** empty log message ***
 *
 *
 */

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

extern char err_tmp[];

void q_cmd_rcsid (void);

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

#ifdef QCMDOK
void
q_cmd (char *buf, player * P)
{
  char t[MAXTEXT];
  char newentry[MAXTEXT+2+MAXSTRLEN]; /* MAXTEXT MAXSTRLEN + : + \0 */
  int l;
  
  cmd_init(buf);
  hstrncpy (t, next_token (), MAXTEXT);
  if (t[0])
  {
    if (hstricmp (t,P->name))
    {
      sprintf (err_tmp,"Quit command failed- player name mismatch (%s)\n", t);
      error (err_tmp);
      return;
    }
#ifndef PREPROC /* Do NOT reset if using preprocessor! */
    /* Build new entry for races:players */
    hstrncpy (newentry,P->name,MAXTEXT);
    l = strlen(newentry);
    newentry[l]=':';
    newentry[l+1]='\0';
    strncat (newentry,QADDR,MAXSTRLEN);
    if (reset_email (P->name,newentry))
    {
      error (err_tmp);
      return;
    }
#endif
  }
  else
  {
    error ("Quit command failed- no player name verified!\n");
    return;
  }
  extra_token();
}
#else
void
q_cmd (char *buf, player * P)
{
  error ("This command is not enabled!\n");
}
#endif
