From 89afb970d88e3efa8ddb2f1eafff10cd6525f2b7 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 29 Jan 2012 19:28:19 +0000 Subject: VC2008 / VC2010: Enabled precompiled header through Globals.h; the header included in every module in the project. Compilation optimization. git-svn-id: http://mc-server.googlecode.com/svn/trunk@188 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- VC2008/MCServer.sln | 7 + VC2008/MCServer.vcproj | 127 +++++------ VC2008/WebServer.vcproj | 233 +++++++++++++++++++++ VC2010/MCServer.vcxproj | 15 +- VC2010/MCServer.vcxproj.filters | 2 + VC2010/WebServer.vcxproj | 13 +- VC2010/WebServer.vcxproj.filters | 15 +- WebServer/Globals.cpp | 10 + WebServer/Globals.h | 78 +++++++ WebServer/Socket.cpp | 6 +- WebServer/StdHelpers.cpp | 3 +- WebServer/UrlHelper.cpp | 6 +- WebServer/WebServer.cpp | 18 +- WebServer/WebServer.h | 100 +++++---- WebServer/base64.cpp | 3 + WebServer/cEvent.cpp | 112 ---------- WebServer/cEvent.h | 18 -- WebServer/cEvents.cpp | 125 +++++++++++ WebServer/cEvents.h | 18 ++ iniFile/iniFile.cpp | 3 +- source/AllToLua.pkg | 3 + source/Bindings.cpp | 2 + source/Defines.h | 1 - source/Endianness.h | 7 +- source/Globals.cpp | 10 + source/Globals.h | 82 ++++++++ source/MCSocket.h | 49 ++--- source/ManualBindings.cpp | 4 +- source/Matrix4f.cpp | 4 + source/SquirrelBindings.cpp | 9 +- source/Vector3d.cpp | 7 + source/Vector3f.cpp | 3 + source/Vector3i.cpp | 7 + source/cAggressiveMonster.cpp | 3 + source/cAuthenticator.cpp | 5 +- source/cBlockToPickup.cpp | 3 + source/cBlockingTCPLink.cpp | 12 +- source/cBlockingTCPLink.h | 5 +- source/cCavespider.cpp | 3 + source/cChatColor.cpp | 3 + source/cChestEntity.cpp | 15 +- source/cChicken.cpp | 3 + source/cChunk.cpp | 15 +- source/cChunkGenerator.cpp | 10 +- source/cChunkLoader.cpp | 3 + source/cChunkMap.cpp | 15 +- source/cClientHandle.cpp | 11 +- source/cCow.cpp | 3 + source/cCraftingWindow.cpp | 4 +- source/cCreativeInventory.cpp | 5 +- source/cCreeper.cpp | 3 + source/cCriticalSection.cpp | 9 +- source/cCuboid.cpp | 13 +- source/cEnderman.cpp | 3 + source/cEntity.cpp | 4 +- source/cEvent.cpp | 15 +- source/cFileFormatUpdater.cpp | 20 +- source/cFireSimulator.cpp | 4 +- source/cFluidSimulator.cpp | 4 +- source/cFurnaceEntity.cpp | 5 +- source/cFurnaceRecipe.cpp | 4 +- source/cFurnaceWindow.cpp | 7 +- source/cGenSettings.cpp | 3 + source/cGhast.cpp | 3 + source/cGroup.cpp | 3 + source/cGroupManager.cpp | 4 +- source/cHeartBeat.cpp | 11 +- source/cInventory.cpp | 9 +- source/cItem.cpp | 7 + source/cLavaSimulator.cpp | 3 + source/cLog.cpp | 14 +- source/cLuaCommandBinder.cpp | 8 +- source/cMCLogger.cpp | 15 +- source/cMCLogger.h | 1 - source/cMakeDir.cpp | 21 +- source/cMonster.cpp | 12 +- source/cMonsterConfig.cpp | 11 +- source/cNoise.cpp | 7 + source/cPassiveAggressiveMonster.cpp | 6 + source/cPassiveMonster.cpp | 6 + source/cPawn.cpp | 4 +- source/cPickup.cpp | 8 +- source/cPig.cpp | 5 + source/cPiston.cpp | 7 + source/cPlayer.cpp | 7 +- source/cPlayer.h | 6 +- source/cPlugin.cpp | 8 +- source/cPluginManager.cpp | 8 +- source/cPlugin_Lua.cpp | 5 +- source/cPlugin_NewLua.cpp | 3 + source/cRecipeChecker.cpp | 11 +- source/cRedstone.cpp | 9 +- source/cReferenceManager.cpp | 7 + source/cRoot.cpp | 4 +- source/cSandSimulator.cpp | 8 +- source/cSemaphore.cpp | 15 +- source/cServer.cpp | 18 +- source/cSheep.cpp | 3 + source/cSignEntity.cpp | 8 +- source/cSilverfish.cpp | 7 + source/cSimulator.cpp | 8 +- source/cSimulatorManager.cpp | 8 +- source/cSkeleton.cpp | 7 + source/cSleep.cpp | 13 +- source/cSlime.cpp | 7 + source/cSocket.cpp | 21 +- source/cSocket.h | 9 +- source/cSpider.cpp | 7 + source/cSquid.cpp | 7 + source/cStringMap.cpp | 7 + source/cStringMap.h | 16 +- source/cSurvivalInventory.cpp | 9 +- source/cTCPLink.cpp | 16 +- source/cTCPLink.h | 1 - source/cThread.cpp | 27 ++- source/cThread.h | 1 - source/cTimer.cpp | 13 +- source/cTracer.cpp | 6 +- source/cWaterSimulator.cpp | 6 + source/cWaterSimulator.h | 1 + source/cWebAdmin.cpp | 17 +- source/cWebAdmin.h | 1 - source/cWebPlugin.cpp | 8 +- source/cWebPlugin.h | 3 +- source/cWebPlugin_Lua.cpp | 9 +- source/cWebPlugin_Lua.h | 2 - source/cWindow.cpp | 8 +- source/cWindow.h | 3 - source/cWindowOwner.h | 1 - source/cWolf.cpp | 3 + source/cWorld.cpp | 11 +- source/cWorld.h | 8 +- source/cWorldGenerator.cpp | 7 + source/cWorldGenerator_Test.cpp | 7 + source/cZombie.cpp | 7 + source/cZombiepigman.cpp | 7 + source/main.cpp | 16 +- source/md5/md5.cpp | 2 + source/packets/cPacket.cpp | 12 +- source/packets/cPacket.h | 7 +- source/packets/cPacket_13.cpp | 7 + source/packets/cPacket_AddToInventory.cpp | 7 + source/packets/cPacket_ArmAnim.cpp | 7 + source/packets/cPacket_BlockAction.cpp | 7 + source/packets/cPacket_BlockChange.cpp | 7 + source/packets/cPacket_BlockDig.cpp | 7 + source/packets/cPacket_BlockPlace.cpp | 7 + source/packets/cPacket_Chat.cpp | 6 + source/packets/cPacket_CollectItem.cpp | 7 + source/packets/cPacket_CreativeInventoryAction.cpp | 7 + source/packets/cPacket_DestroyEntity.cpp | 7 + source/packets/cPacket_Disconnect.cpp | 7 + source/packets/cPacket_EntityEquipment.cpp | 7 + source/packets/cPacket_EntityLook.cpp | 7 + source/packets/cPacket_EntityStatus.cpp | 7 + source/packets/cPacket_Explosion.cpp | 7 + source/packets/cPacket_Flying.cpp | 7 + source/packets/cPacket_Handshake.cpp | 7 + source/packets/cPacket_InventoryProgressBar.cpp | 7 + source/packets/cPacket_InventorySlot.cpp | 7 + source/packets/cPacket_ItemData.cpp | 7 + source/packets/cPacket_ItemSwitch.cpp | 7 + source/packets/cPacket_KeepAlive.cpp | 7 + source/packets/cPacket_Login.cpp | 7 + source/packets/cPacket_MapChunk.cpp | 7 + source/packets/cPacket_Metadata.cpp | 7 + source/packets/cPacket_MultiBlock.cpp | 7 + source/packets/cPacket_NamedEntitySpawn.cpp | 6 + source/packets/cPacket_NewInvalidState.cpp | 7 + source/packets/cPacket_PickupSpawn.cpp | 7 + source/packets/cPacket_PlayerListItem.cpp | 7 + source/packets/cPacket_PlayerLook.cpp | 7 + source/packets/cPacket_PlayerMoveLook.cpp | 7 + source/packets/cPacket_PlayerPosition.cpp | 7 + source/packets/cPacket_PreChunk.cpp | 7 + source/packets/cPacket_RelativeEntityMove.cpp | 7 + source/packets/cPacket_RelativeEntityMoveLook.cpp | 7 + source/packets/cPacket_Respawn.cpp | 7 + source/packets/cPacket_SoundEffect.cpp | 7 + source/packets/cPacket_SpawnMob.cpp | 7 +- source/packets/cPacket_TeleportEntity.cpp | 7 + source/packets/cPacket_Thunderbolt.cpp | 7 + source/packets/cPacket_TimeUpdate.cpp | 7 + source/packets/cPacket_UpdateHealth.cpp | 7 +- source/packets/cPacket_UpdateSign.cpp | 7 + source/packets/cPacket_UseEntity.cpp | 7 + source/packets/cPacket_WholeInventory.cpp | 7 + source/packets/cPacket_WindowClick.cpp | 7 + source/packets/cPacket_WindowClose.cpp | 7 + source/packets/cPacket_WindowOpen.cpp | 7 + source/tolua_base.h | 5 +- source/wdirent.h | 3 - 192 files changed, 1674 insertions(+), 615 deletions(-) create mode 100644 VC2008/WebServer.vcproj create mode 100644 WebServer/Globals.cpp create mode 100644 WebServer/Globals.h delete mode 100644 WebServer/cEvent.cpp delete mode 100644 WebServer/cEvent.h create mode 100644 WebServer/cEvents.cpp create mode 100644 WebServer/cEvents.h create mode 100644 source/Globals.cpp create mode 100644 source/Globals.h diff --git a/VC2008/MCServer.sln b/VC2008/MCServer.sln index b64ce1e41..e71c3d197 100644 --- a/VC2008/MCServer.sln +++ b/VC2008/MCServer.sln @@ -3,6 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 10.00 # Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MCServer", "MCServer.vcproj", "{32012054-0C96-4C43-AB27-174FF8E72D66}" ProjectSection(ProjectDependencies) = postProject + {9A476537-42C0-4848-AB40-15CFE83D17A8} = {9A476537-42C0-4848-AB40-15CFE83D17A8} {082E8185-7B3A-4945-8C82-9132341A329D} = {082E8185-7B3A-4945-8C82-9132341A329D} {EEAB54AD-114C-4AB8-8482-0A52D502BD35} = {EEAB54AD-114C-4AB8-8482-0A52D502BD35} {5AAA90B9-946D-4034-83F3-676B06A6E326} = {5AAA90B9-946D-4034-83F3-676B06A6E326} @@ -17,6 +18,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lua", "Lua.vcproj", "{082E8 EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ToLua", "ToLua.vcproj", "{EEAB54AD-114C-4AB8-8482-0A52D502BD35}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebServer", "WebServer.vcproj", "{9A476537-42C0-4848-AB40-15CFE83D17A8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 @@ -43,6 +46,10 @@ Global {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug|Win32.Build.0 = Debug|Win32 {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release|Win32.ActiveCfg = Release|Win32 {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release|Win32.Build.0 = Release|Win32 + {9A476537-42C0-4848-AB40-15CFE83D17A8}.Debug|Win32.ActiveCfg = Debug|Win32 + {9A476537-42C0-4848-AB40-15CFE83D17A8}.Debug|Win32.Build.0 = Debug|Win32 + {9A476537-42C0-4848-AB40-15CFE83D17A8}.Release|Win32.ActiveCfg = Release|Win32 + {9A476537-42C0-4848-AB40-15CFE83D17A8}.Release|Win32.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj index 1bed41d81..4274c2f5e 100644 --- a/VC2008/MCServer.vcproj +++ b/VC2008/MCServer.vcproj @@ -46,7 +46,8 @@ MinimalRebuild="false" BasicRuntimeChecks="3" RuntimeLibrary="3" - UsePrecompiledHeader="0" + UsePrecompiledHeader="2" + PrecompiledHeaderThrough="Globals.h" WarningLevel="3" DebugInformationFormat="4" /> @@ -115,7 +116,8 @@ AdditionalIncludeDirectories="../zlib-1.2.5;../jsoncpp-src-0.5.0/include;../lua-5.1.4/src;../tolua++-1.0.93/include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;" RuntimeLibrary="2" - UsePrecompiledHeader="0" + UsePrecompiledHeader="2" + PrecompiledHeaderThrough="Globals.h" WarningLevel="3" DebugInformationFormat="3" /> @@ -287,14 +289,6 @@ RelativePath="..\source\cEntity.h" > - - - - @@ -416,9 +410,18 @@ FavorSizeOrSpeed="1" OmitFramePointers="true" BasicRuntimeChecks="0" + UsePrecompiledHeader="0" DebugInformationFormat="3" /> + + + - - - - @@ -660,6 +655,30 @@ RelativePath="..\source\FileDefine.h" > + + + + + + + + + + @@ -1415,6 +1434,14 @@ RelativePath="..\source\cCriticalSection.h" > + + + + @@ -1423,6 +1450,14 @@ RelativePath="..\source\cSemaphore.h" > + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/VC2008/WebServer.vcproj b/VC2008/WebServer.vcproj new file mode 100644 index 000000000..f86f4ba8b --- /dev/null +++ b/VC2008/WebServer.vcproj @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC2010/MCServer.vcxproj b/VC2010/MCServer.vcxproj index 84449e65d..48447f926 100644 --- a/VC2010/MCServer.vcxproj +++ b/VC2010/MCServer.vcxproj @@ -109,6 +109,8 @@ Level3 EditAndContinue true + Use + Globals.h /IGNORE:4078 %(AdditionalOptions) @@ -138,6 +140,8 @@ Level3 EditAndContinue true + Use + Globals.h /IGNORE:4078 %(AdditionalOptions) @@ -230,8 +234,7 @@ false StreamingSIMDExtensions Fast - - + Use Level4 @@ -239,6 +242,7 @@ true true + Globals.h /IGNORE:4078 %(AdditionalOptions) @@ -339,6 +343,7 @@ Speed true Default + NotUsing @@ -381,6 +386,11 @@ + + Create + Create + Create + @@ -540,6 +550,7 @@ + diff --git a/VC2010/MCServer.vcxproj.filters b/VC2010/MCServer.vcxproj.filters index 98598731a..0d7e966f9 100644 --- a/VC2010/MCServer.vcxproj.filters +++ b/VC2010/MCServer.vcxproj.filters @@ -907,6 +907,7 @@ cWebAdmin\cWebPlugin\cWebPlugin + @@ -1395,6 +1396,7 @@ cWebAdmin\cWebPlugin\cWebPlugin + diff --git a/VC2010/WebServer.vcxproj b/VC2010/WebServer.vcxproj index 03c84d620..90c0dc96c 100644 --- a/VC2010/WebServer.vcxproj +++ b/VC2010/WebServer.vcxproj @@ -76,6 +76,8 @@ Level3 Disabled true + Use + Globals.h true @@ -103,6 +105,8 @@ MultiThreaded Speed true + Use + Globals.h true @@ -128,7 +132,11 @@ - + + + Create + Create + @@ -136,7 +144,8 @@ - + + diff --git a/VC2010/WebServer.vcxproj.filters b/VC2010/WebServer.vcxproj.filters index 4c80b0863..105781d04 100644 --- a/VC2010/WebServer.vcxproj.filters +++ b/VC2010/WebServer.vcxproj.filters @@ -6,9 +6,8 @@ - - Threading - + + @@ -17,13 +16,7 @@ - - Threading - - - - - {5108ca96-8262-4e37-b891-cff8f714210e} - + + \ No newline at end of file diff --git a/WebServer/Globals.cpp b/WebServer/Globals.cpp new file mode 100644 index 000000000..2c60fd698 --- /dev/null +++ b/WebServer/Globals.cpp @@ -0,0 +1,10 @@ + +// Globals.cpp + +// This file is used for precompiled header generation in MSVC environments + +#include "Globals.h" + + + + diff --git a/WebServer/Globals.h b/WebServer/Globals.h new file mode 100644 index 000000000..027b988ef --- /dev/null +++ b/WebServer/Globals.h @@ -0,0 +1,78 @@ + +// Globals.h + +// This file gets included from every module in the project, so that global symbols may be introduced easily +// Also used for precompiled header generation in MSVC environments + + + + + +// OS-dependent stuff: +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include + #include +#else + #include + #include // for mkdir + #include + #include + #include + #include + #include + + #include + #include + #include + #include + #include + #include +#endif + + + + + +// CRT stuff: +#include +#include + + + + + +// STL stuff: +#include +#include +#include +#include +#include + + + + + +// Common headers: +#include "../source/cCriticalSection.h" +#include "../source/cMCLogger.h" + + + + + +// Common definitions: + +/// Evaluates to the number of elements in an array (compile-time!) +#define ARRAYCOUNT(X) (sizeof(X) / sizeof(*(X))) + +// sprintf_s is the preferred call in MSVC ("secure"); make it *nix-compatible: +#ifndef _WIN32 + #define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ ) + #define vsnprintf_s(buffer, buffer_size, maxcount, stringbuffer, ...) (vsnprintf(buffer, maxcount, stringbuffer, __VA_ARGS__)) +#endif // _WIN32 + + + + + diff --git a/WebServer/Socket.cpp b/WebServer/Socket.cpp index 1ae3c9f37..ec3c9a5c7 100644 --- a/WebServer/Socket.cpp +++ b/WebServer/Socket.cpp @@ -29,7 +29,7 @@ THIS IS NOT THE ORIGINAL SOURCE1!!1!!!~!!~`1ONE!!`1 */ -#include "../source/cMCLogger.h" +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "Socket.h" #include @@ -38,11 +38,11 @@ #include #include #else -#define MSG_NOSIGNAL (0) + #define MSG_NOSIGNAL (0) #endif #ifdef __MAC_NA -#define MSG_NOSIGNAL (0) + #define MSG_NOSIGNAL (0) #endif using namespace std; diff --git a/WebServer/StdHelpers.cpp b/WebServer/StdHelpers.cpp index 6bb05f421..f858c0bc4 100644 --- a/WebServer/StdHelpers.cpp +++ b/WebServer/StdHelpers.cpp @@ -29,8 +29,9 @@ THIS IS NOT THE ORIGINAL SOURCE1!!1!!!~!!~`1ONE!!`1 */ +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "StdHelpers.h" -#include #include std::string ReplaceInStr(const std::string& in, const std::string& search_for, const std::string& replace_with) { diff --git a/WebServer/UrlHelper.cpp b/WebServer/UrlHelper.cpp index 3cdb0fc60..44f1166fd 100644 --- a/WebServer/UrlHelper.cpp +++ b/WebServer/UrlHelper.cpp @@ -29,14 +29,12 @@ THIS IS NOT THE ORIGINAL SOURCE1!!1!!!~!!~`1ONE!!`1 */ +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "UrlHelper.h" #include "Tracer.h" #include "StdHelpers.h" -#ifdef _WIN32 -#include -#endif - #include #include diff --git a/WebServer/WebServer.cpp b/WebServer/WebServer.cpp index 954791663..466093fd3 100644 --- a/WebServer/WebServer.cpp +++ b/WebServer/WebServer.cpp @@ -31,24 +31,22 @@ THIS IS NOT THE ORIGINAL SOURCE1!!1!!!~!!~`1ONE!!`1 */ +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include #ifdef _WIN32 -#include + #include #endif #include -#include -#include #include #include "WebServer.h" +#include "cEvents.h" #include "Socket.h" #include "UrlHelper.h" #include "base64.h" -#include "cEvent.h" - - webserver::request_func webserver::request_func_=0; #ifdef _WIN32 @@ -178,7 +176,7 @@ void webserver::Stop() { m_bStop = true; m_Socket->Close(); - m_Event->Wait(); + m_Events->Wait(); } void webserver::Begin() @@ -209,18 +207,18 @@ void webserver::Begin() pthread_create( hHandle, NULL, Request, ptr_s); #endif } - m_Event->Set(); + m_Events->Set(); } webserver::webserver(unsigned int port_to_listen, request_func r) { m_Socket = new SocketServer(port_to_listen,1); request_func_ = r; - m_Event = new cEvent(); + m_Events = new cEvents(); } webserver::~webserver() { delete m_Socket; - delete m_Event; + delete m_Events; } diff --git a/WebServer/WebServer.h b/WebServer/WebServer.h index 06c6359e6..844af0c46 100644 --- a/WebServer/WebServer.h +++ b/WebServer/WebServer.h @@ -30,66 +30,64 @@ THIS IS NOT THE ORIGINAL SOURCE1!!1!!!~!!~`1ONE!!`1 */ -#include -#include -class cEvent; +class cEvents; class Socket; class SocketServer; class webserver { - public: - struct http_request { - - http_request() - : s_( 0 ) - , authentication_given_(false) - {} - - Socket* s_; - std::string method_; - std::string path_; - std::map params_; - - std::string accept_; - std::string accept_language_; - std::string accept_encoding_; - std::string user_agent_; - - /* status_: used to transmit server's error status, such as - o 202 OK - o 404 Not Found - and so on */ - std::string status_; - - /* auth_realm_: allows to set the basic realm for an authentication, - no need to additionally set status_ if set */ - std::string auth_realm_; - - std::string answer_; - - /* authentication_given_ is true when the user has entered a username and password. - These can then be read from username_ and password_ */ - bool authentication_given_; - std::string username_; - std::string password_; - }; - - typedef void (*request_func) (http_request*); - webserver(unsigned int port_to_listen, request_func); +public: + struct http_request { + + http_request() + : s_( 0 ) + , authentication_given_(false) + {} + + Socket* s_; + std::string method_; + std::string path_; + std::map params_; + + std::string accept_; + std::string accept_language_; + std::string accept_encoding_; + std::string user_agent_; + + /* status_: used to transmit server's error status, such as + o 202 OK + o 404 Not Found + and so on */ + std::string status_; + + /* auth_realm_: allows to set the basic realm for an authentication, + no need to additionally set status_ if set */ + std::string auth_realm_; + + std::string answer_; + + /* authentication_given_ is true when the user has entered a username and password. + These can then be read from username_ and password_ */ + bool authentication_given_; + std::string username_; + std::string password_; + }; + + typedef void (*request_func) (http_request*); + webserver(unsigned int port_to_listen, request_func); ~webserver(); void Begin(); void Stop(); - private: +private: bool m_bStop; - #ifdef _WIN32 - static unsigned __stdcall Request(void*); - #else - static void* Request(void*); - #endif - static request_func request_func_; - - cEvent* m_Event; +#ifdef _WIN32 + static unsigned __stdcall Request(void*); +#else + static void* Request(void*); +#endif + static request_func request_func_; + + cEvents * m_Events; SocketServer* m_Socket; }; diff --git a/WebServer/base64.cpp b/WebServer/base64.cpp index 8a6f33147..72cd7cd59 100644 --- a/WebServer/base64.cpp +++ b/WebServer/base64.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "base64.h" #include diff --git a/WebServer/cEvent.cpp b/WebServer/cEvent.cpp deleted file mode 100644 index 289131568..000000000 --- a/WebServer/cEvent.cpp +++ /dev/null @@ -1,112 +0,0 @@ -#include "cEvent.h" -#include "../source/cMCLogger.h" - -#ifdef _WIN32 -#include -#else -#include -#include -#include -#include // sprintf() -#endif - -cEvent::cEvent( unsigned int a_NumEvents /* = 1 */ ) - : m_NumEvents( a_NumEvents ) -#ifndef _WIN32 - , m_bNamed( false ) -#endif -{ - if( m_NumEvents < 1 ) m_NumEvents = 1; - -#ifdef _WIN32 - m_Handle = new HANDLE[ m_NumEvents ]; - for( unsigned int i = 0; i < m_NumEvents; i++) - { - ((HANDLE*)m_Handle)[i] = CreateEvent( 0, FALSE, FALSE, 0 ); - } -#else - m_Handle = new sem_t*[ m_NumEvents ]; - for( unsigned int i = 0; i < m_NumEvents; i++) - { - - sem_t* & HandlePtr = ((sem_t**)m_Handle)[i]; - HandlePtr = new sem_t; - - if( sem_init( HandlePtr, 0, 0 ) ) - { - LOG("WARNING cEvent: Could not create unnamed semaphore, fallback to named."); - m_bNamed = true; - delete HandlePtr; // named semaphores return their own address - - char c_Str[32]; - sprintf( c_Str, "cEvent%p", &HandlePtr ); - HandlePtr = sem_open( c_Str, O_CREAT, 777, 0 ); - if( HandlePtr == SEM_FAILED ) - LOG("ERROR: Could not create Event. (%i)", errno); - else - if( sem_unlink( c_Str ) != 0 ) - LOG("ERROR: Could not unlink cEvent. (%i)", errno); - } - } -#endif -} - -cEvent::~cEvent() -{ -#ifdef _WIN32 - for( unsigned int i = 0; i < m_NumEvents; i++ ) - { - CloseHandle( ((HANDLE*)m_Handle)[i] ); - } - delete [] (HANDLE*)m_Handle; -#else - for( unsigned int i = 0; i < m_NumEvents; i++ ) - { - if( m_bNamed ) - { - sem_t* & HandlePtr = ((sem_t**)m_Handle)[i]; - char c_Str[32]; - sprintf( c_Str, "cEvent%p", &HandlePtr ); - // LOG("Closing event: %s", c_Str ); - // LOG("Sem ptr: %p", HandlePtr ); - if( sem_close( HandlePtr ) != 0 ) - { - LOG("ERROR: Could not close cEvent. (%i)", errno); - } - } - else - { - sem_destroy( ((sem_t**)m_Handle)[i] ); - delete ((sem_t**)m_Handle)[i]; - } - } - delete [] (sem_t**)m_Handle; m_Handle = 0; -#endif -} - -void cEvent::Wait() -{ -#ifdef _WIN32 - WaitForMultipleObjects( m_NumEvents, (HANDLE*)m_Handle, true, INFINITE ); -#else - for(unsigned int i = 0; i < m_NumEvents; i++) - { - if( sem_wait( ((sem_t**)m_Handle)[i] ) != 0 ) - { - LOG("ERROR: Could not wait for cEvent. (%i)", errno); - } - } -#endif -} - -void cEvent::Set(unsigned int a_EventNum /* = 0 */) -{ -#ifdef _WIN32 - SetEvent( ((HANDLE*)m_Handle)[a_EventNum] ); -#else - if( sem_post( ((sem_t**)m_Handle)[a_EventNum] ) != 0 ) - { - LOG("ERROR: Could not set cEvent. (%i)", errno); - } -#endif -} diff --git a/WebServer/cEvent.h b/WebServer/cEvent.h deleted file mode 100644 index e5b77be50..000000000 --- a/WebServer/cEvent.h +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -class cEvent -{ -public: - cEvent( unsigned int a_NumEvents = 1 ); - ~cEvent(); - - void Wait(); - void Set(unsigned int a_EventNum = 0); -private: - unsigned int m_NumEvents; - void* m_Handle; // HANDLE[] pointer - -#ifndef _WIN32 - bool m_bNamed; -#endif -}; diff --git a/WebServer/cEvents.cpp b/WebServer/cEvents.cpp new file mode 100644 index 000000000..4c9fa8775 --- /dev/null +++ b/WebServer/cEvents.cpp @@ -0,0 +1,125 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + +#include "cEvents.h" + + + + + +cEvents::cEvents( unsigned int a_NumEvents /* = 1 */ ) + : m_NumEvents( a_NumEvents ) +#ifndef _WIN32 + , m_bNamed( false ) +#endif +{ + if( m_NumEvents < 1 ) m_NumEvents = 1; + +#ifdef _WIN32 + m_Handle = new HANDLE[ m_NumEvents ]; + for( unsigned int i = 0; i < m_NumEvents; i++) + { + ((HANDLE*)m_Handle)[i] = CreateEvent( 0, FALSE, FALSE, 0 ); + } +#else + m_Handle = new sem_t*[ m_NumEvents ]; + for( unsigned int i = 0; i < m_NumEvents; i++) + { + + sem_t* & HandlePtr = ((sem_t**)m_Handle)[i]; + HandlePtr = new sem_t; + + if( sem_init( HandlePtr, 0, 0 ) ) + { + LOG("WARNING cEvents: Could not create unnamed semaphore, fallback to named."); + m_bNamed = true; + delete HandlePtr; // named semaphores return their own address + + char c_Str[32]; + sprintf( c_Str, "cEvents%p", &HandlePtr ); + HandlePtr = sem_open( c_Str, O_CREAT, 777, 0 ); + if( HandlePtr == SEM_FAILED ) + LOG("ERROR: Could not create Event. (%i)", errno); + else + if( sem_unlink( c_Str ) != 0 ) + LOG("ERROR: Could not unlink cEvents. (%i)", errno); + } + } +#endif +} + + + + + +cEvents::~cEvents() +{ +#ifdef _WIN32 + for( unsigned int i = 0; i < m_NumEvents; i++ ) + { + CloseHandle( ((HANDLE*)m_Handle)[i] ); + } + delete [] (HANDLE*)m_Handle; +#else + for( unsigned int i = 0; i < m_NumEvents; i++ ) + { + if( m_bNamed ) + { + sem_t* & HandlePtr = ((sem_t**)m_Handle)[i]; + char c_Str[32]; + sprintf( c_Str, "cEvents%p", &HandlePtr ); + // LOG("Closing event: %s", c_Str ); + // LOG("Sem ptr: %p", HandlePtr ); + if( sem_close( HandlePtr ) != 0 ) + { + LOG("ERROR: Could not close cEvents. (%i)", errno); + } + } + else + { + sem_destroy( ((sem_t**)m_Handle)[i] ); + delete ((sem_t**)m_Handle)[i]; + } + } + delete [] (sem_t**)m_Handle; m_Handle = 0; +#endif +} + + + + + +void cEvents::Wait() +{ +#ifdef _WIN32 + WaitForMultipleObjects( m_NumEvents, (HANDLE*)m_Handle, true, INFINITE ); +#else + for(unsigned int i = 0; i < m_NumEvents; i++) + { + if( sem_wait( ((sem_t**)m_Handle)[i] ) != 0 ) + { + LOG("ERROR: Could not wait for cEvents. (%i)", errno); + } + } +#endif +} + + + + + +void cEvents::Set(unsigned int a_EventNum /* = 0 */) +{ +#ifdef _WIN32 + SetEvent( ((HANDLE*)m_Handle)[a_EventNum] ); +#else + if( sem_post( ((sem_t**)m_Handle)[a_EventNum] ) != 0 ) + { + LOG("ERROR: Could not set cEvents. (%i)", errno); + } +#endif +} + + + + diff --git a/WebServer/cEvents.h b/WebServer/cEvents.h new file mode 100644 index 000000000..c8a6a7df9 --- /dev/null +++ b/WebServer/cEvents.h @@ -0,0 +1,18 @@ +#pragma once + +class cEvents +{ +public: + cEvents( unsigned int a_NumEvents = 1 ); + ~cEvents(); + + void Wait(); + void Set(unsigned int a_EventNum = 0); +private: + unsigned int m_NumEvents; + void* m_Handle; // HANDLE[] pointer + +#ifndef _WIN32 + bool m_bNamed; +#endif +}; diff --git a/iniFile/iniFile.cpp b/iniFile/iniFile.cpp index 76e64ff37..f4381c64f 100644 --- a/iniFile/iniFile.cpp +++ b/iniFile/iniFile.cpp @@ -15,6 +15,8 @@ !! MODIFIED BY FAKETRUTH !! */ +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + // C++ Includes #include #include @@ -23,7 +25,6 @@ using namespace std; // C Includes -#include #include #include diff --git a/source/AllToLua.pkg b/source/AllToLua.pkg index 32293c370..be0dd33f8 100644 --- a/source/AllToLua.pkg +++ b/source/AllToLua.pkg @@ -1,3 +1,6 @@ + +$#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + $#include "tolua_base.h" $cfile "cTorch.h" diff --git a/source/Bindings.cpp b/source/Bindings.cpp index 2a97c8af6..51342db62 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -3,6 +3,8 @@ ** Generated automatically by tolua++-1.0.92 on 01/27/12 00:53:11. */ +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #ifndef __cplusplus #include "stdlib.h" #endif diff --git a/source/Defines.h b/source/Defines.h index fb76c5bc7..dcf4f0e0c 100644 --- a/source/Defines.h +++ b/source/Defines.h @@ -1,6 +1,5 @@ #pragma once -#include "MemoryLeak.h" #include "BlockID.h" //tolua_begin diff --git a/source/Endianness.h b/source/Endianness.h index 1a16a11cc..09ae3b372 100644 --- a/source/Endianness.h +++ b/source/Endianness.h @@ -1,11 +1,10 @@ #pragma once -#include #ifdef _WIN32 -#include + #include #else -#include -#include + #include + #include #endif // Changes endianness diff --git a/source/Globals.cpp b/source/Globals.cpp new file mode 100644 index 000000000..2c60fd698 --- /dev/null +++ b/source/Globals.cpp @@ -0,0 +1,10 @@ + +// Globals.cpp + +// This file is used for precompiled header generation in MSVC environments + +#include "Globals.h" + + + + diff --git a/source/Globals.h b/source/Globals.h new file mode 100644 index 000000000..5551386ce --- /dev/null +++ b/source/Globals.h @@ -0,0 +1,82 @@ + +// Globals.h + +// This file gets included from every module in the project, so that global symbols may be introduced easily +// Also used for precompiled header generation in MSVC environments + + + + + +// OS-dependent stuff: +#ifdef _WIN32 + #define WIN32_LEAN_AND_MEAN + #include + #include +#else + #include + #include // for mkdir + #include + #include + #include + #include + #include + + #include + #include + #include + #include + #include + #include +#endif + + + + + +// CRT stuff: +#include +#include + + + + + +// STL stuff: +#include +#include +#include +#include +#include + + + + + +// Common headers: +#include "cSleep.h" +#include "cCriticalSection.h" +#include "cSemaphore.h" +#include "cEvent.h" +#include "cThread.h" +#include "cMCLogger.h" + + + + + +// Common definitions: + +/// Evaluates to the number of elements in an array (compile-time!) +#define ARRAYCOUNT(X) (sizeof(X) / sizeof(*(X))) + +// sprintf_s is the preferred call in MSVC ("secure"); make it *nix-compatible: +#ifndef _WIN32 + #define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ ) + #define vsnprintf_s(buffer, buffer_size, maxcount, stringbuffer, ...) (vsnprintf(buffer, maxcount, stringbuffer, __VA_ARGS__)) +#endif // _WIN32 + + + + + diff --git a/source/MCSocket.h b/source/MCSocket.h index 5dda6c5a3..30aa20bdd 100644 --- a/source/MCSocket.h +++ b/source/MCSocket.h @@ -1,36 +1,29 @@ #pragma once -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#include -// #define socklen_t int -// #ifdef SendMessage -// #undef SendMessage -// #endif -#else +#ifndef _WIN32 + // Linux threads http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html + #include + #include + #include + #include + #include + + // TODO: We shouldn't need these! Use the OS support objects instead + #define SOCKET int + typedef void *HANDLE; + #define CRITICAL_SECTION pthread_mutex_t + #define SD_BOTH (2) + #define closesocket(x) (shutdown(x, SD_BOTH), close(x)) + #define SOCKET_ERROR SO_ERROR + #define EnterCriticalSection(x) pthread_mutex_lock(x) + #define LeaveCriticalSection(x) pthread_mutex_unlock(x) + #define InitializeCriticalSection(x) pthread_mutex_init(x, NULL) + #define DeleteCriticalSection(x) (x) +#endif + -// Linux threads http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html -#include -#include -#include -#include -#include -#include -#define SOCKET int -typedef void *HANDLE; -#define CRITICAL_SECTION pthread_mutex_t -#define SD_BOTH (2) -#define closesocket(x) (shutdown(x, SD_BOTH), close(x)) -#define SOCKET_ERROR SO_ERROR -#define EnterCriticalSection(x) pthread_mutex_lock(x) -#define LeaveCriticalSection(x) pthread_mutex_unlock(x) -#define InitializeCriticalSection(x) pthread_mutex_init(x, NULL) -#define DeleteCriticalSection(x) (x) -#define sprintf_s(x, y, ...) sprintf(x, __VA_ARGS__) -#endif inline bool IsSocketError( int a_ReturnedValue ) { diff --git a/source/ManualBindings.cpp b/source/ManualBindings.cpp index a40bcb9d6..45fae285d 100644 --- a/source/ManualBindings.cpp +++ b/source/ManualBindings.cpp @@ -1,6 +1,8 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "ManualBindings.h" #include "tolua++.h" -#include "cMCLogger.h" #include "cRoot.h" #include "cWorld.h" diff --git a/source/Matrix4f.cpp b/source/Matrix4f.cpp index e69de29bb..322bad192 100644 --- a/source/Matrix4f.cpp +++ b/source/Matrix4f.cpp @@ -0,0 +1,4 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + +// _X: empty file?? diff --git a/source/SquirrelBindings.cpp b/source/SquirrelBindings.cpp index 20f226e3a..9f64b2c9b 100644 --- a/source/SquirrelBindings.cpp +++ b/source/SquirrelBindings.cpp @@ -1,10 +1,11 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "SquirrelBindings.h" #if USE_SQUIRREL #pragma warning(disable:4100) // Getting A LOT of these warnings from SqPlus #pragma warning(disable:4127) -#include "cMCLogger.h" - #include #include #include <../squirrel/sqstate.h> @@ -16,6 +17,10 @@ #include "cRoot.h" #include "cPlayer.h" + + + + bool SquirrelBindings::IsBound = false; bool IsTopClosure( HSQUIRRELVM v ) diff --git a/source/Vector3d.cpp b/source/Vector3d.cpp index b2c47972a..075034605 100644 --- a/source/Vector3d.cpp +++ b/source/Vector3d.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "Vector3d.h" #include "Vector3f.h" + + + + Vector3d::Vector3d(const Vector3f & v ) : x( v.x ) , y( v.y ) diff --git a/source/Vector3f.cpp b/source/Vector3f.cpp index bc73a8070..c23644065 100644 --- a/source/Vector3f.cpp +++ b/source/Vector3f.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "Vector3f.h" #include "Vector3d.h" #include "Vector3i.h" diff --git a/source/Vector3i.cpp b/source/Vector3i.cpp index 6a163a7e8..3e812bf7c 100644 --- a/source/Vector3i.cpp +++ b/source/Vector3i.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "Vector3i.h" #include "Vector3d.h" + + + + Vector3i::Vector3i( const Vector3d & v ) : x( (int)v.x ) , y( (int)v.y ) diff --git a/source/cAggressiveMonster.cpp b/source/cAggressiveMonster.cpp index d52c1c19a..54d204c8b 100644 --- a/source/cAggressiveMonster.cpp +++ b/source/cAggressiveMonster.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cAggressiveMonster.h" #include "Vector3f.h" diff --git a/source/cAuthenticator.cpp b/source/cAuthenticator.cpp index 11fbaf12b..168ace7b5 100644 --- a/source/cAuthenticator.cpp +++ b/source/cAuthenticator.cpp @@ -1,13 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cAuthenticator.h" #include "cBlockingTCPLink.h" -#include "cMCLogger.h" #include "../iniFile/iniFile.h" #ifndef _WIN32 #include #endif -#include #include extern void ReplaceString( std::string & a_HayStack, const std::string & a_Needle, const std::string & a_ReplaceWith ); diff --git a/source/cBlockToPickup.cpp b/source/cBlockToPickup.cpp index 53ae84b48..c6d9e732f 100644 --- a/source/cBlockToPickup.cpp +++ b/source/cBlockToPickup.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cBlockToPickup.h" #include "Defines.h" #include "BlockID.h" diff --git a/source/cBlockingTCPLink.cpp b/source/cBlockingTCPLink.cpp index 6a2208084..19026321e 100644 --- a/source/cBlockingTCPLink.cpp +++ b/source/cBlockingTCPLink.cpp @@ -1,17 +1,17 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cBlockingTCPLink.h" #include "packets/cPacket.h" #include "MCSocket.h" -#include - -#include "cMCLogger.h" #ifndef _WIN32 -#include -#include + #include + #include #endif #ifdef _WIN32 -#define MSG_NOSIGNAL (0) + #define MSG_NOSIGNAL (0) #endif #ifdef __MACH__ #define MSG_NOSIGNAL (0) diff --git a/source/cBlockingTCPLink.h b/source/cBlockingTCPLink.h index 535137c3e..11f3287e2 100644 --- a/source/cBlockingTCPLink.h +++ b/source/cBlockingTCPLink.h @@ -1,7 +1,10 @@ #pragma once #include "cSocket.h" -#include + + + + class cEvent; class cBlockingTCPLink //tolua_export diff --git a/source/cCavespider.cpp b/source/cCavespider.cpp index f31f229e3..5008270f1 100644 --- a/source/cCavespider.cpp +++ b/source/cCavespider.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cCavespider.h" cCavespider::cCavespider() diff --git a/source/cChatColor.cpp b/source/cChatColor.cpp index 450bb4ab3..061148197 100644 --- a/source/cChatColor.cpp +++ b/source/cChatColor.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cChatColor.h" const std::string cChatColor::Color = "\xa7"; // Old color was "\xc2\xa7" or in other words: "ยง" diff --git a/source/cChestEntity.cpp b/source/cChestEntity.cpp index ee70a6fb8..4df900327 100644 --- a/source/cChestEntity.cpp +++ b/source/cChestEntity.cpp @@ -1,20 +1,27 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cChestEntity.h" #include "cItem.h" -#include #include "cClientHandle.h" -#include "cMCLogger.h" #include "cPlayer.h" #include "cWindow.h" #include "cWorld.h" #include "cRoot.h" #include "cPickup.h" -#include "cMCLogger.h" #include "cChunk.h" +#include + + + + class cWorld; class cRoot; -#include + + + cChestEntity::cChestEntity(int a_X, int a_Y, int a_Z, cChunk* a_Chunk) : cBlockEntity( E_BLOCK_CHEST, a_X, a_Y, a_Z, a_Chunk ) diff --git a/source/cChicken.cpp b/source/cChicken.cpp index 201ea7f45..37321410b 100644 --- a/source/cChicken.cpp +++ b/source/cChicken.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cChicken.h" //TODO Drop egg every 5-10 minutes diff --git a/source/cChunk.cpp b/source/cChunk.cpp index 04f7cc979..8d93b34ec 100644 --- a/source/cChunk.cpp +++ b/source/cChunk.cpp @@ -1,8 +1,9 @@ +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #ifndef _WIN32 #include #include -#include #include // for mkdir #include #endif @@ -16,11 +17,9 @@ #include "cServer.h" #include "zlib.h" #include "Defines.h" -#include // memset #include "cChestEntity.h" #include "cFurnaceEntity.h" #include "cSignEntity.h" -#include "cMCLogger.h" #include "cTorch.h" #include "cLadder.h" #include "cPickup.h" @@ -28,7 +27,6 @@ #include "cItem.h" #include "cNoise.h" #include "cRoot.h" -#include "cCriticalSection.h" #include "cWorldGenerator.h" #include "cBlockToPickup.h" #include "MersenneTwister.h" @@ -41,13 +39,9 @@ #include -#include -#include -#include -#ifndef _WIN32 -#define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ ) -#endif + + extern bool g_bWaterPhysics; @@ -57,6 +51,7 @@ typedef std::list< cFurnaceEntity* > FurnaceEntityList; typedef std::list< cClientHandle* > ClientHandleList; typedef std::list< cBlockEntity* > BlockEntityList; typedef std::list< cEntity* > EntityList; + struct cChunk::sChunkState { sChunkState() diff --git a/source/cChunkGenerator.cpp b/source/cChunkGenerator.cpp index 78c90e244..78853a26b 100644 --- a/source/cChunkGenerator.cpp +++ b/source/cChunkGenerator.cpp @@ -1,17 +1,13 @@ -#include "MemoryLeak.h" + +#include "Globals.h" + #include "cChunkGenerator.h" #include "cChunkMap.h" #include "cChunk.h" #include "cWorld.h" -#include "cThread.h" -#include "cCriticalSection.h" -#include "cSemaphore.h" - #include "cMCLogger.h" -#include - typedef std::pair ChunkCoord; typedef std::list< ChunkCoord > ChunkCoordList; diff --git a/source/cChunkLoader.cpp b/source/cChunkLoader.cpp index a5d07818d..e5220575c 100644 --- a/source/cChunkLoader.cpp +++ b/source/cChunkLoader.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #if 0 // ignore all contents of this file #include "cChunkLoader.h" #include "cChunk.h" diff --git a/source/cChunkMap.cpp b/source/cChunkMap.cpp index 3cfeb0485..cb2b5f3f3 100644 --- a/source/cChunkMap.cpp +++ b/source/cChunkMap.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cChunkMap.h" #include "cChunk.h" #include "cMCLogger.h" @@ -7,12 +10,8 @@ #include // floorf #ifndef _WIN32 -#include // memcpy -#include // abs -#include // sprintf and stuff - - -#define sprintf_s( dest, size, format, ... ) sprintf( dest, format, __VA_ARGS__ ) + #include // memcpy + #include // abs #endif #include "zlib.h" @@ -22,6 +21,10 @@ #define LAYER_SIZE (32) + + + + cChunkMap::cChunkMap( int a_Width, int a_Height, cWorld* a_World ) : m_Nodes( new cChunkNode[ a_Width * a_Height ] ) , m_Width( a_Width ) diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index 9aef2021e..d5fd0d5c0 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cClientHandle.h" #include "cServer.h" #include "cWorld.h" @@ -8,7 +11,6 @@ #include "cInventory.h" #include "cChestEntity.h" #include "cSignEntity.h" -#include "cMCLogger.h" #include "cWindow.h" #include "cCraftingWindow.h" #include "cItem.h" @@ -30,9 +32,6 @@ #include "Vector3f.h" #include "Vector3d.h" -#include "cCriticalSection.h" -#include "cSemaphore.h" -#include "cEvent.h" #include "cSleep.h" #include "cRoot.h" @@ -70,10 +69,6 @@ #include "packets/cPacket_PlayerListItem.h" -#ifndef _WIN32 -#define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ ) -#endif - #define AddPistonDir( x, y, z, dir, amount ) switch(dir) { case 0: (y)-=(amount); break; case 1: (y)+=(amount); break;\ case 2: (z)-=(amount); break; case 3: (z)+=(amount); break;\ case 4: (x)-=(amount); break; case 5: (x)+=(amount); break; } diff --git a/source/cCow.cpp b/source/cCow.cpp index de9815a9d..56651dd24 100644 --- a/source/cCow.cpp +++ b/source/cCow.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cCow.h" //TODO: Milk Cow diff --git a/source/cCraftingWindow.cpp b/source/cCraftingWindow.cpp index ed82223df..71ffe96b3 100644 --- a/source/cCraftingWindow.cpp +++ b/source/cCraftingWindow.cpp @@ -1,6 +1,8 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cCraftingWindow.h" #include "cItem.h" -#include "cMCLogger.h" #include "cRecipeChecker.h" #include "cPlayer.h" #include "cClientHandle.h" diff --git a/source/cCreativeInventory.cpp b/source/cCreativeInventory.cpp index b1606f077..f19051c5e 100644 --- a/source/cCreativeInventory.cpp +++ b/source/cCreativeInventory.cpp @@ -1,8 +1,9 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cCreativeInventory.h" -#include //memset #include "cPlayer.h" #include "cClientHandle.h" -#include "cMCLogger.h" #include "cWindow.h" #include "cItem.h" #include "cRecipeChecker.h" diff --git a/source/cCreeper.cpp b/source/cCreeper.cpp index 02bcf0094..351ddf519 100644 --- a/source/cCreeper.cpp +++ b/source/cCreeper.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cCreeper.h" cCreeper::cCreeper() diff --git a/source/cCriticalSection.cpp b/source/cCriticalSection.cpp index bf84b7c2f..bf27e9c0b 100644 --- a/source/cCriticalSection.cpp +++ b/source/cCriticalSection.cpp @@ -1,12 +1,5 @@ -#include "cCriticalSection.h" -#include "cMCLogger.h" -#include -#ifdef _WIN32 -#include -#else -#include -#endif +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules diff --git a/source/cCuboid.cpp b/source/cCuboid.cpp index 9f102129c..ecd457549 100644 --- a/source/cCuboid.cpp +++ b/source/cCuboid.cpp @@ -1,10 +1,19 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cCuboid.h" -#include // swap + + + void cCuboid::Sort() { if( p1.x > p2.x ) std::swap( p1.x, p2.x ); if( p1.y > p2.y ) std::swap( p1.y, p2.y ); if( p1.z > p2.z ) std::swap( p1.z, p2.z ); -} \ No newline at end of file +} + + + + diff --git a/source/cEnderman.cpp b/source/cEnderman.cpp index 36982b1e8..6b0856187 100644 --- a/source/cEnderman.cpp +++ b/source/cEnderman.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cEnderman.h" cEnderman::cEnderman() diff --git a/source/cEntity.cpp b/source/cEntity.cpp index 8a841ea87..cdb6ea211 100644 --- a/source/cEntity.cpp +++ b/source/cEntity.cpp @@ -1,7 +1,9 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cEntity.h" #include "cWorld.h" #include "cChunk.h" -#include "cMCLogger.h" #include "cServer.h" #include "cRoot.h" #include "Vector3d.h" diff --git a/source/cEvent.cpp b/source/cEvent.cpp index f3a0a3570..18c1ac09b 100644 --- a/source/cEvent.cpp +++ b/source/cEvent.cpp @@ -1,14 +1,9 @@ -#include "cEvent.h" -#include "cMCLogger.h" -#ifdef _WIN32 -#include -#else -#include -#include -#include -#include -#endif +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + + + + cEvent::cEvent( unsigned int a_NumEvents /* = 1 */ ) : m_NumEvents( a_NumEvents ) diff --git a/source/cFileFormatUpdater.cpp b/source/cFileFormatUpdater.cpp index 733b0e0e4..e95a66095 100644 --- a/source/cFileFormatUpdater.cpp +++ b/source/cFileFormatUpdater.cpp @@ -1,24 +1,10 @@ + +#include "Globals.h" + #include "cFileFormatUpdater.h" #include "cMCLogger.h" #include "Vector3d.h" #include "Vector3f.h" -#include -#include -#include - -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#else -#include -#include -#include -#include -#include -#include - -#include -#endif #include "cItem.h" #include diff --git a/source/cFireSimulator.cpp b/source/cFireSimulator.cpp index 10dc8f589..31ac1e992 100644 --- a/source/cFireSimulator.cpp +++ b/source/cFireSimulator.cpp @@ -1,9 +1,11 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cFireSimulator.h" #include "cWorld.h" #include "Vector3i.h" #include "BlockID.h" #include "Defines.h" -#include cFireSimulator::cFireSimulator( cWorld* a_World ) : cSimulator(a_World) diff --git a/source/cFluidSimulator.cpp b/source/cFluidSimulator.cpp index 318ecfd5c..e4f0aa85a 100644 --- a/source/cFluidSimulator.cpp +++ b/source/cFluidSimulator.cpp @@ -1,9 +1,11 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cFluidSimulator.h" #include "cWorld.h" #include "Vector3i.h" #include "BlockID.h" #include "Defines.h" -#include #include "cPickup.h" #include "cItem.h" diff --git a/source/cFurnaceEntity.cpp b/source/cFurnaceEntity.cpp index 46cadf5f2..b5ce42805 100644 --- a/source/cFurnaceEntity.cpp +++ b/source/cFurnaceEntity.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cFurnaceEntity.h" #include "BlockID.h" #include "cItem.h" @@ -13,8 +16,6 @@ #include "packets/cPacket_InventoryProgressBar.h" -#include "cMCLogger.h" - #include cFurnaceEntity::cFurnaceEntity(int a_X, int a_Y, int a_Z, cChunk* a_Chunk) diff --git a/source/cFurnaceRecipe.cpp b/source/cFurnaceRecipe.cpp index 2885f769d..321253422 100644 --- a/source/cFurnaceRecipe.cpp +++ b/source/cFurnaceRecipe.cpp @@ -1,6 +1,8 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cFurnaceRecipe.h" #include "cItem.h" -#include "cMCLogger.h" #include #include diff --git a/source/cFurnaceWindow.cpp b/source/cFurnaceWindow.cpp index ea0cad59a..b76c53498 100644 --- a/source/cFurnaceWindow.cpp +++ b/source/cFurnaceWindow.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cFurnaceWindow.h" #include "cItem.h" #include "cFurnaceEntity.h" @@ -5,7 +8,9 @@ #include "packets/cPacket_WindowClick.h" -#include "cMCLogger.h" + + + cFurnaceWindow::cFurnaceWindow( cFurnaceEntity* a_Owner ) : cWindow( a_Owner, true ) diff --git a/source/cGenSettings.cpp b/source/cGenSettings.cpp index 7c7206d91..2edd55a6a 100644 --- a/source/cGenSettings.cpp +++ b/source/cGenSettings.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cGenSettings.h" diff --git a/source/cGhast.cpp b/source/cGhast.cpp index e08d6e29a..fb336364d 100644 --- a/source/cGhast.cpp +++ b/source/cGhast.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cGhast.h" cGhast::cGhast() diff --git a/source/cGroup.cpp b/source/cGroup.cpp index 2590c5303..4fef22cb2 100644 --- a/source/cGroup.cpp +++ b/source/cGroup.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cGroup.h" void cGroup::AddCommand( std::string a_Command ) diff --git a/source/cGroupManager.cpp b/source/cGroupManager.cpp index 4d7bf7a9a..a67e79418 100644 --- a/source/cGroupManager.cpp +++ b/source/cGroupManager.cpp @@ -1,8 +1,10 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cGroupManager.h" #include "cGroup.h" #include "../iniFile/iniFile.h" #include "cChatColor.h" -#include "cMCLogger.h" #include "cRoot.h" extern std::vector< std::string > StringSplit( std::string str, std::string delim); diff --git a/source/cHeartBeat.cpp b/source/cHeartBeat.cpp index 3661b9376..c1aa327c5 100644 --- a/source/cHeartBeat.cpp +++ b/source/cHeartBeat.cpp @@ -1,16 +1,17 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cHeartBeat.h" #include "cMCLogger.h" #include "md5/md5.h" -#include - #include "cRoot.h" #include "cServer.h" #include "cSleep.h" -#ifndef _WIN32 -#define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ ) -#endif + + + cHeartBeat::cHeartBeat() { diff --git a/source/cInventory.cpp b/source/cInventory.cpp index 166ef6ad5..93edf2c57 100644 --- a/source/cInventory.cpp +++ b/source/cInventory.cpp @@ -1,8 +1,9 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cInventory.h" -#include //memset #include "cPlayer.h" #include "cClientHandle.h" -#include "cMCLogger.h" #include "cWindow.h" #include "cItem.h" #include "cRecipeChecker.h" @@ -14,6 +15,10 @@ #include "packets/cPacket_WholeInventory.h" #include "packets/cPacket_InventorySlot.h" + + + + cInventory::~cInventory() { delete [] m_Slots; diff --git a/source/cItem.cpp b/source/cItem.cpp index 1233f1287..2015bd751 100644 --- a/source/cItem.cpp +++ b/source/cItem.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cItem.h" #include + + + + void cItem::GetJson( Json::Value & a_OutValue ) { a_OutValue["ID"] = m_ItemID; diff --git a/source/cLavaSimulator.cpp b/source/cLavaSimulator.cpp index fbd1734ab..ea637ce3c 100644 --- a/source/cLavaSimulator.cpp +++ b/source/cLavaSimulator.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cLavaSimulator.h" #include "Defines.h" diff --git a/source/cLog.cpp b/source/cLog.cpp index 105916a2f..8f24b24ad 100644 --- a/source/cLog.cpp +++ b/source/cLog.cpp @@ -1,19 +1,15 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cLog.h" + #include #include #include -#ifdef _WIN32 -#include -#else -#include // for mkdir -#include -#define sprintf_s(buffer, buffer_size, stringbuffer, ...) (sprintf(buffer, stringbuffer, __VA_ARGS__)) -#define vsnprintf_s(buffer, buffer_size, maxcount, stringbuffer, ...) (vsnprintf(buffer, maxcount, stringbuffer, __VA_ARGS__)) -#endif -#include + cLog* cLog::s_Log = NULL; diff --git a/source/cLuaCommandBinder.cpp b/source/cLuaCommandBinder.cpp index b3f20cbdc..5ed3515ca 100644 --- a/source/cLuaCommandBinder.cpp +++ b/source/cLuaCommandBinder.cpp @@ -1,10 +1,16 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cLuaCommandBinder.h" -#include "cMCLogger.h" #include "cPlayer.h" #include "cPlugin_Lua.h" #include "tolua++.h" + + + + extern std::vector StringSplit(std::string str, std::string delim); extern bool report_errors(lua_State* lua, int status); diff --git a/source/cMCLogger.cpp b/source/cMCLogger.cpp index 0c6d25df3..a084c62bf 100644 --- a/source/cMCLogger.cpp +++ b/source/cMCLogger.cpp @@ -1,16 +1,13 @@ -#include "cMCLogger.h" -#include "cLog.h" -#include "cCriticalSection.h" -#include +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include #include +#include "cLog.h" + + + -#ifndef _WIN32 -#define sprintf_s(buffer, buffer_size, stringbuffer, ...) (sprintf(buffer, stringbuffer, __VA_ARGS__)) -#else -#include -#endif cMCLogger* cMCLogger::s_MCLogger = 0; diff --git a/source/cMCLogger.h b/source/cMCLogger.h index 4bfae66f1..f37c4f642 100644 --- a/source/cMCLogger.h +++ b/source/cMCLogger.h @@ -4,7 +4,6 @@ #include #endif -class cCriticalSection; class cLog; class cMCLogger //tolua_export { //tolua_export diff --git a/source/cMakeDir.cpp b/source/cMakeDir.cpp index 60817d5aa..8c43a7d92 100644 --- a/source/cMakeDir.cpp +++ b/source/cMakeDir.cpp @@ -1,14 +1,11 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cMakeDir.h" -#ifndef _WIN32 -//#include // If something is missing, uncomment some of these! -//#include -//#include -#include // for mkdir -//#include -#else -#include -#endif + + + void cMakeDir::MakeDir( const char* a_Directory ) { @@ -21,4 +18,8 @@ void cMakeDir::MakeDir( const char* a_Directory ) #else mkdir(a_Directory, S_IRWXU | S_IRWXG | S_IRWXO); #endif -} \ No newline at end of file +} + + + + diff --git a/source/cMonster.cpp b/source/cMonster.cpp index cee068b08..e5f970122 100644 --- a/source/cMonster.cpp +++ b/source/cMonster.cpp @@ -1,9 +1,11 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cMonster.h" #include "cRoot.h" #include "cServer.h" #include "cClientHandle.h" #include "cWorld.h" -#include "cMCLogger.h" #include "cChunk.h" #include "cPlayer.h" #include "BlockID.h" @@ -28,12 +30,12 @@ #include "../iniFile/iniFile.h" #ifndef _WIN32 -#include // rand -#include -#include + #include // rand + #include #endif -#include + + cMonster::cMonster() diff --git a/source/cMonsterConfig.cpp b/source/cMonsterConfig.cpp index abb2ca2e7..1c3a38fea 100644 --- a/source/cMonsterConfig.cpp +++ b/source/cMonsterConfig.cpp @@ -1,11 +1,16 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cMonsterConfig.h" #include "cMonster.h" #include "../iniFile/iniFile.h" -#include -#include #include //#include "../source/cprintf.h" -#include + + + + + using namespace std; extern std::vector StringSplit(std::string str, std::string delim); diff --git a/source/cNoise.cpp b/source/cNoise.cpp index 82d999fdd..4221d9218 100644 --- a/source/cNoise.cpp +++ b/source/cNoise.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cNoise.h" #include @@ -7,6 +10,10 @@ #define FAST_FLOOR( x ) ( (x) < 0 ? ((int)x)-1 : ((int)x) ) + + + + cNoise::cNoise( unsigned int a_Seed ) : m_Seed( a_Seed ) { diff --git a/source/cPassiveAggressiveMonster.cpp b/source/cPassiveAggressiveMonster.cpp index e1a78ab36..9d423b0f7 100644 --- a/source/cPassiveAggressiveMonster.cpp +++ b/source/cPassiveAggressiveMonster.cpp @@ -1,8 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPassiveAggressiveMonster.h" #include "cPlayer.h" + + + cPassiveAggressiveMonster::cPassiveAggressiveMonster() { m_EMPersonality = PASSIVE; diff --git a/source/cPassiveMonster.cpp b/source/cPassiveMonster.cpp index 0879ebbee..ad6da16f7 100644 --- a/source/cPassiveMonster.cpp +++ b/source/cPassiveMonster.cpp @@ -1,7 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPassiveMonster.h" #include "MersenneTwister.h" + + + cPassiveMonster::cPassiveMonster() { m_EMPersonality = PASSIVE; diff --git a/source/cPawn.cpp b/source/cPawn.cpp index db61f734e..fa79fdcb9 100644 --- a/source/cPawn.cpp +++ b/source/cPawn.cpp @@ -1,10 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPawn.h" #include "cRoot.h" #include "cServer.h" #include "cWorld.h" #include "cPlayer.h" #include "cChunk.h" -#include "cMCLogger.h" #include "cPluginManager.h" #include "Vector3d.h" #include "BlockID.h" diff --git a/source/cPickup.cpp b/source/cPickup.cpp index 9e9dc2666..120fe17aa 100644 --- a/source/cPickup.cpp +++ b/source/cPickup.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #ifndef _WIN32 #include #endif @@ -12,7 +15,6 @@ #include "cPluginManager.h" #include "cItem.h" #include "cRoot.h" -#include "cMCLogger.h" #include "cTracer.h" #include "cChunk.h" @@ -23,6 +25,10 @@ #include "Vector3d.h" #include "Vector3f.h" + + + + CLASS_DEFINITION( cPickup, cEntity ) cPickup::~cPickup() diff --git a/source/cPig.cpp b/source/cPig.cpp index 079b5f3e5..a35075233 100644 --- a/source/cPig.cpp +++ b/source/cPig.cpp @@ -1,7 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPig.h" + + cPig::cPig() { m_MobType = 90; diff --git a/source/cPiston.cpp b/source/cPiston.cpp index 1104122c8..7fb503a3a 100644 --- a/source/cPiston.cpp +++ b/source/cPiston.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPiston.h" #include "cRedstone.h" #include "cChunk.h" @@ -19,6 +22,10 @@ extern bool g_BlockPistonBreakable[]; #define FAST_FLOOR( x ) ( (x) < 0 ? ((int)x)-1 : ((int)x) ) + + + + cPiston::cPiston( cWorld* a_World ) :m_World ( a_World ) { diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp index 9071a31b1..c7ef8e56d 100644 --- a/source/cPlayer.cpp +++ b/source/cPlayer.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPlayer.h" #include "cServer.h" #include "cCreativeInventory.h" @@ -7,7 +10,6 @@ #include "cPickup.h" #include "cPluginManager.h" #include "cChunk.h" -#include "cMCLogger.h" #include "cWindow.h" #include "cBlockEntity.h" #include "cGroupManager.h" @@ -494,9 +496,6 @@ void cPlayer::SetIP( std::string a_IP ) m_IP = a_IP; } -#ifdef SendMessage // Cause stupid windows.h defines SendMessage as SendMessageA -#undef SendMessage -#endif void cPlayer::SendMessage( const char* a_Message ) { m_ClientHandle->Send( cPacket_Chat( a_Message ) ); diff --git a/source/cPlayer.h b/source/cPlayer.h index b3344c410..3793443dd 100644 --- a/source/cPlayer.h +++ b/source/cPlayer.h @@ -3,8 +3,10 @@ #include "cPawn.h" #include "cSurvivalInventory.h" #include "cCreativeInventory.h" -#include -#include // TODO - use const char* + + + + class cGroup; class cWindow; diff --git a/source/cPlugin.cpp b/source/cPlugin.cpp index 5fc056a2d..2cbba40a0 100644 --- a/source/cPlugin.cpp +++ b/source/cPlugin.cpp @@ -1,7 +1,11 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPlugin.h" -#include -#include "cMCLogger.h" + + + cPlugin::cPlugin() : m_Version( 0 ) diff --git a/source/cPluginManager.cpp b/source/cPluginManager.cpp index 007e0fd92..f7d8ad7dc 100644 --- a/source/cPluginManager.cpp +++ b/source/cPluginManager.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPluginManager.h" #include "cPlugin.h" #include "cPlugin_Lua.h" @@ -8,7 +11,6 @@ #include "cRoot.h" #include "cLuaCommandBinder.h" #include "../iniFile/iniFile.h" -#include //strcmp #include #include "SquirrelBindings.h" @@ -18,6 +20,10 @@ #pragma warning(default:4100;default:4127;default:4510;default:4610;default:4244;default:4512) #endif + + + + extern std::vector StringSplit(std::string str, std::string delim); typedef std::list< cPlugin_Lua* > LuaPluginList; diff --git a/source/cPlugin_Lua.cpp b/source/cPlugin_Lua.cpp index 3265f0615..d25df0242 100644 --- a/source/cPlugin_Lua.cpp +++ b/source/cPlugin_Lua.cpp @@ -1,6 +1,7 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #define LUA_USE_POSIX -#include "cMCLogger.h" -#include #include "cPlugin_Lua.h" #include "cPluginManager.h" #include "cRoot.h" diff --git a/source/cPlugin_NewLua.cpp b/source/cPlugin_NewLua.cpp index fd5a23772..a5b9bdc48 100644 --- a/source/cPlugin_NewLua.cpp +++ b/source/cPlugin_NewLua.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #define LUA_USE_POSIX #include "cPlugin_NewLua.h" #include "cMCLogger.h" diff --git a/source/cRecipeChecker.cpp b/source/cRecipeChecker.cpp index 53a55b08b..d26d8d9df 100644 --- a/source/cRecipeChecker.cpp +++ b/source/cRecipeChecker.cpp @@ -1,10 +1,10 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cRecipeChecker.h" #include #include -#include -#include -#include #ifndef _WIN32 #include @@ -12,9 +12,12 @@ #endif #include "Defines.h" -#include "cMCLogger.h" #include "cRoot.h" + + + + typedef std::list< cRecipeChecker::Recipe* > RecipeList; struct cRecipeChecker::sRecipeCheckerState { diff --git a/source/cRedstone.cpp b/source/cRedstone.cpp index c022a5756..567394d0c 100644 --- a/source/cRedstone.cpp +++ b/source/cRedstone.cpp @@ -1,11 +1,16 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cRedstone.h" #include "cPiston.h" #include "cRoot.h" #include "cWorld.h" #include "BlockID.h" #include -#include -#include + + + + cRedstone::cRedstone( cWorld* a_World ) :m_World ( a_World ) diff --git a/source/cReferenceManager.cpp b/source/cReferenceManager.cpp index cad6ca0a2..e639884c4 100644 --- a/source/cReferenceManager.cpp +++ b/source/cReferenceManager.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cReferenceManager.h" #include "cEntity.h" + + + + cReferenceManager::cReferenceManager( ENUM_REFERENCE_MANAGER_TYPE a_Type ) : m_Type( a_Type ) { diff --git a/source/cRoot.cpp b/source/cRoot.cpp index 928461976..4f6dec035 100644 --- a/source/cRoot.cpp +++ b/source/cRoot.cpp @@ -1,5 +1,7 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cRoot.h" -#include "cMCLogger.h" #include "cServer.h" #include "cWorld.h" #include "cWebAdmin.h" diff --git a/source/cSandSimulator.cpp b/source/cSandSimulator.cpp index c0ed2309b..9adde94e7 100644 --- a/source/cSandSimulator.cpp +++ b/source/cSandSimulator.cpp @@ -1,9 +1,15 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSandSimulator.h" #include "cWorld.h" #include "Vector3i.h" #include "BlockID.h" #include "Defines.h" -#include + + + + cSandSimulator::cSandSimulator( cWorld* a_World ) : cSimulator(a_World) diff --git a/source/cSemaphore.cpp b/source/cSemaphore.cpp index 96c542df6..3bc83f393 100644 --- a/source/cSemaphore.cpp +++ b/source/cSemaphore.cpp @@ -1,14 +1,9 @@ -#include "cSemaphore.h" -#include "cMCLogger.h" -#ifdef _WIN32 -#include -#else -#include -#include -#include -#include -#endif +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + + + + cSemaphore::cSemaphore( unsigned int a_MaxCount, unsigned int a_InitialCount /* = 0 */ ) #ifndef _WIN32 diff --git a/source/cServer.cpp b/source/cServer.cpp index 326bbf9ce..f13fc50dd 100644 --- a/source/cServer.cpp +++ b/source/cServer.cpp @@ -1,10 +1,10 @@ + // ReDucTor is an awesome guy who helped me a lot +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cServer.h" #include "cClientHandle.h" -#include "cMCLogger.h" -#include "cThread.h" -#include "cEvent.h" #include "cSleep.h" #include "cTimer.h" #include "cMonster.h" @@ -30,22 +30,18 @@ #include "packets/cPacket_Chat.h" -#ifndef _WIN32 -#define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ ) -#endif - -#include #include #include #include + + + + extern "C" { #include "zlib.h" } -#ifdef SendMessage -#undef SendMessage -#endif bool g_bWaterPhysics = false; diff --git a/source/cSheep.cpp b/source/cSheep.cpp index 6d2024d01..5f4dd6379 100644 --- a/source/cSheep.cpp +++ b/source/cSheep.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSheep.h" //Todo: Implement color diff --git a/source/cSignEntity.cpp b/source/cSignEntity.cpp index 2c82563f1..beac869c8 100644 --- a/source/cSignEntity.cpp +++ b/source/cSignEntity.cpp @@ -1,5 +1,7 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSignEntity.h" -#include "cMCLogger.h" #include "cPlayer.h" #include "cClientHandle.h" @@ -11,6 +13,10 @@ #include + + + + cSignEntity::cSignEntity(ENUM_BLOCK_ID a_BlockType, int a_X, int a_Y, int a_Z, cChunk* a_Chunk) : cBlockEntity(a_BlockType, a_X, a_Y, a_Z, a_Chunk) { diff --git a/source/cSilverfish.cpp b/source/cSilverfish.cpp index a24c96468..c08129181 100644 --- a/source/cSilverfish.cpp +++ b/source/cSilverfish.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSilverfish.h" + + + + cSilverfish::cSilverfish() { m_MobType = 60; diff --git a/source/cSimulator.cpp b/source/cSimulator.cpp index a5bb4e311..92cc0823c 100644 --- a/source/cSimulator.cpp +++ b/source/cSimulator.cpp @@ -1,9 +1,15 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSimulator.h" #include "cWorld.h" #include "Vector3i.h" #include "BlockID.h" #include "Defines.h" -#include + + + + cSimulator::cSimulator( cWorld* a_World ) : m_World(a_World) diff --git a/source/cSimulatorManager.cpp b/source/cSimulatorManager.cpp index 98303008a..2ff44c640 100644 --- a/source/cSimulatorManager.cpp +++ b/source/cSimulatorManager.cpp @@ -1,5 +1,11 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSimulatorManager.h" -#include + + + + cSimulatorManager::cSimulatorManager() { diff --git a/source/cSkeleton.cpp b/source/cSkeleton.cpp index 77a0984de..8574e3c29 100644 --- a/source/cSkeleton.cpp +++ b/source/cSkeleton.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSkeleton.h" + + + + cSkeleton::cSkeleton() { m_MobType = 51; diff --git a/source/cSleep.cpp b/source/cSleep.cpp index 920ffaf65..77da5dd58 100644 --- a/source/cSleep.cpp +++ b/source/cSleep.cpp @@ -1,11 +1,14 @@ -#include "cSleep.h" -#ifdef _WIN32 -#include -#else -#include +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + +#ifndef _WIN32 + #include #endif + + + + void cSleep::MilliSleep( unsigned int a_MilliSeconds ) { #ifdef _WIN32 diff --git a/source/cSlime.cpp b/source/cSlime.cpp index 27ecd050b..67f9e8dc8 100644 --- a/source/cSlime.cpp +++ b/source/cSlime.cpp @@ -1,7 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSlime.h" //TODO Implement sized slimes + + + + cSlime::cSlime() { m_MobType = 55; diff --git a/source/cSocket.cpp b/source/cSocket.cpp index 427441145..c8b651342 100644 --- a/source/cSocket.cpp +++ b/source/cSocket.cpp @@ -1,17 +1,22 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSocket.h" -#include "cMCLogger.h" #ifndef _WIN32 -#include -#include -#include -//#include -//#include -#include //inet_ntoa() + #include + #include + // #include + // #include + #include //inet_ntoa() #else -#define socklen_t int + #define socklen_t int #endif + + + + cSocket::cSocket( xSocket a_Socket ) : m_Socket( a_Socket ) , m_IPString( 0 ) diff --git a/source/cSocket.h b/source/cSocket.h index dde268a8a..43bb8ee09 100644 --- a/source/cSocket.h +++ b/source/cSocket.h @@ -1,12 +1,7 @@ #pragma once -#ifdef _WIN32 -#define WIN32_LEAN_AND_MEAN -#include -#ifdef SendMessage -#undef SendMessage -#endif -#endif // _WIN32 + + class cSocket diff --git a/source/cSpider.cpp b/source/cSpider.cpp index e05e85662..a1d3a62d9 100644 --- a/source/cSpider.cpp +++ b/source/cSpider.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSpider.h" + + + + cSpider::cSpider() { m_MobType = 52; diff --git a/source/cSquid.cpp b/source/cSquid.cpp index 7ff964ce5..1d3b332f4 100644 --- a/source/cSquid.cpp +++ b/source/cSquid.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSquid.h" #include "Vector3d.h" + + + + cSquid::cSquid() { m_MobType = 94; diff --git a/source/cStringMap.cpp b/source/cStringMap.cpp index 1ddc2197c..7907efc34 100644 --- a/source/cStringMap.cpp +++ b/source/cStringMap.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cStringMap.h" + + + + unsigned int cStringMap::size() const { return m_StringMap.size(); diff --git a/source/cStringMap.h b/source/cStringMap.h index f83ca5797..454218cf4 100644 --- a/source/cStringMap.h +++ b/source/cStringMap.h @@ -1,9 +1,13 @@ + +// A std::map interface for Lua + #pragma once #include "tolua++.h" -#include -#include -// A std::map interface for Lua + + + + class cStringMap // tolua_export { // tolua_export @@ -16,4 +20,8 @@ public: // tolua_export std::string & get( const std::string & index ); //tolua_export private: std::map< std::string, std::string > m_StringMap; -}; // tolua_export \ No newline at end of file +}; // tolua_export + + + + diff --git a/source/cSurvivalInventory.cpp b/source/cSurvivalInventory.cpp index 59f634ca5..088c4362c 100644 --- a/source/cSurvivalInventory.cpp +++ b/source/cSurvivalInventory.cpp @@ -1,14 +1,19 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cSurvivalInventory.h" -#include //memset #include "cPlayer.h" #include "cClientHandle.h" -#include "cMCLogger.h" #include "cWindow.h" #include "cItem.h" #include "cRecipeChecker.h" #include "cRoot.h" #include "packets/cPacket_WindowClick.h" + + + + cSurvivalInventory::~cSurvivalInventory() { diff --git a/source/cTCPLink.cpp b/source/cTCPLink.cpp index bfd987bd9..4170da710 100644 --- a/source/cTCPLink.cpp +++ b/source/cTCPLink.cpp @@ -1,23 +1,27 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cTCPLink.h" #include "cSocket.h" -#include "cEvent.h" -#include "cThread.h" #include "MCSocket.h" #include "cMCLogger.h" -#include #ifndef _WIN32 -#include + #include #endif #ifdef _WIN32 -#define MSG_NOSIGNAL (0) + #define MSG_NOSIGNAL (0) #endif #ifdef __MACH__ -#define MSG_NOSIGNAL (0) + #define MSG_NOSIGNAL (0) #endif + + + + cTCPLink::cTCPLink() : m_Socket( 0 ) , m_StopEvent( new cEvent() ) diff --git a/source/cTCPLink.h b/source/cTCPLink.h index 634c3afd5..ac5d86584 100644 --- a/source/cTCPLink.h +++ b/source/cTCPLink.h @@ -2,7 +2,6 @@ #include "cSocket.h" -class cEvent; class cTCPLink //tolua_export { //tolua_export public: //tolua_export diff --git a/source/cThread.cpp b/source/cThread.cpp index 4d09907ab..3197fdcd6 100644 --- a/source/cThread.cpp +++ b/source/cThread.cpp @@ -1,17 +1,12 @@ -#ifndef _WIN32 -#include -#include -#include -#include -#else -#define WIN32_LEAN_AND_MEAN -#include -#endif -#include "cThread.h" -#include "cEvent.h" -#include "cMCLogger.h" -#ifdef _WIN32 +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + + + + + +// When in MSVC, the debugger provides "thread naming" by catching special exceptions. Interface here: +#ifdef _MSC_VER // // Usage: SetThreadName (-1, "MainThread"); // @@ -39,7 +34,11 @@ void SetThreadName( DWORD dwThreadID, LPCSTR szThreadName) { } } -#endif +#endif // _MSC_VER + + + + cThread::cThread( ThreadFunc a_ThreadFunction, void* a_Param, const char* a_ThreadName /* = 0 */ ) : m_ThreadFunction( a_ThreadFunction ) diff --git a/source/cThread.h b/source/cThread.h index f2cd8a75d..4fb001e67 100644 --- a/source/cThread.h +++ b/source/cThread.h @@ -1,6 +1,5 @@ #pragma once -class cEvent; class cThread { public: diff --git a/source/cTimer.cpp b/source/cTimer.cpp index 1cdde38ce..8fa0c2715 100644 --- a/source/cTimer.cpp +++ b/source/cTimer.cpp @@ -1,11 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cTimer.h" -#ifdef _WIN32 -#include -#else -#include -#include -#endif + + + + cTimer::cTimer() #ifdef _WIN32 diff --git a/source/cTracer.cpp b/source/cTracer.cpp index 2dce341b4..b0a913da9 100644 --- a/source/cTracer.cpp +++ b/source/cTracer.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cTracer.h" #include "cWorld.h" @@ -6,13 +9,12 @@ #include "Vector3d.h" #include "BlockID.h" -#include "cMCLogger.h" #include "cEntity.h" #include "Defines.h" #ifndef _WIN32 -#include // abs() + #include // abs() #endif cTracer::cTracer(cWorld* a_World) diff --git a/source/cWaterSimulator.cpp b/source/cWaterSimulator.cpp index 595ba556f..823c6c587 100644 --- a/source/cWaterSimulator.cpp +++ b/source/cWaterSimulator.cpp @@ -1,7 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cWaterSimulator.h" #include "Defines.h" + + + cWaterSimulator::cWaterSimulator(cWorld *a_World) : cFluidSimulator(a_World) { diff --git a/source/cWaterSimulator.h b/source/cWaterSimulator.h index d08902e44..437f14387 100644 --- a/source/cWaterSimulator.h +++ b/source/cWaterSimulator.h @@ -1,4 +1,5 @@ #pragma once + #include "cFluidSimulator.h" class cWaterSimulator : public cFluidSimulator diff --git a/source/cWebAdmin.cpp b/source/cWebAdmin.cpp index 6f9546304..23348fcdc 100644 --- a/source/cWebAdmin.cpp +++ b/source/cWebAdmin.cpp @@ -1,5 +1,7 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cWebAdmin.h" -#include "cMCLogger.h" #include "cStringMap.h" #include "cWebPlugin.h" @@ -8,24 +10,23 @@ #include "cPluginManager.h" #include "cPlugin.h" -#include "cEvent.h" #include "cWorld.h" #include "cPlayer.h" #include "cServer.h" #include "cRoot.h" -#include - #include "../iniFile/iniFile.h" -#include "MemoryLeak.h" #ifdef _WIN32 -#include + #include #else -#include -#define sprintf_s(dst, size, format, ...) sprintf(dst, format, __VA_ARGS__ ) + #include #endif + + + + extern std::vector StringSplit(std::string str, std::string delim); cWebAdmin* WebAdmin = 0; diff --git a/source/cWebAdmin.h b/source/cWebAdmin.h index e58eab24e..5a43b4877 100644 --- a/source/cWebAdmin.h +++ b/source/cWebAdmin.h @@ -1,6 +1,5 @@ #pragma once -#include #include "../WebServer/WebServer.h" #include "cSocket.h" diff --git a/source/cWebPlugin.cpp b/source/cWebPlugin.cpp index 43e5e5e54..923c48722 100644 --- a/source/cWebPlugin.cpp +++ b/source/cWebPlugin.cpp @@ -1,10 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cWebPlugin.h" #include "cWebAdmin.h" #include "cServer.h" -#include "cMCLogger.h" #include "cRoot.h" -#include "MemoryLeak.h" + + + cWebPlugin::cWebPlugin( lua_State* L ) { diff --git a/source/cWebPlugin.h b/source/cWebPlugin.h index 397f3ea81..1faf4e9ae 100644 --- a/source/cWebPlugin.h +++ b/source/cWebPlugin.h @@ -1,6 +1,5 @@ -#pragma once -#include +#pragma once struct lua_State; struct HTTPRequest; diff --git a/source/cWebPlugin_Lua.cpp b/source/cWebPlugin_Lua.cpp index c9aaef5a7..f92cb1690 100644 --- a/source/cWebPlugin_Lua.cpp +++ b/source/cWebPlugin_Lua.cpp @@ -1,11 +1,16 @@ -#include "cMCLogger.h" + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cWebPlugin_Lua.h" #include "cPlugin_NewLua.h" -#include #include "tolua++.h" #include "cWebAdmin.h" + + + + extern bool report_errors(lua_State* lua, int status); extern std::vector StringSplit(std::string str, std::string delim); diff --git a/source/cWebPlugin_Lua.h b/source/cWebPlugin_Lua.h index deec9333e..98080e855 100644 --- a/source/cWebPlugin_Lua.h +++ b/source/cWebPlugin_Lua.h @@ -2,8 +2,6 @@ #include "cWebPlugin.h" -#include -#include class cPlugin_NewLua; typedef struct lua_State lua_State; diff --git a/source/cWindow.cpp b/source/cWindow.cpp index 68c8d4142..4710ad8a4 100644 --- a/source/cWindow.cpp +++ b/source/cWindow.cpp @@ -1,6 +1,8 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cWindow.h" #include "cItem.h" -#include "cMCLogger.h" #include "cClientHandle.h" #include "cPlayer.h" #include "cPickup.h" @@ -12,7 +14,9 @@ #include "packets/cPacket_WindowOpen.h" #include "packets/cPacket_WindowClose.h" -#include + + + cWindow::cWindow( cWindowOwner* a_Owner, bool a_bInventoryVisible ) : m_WindowID( 0 ) diff --git a/source/cWindow.h b/source/cWindow.h index 1cc44d138..a6885a7cc 100644 --- a/source/cWindow.h +++ b/source/cWindow.h @@ -1,8 +1,5 @@ #pragma once -#include "MemoryLeak.h" -#include -#include class cPacket_WindowClick; class cPlayer; diff --git a/source/cWindowOwner.h b/source/cWindowOwner.h index fed44d2d1..91d78848c 100644 --- a/source/cWindowOwner.h +++ b/source/cWindowOwner.h @@ -1,6 +1,5 @@ #pragma once -#include "MemoryLeak.h" class cWindow; class cBlockEntity; diff --git a/source/cWolf.cpp b/source/cWolf.cpp index 055c434ed..8226b06ac 100644 --- a/source/cWolf.cpp +++ b/source/cWolf.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cWolf.h" cWolf::cWolf() diff --git a/source/cWorld.cpp b/source/cWorld.cpp index fc7447c1d..9891946be 100644 --- a/source/cWorld.cpp +++ b/source/cWorld.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "BlockID.h" #include "cWorld.h" #include "cRedstone.h" @@ -5,10 +8,8 @@ #include "cClientHandle.h" #include "cPickup.h" #include "cBlockToPickup.h" -#include "cMCLogger.h" #include "cPlayer.h" #include "cServer.h" -#include "cCriticalSection.h" #include "cItem.h" #include "cRoot.h" #include "../iniFile/iniFile.h" @@ -54,13 +55,13 @@ #include "tolua++.h" #ifndef _WIN32 -#include -//#include // for mkdir -#include + #include #endif + + float cWorld::m_Time = 0.f; char g_BlockLightValue[128]; diff --git a/source/cWorld.h b/source/cWorld.h index 38b7ec349..c5d036141 100644 --- a/source/cWorld.h +++ b/source/cWorld.h @@ -8,13 +8,13 @@ enum ENUM_ITEM_ID; #define MAX_PLAYERS 65535 -#include -#include -#include - #include "cSimulatorManager.h" #include "ptr_cChunk.h" + + + + class cPacket; class cRedstone; class cFireSimulator; diff --git a/source/cWorldGenerator.cpp b/source/cWorldGenerator.cpp index b4291ddb0..c54be8899 100644 --- a/source/cWorldGenerator.cpp +++ b/source/cWorldGenerator.cpp @@ -1,3 +1,6 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cWorldGenerator.h" #include "cNoise.h" #include "cWorld.h" @@ -8,6 +11,10 @@ #include "BlockID.h" #include "Vector3i.h" + + + + cWorldGenerator::cWorldGenerator() { } diff --git a/source/cWorldGenerator_Test.cpp b/source/cWorldGenerator_Test.cpp index d6cc2c00b..a484e43ec 100644 --- a/source/cWorldGenerator_Test.cpp +++ b/source/cWorldGenerator_Test.cpp @@ -1,7 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cWorldGenerator_Test.h" #include "cChunk.h" #include "BlockID.h" + + + + void cWorldGenerator_Test::GenerateTerrain( cChunk* a_Chunk ) { char* BlockType = a_Chunk->pGetType(); diff --git a/source/cZombie.cpp b/source/cZombie.cpp index 62ba163e4..566f271fc 100644 --- a/source/cZombie.cpp +++ b/source/cZombie.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cZombie.h" + + + + cZombie::cZombie() { m_MobType = 54; diff --git a/source/cZombiepigman.cpp b/source/cZombiepigman.cpp index 95a78a4f2..afe6248b7 100644 --- a/source/cZombiepigman.cpp +++ b/source/cZombiepigman.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cZombiepigman.h" + + + + cZombiepigman::cZombiepigman() { m_MobType = 57; diff --git a/source/main.cpp b/source/main.cpp index cbe499281..37b3be5ac 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -1,21 +1,23 @@ -// Mem leak detection -#include "MemoryLeak.h" + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules #include "cRoot.h" -#include "cMCLogger.h" #include //std::exception -#include //printf #include //std::signal #include //exit() #include "SquirrelBindings.h" #if USE_SQUIRREL -#pragma warning(disable:4100;disable:4127;disable:4510;disable:4610;disable:4244;disable:4512) // Getting A LOT of these warnings from SqPlus -#include -#pragma warning(default:4100;default:4127;default:4510;default:4610;default:4244;default:4512) + #pragma warning(disable:4100;disable:4127;disable:4510;disable:4610;disable:4244;disable:4512) // Getting A LOT of these warnings from SqPlus + #include + #pragma warning(default:4100;default:4127;default:4510;default:4610;default:4244;default:4512) #endif + + + + void ShowCrashReport(int) { std::signal(SIGSEGV, SIG_DFL); diff --git a/source/md5/md5.cpp b/source/md5/md5.cpp index 21bec8f12..534020219 100644 --- a/source/md5/md5.cpp +++ b/source/md5/md5.cpp @@ -30,6 +30,8 @@ documentation and/or software. */ +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + /* interface header */ #include "md5.h" diff --git a/source/packets/cPacket.cpp b/source/packets/cPacket.cpp index a22e27d41..06ae24706 100644 --- a/source/packets/cPacket.cpp +++ b/source/packets/cPacket.cpp @@ -1,15 +1,21 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket.h" -#include "../cMCLogger.h" #include "../Endianness.h" #ifdef _WIN32 -#define MSG_NOSIGNAL (0) + #define MSG_NOSIGNAL (0) #endif #ifdef __MAC_NA -#define MSG_NOSIGNAL (0) + #define MSG_NOSIGNAL (0) #endif + + + + //***************************************************************************** // Blocking receive all function //***************************************************************************** diff --git a/source/packets/cPacket.h b/source/packets/cPacket.h index 5f226cfcf..3d6f812a9 100644 --- a/source/packets/cPacket.h +++ b/source/packets/cPacket.h @@ -4,11 +4,10 @@ #include "../PacketID.h" #ifdef _WIN32 -#include + // #include #else -#include // Silly Linux doesn't have xstring... -#include -#include + #include // Silly Linux doesn't have xstring... + #include #endif class cSocket; diff --git a/source/packets/cPacket_13.cpp b/source/packets/cPacket_13.cpp index 5e649fbd9..bf1b47437 100644 --- a/source/packets/cPacket_13.cpp +++ b/source/packets/cPacket_13.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_13.h" + + + + bool cPacket_13::Parse(cSocket & a_Socket) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_AddToInventory.cpp b/source/packets/cPacket_AddToInventory.cpp index e8701cb7b..da350e9b3 100644 --- a/source/packets/cPacket_AddToInventory.cpp +++ b/source/packets/cPacket_AddToInventory.cpp @@ -1,8 +1,15 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_AddToInventory.h" #include "cPacket_WholeInventory.h" #include "../cItem.h" #include "cPacket_ItemData.h" + + + + bool cPacket_AddToInventory::Send( cSocket & a_Socket ) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_ArmAnim.cpp b/source/packets/cPacket_ArmAnim.cpp index f0a662f27..03880101e 100644 --- a/source/packets/cPacket_ArmAnim.cpp +++ b/source/packets/cPacket_ArmAnim.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_ArmAnim.h" + + + + bool cPacket_ArmAnim::Parse( cSocket & a_Socket ) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_BlockAction.cpp b/source/packets/cPacket_BlockAction.cpp index adbd9b93f..46faf0cc6 100644 --- a/source/packets/cPacket_BlockAction.cpp +++ b/source/packets/cPacket_BlockAction.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_BlockAction.h" + + + + cPacket_BlockAction::cPacket_BlockAction( const cPacket_BlockAction & a_Copy ) { m_PacketID = E_BLOCK_ACTION; diff --git a/source/packets/cPacket_BlockChange.cpp b/source/packets/cPacket_BlockChange.cpp index 44b389a14..8b758f618 100644 --- a/source/packets/cPacket_BlockChange.cpp +++ b/source/packets/cPacket_BlockChange.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_BlockChange.h" + + + + bool cPacket_BlockChange::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_BlockDig.cpp b/source/packets/cPacket_BlockDig.cpp index c6092f9cd..498023508 100644 --- a/source/packets/cPacket_BlockDig.cpp +++ b/source/packets/cPacket_BlockDig.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_BlockDig.h" + + + + bool cPacket_BlockDig::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_BlockPlace.cpp b/source/packets/cPacket_BlockPlace.cpp index 9943ae38e..6fd8cef28 100644 --- a/source/packets/cPacket_BlockPlace.cpp +++ b/source/packets/cPacket_BlockPlace.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_BlockPlace.h" #include "cPacket_ItemData.h" + + + + bool cPacket_BlockPlace::Parse(cSocket & a_Socket) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_Chat.cpp b/source/packets/cPacket_Chat.cpp index d948c5deb..251c9d7ec 100644 --- a/source/packets/cPacket_Chat.cpp +++ b/source/packets/cPacket_Chat.cpp @@ -1,6 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Chat.h" + + + bool cPacket_Chat::Parse( cSocket & a_Socket ) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_CollectItem.cpp b/source/packets/cPacket_CollectItem.cpp index 0ad92ddad..cc67cef35 100644 --- a/source/packets/cPacket_CollectItem.cpp +++ b/source/packets/cPacket_CollectItem.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_CollectItem.h" + + + + bool cPacket_CollectItem::Send( cSocket & a_Socket ) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_CreativeInventoryAction.cpp b/source/packets/cPacket_CreativeInventoryAction.cpp index 834a3c2fe..685d488e6 100644 --- a/source/packets/cPacket_CreativeInventoryAction.cpp +++ b/source/packets/cPacket_CreativeInventoryAction.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_CreativeInventoryAction.h" #include "cPacket_ItemData.h" + + + + cPacket_CreativeInventoryAction::cPacket_CreativeInventoryAction( const cPacket_CreativeInventoryAction & a_Copy ) { m_PacketID = E_CREATIVE_INVENTORY_ACTION; diff --git a/source/packets/cPacket_DestroyEntity.cpp b/source/packets/cPacket_DestroyEntity.cpp index 6dfd059c8..6e1f8a97a 100644 --- a/source/packets/cPacket_DestroyEntity.cpp +++ b/source/packets/cPacket_DestroyEntity.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_DestroyEntity.h" #include "../cEntity.h" + + + + cPacket_DestroyEntity::cPacket_DestroyEntity(cEntity* a_Entity) { m_PacketID = E_DESTROY_ENT; diff --git a/source/packets/cPacket_Disconnect.cpp b/source/packets/cPacket_Disconnect.cpp index c2a0e3be6..2e085c516 100644 --- a/source/packets/cPacket_Disconnect.cpp +++ b/source/packets/cPacket_Disconnect.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Disconnect.h" + + + + bool cPacket_Disconnect::Parse( cSocket & a_Socket ) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_EntityEquipment.cpp b/source/packets/cPacket_EntityEquipment.cpp index afd2e7678..b3030ac74 100644 --- a/source/packets/cPacket_EntityEquipment.cpp +++ b/source/packets/cPacket_EntityEquipment.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_EntityEquipment.h" + + + + cPacket_EntityEquipment::cPacket_EntityEquipment( const cPacket_EntityEquipment & a_Copy ) { m_PacketID = E_ENTITY_EQUIPMENT; diff --git a/source/packets/cPacket_EntityLook.cpp b/source/packets/cPacket_EntityLook.cpp index f4caf7191..7cca43210 100644 --- a/source/packets/cPacket_EntityLook.cpp +++ b/source/packets/cPacket_EntityLook.cpp @@ -1,7 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_EntityLook.h" #include "../cEntity.h" + + + + cPacket_EntityLook::cPacket_EntityLook(cEntity* a_Entity) { m_PacketID = E_ENT_LOOK; diff --git a/source/packets/cPacket_EntityStatus.cpp b/source/packets/cPacket_EntityStatus.cpp index 41d94b6c2..aafea5c12 100644 --- a/source/packets/cPacket_EntityStatus.cpp +++ b/source/packets/cPacket_EntityStatus.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_EntityStatus.h" + + + + bool cPacket_EntityStatus::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_Explosion.cpp b/source/packets/cPacket_Explosion.cpp index e1de9d6ff..d2baba876 100644 --- a/source/packets/cPacket_Explosion.cpp +++ b/source/packets/cPacket_Explosion.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Explosion.h" + + + + cPacket_Explosion::~cPacket_Explosion() { if( m_Records ) diff --git a/source/packets/cPacket_Flying.cpp b/source/packets/cPacket_Flying.cpp index b8cab1de1..44f30bbe3 100644 --- a/source/packets/cPacket_Flying.cpp +++ b/source/packets/cPacket_Flying.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Flying.h" + + + + bool cPacket_Flying::Parse(cSocket & a_Socket) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_Handshake.cpp b/source/packets/cPacket_Handshake.cpp index 2513ab33d..482f25d26 100644 --- a/source/packets/cPacket_Handshake.cpp +++ b/source/packets/cPacket_Handshake.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Handshake.h" + + + + bool cPacket_Handshake::Parse(cSocket & a_Socket) { //printf("Parse: NEW Handshake\n"); diff --git a/source/packets/cPacket_InventoryProgressBar.cpp b/source/packets/cPacket_InventoryProgressBar.cpp index c8d7b0383..4f00ef80a 100644 --- a/source/packets/cPacket_InventoryProgressBar.cpp +++ b/source/packets/cPacket_InventoryProgressBar.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_InventoryProgressBar.h" + + + + bool cPacket_InventoryProgressBar::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_InventorySlot.cpp b/source/packets/cPacket_InventorySlot.cpp index 3c3a40210..f28c39aa7 100644 --- a/source/packets/cPacket_InventorySlot.cpp +++ b/source/packets/cPacket_InventorySlot.cpp @@ -1,7 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_InventorySlot.h" #include "cPacket_WholeInventory.h" #include "cPacket_ItemData.h" + + + + bool cPacket_InventorySlot::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_ItemData.cpp b/source/packets/cPacket_ItemData.cpp index 1c1d13c60..851323ee4 100644 --- a/source/packets/cPacket_ItemData.cpp +++ b/source/packets/cPacket_ItemData.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_ItemData.h" + + + + bool cPacket_ItemData::Parse(cSocket & a_Socket) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_ItemSwitch.cpp b/source/packets/cPacket_ItemSwitch.cpp index 39c61833e..517e1de4b 100644 --- a/source/packets/cPacket_ItemSwitch.cpp +++ b/source/packets/cPacket_ItemSwitch.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_ItemSwitch.h" + + + + bool cPacket_ItemSwitch::Parse( cSocket & a_Socket ) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_KeepAlive.cpp b/source/packets/cPacket_KeepAlive.cpp index 8dcd9092f..11c4efa11 100644 --- a/source/packets/cPacket_KeepAlive.cpp +++ b/source/packets/cPacket_KeepAlive.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_KeepAlive.h" + + + + bool cPacket_KeepAlive::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_Login.cpp b/source/packets/cPacket_Login.cpp index 2716aaf97..60feb215a 100644 --- a/source/packets/cPacket_Login.cpp +++ b/source/packets/cPacket_Login.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Login.h" + + + + const std::string cPacket_Login::LEVEL_TYPE_DEFAULT = "DEFAULT"; const std::string cPacket_Login::LEVEL_TYPE_SUPERFLAT = "SUPERFLAT"; diff --git a/source/packets/cPacket_MapChunk.cpp b/source/packets/cPacket_MapChunk.cpp index 08681494c..6bc764e09 100644 --- a/source/packets/cPacket_MapChunk.cpp +++ b/source/packets/cPacket_MapChunk.cpp @@ -1,8 +1,15 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_MapChunk.h" #include "../cChunk.h" #include "zlib.h" + + + + cPacket_MapChunk::~cPacket_MapChunk() { if( m_CompressedData ) diff --git a/source/packets/cPacket_Metadata.cpp b/source/packets/cPacket_Metadata.cpp index d06bdacbe..e130f86fc 100644 --- a/source/packets/cPacket_Metadata.cpp +++ b/source/packets/cPacket_Metadata.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Metadata.h" + + + + cPacket_Metadata::cPacket_Metadata(int s, int id) : m_EMetaData( (cPawn::MetaData)s ) , m_UniqueID( id ) diff --git a/source/packets/cPacket_MultiBlock.cpp b/source/packets/cPacket_MultiBlock.cpp index ef396874f..392bc7fef 100644 --- a/source/packets/cPacket_MultiBlock.cpp +++ b/source/packets/cPacket_MultiBlock.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_MultiBlock.h" + + + + cPacket_MultiBlock::cPacket_MultiBlock( const cPacket_MultiBlock & a_Copy ) { m_PacketID = E_MULTI_BLOCK; diff --git a/source/packets/cPacket_NamedEntitySpawn.cpp b/source/packets/cPacket_NamedEntitySpawn.cpp index 222711119..8718bb206 100644 --- a/source/packets/cPacket_NamedEntitySpawn.cpp +++ b/source/packets/cPacket_NamedEntitySpawn.cpp @@ -1,6 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_NamedEntitySpawn.h" + + + bool cPacket_NamedEntitySpawn::Send( cSocket & a_Socket ) { unsigned int TotalSize = c_Size + m_PlayerName.size() * sizeof( short ); diff --git a/source/packets/cPacket_NewInvalidState.cpp b/source/packets/cPacket_NewInvalidState.cpp index 6755ec207..ce9b9d12a 100644 --- a/source/packets/cPacket_NewInvalidState.cpp +++ b/source/packets/cPacket_NewInvalidState.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_NewInvalidState.h" + + + + cPacket_NewInvalidState::cPacket_NewInvalidState( const cPacket_NewInvalidState & a_Copy ) { m_PacketID = E_NEW_INVALID_STATE; diff --git a/source/packets/cPacket_PickupSpawn.cpp b/source/packets/cPacket_PickupSpawn.cpp index 73f4e3846..6ddd99911 100644 --- a/source/packets/cPacket_PickupSpawn.cpp +++ b/source/packets/cPacket_PickupSpawn.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_PickupSpawn.h" + + + + bool cPacket_PickupSpawn::Parse( cSocket & a_Socket ) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_PlayerListItem.cpp b/source/packets/cPacket_PlayerListItem.cpp index 85970b7ca..70971dc34 100644 --- a/source/packets/cPacket_PlayerListItem.cpp +++ b/source/packets/cPacket_PlayerListItem.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_PlayerListItem.h" #include "../cChatColor.h" + + + + cPacket_PlayerListItem::cPacket_PlayerListItem(std::string a_PlayerName, bool a_Online, short a_Ping) { m_PacketID = E_PLAYER_LIST_ITEM; diff --git a/source/packets/cPacket_PlayerLook.cpp b/source/packets/cPacket_PlayerLook.cpp index 2660ccf92..30c25c074 100644 --- a/source/packets/cPacket_PlayerLook.cpp +++ b/source/packets/cPacket_PlayerLook.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_PlayerLook.h" #include "../cPlayer.h" + + + + cPacket_PlayerLook::cPacket_PlayerLook( cPlayer* a_Player ) { m_PacketID = E_PLAYERLOOK; diff --git a/source/packets/cPacket_PlayerMoveLook.cpp b/source/packets/cPacket_PlayerMoveLook.cpp index 3970e27ae..55bd8f803 100644 --- a/source/packets/cPacket_PlayerMoveLook.cpp +++ b/source/packets/cPacket_PlayerMoveLook.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_PlayerMoveLook.h" #include "../cPlayer.h" + + + + cPacket_PlayerMoveLook::cPacket_PlayerMoveLook( cPlayer* a_Player ) { m_PacketID = E_PLAYERMOVELOOK; diff --git a/source/packets/cPacket_PlayerPosition.cpp b/source/packets/cPacket_PlayerPosition.cpp index e1d6877bb..c9e6c966f 100644 --- a/source/packets/cPacket_PlayerPosition.cpp +++ b/source/packets/cPacket_PlayerPosition.cpp @@ -1,6 +1,13 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_PlayerPosition.h" #include "../cPlayer.h" + + + + cPacket_PlayerPosition::cPacket_PlayerPosition( cPlayer* a_Player ) { m_PacketID = E_PLAYERPOS; diff --git a/source/packets/cPacket_PreChunk.cpp b/source/packets/cPacket_PreChunk.cpp index 686984a1e..8117f0ad7 100644 --- a/source/packets/cPacket_PreChunk.cpp +++ b/source/packets/cPacket_PreChunk.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_PreChunk.h" + + + + bool cPacket_PreChunk::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_RelativeEntityMove.cpp b/source/packets/cPacket_RelativeEntityMove.cpp index 4a1dc56b2..8072097b6 100644 --- a/source/packets/cPacket_RelativeEntityMove.cpp +++ b/source/packets/cPacket_RelativeEntityMove.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_RelativeEntityMove.h" + + + + bool cPacket_RelativeEntityMove::Send( cSocket & a_Socket ) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_RelativeEntityMoveLook.cpp b/source/packets/cPacket_RelativeEntityMoveLook.cpp index e879870cd..8de1a0be7 100644 --- a/source/packets/cPacket_RelativeEntityMoveLook.cpp +++ b/source/packets/cPacket_RelativeEntityMoveLook.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_RelativeEntityMoveLook.h" + + + + bool cPacket_RelativeEntityMoveLook::Send( cSocket & a_Socket ) { unsigned int TotalSize = c_Size; diff --git a/source/packets/cPacket_Respawn.cpp b/source/packets/cPacket_Respawn.cpp index 1bc18d500..b09659eb3 100644 --- a/source/packets/cPacket_Respawn.cpp +++ b/source/packets/cPacket_Respawn.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Respawn.h" + + + + bool cPacket_Respawn::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size + m_LevelType.size() * sizeof(short); diff --git a/source/packets/cPacket_SoundEffect.cpp b/source/packets/cPacket_SoundEffect.cpp index 962c0b709..453750d55 100644 --- a/source/packets/cPacket_SoundEffect.cpp +++ b/source/packets/cPacket_SoundEffect.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_SoundEffect.h" + + + + cPacket_SoundEffect::cPacket_SoundEffect( const cPacket_SoundEffect & a_Copy ) { m_PacketID = E_SOUND_EFFECT; diff --git a/source/packets/cPacket_SpawnMob.cpp b/source/packets/cPacket_SpawnMob.cpp index 0055e74db..417a7c004 100644 --- a/source/packets/cPacket_SpawnMob.cpp +++ b/source/packets/cPacket_SpawnMob.cpp @@ -1,7 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_SpawnMob.h" #include "../Vector3i.h" -#include "../cMCLogger.h" + + + cPacket_SpawnMob::~cPacket_SpawnMob() { diff --git a/source/packets/cPacket_TeleportEntity.cpp b/source/packets/cPacket_TeleportEntity.cpp index f5be680aa..0b735a1cb 100644 --- a/source/packets/cPacket_TeleportEntity.cpp +++ b/source/packets/cPacket_TeleportEntity.cpp @@ -1,7 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_TeleportEntity.h" #include "../cEntity.h" + + + + cPacket_TeleportEntity::cPacket_TeleportEntity(cEntity* a_Client) { m_PacketID = E_ENT_TELEPORT; diff --git a/source/packets/cPacket_Thunderbolt.cpp b/source/packets/cPacket_Thunderbolt.cpp index 48e8f1573..51c951a1d 100644 --- a/source/packets/cPacket_Thunderbolt.cpp +++ b/source/packets/cPacket_Thunderbolt.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_Thunderbolt.h" + + + + cPacket_Thunderbolt::cPacket_Thunderbolt( const cPacket_Thunderbolt & a_Copy ) { m_PacketID = E_THUNDERBOLT; diff --git a/source/packets/cPacket_TimeUpdate.cpp b/source/packets/cPacket_TimeUpdate.cpp index 09a9ca66a..c1e760d62 100644 --- a/source/packets/cPacket_TimeUpdate.cpp +++ b/source/packets/cPacket_TimeUpdate.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_TimeUpdate.h" + + + + bool cPacket_TimeUpdate::Parse(cSocket & a_Socket) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_UpdateHealth.cpp b/source/packets/cPacket_UpdateHealth.cpp index fe4929cc9..c6cec56ae 100644 --- a/source/packets/cPacket_UpdateHealth.cpp +++ b/source/packets/cPacket_UpdateHealth.cpp @@ -1,6 +1,11 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_UpdateHealth.h" -#include "../cMCLogger.h" + + + bool cPacket_UpdateHealth::Send(cSocket & a_Socket) { diff --git a/source/packets/cPacket_UpdateSign.cpp b/source/packets/cPacket_UpdateSign.cpp index f7d3f8618..726ee5865 100644 --- a/source/packets/cPacket_UpdateSign.cpp +++ b/source/packets/cPacket_UpdateSign.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_UpdateSign.h" + + + + bool cPacket_UpdateSign::Parse( cSocket & a_Socket ) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_UseEntity.cpp b/source/packets/cPacket_UseEntity.cpp index bbe22d3ec..346341fb0 100644 --- a/source/packets/cPacket_UseEntity.cpp +++ b/source/packets/cPacket_UseEntity.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_UseEntity.h" + + + + bool cPacket_UseEntity::Parse(cSocket & a_Socket) { m_Socket = a_Socket; diff --git a/source/packets/cPacket_WholeInventory.cpp b/source/packets/cPacket_WholeInventory.cpp index f9b7be2c4..130d4dc8c 100644 --- a/source/packets/cPacket_WholeInventory.cpp +++ b/source/packets/cPacket_WholeInventory.cpp @@ -1,9 +1,16 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_WholeInventory.h" #include "../cItem.h" #include "../cInventory.h" #include "../cWindow.h" #include "cPacket_ItemData.h" + + + + cPacket_WholeInventory::cPacket_WholeInventory( const cPacket_WholeInventory & a_Clone ) { m_PacketID = E_INVENTORY_WHOLE; diff --git a/source/packets/cPacket_WindowClick.cpp b/source/packets/cPacket_WindowClick.cpp index a84fbd34a..2df2108e1 100644 --- a/source/packets/cPacket_WindowClick.cpp +++ b/source/packets/cPacket_WindowClick.cpp @@ -1,7 +1,14 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_WindowClick.h" #include "cPacket_WholeInventory.h" #include "cPacket_ItemData.h" + + + + bool cPacket_WindowClick::Parse(cSocket & a_Socket) { // LOG("-----------INV66-----------"); diff --git a/source/packets/cPacket_WindowClose.cpp b/source/packets/cPacket_WindowClose.cpp index 0881fb703..6cd8f861a 100644 --- a/source/packets/cPacket_WindowClose.cpp +++ b/source/packets/cPacket_WindowClose.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_WindowClose.h" + + + + bool cPacket_WindowClose::Parse(cSocket & a_Socket) { //LOG("CLOSE INVENTORY PACKET"); diff --git a/source/packets/cPacket_WindowOpen.cpp b/source/packets/cPacket_WindowOpen.cpp index 5d1299acd..46e84a943 100644 --- a/source/packets/cPacket_WindowOpen.cpp +++ b/source/packets/cPacket_WindowOpen.cpp @@ -1,5 +1,12 @@ + +#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules + #include "cPacket_WindowOpen.h" + + + + bool cPacket_WindowOpen::Send(cSocket & a_Socket) { unsigned int TotalSize = c_Size + m_WindowTitle.size() * sizeof( short ); diff --git a/source/tolua_base.h b/source/tolua_base.h index 28ab9d41d..28708eb59 100644 --- a/source/tolua_base.h +++ b/source/tolua_base.h @@ -4,7 +4,10 @@ #pragma warning(disable:4800) // This file is ONLY included by Bindings.cpp and it throws lots of C4800 warnings #include "tolua++.h" -#include "cMCLogger.h" + + + + class ToluaBase { diff --git a/source/wdirent.h b/source/wdirent.h index 445d040dc..0f8b37842 100644 --- a/source/wdirent.h +++ b/source/wdirent.h @@ -76,9 +76,6 @@ #ifndef DIRENT_H #define DIRENT_H -#define WIN32_LEAN_AND_MEAN -#include -#include #include #include #include -- cgit v1.2.3