/* Netrek Configuration file - by Kurt Siegl * */ #ifndef __CONFIG_H #define __CONFIG_H /* ################################################################################ Type of code (select in configure.in) ################################################################################ */ #undef COW #undef SERVER #undef STABLE /* ################################################################################ All The fun defines ################################################################################ */ /* Defines Some possible values: NOTE: Only NON-system specific defines belong here */ /* ------------------------------------------------------------ Common defines ------------------------------------------------------------ */ /* RSA - New RSA reserved packets stuff */ /* #define RSA - Defined in the Makefile */ #define RCD /* RCD - Support Reciever variable distresses */ /* PING - Ping statistics */ #define PING /* SHORT_PACKETS - Reduce Network load */ /* This define has no meaning for the server */ #define SHORT_PACKETS /* SPEEDUP - Misc improvements to make the code faster */ /* This define has no meaning for the server */ #define SPEEDUP /* FEATURE_PACKETS - feature packets */ #define FEATURE_PACKETS /* DEBUG - Various useful debugging stuff. No signal trap */ #undef DEBUG /* ------------------------------------------------------------ COW only defines ------------------------------------------------------------ */ #ifdef COW /* NBT - Nick trown's macro code */ #define NBT /* MAXPLAYER - Maximal number of players + observers */ /* REMOVED from config.h.in due to redundancy */ /* Look for it in ntserv/defs.h */ /* CORRUPTED_PACKETS - prevents some seg faults but verbose output */ #define CORRUPTED_PACKETS /* EXPIRE=# - number of days this version will work for */ #ifndef STABLE #define EXPIRE 365 #endif /* ARMY_SLIDER - some sort of funky status window thing */ #define ARMY_SLIDER /* META - show active servers via metaserver - NBT */ #define META /* PACKET_LOG - log packets to stdout (for bandwith measurement) */ #define PACKET_LOG /* NEWMACRO - newmacro language */ #define NEWMACRO /* SMARTMACRO - macro extension (needs NEWMACRO) */ #define SMARTMACRO /* MULTILINE_MACROS - enables multiline macros */ #define MULTILINE_MACROS /* XTREKRC_HELP - Hadley's xtrekrc window (stolden by KP) */ #define XTREKRC_HELP /* TOOLS - Various tools, like shell escape, ... */ #define TOOLS /* SOUND - support of external sound players */ #define SOUND /* HOCKEY_LINES - allow showing of hockey lines */ #define HOCKEY_LINES /* SMALL_SCREEN - for 800x600 resolution screens */ /* #define SMALL_SCREEN */ /* BEEPLITE - player and planets highlighting */ #define BEEPLITE /* VSHIELD_BITMAPS - damage dependent shields (hull) */ #define VSHIELD_BITMAPS #define VARY_HULL /* WARP_DEAD - Use death detection */ #undef WARP_DEAD /* RCM - Receiver configurable Server messages */ #define RCM /* RACE_COLORS - additional bitplane for race colors */ #define RACE_COLORS /* XTRA_MESSAGE_UI - Show message being typed on the local display */ #define XTRA_MESSAGE_UI #define PLIST1 #define PLIST #define CONTROL_KEY #define BRMH #define DOC_WIN #define RABBIT_EARS #define ROTATERACE #define FUNCTION_KEYS /* client options */ #define IGNORE_SIGNALS_SEGV_BUS #define NEW_DASHBOARD_2 #define MOUSE_AS_SHIFT #define SHIFTED_MOUSE #define TNG_FED_BITMAPS #define MOTION_MOUSE #define DIST_KEY_NAME #define PHASER_STATS #define RECORDGAME #endif /* COW */ /* ------------------------------------------------------------ SERVER only defines ------------------------------------------------------------ */ #ifdef SERVER /* AUTOMOTD - Updates your MOTD every 12 hours */ #undef AUTOMOTD /* CHECKMESG - Check for god messages and/or log all messages */ #define CHECKMESG /* ERIKPLAGUE - Define for Erik's Plagueing */ #define ERIKPLAGUE /* FEATURES - Server/client communication */ #define FEATURES /* REVERSED_HOSTNAMES - Truncate the short hostname from the end rather than the start */ #define REVERSED_HOSTNAMES #undef DNSBL_CHECK /* DNSBL_CHECK - Check player's IP against public DNS blacklists to detect open proxies as well as possibly infected computers. */ #ifdef DNSBL_CHECK #undef DNSBL_SHOW /* DNSBL_SHOW - Show possible proxies to ALL and in WHOIS, otherwise just log it */ #define DNSBL_PROXY_MUTE /* DNSBL_PROXY_MUTE - Automatically mute hosts that are detected as possible open proxies */ #define DNSBL_WARN /* DNSBL_WARN - Warn players who appear on the infected host lists with a private message */ #undef DNSBL_WARN_VERBOSE /* DNSBL_WARN_VERBOSE - Alert all players of a possibly infected host */ #endif /* INL_POP - Use INL style planet popping scheme */ #define INL_POP /* LTD_STATS - Leonard/Tom/Dave extended player statistics. See README.LTD for details. THIS BREAKS PLAYERDB COMPATIBILITY!! */ #undef PKEY /* PKEY - shared memory key, to override key specified in ntserv/defs.h */ #undef LTD_STATS /* LTD_PER_RACE - LTD stats are normally combined regardless of which race the player is playing. Define this to further split the stats by race. NOTE: THIS IS REQUIRED for LTD enabled INL servers. */ /* NOTE: DO NOT USE THIS WITH PICKUP SERVERS AT THIS TIME */ #undef LTD_PER_RACE /* ARMYTRACK - Generate army tracking WRN messages in log */ #define ARMYTRACK /* NO_PLANET_PLAGUE -Define for plagueing (Don't use with ERIKPLAGUE) */ #undef NO_PLANET_PLAGUE /* SHOW_RSA - Display the client type at login */ #define SHOW_RSA /* RESETGALAXY - Reset the galaxy after each conquer */ #define RESETGALAXY /* SELF_RESET - Galaxy will reset if the daemon dies */ #define SELF_RESET /* SHORT_THRESHOLD - For Short Packets */ #undef SHORT_THRESHOLD /* SURRENDER_SHORT - Cut surrender time in half */ #undef SURRENDER_SHORT /* TWO_RACE - Conquer only a 1/4 of the galaxy for reset */ #define TWO_RACE /* SENDFLAGS - Print flags set in MOTD */ #undef SENDFLAGS /* SENDPATCHLEVEL - Print release and patch level in MOTD */ #define SENDPATCHLEVEL /* CHECK_ENV - Check environment variable NTSERV_PATH for location of system files */ #undef CHECK_ENV /* GPPRINT - Print which path is being used to find the system files */ #undef GPPRINT /* ONCHECK - support for trekon player check */ #undef ONCHECK /* NBR - Leave in for server. It tells programs like xsg that it is this code. */ #define NBR /* NEED_EXIT - For systems that need exit defined */ #define NEED_EXIT /* SB_CALVINWARP - calvin style transwarp */ #undef SB_CALVINWARP /* FLAT_BONUS - 3x bonus for killing last army on a planet */ #undef FLAT_BONUS /* BASEPRACTICE - trainingserver support */ #define BASEPRACTICE /* NEWBIESERVER - twinkserver support */ #define NEWBIESERVER /* PRETSERVER - pre-T bot support */ #define PRETSERVER /* PRETKEEPALIVE - keep pre-T mode going even if there are no humans; this works around a stuck Kathy bug that should be fixed */ #define PRETKEEPALIVE /* STURGEON - sturgeon mode support */ #define STURGEON /* NEW_CREDIT - give 1 planet for destroying, two planets for taking. Be sure to scale your player database's planet counts by a factor of three - running newscores as compiled with a -DCONVERT _once_ will do this scaling for you */ #undef NEW_CREDIT /* SBFUEL_FIX - fix starbase re-fueling */ #define SBFUEL_FIX /* NEW_ETEMP - Wreck's etemp fix */ #undef NEW_ETEMP /* DOGFIGHT - .sysdef interface for dogfight robot */ /* CLUE2 - include harder clue questions */ #undef CLUE2 #define DOGFIGHT #define NODOCK /* NODOCK allow per-slot docking priveledges */ #define NOTRANSWARP /* NOTRANSWARP - allow starbase to set transwarp initiation restrictions */ /* NO_BRUTALITY - disallow fighting between waiting players in the dogfighting mode */ #ifdef DOGFIGHT #define NO_BRUTALITY #endif /* AS_CLOAK - gives cloaked AS's more randomness in their apparent positions */ #undef AS_CLOAK /* GENO_COUNT - keep track of a player's winning genocides, see tools/conq_vert.c for a description of how to use this define. */ #undef GENO_COUNT /* AUTO_INL - starts up INL robot by majority vote */ /* WARNING: AUTO_INL as currently implemented may hose your player database because the INL server must provide cleared stats at startup. Enable this only if you have no intention of retaining stats on the server for pickup */ #undef AUTO_INL /* AUTO_PRACTICE - starts up PRACTICE robot by majority vote */ #ifdef BASEPRACTICE #define AUTO_PRACTICE #endif /* AUTO_HOCKEY - starts up HOCKEY robot by majority vote */ #define AUTO_HOCKEY /* AUTO_DOGFIGHT - starts up DOGFIGHT robot by majority vote */ /* DOG_RANDOM - somewhat random player placement in arena */ #ifdef DOGFIGHT #define AUTO_DOGFIGHT /* #define DOG_RANDOM */ #endif /* TRIPLE_PLANET_MAYHEM - enable voting for the three planet cool server idea by felix@coop.com */ #define TRIPLE_PLANET_MAYHEM /* Balance vote weightings; how important each t-mode stat is for calculating a player value */ #define BALANCE_BOMBING 100 #define BALANCE_PLANET 100 #define BALANCE_DEFENSE 0 #define BALANCE_OFFENSE 100 /* MESSAGES_ALL_TIME - allow messaging during freezes like twarp, refit, and war decl. required to be set for INL robot use. */ #define MESSAGES_ALL_TIME /* RANDOM_PRACTICE_ROBOT - Gives the practice robot (Hoser) the option of comming out in a random ship type. */ #undef RANDOM_PRACTICE_ROBOT /* Rolling statistics - makes the player stats reflect the immediate playing history of each player, for office games using BALANCE. Set slots to 20 and mask to 32767 for 18 hours. */ #undef ROLLING_STATS #undef ROLLING_STATS_SLOTS #undef ROLLING_STATS_MASK /* UDP_PORTSWAP - Allow the client to initiate the UDP connection first if it so chooses. This allows UDP connections through some packet filtering firewalls. */ #define UDP_PORTSWAP /* NO_CHUNG_CREDIT - Avoid crediting a player for armies killed by their own death due to a plasma owned by their team. Not a particularly common misuse but a few people asked for this, apparently just because of one player. */ #undef NO_CHUNG_CREDIT /* NO_BEAM_DOWN_OUT_OF_T_MODE - Prevent beaming down from working if t-mode is not active. */ #undef NO_BEAM_DOWN_OUT_OF_T_MODE /* PLAYER_INDEX - create and maintain an index of the player database, to reduce time to log in for servers with large or untrimmed player databases, requires libgdbm, and indexes only characters who return to the server. */ #define PLAYER_INDEX /* ROBOT_OBSERVER_OFFSET - force observers to start in slot 'h' thereby forcing the moderation bots to occupy slot 'g'. */ #undef ROBOT_OBSERVER_OFFSET /* SB_RAPID_COOLDOWN - enables twice the normal rate of weapon cool down. Useful in base practice mode */ #undef SB_RAPID_COOLDOWN /* ALLOW_PRACTICE_ROBOT_SB - allows practice robots to be refitted into SBs */ #undef ALLOW_PRACTICE_ROBOT_SB #endif /* SERVER */ /* ############################################################################## All system dependencies should be defined here ############################################################################## */ #define NEED_EXIT /* Automatic generated system dependend defines */ #undef HAVE_MATH_H #undef HAVE_STDLIB_H #undef _ALL_SOURCES #undef HAVE_SYS_SIGNAL_H #undef BSD_SIGNALS #undef SYSV_SIGNALS #undef POSIX_SIGNALS #undef RESTARTABLE_SYSCALLS #undef NEED_MEMORY_H #define STDC_HEADERS 1 /* 13/01/94 omit hosed index [007] */ #undef HAVE_WAIT3 #undef NEED_SYS_SELECT_H /* Guess we suck badly if that happens :( */ #undef NO_FD_SET #undef HAVE_UNISTD_H #undef HAVE_SYS_TIMEB_H #undef TM_IN_SYS_TIME #undef TIME_WITH_SYS_TIME #undef NEED_SYS_TIME_H #undef HAVE_SYS_PTYIO_H #undef HAVE_SYS_FCNTL_H #undef HAVE_FCNTL_H #undef HAVE_CTYPE_H #undef HAVE_MACHINE_ENDIAN_H #undef HAVE_SYS_RESOURCE_H #undef HAVE_SYS_WAIT_H #undef HAVE_NETINET_IN_H /* Needed for Solaris 2.x */ #undef HAVE_SYS_FILIO_H #undef HAVE_GMP2_H #undef NO_U_INT #undef SIZEOF_LONG #undef HAVE_USLEEP #undef HAVE_SETSTATE #undef HAVE_RANDOM #undef HAVE_STRFTIME #undef HAVE_FTIME #undef HAVE_STRCMPI #undef HAVE_STRNCMPI #undef HAVE_NINT #undef NEED_RINT_DEC #undef RETSIGTYPE #undef pid_t #undef uid_t #undef gid_t #undef size_t #undef vfork #if (defined(sparc) && defined(sun)) #define vfork fork #endif #undef NO_PATH_MAX #undef inline #ifdef COW #undef HAVE_X11 #undef HAVE_WIN32 #undef HAVE_XPM #undef HAVE_X11_XPM_H /* Autodetection error with GNU win32 */ #ifdef HAVE_WIN32 #define HAVE_STRCMPI #define HAVE_STRNCMPI #endif #endif #ifdef SERVER /* paths substituted by configure, see AC_DEFINE_UNQUOTED in configure.in */ #define LIBDIR "/usr/local/games/netrek" #define BINDIR "/usr/local/games/netrek" #define SYSCONFDIR "/usr/local/games/netrek" #define LOCALSTATEDIR "/usr/local/games/netrek" /* System dependend programs */ #define UPTIME "/usr/ucb/uptime" #define NETSTAT "/bin/true" /* UDP connection timeout fix for SYSV machines */ #ifdef HAVE_UNISTD_H #define UDP_FIX #endif #endif /* System dependend macros */ /* SYSV signal handling */ #ifdef SYSV_SIGNALS #include #define SIGNAL(x,y) sigset(x,y) #define PAUSE(x) sigpause(x) #define SIGSETMASK(x) { } #else #define SIGNAL(x,y) signal(x,y) #define PAUSE(x) pause() #define SIGSETMASK(x) sigsetmask(x) #endif #ifdef POSIX_SIGNALS #define HANDLE_SIG(s,h) signal(s,h) #define setjmp(x) sigsetjmp(x,1) #define longjmp(x,y) siglongjmp(x,y) #else #define HANDLE_SIG(s,h) {} #endif #ifdef STDC_HEADERS #define INC_STRINGS #else #define INC_STRINGS #endif #ifdef STDC_HEADERS #define MCMP(x,y,z) memcmp(x,y,z) #define MCOPY(b1,b2,l) memcpy(b2,b1,l) #define MZERO(b1,l) memset(b1,0,l) #define INDEX(s,c) strchr(s,c) #define RINDEX(s,c) strrchr(s,c) #else #define INDEX(s,c) index(s,c) #define RINDEX(s,c) rindex(s,c) #define MCMP(x,y,z) bcmp(x,y,z) #define MCOPY(b1,b2,l) bcopy(b1,b2,l) #define MZERO(b1,l) bzero(b1,l) #endif #ifdef SPEEDUP /* strncpy is terrible slow */ #ifdef NEED_MEMORY_H #include #else #include #endif /* #define STRNCPY(x,y,z) memcpy(x,y,z) */ #define STRNCPY(x,y,z) memccpy(x,y,'\0',z) #else #define STRNCPY(x,y,z) strncpy(x,y,z) #endif #ifndef HAVE_WAIT3 #define WAIT3(x,y,z) waitpid(-1, x, y ) #else #define WAIT3(x,y,z) wait3(x, y, z) #endif #if (defined(HAVE_RANDOM) && defined(HAVE_SETSTATE)) || !defined(HAVE_RANDOM) #define RANDOM() random() #define SRANDOM(x) srandom(x) #else #define RANDOM() rrandom() #define SRANDOM(x) ssrandom(x) extern void ssrandom (); extern long rrandom (); #endif #if !defined(HAVE_RANDOM) extern void srandom (); extern long random (); #endif #if (SIZEOF_LONG == 8) #define _64BIT #define LONG int #define U_LONG u_int #else #define LONG long #define U_LONG u_long #endif /* Some Server specific programs */ #ifdef SERVER #include /* SYSV Types */ #ifdef NO_U_INT #define u_char unchar #define u_int uint #define u_long ulong #define u_short ushort #endif #ifdef HAVE_UNISTD_H #if defined (hpux) || defined(__osf__) #define SETPGRP() setsid() #else #if defined (linux) || defined(sgi) || (defined(sparc) && defined(sun)) #define SETPGRP() setpgrp() #else #define SETPGRP() setpgrp (0, 0) #endif #endif #else #define SETPGRP() setpgrp (0, getpid()) #endif #ifdef _SEQUENT_ #define PERMS O_RDWR | O_NOCTTY #else #define PERMS O_RDWR #endif #if defined(HAVE_UNISTD_H) && defined(TIOCTTY) #define IOCTL(i) \ int zero = 0; \ (void) ioctl (i, TIOCTTY, &zero); #else #if defined(TIOCNOTTY) #define IOCTL(i) \ (void) ioctl (i, TIOCNOTTY, (char *) 0); #else #define IOCTL(i) #endif #endif #define DETACH {\ int i; \ if ((i = open("/dev/tty", PERMS, 0)) >=0) { \ IOCTL(i) \ (void) close (i); \ } \ SETPGRP(); \ } #ifdef HAVE_USLEEP #define USLEEP(x) usleep(x) #else #define USLEEP(x) microsleep(x) /* from util.c */ #endif #if defined (SunOS) /* this core dumps with SIGSEGV on a sparc-10 */ #define LONGJMP(x,y) return; #else #define LONGJMP(x,y) longjmp(x,y); #endif #if defined (hpux) #define PCLOSE(x) fclose(x) #else #define PCLOSE(x) pclose(x) #endif #if defined (__sequent__) #define WAIT_TYPE union wait #define WSTOPSIG(foo) 0 #else #define WAIT_TYPE int #endif #endif /* SERVER programs */ /* System dependend Include files */ #ifdef SERVER #define NULLFILE "../null" #else #define NULLFILE "null" #endif #ifdef NEED_SYS_SELECT_H #define INC_SYS_SELECT #ifdef SERVER /* fd_set is used in data.h of the server */ #include #endif #else #define INC_SYS_SELECT NULLFILE #endif #define SELECT select #ifdef HAVE_UNISTD_H #define INC_UNISTD #else #define INC_UNISTD NULLFILE #endif #ifdef HAVE_SYS_SIGNAL_H #define INC_SYS_SIGNAL #else #define INC_SYS_SIGNAL NULLFILE #endif #ifdef HAVE_SYS_FCNTL_H #define INC_SYS_FCNTL #else #define INC_SYS_FCNTL NULLFILE #endif #ifndef VMS #ifdef HAVE_FCNTL_H #define INC_FCNTL #else #define INC_FCNTL NULLFILE #endif #else #define INC_FCNTL #endif /* Some systems don't include in */ #if defined(TM_IN_SYS_TIME) || defined(NEED_SYS_TIME_H) #define INC_SYS_TIME #else #define INC_SYS_TIME NULLFILE #endif #ifdef HAVE_SYS_PTYIO_H #define INC_SYS_PTYIO #else #define INC_SYS_PTYIO NULLFILE #endif #ifdef HAVE_CTYPE_H #define INC_CTYPE #else #define INC_CTYPE NULLFILE #endif #ifdef HAVE_MACHINE_ENDIAN_H #define INC_MACHINE_ENDIAN #else #define INC_MACHINE_ENDIAN NULLFILE #endif #ifdef HAVE_SYS_RESOURCE_H #define INC_SYS_RESOURCE #else #define INC_SYS_RESOURCE NULLFILE #endif #ifdef HAVE_SYS_WAIT_H #define INC_SYS_WAIT #else #define INC_SYS_WAIT NULLFILE #endif #ifdef HAVE_NETINET_IN_H #define INC_NETINET_IN #else #define INC_NETINET_IN NULLFILE #endif /* Replace outdated ftime with gettimeofday */ #if defined(HAVE_SYS_TIMEB_H) && defined(HAVE_FTIME) #define INC_SYS_TIMEB #else #define NOTIMEB #define INC_SYS_TIMEB #endif #ifdef HAVE_GMP2_H #define INC_MP #define MPTYPEDEF typedef mpz_t MPTYPE; #define assignItom(x,i) {mpz_init(x); mpz_set_ui(x,i);} #define madd(x, y, z) mpz_add(z, x, y) #define msub(x, y, z) mpz_sub(z, x, y) #define mult(x, y, z) mpz_mul(z, x, y) #define mdiv(n, d, q, r) mpz_fdiv_qr(q, r, n, d) #define sdiv(n, d, q, r) *r = mpz_fdiv_q_ui(q, n, d) #define msqrt(x, y, z) mpz_sqrt(z, x, y) #define mp_pow(x, y, z, a) mpz_powm(a, x, y, z) #define gcd(x, y, z) mpz_gcd(z, x, y) #define mcmp(x, y) mpz_cmp(x, y) #define min(x) mpz_min(x) #define mout(x) mpz_mout(x) #define mfree(x) mpz_clear(x) #else #define MPTYPEDEF typedef MINT *MPTYPE; #define assignItom(x,i) x= itom(i) #define mp_pow(x, y, z, a) pow(x, y, z, a) #define INC_MP #endif #ifdef NO_PATH_MAX #define PATH_MAX 255 #define INC_LIMITS NULLFILE #else #define INC_LIMITS #endif #ifdef HAVE_XPM #ifdef HAVE_X11_XPM_H #define INC_XPM #else #define INC_XPM #endif #else #define INC_XPM NULLFILE #endif /* Unchecked machine dependencies */ #ifdef linux #define SHMFLAG sizeof(struct memory) #else #define SHMFLAG 0 #endif #if defined(sun3) #define INC_STDLIB NULLFILE #else #define INC_STDLIB #endif #ifndef sun4 #if defined(HAVE_NINT) && defined(HAVE_MATH_H) #define INC_MATH #else #if defined(NEED_RINT_DEC) extern double rint(double); #define INC_MATH NULLFILE #else #define INC_MATH #endif #define nint(x) ((int) rint(x)) #endif #endif #ifdef VMS #define R_OK 04 typedef unsigned short int ushort; #define Sin sinetable #define Cos cosinetable #define strncasecmp strncmp #include /* for struct timeval */ #include "vmsutils.h" /* for typedef fd_set & FD_ macros */ #endif /* Some systems, most notably SunOS 4.1.3, don't include function definitions in the libraries. This results in some warning we don't want. This header defines the type for all these functions. */ #ifdef sun4 #include #include #include int close(int); int connect(int, struct sockaddr *, int); int fprintf(FILE *, const char *, ...); int fputs(char *, FILE *); char *memccpy(char *, char *, int, int); int perror(char *); int socket(int, int, int); int sscanf(char *, char *, ...); char *strdup(char *arg); char _filbuf(FILE *); int _flsbuf(unsigned char, FILE *); #endif /* defined sun4 */ #ifdef WIN32 typedef unsigned short int ushort; #define strncasecmp strncmp #ifdef THREADED #define THREAD(fn) { DWORD junk; CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)f #define ENDTHREAD ExitThread(0); typedef unsigned long int SEMAPHORE; #define CREATE_SEMAPHORE(initstate) CreateEvent(NULL, 1, initstate, NULL) #define SET_SEMAPHORE(sem) SetEvent((HANDLE)sem) #define RESET_SEMAPHORE(sem) ResetEvent((HANDLE)sem) #endif #endif #ifdef _MSC_VER #define INC_STRINGS #define INC_IO #else #define INC_IO NULLFILE #endif /* Solaris specific stuff */ #if defined(HAVE_SYS_FILIO_H) #define INC_SYS_FILIO #else #define INC_SYS_FILIO NULLFILE #endif #endif /* __CONFIG_H */