#ifndef BABBLEMUD_GLOBALS_H
#define BABBLEMUD_GLOBALS_H

#include <set>
#include <string>
#include <map>
#include <fstream>

#include "object.h"

#include "exceptions.h"
#include "player.h"   // for player list
#include "webclient.h"   // for player list
#include "room.h"     // for rooms and exits
#include "events.h"   // for events

// list of all connected players
PlayerList & playerlist ();   
// list of all connected web clients
WebClientList & webclientlist ();   
// list of all mobs
CharacterList & moblist ();   
// map of all rooms
WorldMap & world ();
// objects
ObjectList & objects ();
// mobs
ObjectList & mobs ();
// resets
ObjectList & resets ();
// rooms
ObjectList & rooms ();
// errors (for throwing)
StringMap & errormap ();
// messages (for general use)
StringMap & messagemap ();
// commands
ObjectList & commands ();
// command handlers
CommandHandlerMap & getCommandHandlerMap ();
// web page handlers
WebHandlerMap & getWebHandlerMap ();
// connection states
StateHandlerMap & getStateMap ();
// event handlers
EventHandlerMap & getEventHandlerMap ();
// control items
TopThing & control ();
// events queue
EventQueue & eventQueue ();
// who is playing?
PlayingMap & playing ();
// miscellaneous server info (not saved)
thing & serverInfo ();  
// bad passwords
StringIntMap & badPlayerPasswords ();
StringIntMap & badWebPasswords ();

// global variables
extern bool   bStopNow;      // when set, the MUD shuts down
extern time_t tLastMessage;      // time we last sent a periodic message 
extern int    iMudControl;  // socket for accepting new players 
extern int    iWebControl;  // socket for accepting new web clients 

extern ofstream logFileGeneral;
extern ofstream logFileFailedCommands;
extern ofstream logFileFailedMobCommands;
extern ofstream logFileWebServer;


#endif  // BABBLEMUD_GLOBALS_H
