/**************************************************************************
* Original Diku Mud copyright (C) 1990, 1991 by Sebastian Hammer, *
* Michael Seifert, Hans Henrik St{rfeldt, Tom Madsen, and Katja Nyboe. *
* *
* Merc Diku Mud improvements copyright (C) 1992, 1993 by Michael *
* Chastain, Michael Quan, and Mitchell Tse. *
* *
* In order to use any part of this Merc Diku Mud, you must comply with *
* both the original Diku license in 'license.doc' as well the Merc *
* license in 'license.txt'. In particular, you may not remove either of *
* these copyright notices. *
* *
* Much time and thought has gone into this software and you are *
* benefiting. We hope that you share your changes too. What goes *
* around, comes around. *
***************************************************************************
* ROM 2.4 is copyright 1993-1998 Russ Taylor *
* ROM has been brought to you by the ROM consortium *
* Russ Taylor (rtaylor@hypercube.org) *
* Gabrielle Taylor (gtaylor@hypercube.org) *
* Brian Moore (zump@rom.org) *
* By using this code, you have agreed to follow the terms of the *
* ROM license, in the file Rom24/doc/rom.license *
***************************************************************************
* 1stMUD ROM Derivative (c) 2001-2003 by Ryan Jennings *
* http://1stmud.dlmud.com/ <r-jenn@shaw.ca> *
***************************************************************************/
#if !defined(MERC_H)
#define MERC_H
#if defined(HAVE_CONFIG_H)
#include "config.h"
#endif
#if defined(WIN32)
#include <time.h>
#include <io.h>
#include <process.h>
#include <winsock2.h>
#include <sys\timeb.h>
#include <direct.h>
#include <lmcons.h>
#include "winstuff.h"
#else
#if !defined(_GNU_SOURCE)
#define _GNU_SOURCE
#endif
#include <unistd.h>
#include <sys/time.h>
#include <arpa/inet.h>
#include <sys/resource.h>
#include <sys/wait.h>
#include <netdb.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <pwd.h>
#include <dirent.h>
#include <limits.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdarg.h>
#include <errno.h>
#include <signal.h>
#include <fcntl.h>
#if defined(WIN32)
#pragma warning( disable: 4018 4244 4305 4761 4800 4309)
#if !defined(NO_COPYOVER)
#define NO_COPYOVER
#endif
#if !defined(NO_VTIMER)
#define NO_VTIMER
#endif
#if !defined(NOCRYPT)
#define NOCRYPT
#endif
#elif defined(__CYGWIN__)
#if !defined(NO_COPYOVER)
#define NO_COPYOVER
#endif
#if !defined(NOCRYPT)
#define NOCRYPT
#endif
#if !defined(NO_MCCP)
#define NO_MCCP
#endif
#endif
#if !defined(NO_MCCP)
#if defined(WIN32)
#include "zlib.h"
#else
#include <zlib.h>
#endif
#define TELOPT_COMPRESS 85
#define COMPRESS_BUF_SIZE 16384
#endif
#include "ansi.h"
#include "typedef.h"
#include "defines.h"
#include "board.h"
#include "structs.h"
#include "bits.h"
#include "gsn.h"
#include "macro.h"
/*
* Global variables.
*/
#include "globals.h"
#include "proto.h"
/*
* The crypt(3) function is not available on some operating systems.
* In particular, the U.S. Government prohibits its export from the
* United States to foreign countries.
*/
#if defined(NOCRYPT)
#define crypt(s1, s2) (s1)
#else
#include <crypt.h>
#endif
/*
* Data files used by the server.
*
* AREA_LIST contains a list of areas to boot.
* All files are read in completely at bootup.
* Most output files (bug, idea, typo, shutdown) are append-only.
*
* The NULL_FILE is held open so that we have a stream handle in reserve,
* so players can go ahead and telnet to all the other descriptors.
* Then we close it whenever we need to open a file (e.g. a save file).
*/
#if defined(WIN32)
#define DIR_SYM "\\"
#define NULL_FILE "nul"
#else
#define DIR_SYM "/"
#define NULL_FILE "/dev/null" /* To reserve one stream */
#endif
#define PLAYER_DIR ".."DIR_SYM"player"DIR_SYM /* Player files */
#define DATA_DIR ".."DIR_SYM"data"DIR_SYM
#define AREA_DIR ".."DIR_SYM"area"DIR_SYM
#define BIN_DIR ".."DIR_SYM"bin"DIR_SYM
#define LOG_DIR ".."DIR_SYM"log"DIR_SYM
#define NOTE_DIR ".."DIR_SYM"notes"DIR_SYM
#define AREA_LIST AREA_DIR "area.lst" /* List of areas */
#define BUG_FILE DATA_DIR "bugs.txt" /* For 'bug' and bug() */
#define TYPO_FILE DATA_DIR "typos.txt" /* For 'typo' */
#define SHUTDOWN_FILE DATA_DIR "shutdown.txt" /* For 'shutdown' */
#define HELP_FILE AREA_DIR "help.are"
#define BAN_FILE DATA_DIR "ban.dat"
#define MUSIC_FILE DATA_DIR "music.dat"
#define DISABLED_FILE DATA_DIR "disabled.dat" /* disabled commands */
#define STAT_FILE DATA_DIR "statlist.dat"
#define GQUEST_FILE DATA_DIR "gquest.dat"
#define WAR_FILE DATA_DIR "war.dat"
#define CLAN_FILE DATA_DIR "clans.dat"
#define COMMAND_FILE DATA_DIR "commands.dat"
#define SKILL_FILE DATA_DIR "skills.dat"
#define GROUP_FILE DATA_DIR "groups.dat"
#define RACE_FILE DATA_DIR "races.dat"
#define CLASS_FILE DATA_DIR "classes.dat"
#define SOCIAL_FILE DATA_DIR "social.dat"
#define CORPSE_FILE DATA_DIR "corpses.dat"
#define PIT_FILE DATA_DIR "pit.dat"
#define DEITY_FILE DATA_DIR "deity.dat"
#define WPWD_FILE DATA_DIR "webpass.dat"
#define MBR_FILE DATA_DIR "mbr.dat"
#define CHANNEL_FILE DATA_DIR "channels.dat"
#define MUD_FILE DATA_DIR "mud.dat"
#define TIME_FILE DATA_DIR "time.dat"
#if !defined(NO_COPYOVER)
#define COPYOVER_FILE DATA_DIR "copyover.txt"
#endif
#endif