#ifndef RECCOON_USER_H
#define RECCOON_USER_H TRUE
/*
**  $Filename: Reccoon/User.h $
**  $Release: 0.58 $
**  $Revision: 58.2 $
**  $Date: 94/02/21 $
**
**  Reccoon user structures.
**
**  (C) Copyright 1991-94 Niclas Emdelius.
**          All Rights Reserved
*/ 

#ifndef EXEC_TYPES_H
#include <exec/types.h>
#endif

#ifndef RECCOON_RECCOON_H
#include <Reccoon/Reccoon2.h>
#endif

#ifndef RECCOON_MSGBASE_H
#include <Reccoon/MsgBase.h>
#endif

struct user_flags
{
	unsigned int wannonym		:1;	// (Obsolete)
	unsigned int traceannonym 	:1;	// (Obsolete)
	unsigned int changefrom 	:1;	// (Obsolete)
	unsigned int autovalidate	:1;	// (Obsolete)
	unsigned int noinactivekill	:1;	// (Future)
	unsigned int ageoverride	:1;	// Override age-check.
	unsigned int unusedbits		:26;
};

//** User information/statistic.
//** Avoid loading it from disk by yourself,
//** use GetUser() instead!
//** This structure needs to grow in the future.

struct usr
{
        UWORD  	level;			// Access level
        UBYTE 	username[22];		// User name
	UBYTE 	handle[22];		// User's handle
        UBYTE 	password[14];		// Password
	UBYTE 	address[40];		// User's address
	UBYTE	city[30];		// City
	UBYTE 	zip[8];			// Zip code
	UBYTE 	tele[16];		// Telephone number
	UWORD 	calls;			// Nr of calls to system
	UWORD 	carrierlost;		// Times user lost carrier
	ULONG 	byteul;			// Bytes Uploaded
	ULONG 	bytedl;			// Bytes Downloaded
	UWORD 	fileul;			// Files Uploaded
	UWORD 	filedl;			// Files Downloaded
	UWORD 	messages;		// Messages written
	ULONG 	fidocredits;		// Fidonet netmail credits (future?)
	UWORD 	graphics;		// Graphic mode
	UWORD 	scrlength;		// Screen length

	struct user_flags userflags;	// Userflags

	UWORD	maxmsg;			// Max messages/call (future)
	UWORD 	timeday;		// Time per day
	UWORD 	timecall;		// Time per call
	UWORD 	minutesused;		// Minutes user if laston=today
	UWORD 	callsday;		// Calls per day (future)
	UWORD 	callstoday;		// Calls today if laston=today
	UWORD 	fileratio;		// File ratio
	UWORD 	byteratio;		// Byte ratio

	struct TimeDate laston;		// Last on
	struct TimeDate firston;	// First time on
	struct TimeDate lastscan;	// Last scaned new files
	struct TimeDate memberbegin;	// System membership from (future)
	struct TimeDate memberexpire;	// System membership expire (future)

	UWORD	oldmsgarea;		// Last MsgArea
	UWORD	oldmsgsig;		// Last MsgSIG
	UWORD	oldfilearea;		// Last filearea
	UWORD	oldfilesig;		// Last FileSIG

	unsigned int 	lockout :1;	// User locked out? (more or less unused)
	unsigned int 	expert  :1;	// Expert mode?
	unsigned int 	hotkeys :1;	// Hotkeys? (future)
	unsigned int 	cludges :1;	// Show message cludges?
	unsigned int	opttext :1;	// Optimize textoutput
	unsigned int	skipownmsg :1;	// Skip own messages when reading?
	unsigned int	locked	:1;	// Indicating this user has locked structures
	unsigned int 	unusedbits :25;

	UWORD	xlate;			// Character translation mode
	UBYTE 	computer;		// Computer type (future)
	UBYTE	fsed;			// Message editor (future)

	struct {
		unsigned int year  :7;	// Year - 1900
		unsigned int month :4;
		unsigned int day   :5;
		unsigned int unused :16;
	} born;				// When he is born

};

//** This structure and more is stored in RData:ALevelX.DAT
//** Do not alter those files by yourself, unless you know the
//** format for sure!

struct accesslevel
{
	struct user_flags user_flags;	// Access flags
	UWORD 	user_timecall;		// Time per day
	UWORD 	user_timeday;		// Time per call
	UWORD 	user_callday;		// Calls per day (future)
	UWORD 	user_fileratio;		// File ratio
	UWORD 	user_byteratio;		// Byte ratio
	UWORD 	user_maxmsg;		// Message ent limit (future)
	struct MsgAccess defmsgaccess;	// Default msgaccess
	struct FileAccess deffileaccess;// Default fileaccess
};

#endif
