/* 	$Id: sysdefaults.h,v 1.2 1999/01/28 10:58:01 cameron Exp $	 */

/* structure for default values that are represented as array of flags */
struct sysdef_array {
  char *name;
  int max;
  char **keys;
  int *p;
};

struct sysdef_array sysdefships   =
	{ "SHIPS",   NUM_TYPES,  shiptypes,   shipsallowed   };

struct sysdef_array sysdefweapons =
	{ "WEAPONS", WP_MAX,     weapontypes, weaponsallowed };

struct sysdef_array sysdefplanets =
	{ "PLANETS", MAXPLANETS, planettypes, startplanets   };

/* default value types */
#define SYSDEF_INT	0	/* a simple integer value	*/
#define SYSDEF_CHAR	1	/* a string value		*/
#define SYSDEF_ARRAY	2	/* an array of flags to be set	*/
#define SYSDEF_ROBOT	3	/* start_robot is to be set	*/
#define SYSDEF_SHIP	4	/* shipvals if to be called	*/
#define SYSDEF_END	-1	/* marks end of keyword table	*/

struct sysdef_keywords {
  char *key;			/* keyword to match		*/
  int type;			/* type of keyword as per above	*/
  void *p;			/* pointer to variable		*/
/*
	SYSDEF_INT	(int *)
	SYSDEF_CHAR	(char *)
	SYSDEF_ARRAY	(struct sysdef_array *)
	SYSDEF_ROBOT	(const char *)
	SYSDEF_SHIP	NULL
	SYSDEF_END	NULL
*/
} sysdef_keywords[] =
{
  { "CLUE",		SYSDEF_INT,	&clue		},
  { "CLUERANK",		SYSDEF_INT,	&cluerank	},
  { "HUNTERKILLER",	SYSDEF_INT,	&killer		},
  { "RESETGALAXY",	SYSDEF_INT,	&resetgalaxy	},
#ifdef CHECKMESG
  { "CHECKMESG",	SYSDEF_INT,	&checkmessage	},
  { "LOGALL",		SYSDEF_INT,	&logall		},
  { "LOGGOD",		SYSDEF_INT,	&loggod		},
  { "EVENTLOG",		SYSDEF_INT,	&eventlog	},
#endif /* CHECKMESG */
  { "DOOSHER",		SYSDEF_INT,	&doosher	},
  { "CHECKSCUM",	SYSDEF_INT,	&check_scum	},
#ifdef CHAIN_REACTION
  { "WHYMESS",		SYSDEF_INT,	&whymess	},
#endif
  { "MAX_POP",		SYSDEF_INT,	&max_pop	},
  { "SHOWSYSDEF",	SYSDEF_INT,	&show_sysdef	},
  { "PLANET_MOVE",	SYSDEF_INT,	&planet_move	},
  { "WRAP_GALAXY",	SYSDEF_INT,	&wrap_galaxy	},
#ifdef MINES
  { "STARBASE_MINES",	SYSDEF_INT,	&mines		},
#endif
  { "PINGPONG_PLASMA",	SYSDEF_INT,	&pingpong_plasma },
  { "MAX_CHAOS_BASES",	SYSDEF_INT,	&max_chaos_bases },
  { "TOURN",		SYSDEF_INT,	&tournplayers	},
  { "SHIPS",		SYSDEF_ARRAY,	&sysdefships	},
  { "WEAPONS",		SYSDEF_ARRAY,	&sysdefweapons	},
  { "PLKILLS",		SYSDEF_INT,	&plkills	},
  { "SBRANK",		SYSDEF_INT,	&sbrank		},
  { "CHAOS",		SYSDEF_INT,	&chaosmode	},
#ifdef SNAKEPATROL
  { "SNAKEPATROL",	SYSDEF_INT,	&snakepatrol	},
#endif
  { "NODIAG",		SYSDEF_INT,	&nodiag		},
  { "TOPGUN",		SYSDEF_INT,	&topgun		},
  { "NEWTURN",		SYSDEF_INT,	&newturn	},
  { "HIDDEN",		SYSDEF_INT,	&hiddenenemy	},
  { "LOADCHECK",	SYSDEF_INT,	&loadcheck	},
  { "MAXLOAD",		SYSDEF_INT,	&maxload	},
  { "PLANETS",		SYSDEF_ARRAY,	&sysdefplanets	},
  { "CONFIRM",		SYSDEF_INT,	&binconfirm	},
  { "UDP",		SYSDEF_INT,	&udpAllowed	},
  { "SURRSTART",	SYSDEF_INT,	&surrenderStart	},
#ifdef PING
  { "PING_FREQ",	SYSDEF_INT,	&ping_freq	},
  { "PING_ILOSS_INTERVAL",SYSDEF_INT,	&ping_iloss_interval },
  { "PING_GHOSTBUST",	SYSDEF_INT,	&ping_allow_ghostbust },
  { "PING_GHOSTBUST_INTERVAL", SYSDEF_INT, &ping_ghostbust_interval },
#endif /* PING */
#ifdef SB_TRANSWARP
  { "TRANSWARP",	SYSDEF_INT,	&twarpMode	},
  { "WARPSPEED",	SYSDEF_INT,	&twarpSpeed	},
#endif /* SB_TRANSWARP */
  { "VECTOR",		SYSDEF_INT,	&vectortorps	},
  { "START_ARMIES",	SYSDEF_INT,	&top_armies	},
  { "ERROR_LEVEL",	SYSDEF_INT,	&errorlevel	},
#ifdef BASEPRACTICE
  { "BASEPRACTICE",	SYSDEF_ROBOT,	(void *) BASEP_ROBOT	},
  { "ROBOTHOST",	SYSDEF_CHAR,	robot_host	},
#endif
  { "HOCKEY",		SYSDEF_ROBOT,	(void *) PUCK_ROBOT	},
  { "INL",		SYSDEF_ROBOT,	(void *) INL_ROBOT	},
#ifdef DOGFIGHT
  { "DOGFIGHT",		SYSDEF_ROBOT,	(void *) MARS_ROBOT	},
  { "CONTESTSIZE",	SYSDEF_INT,	&contestsize	},
  { "NUMMATCH",		SYSDEF_INT,	&nummatch	},
  { "SAVE_DOG_STAT",	SYSDEF_INT,	&dogcounts	},
#endif /* DOGFIGHT */
  { "MOTD",		SYSDEF_CHAR,	Motd		},
  { "SHIP",		SYSDEF_SHIP,	NULL		},
  { "REALITY",		SYSDEF_INT,	&reality	},
  { "MINSKIP",		SYSDEF_INT,	&minskip	},
  { "MAXSKIP",		SYSDEF_INT,	&maxskip	},
  { "",			SYSDEF_END,	NULL		}
};

/*

Procedure for adding new default value.
James Cameron, 26th January 1999.

- add to ntserv/data.c
- add to ntserv/data.h
- add to sysdef_keywords in ntserv/sysdefaults.h, in any order
- add to docs/sample_sysdef with comment about value meanings
- use glade to add to gum/gum.xml and regenerate code

*/
