/
swrfuss/
swrfuss/boards/
swrfuss/color/
swrfuss/doc/mudprogs/
swrfuss/email/
swrfuss/planets/
swrfuss/space/
/***************************************************************************
*                           STAR WARS REALITY 1.0                          *
*--------------------------------------------------------------------------*
* Star Wars Reality Code Additions and changes from the Smaug Code         *
* copyright (c) 1997 by Sean Cooper                                        *
* -------------------------------------------------------------------------*
* Starwars and Starwars Names copyright(c) Lucas Film Ltd.                 *
*--------------------------------------------------------------------------*
* SMAUG 1.0 (C) 1994, 1995, 1996 by Derek Snider                           *
* SMAUG code team: Thoric, Altrag, Blodkai, Narn, Haus,                    *
* Scryn, Rennard, Swordbearer, Gorog, Grishnakh and Tricops                *
* ------------------------------------------------------------------------ *
* Merc 2.1 Diku Mud improvments copyright (C) 1992, 1993 by Michael        *
* Chastain, Michael Quan, and Mitchell Tse.                                *
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer,          *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe.     *
* ------------------------------------------------------------------------ *
*                      Account Management Header File                      *
****************************************************************************/

/*
 *
 * A lot of credit goes to Ewerta for the initial release of this code. I have modified
 * it heavily allow for more features as well as being up-to-date with current compilers.
 *
 */

typedef struct acc_char_data ACC_CHAR_DATA;  /* Account System - Ewerta 2004 */
typedef struct account_data ACCOUNT_DATA;    /* Account System - Ewerta 2004 */

ACCOUNT_DATA *first_account;                 /* First Account */
ACCOUNT_DATA *last_account;                  /* Last Account */

#define ACCOUNT_TIMER   2                    /* Timer to wait between logins */
#define MAIL_ROOT_DIR   "mail"               /* Path to mail command */
#define ACCOUNT_DIR     "../accounts/"       /* Account Directory */
#define EMAIL_DIR       "../email/"          /* Email Directory for Storing Verification Emails */
#define EMAIL_LOG       "../email/email.log" /* Email log file */

#define MUD_NAME        "Star Wars Reality"  /* Enter your own MUD name for verification email */

/* Character Structure for Account Menu */
struct acc_char_data
{
   ACC_CHAR_DATA *next;
   ACC_CHAR_DATA *prev;
   ACCOUNT_DATA *account;
   char *password;
   char *name;
   char *quit_location;
   char *clan;
   int level;
   int race;
};


/* Account Structure */
struct account_data
{
   ACCOUNT_DATA *next;
   ACCOUNT_DATA *prev;
   ACC_CHAR_DATA *first_acc_char;
   ACC_CHAR_DATA *last_acc_char;
   ACC_CHAR_DATA *pending;
   char *host;
   char *name;
   char *last_played;
   char *password;
   char *temppass;
   char *email;
   time_t timer;
   bool immortal;
   bool multiplay;
   bool banned;
   int alts;
   int maxalts;
   int points;
   int verify;
   int verified;
   int attempts;
   int passwordfail;
};


/* Global Definitions */
bool add_acc_char( ACCOUNT_DATA * account, char *name, bool pending, bool newbie );
void account_interp( DESCRIPTOR_DATA * d, char *cmdline );
void display_account_menu( DESCRIPTOR_DATA * d );
void save_account( ACCOUNT_DATA * account );
void dispose_account( ACCOUNT_DATA * account );
void ad_printf( DESCRIPTOR_DATA * d, char *fmt, ... );
bool has_account( CHAR_DATA * ch );
ACCOUNT_DATA *fread_account( char *name );
void account_password( DESCRIPTOR_DATA * d, char *cmdline );
void account_update( void );