From ad9c0df5525237dcb29b7bb6ec718f9e8ffa75b5 Mon Sep 17 00:00:00 2001 From: akkadius Date: Sat, 29 Nov 2014 03:12:34 -0600 Subject: [PATCH] #include and forward declaration cleanup of client.cpp net.cpp questmgr.cpp zone.cpp zone.h --- zone/client.cpp | 14 ---------- zone/net.cpp | 2 +- zone/questmgr.cpp | 71 ++++++++++------------------------------------- zone/zone.cpp | 63 +++++++++++++++++++---------------------- zone/zone.h | 28 +++++-------------- 5 files changed, 51 insertions(+), 127 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 7ceb12496..e4f2c823a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -17,13 +17,9 @@ */ #include "../common/debug.h" #include -#include -#include #include #include #include -#include -#include // for windows compile #ifdef _WINDOWS @@ -39,27 +35,17 @@ extern volatile bool RunLoops; #include "../common/features.h" -#include "../common/misc.h" #include "../common/spdat.h" -#include "../common/packet_dump.h" -#include "../common/packet_functions.h" -#include "../common/serverinfo.h" -#include "../common/zone_numbers.h" -#include "../common/moremath.h" #include "../common/guilds.h" -#include "../common/breakdowns.h" #include "../common/rulesys.h" #include "../common/string_util.h" #include "../common/data_verification.h" #include "net.h" -#include "masterentity.h" #include "worldserver.h" #include "zonedb.h" #include "petitions.h" -#include "forage.h" #include "command.h" #include "string_ids.h" -#include "npc_ai.h" #include "client_logs.h" #include "guild_mgr.h" #include "quest_parser_collection.h" diff --git a/zone/net.cpp b/zone/net.cpp index 498ed5102..034c30747 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -97,7 +97,7 @@ extern Zone* zone; EQStreamFactory eqsf(ZoneStream); npcDecayTimes_Struct npcCorpseDecayTimes[100]; TitleManager title_manager; -QueryServ *QServ = 0; +QueryServ *QServ = 0; TaskManager *taskmanager = 0; QuestParserCollection *parse = 0; diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 458a448d9..2ce1dbc37 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -16,66 +16,28 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* - -Assuming you want to add a new perl quest function named joe -that takes 1 integer argument.... - -1. Add the prototype to the quest manager: -questmgr.h: add (~line 50) - void joe(int arg); - -2. Define the actual function in questmgr.cpp: -void QuestManager::joe(int arg) { - //... do something -} - -3. Copy one of the XS routines in perlparser.cpp, preferably - one with the same number of arguments as your routine. Rename - as needed. - Finally, add your routine to the list at the bottom of perlparser.cpp - - -4. -If you want it to work in old mode perl and .qst, edit parser.cpp -Parser::ExCommands (~line 777) - else if (!strcmp(command,"joe")) { - quest_manager.joe(atoi(arglist[0])); - } - -And then at then end of embparser.cpp, add: -"sub joe{push(@cmd_queue,{func=>'joe',args=>join(',',@_)});}" - - - -*/ - -#include "../common/debug.h" -#include "entity.h" -#include "masterentity.h" -#include - -#include -#include -#include - -#include "worldserver.h" -#include "net.h" -#include "../common/skills.h" #include "../common/classes.h" -#include "../common/races.h" -#include "zonedb.h" +#include "../common/debug.h" +#include "../common/rulesys.h" +#include "../common/skills.h" #include "../common/spdat.h" -#include "../common/packet_functions.h" #include "../common/string_util.h" -#include "spawn2.h" -#include "zone.h" +#include "entity.h" #include "event_codes.h" #include "guild_mgr.h" -#include "../common/rulesys.h" +#include "net.h" #include "qglobals.h" -#include "quest_parser_collection.h" #include "queryserv.h" +#include "questmgr.h" +#include "quest_parser_collection.h" +#include "spawn2.h" +#include "worldserver.h" +#include "zone.h" +#include "zonedb.h" +#include +#include +#include + #ifdef BOTS #include "bot.h" #endif @@ -85,9 +47,6 @@ extern Zone* zone; extern WorldServer worldserver; extern EntityList entity_list; -#include "questmgr.h" - -//declare our global instance QuestManager quest_manager; #define QuestManagerCurrentQuestVars() \ diff --git a/zone/zone.cpp b/zone/zone.cpp index ecf10bcb5..9b42bfb68 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -15,17 +15,14 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" + +#include #include -#include +#include #include #include -#include -#include -#include #ifdef _WINDOWS -#include #define snprintf _snprintf #define vsnprintf _vsnprintf #else @@ -33,31 +30,26 @@ #include "../common/unix.h" #endif -#include "masterentity.h" +#include "../common/debug.h" #include "../common/features.h" -#include "spawngroup.h" -#include "spawn2.h" -#include "zone.h" -#include "worldserver.h" -#include "npc.h" -#include "net.h" -#include "../common/seperator.h" -#include "../common/packet_dump_file.h" -#include "../common/eq_stream_factory.h" -#include "../common/eq_stream.h" -#include "../common/string_util.h" -#include "zone_config.h" -#include "../common/breakdowns.h" -#include "map.h" -#include "water_map.h" -#include "object.h" -#include "petitions.h" -#include "pathing.h" -#include "event_codes.h" -#include "client_logs.h" #include "../common/rulesys.h" +#include "../common/seperator.h" +#include "../common/string_util.h" +#include "client_logs.h" #include "guild_mgr.h" +#include "map.h" +#include "net.h" +#include "npc.h" +#include "object.h" +#include "pathing.h" +#include "petitions.h" #include "quest_parser_collection.h" +#include "spawn2.h" +#include "spawngroup.h" +#include "water_map.h" +#include "worldserver.h" +#include "zone_config.h" +#include "zone.h" #ifdef _WINDOWS #define snprintf _snprintf @@ -65,18 +57,19 @@ #define strcasecmp _stricmp #endif - +extern bool staticzone; +extern NetConnection net; +extern PetitionList petition_list; +extern QuestParserCollection* parse; +extern uint16 adverrornum; +extern uint32 numclients; extern WorldServer worldserver; extern Zone* zone; -extern uint32 numclients; -extern NetConnection net; -extern uint16 adverrornum; -extern PetitionList petition_list; + Mutex MZoneShutdown; -extern bool staticzone; -Zone* zone = 0; + volatile bool ZoneLoaded = false; -extern QuestParserCollection* parse; +Zone* zone = 0; bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { const char* zonename = database.GetZoneName(iZoneID); diff --git a/zone/zone.h b/zone/zone.h index 0fa390512..2d74c9f17 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -18,25 +18,13 @@ #ifndef ZONE_H #define ZONE_H -#include "../common/mutex.h" -#include "../common/linked_list.h" -#include "../common/types.h" #include "../common/eqtime.h" -#include "../common/servertalk.h" +#include "../common/linked_list.h" #include "../common/rulesys.h" -#include "../common/eq_packet_structs.h" -#include "../common/features.h" -#include "spawngroup.h" -//#include "mob.h" -#include "zonedump.h" -#include "spawn2.h" -#include "tasks.h" -#include "pathing.h" +#include "../common/types.h" #include "qglobals.h" -#include - -class Map; -class WaterMap; +#include "spawn2.h" +#include "spawngroup.h" struct ZonePoint { @@ -78,12 +66,10 @@ struct item_tick_struct { std::string qglobal; }; -extern EntityList entity_list; -class database; +class Map; +class WaterMap; class PathManager; -struct SendAA_Struct; - -class database; +extern EntityList entity_list; class Zone {