#ifndef BABBLEMUD_CONSTANTS_H
#define BABBLEMUD_CONSTANTS_H

// configuration constants

static const string MUDNAME = "BabbleMUD";     // server name
static const string VERSION = "2.24";        // server version
static const int MESSAGE_INTERVAL = 300;      // seconds between tick messages

// This is the time the "select" waits before timing out.
static const long COMMS_WAIT_SEC = 0;         // time to wait in seconds
static const long COMMS_WAIT_USEC = 500000;   // time to wait in microseconds
static const int NO_SOCKET = -1;              // indicator for no socket connected

// files and directories
static const string CONTROL_FILE    = "./system/control.xml";   // control file
static const string MESSAGES_FILE   = "./system/messages.xml";  // messages
static const string LOG_FILE            = "./log/game.~.log";   // log of interesting events
static const string LOG_FILE_FAILED     = "./log/failed.~.log"; // log of failed commands
static const string LOG_FILE_MOB_FAILED = "./log/mobfailed.~.log"; // log of failed mob commands
static const string LOG_FILE_WEB_SERVER = "./log/webserver.~.log"; // log of http server
static const string COMMANDS_DIR    = "./commands/";      // commands directory
static const string ROOMS_DIR       = "./rooms/";         // rooms directory
static const string WORLD_DIR       = "./world/";         // world directory
static const string OBJECTS_DIR     = "./objects/";       // objects directory
static const string MOBS_DIR        = "./mobs/";          // mobs directory
static const string RESETS_DIR      = "./resets/";        // resets directory
static const string WEB_DIR         = "./html/";          // web pages
static const string PLAYER_DIR      = "./players/";       // location of player files
static const string PLAYER_EXT      = ".player.xml";      // suffix for player files

// this is the colour code escaper, it is put here in case you want to
// change it, but beware it is probably liberally sprinkled through help
// files, descriptions, etc.
static const char COLOURCODE = '`';

static const string RESET = string (1, COLOURCODE) + "X";     // to reset colours

// player names must consist of characters from this list
// warning - do not permit things like . or / or they might make a name
// that "escapes" from the player directory (eg. ../system/blah)
// also, be cautious that if you allow extra characters that you change
// regular expressions in the "match" text for commands, so that player
// names will be regognised, eg. kick (?P<target>\w+)

static const string valid_player_name = 
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";

// valid names for flags (must be parseable by XML parser)
static const string valid_flag_name =
  "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._";

/*
Warning re colours:

I am caching retrieval of the colour codes from the control file (eg. the colour
to show room descriptions in) in the grounds that they will change infrequently,
and doing so will speed up the server.

Thus, if you edit the control data, and change, for example:

  colour_inventory="`R"
  
  to something else, the change will not take effect until next restart.

If you really don't like this, change the define below "CACHE_COLOURS" to be empty.

*/

#define CACHE_COLOURS static    // make empty to not cache colours

#endif // BABBLEMUD_CONSTANTS_H

