#ifndef MUSICMUD_H #define MUSICMUD_H #include <stdlib.h> #include <stdarg.h> #include <stdio.h> #include <time.h> #include <string.h> #include "config.h" #include "World.h" #include "Object.h" #include "MudObject.h" #include "Verb.h" #include "NativeVerb.h" #include "Player.h" #include "log.h" #include "musicio.h" #include "keys.h" //! compare two C-strings for equality. either argument can be NULL. bool streq(const char *a, const char *b); //! number of object instances extern int objects; extern void (*aberhook)(); static inline void strfree(const char *a) { free((void*)a); } extern time_t code_reload, mud_reset, mud_reboot, mud_start, now; typedef World<MudObject> MudObjectWorld; //! A world collected with a preposition and an error code. class NewWorld : public MudObjectWorld { public: int all_nothing; const char *prep; string txt; }; class Global : public MudObjectWorld { public: MudObject *get(int idx) { return MudObjectWorld::get(idx); } MudObject *get(const string &s) { return MudObjectWorld::get(s); } // XXX this is backwards compatability hack for g++ 2.95 // we want using MudObjectWorld::get here. virtual MudObject *get(const char *tag); }; //! all the MudObjects in the world extern Global *planet; //! all the zones extern World<MudObject> *zones; //! the root object extern MudObject *mud; //! do a 'ctime' but with the timezone that o uses const char *ctime_for(MudObject *o, time_t *t); //! do a strftime but with the timezone that who uses string sstrftime(MudObject *who, const char *fmt, time_t when) __attribute__ ((format(strftime, 2, 0))); #include "privs.h" #define IS_OF(a, b) (dynamic_cast<b*>(a)) //! whether mobiles are turned on or off extern int game_mobiles; #endif