#include and forward declaration cleanup of

client.cpp net.cpp questmgr.cpp zone.cpp zone.h
This commit is contained in:
akkadius 2014-11-29 03:12:34 -06:00
parent 8cd19670ab
commit ad9c0df552
5 changed files with 51 additions and 127 deletions

View File

@ -17,13 +17,9 @@
*/ */
#include "../common/debug.h" #include "../common/debug.h"
#include <iostream> #include <iostream>
#include <iomanip>
#include <sstream>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <signal.h>
#include <math.h>
// for windows compile // for windows compile
#ifdef _WINDOWS #ifdef _WINDOWS
@ -39,27 +35,17 @@
extern volatile bool RunLoops; extern volatile bool RunLoops;
#include "../common/features.h" #include "../common/features.h"
#include "../common/misc.h"
#include "../common/spdat.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/guilds.h"
#include "../common/breakdowns.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "../common/data_verification.h" #include "../common/data_verification.h"
#include "net.h" #include "net.h"
#include "masterentity.h"
#include "worldserver.h" #include "worldserver.h"
#include "zonedb.h" #include "zonedb.h"
#include "petitions.h" #include "petitions.h"
#include "forage.h"
#include "command.h" #include "command.h"
#include "string_ids.h" #include "string_ids.h"
#include "npc_ai.h"
#include "client_logs.h" #include "client_logs.h"
#include "guild_mgr.h" #include "guild_mgr.h"
#include "quest_parser_collection.h" #include "quest_parser_collection.h"

View File

@ -16,66 +16,28 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 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 <limits.h>
#include <sstream>
#include <iostream>
#include <list>
#include "worldserver.h"
#include "net.h"
#include "../common/skills.h"
#include "../common/classes.h" #include "../common/classes.h"
#include "../common/races.h" #include "../common/debug.h"
#include "zonedb.h" #include "../common/rulesys.h"
#include "../common/skills.h"
#include "../common/spdat.h" #include "../common/spdat.h"
#include "../common/packet_functions.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "spawn2.h" #include "entity.h"
#include "zone.h"
#include "event_codes.h" #include "event_codes.h"
#include "guild_mgr.h" #include "guild_mgr.h"
#include "../common/rulesys.h" #include "net.h"
#include "qglobals.h" #include "qglobals.h"
#include "quest_parser_collection.h"
#include "queryserv.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 <iostream>
#include <limits.h>
#include <list>
#ifdef BOTS #ifdef BOTS
#include "bot.h" #include "bot.h"
#endif #endif
@ -85,9 +47,6 @@ extern Zone* zone;
extern WorldServer worldserver; extern WorldServer worldserver;
extern EntityList entity_list; extern EntityList entity_list;
#include "questmgr.h"
//declare our global instance
QuestManager quest_manager; QuestManager quest_manager;
#define QuestManagerCurrentQuestVars() \ #define QuestManagerCurrentQuestVars() \

View File

@ -15,17 +15,14 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "../common/debug.h"
#include <float.h>
#include <iostream> #include <iostream>
#include <stdio.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <float.h>
#include <time.h>
#include <math.h>
#ifdef _WINDOWS #ifdef _WINDOWS
#include <process.h>
#define snprintf _snprintf #define snprintf _snprintf
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#else #else
@ -33,31 +30,26 @@
#include "../common/unix.h" #include "../common/unix.h"
#endif #endif
#include "masterentity.h" #include "../common/debug.h"
#include "../common/features.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/rulesys.h"
#include "../common/seperator.h"
#include "../common/string_util.h"
#include "client_logs.h"
#include "guild_mgr.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 "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 #ifdef _WINDOWS
#define snprintf _snprintf #define snprintf _snprintf
@ -65,18 +57,19 @@
#define strcasecmp _stricmp #define strcasecmp _stricmp
#endif #endif
extern bool staticzone;
extern NetConnection net;
extern PetitionList petition_list;
extern QuestParserCollection* parse;
extern uint16 adverrornum;
extern uint32 numclients;
extern WorldServer worldserver; extern WorldServer worldserver;
extern Zone* zone; extern Zone* zone;
extern uint32 numclients;
extern NetConnection net;
extern uint16 adverrornum;
extern PetitionList petition_list;
Mutex MZoneShutdown; Mutex MZoneShutdown;
extern bool staticzone;
Zone* zone = 0;
volatile bool ZoneLoaded = false; volatile bool ZoneLoaded = false;
extern QuestParserCollection* parse; Zone* zone = 0;
bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
const char* zonename = database.GetZoneName(iZoneID); const char* zonename = database.GetZoneName(iZoneID);

View File

@ -18,25 +18,13 @@
#ifndef ZONE_H #ifndef ZONE_H
#define ZONE_H #define ZONE_H
#include "../common/mutex.h"
#include "../common/linked_list.h"
#include "../common/types.h"
#include "../common/eqtime.h" #include "../common/eqtime.h"
#include "../common/servertalk.h" #include "../common/linked_list.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/eq_packet_structs.h" #include "../common/types.h"
#include "../common/features.h"
#include "spawngroup.h"
//#include "mob.h"
#include "zonedump.h"
#include "spawn2.h"
#include "tasks.h"
#include "pathing.h"
#include "qglobals.h" #include "qglobals.h"
#include <unordered_map> #include "spawn2.h"
#include "spawngroup.h"
class Map;
class WaterMap;
struct ZonePoint struct ZonePoint
{ {
@ -78,12 +66,10 @@ struct item_tick_struct {
std::string qglobal; std::string qglobal;
}; };
extern EntityList entity_list; class Map;
class database; class WaterMap;
class PathManager; class PathManager;
struct SendAA_Struct; extern EntityList entity_list;
class database;
class Zone class Zone
{ {