#pragma once //Define for static stuff #define GAME_SERVER #define VERSION "0.3.6" #define MAX_CLIENTS 10 #define COMMAND_COLOR 13 #define BROADCAST_COLOR 2 #define PING_INTERVAL 5000 //Win32 stuff #ifdef WIN32 #pragma warning( disable : 4275) #pragma warning( disable : 4217) #pragma warning( disable : 4312) #pragma warning(disable: 4996) #pragma comment(lib, "mysqlclient.lib") #pragma comment(lib, "wsock32.lib") #define WIN32_LEAN_AND_MEAN #include #include #include #include "mysql.h" #endif //OS Neutral includes #include #include #include "../../src/ItemDefManager.h" #include "../../src/PacketMan.h" #include "../../src/CompiledPacket.h" #include "../../src/ConfigLoader.h" #include "ScriptManager.h" #include "Instance.h" #include "GroupPermissions.h" #include "LocalData.h" #define _LOCAL_DATA_PATH "..\GameServer\src\LocalData.h" #define LOCAL_DATA_TYPE PLAYER_DATA* #include "../../src/Opcode.h" using namespace std; //Structure used to define restricted character names struct RESTRICTED_NAME { char name[19]; //if true cannot have any part of the name contain it //if false then it checks against the exact name bool partial; RESTRICTED_NAME(char *n) { memset(name, 0, 19); partial=true; for (unsigned int i=0; i restrictedNames; //Character names not allowed. int port; //port that the game server is running on? bool sharedInstances; //Allow hostile zones to act like towns? short icPort; //The port the IC Server is listening on int maxRetryConnects; int maxPipes; unsigned short maxPlayers; unsigned short maxPerInstance; char serverName[50]; //Live configuration bool throttleCpu; //Not config but related bool serverHasCrashed; ~SERVER_CONFIG() { sharedInstances=false; if (restrictedNames.size()>0){restrictedNames.clear();} } }; struct SERVER_STATS { short currentPlayers; short maxPlayerPeak; time_t startTime; SERVER_STATS() { currentPlayers=0; maxPlayerPeak=0; } }; //Server variables extern GroupPermissions *gpPermissionGroups; extern hash_map gInstances; extern IDManager gInstanceIds; extern SERVER_CONFIG gServerConfig; //holds the server configuration extern MYSQL_SERVER gDatabaseInfo; extern ItemDefManager gItemDefMan; extern ScriptManager *gpScriptMan; extern SERVER_STATS gServerStats; extern PacketMan gPacketManager; extern Server *gpInternalComm; extern Server *gpGameServer; extern bool gShuttingDown; extern char gCmdLine[250]; extern bool gShutdownOK; //tell the shutdown thread that it's ok to return true extern void *gpAppMutex; extern GWLPLog gCoreLog; extern GWLPLog gScriptLog;