From 2804dc3ec25fef8cdcd4a52331b8d2b4d23f5045 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Fri, 5 Jan 2024 04:33:52 -0800 Subject: [PATCH] fix: make include paths consistent (#1390) * fix: bad header includes tests pass * fix-up more include paths --- CMakeLists.txt | 1 + dAuthServer/AuthServer.cpp | 2 +- dChatServer/ChatServer.cpp | 2 +- dCommon/AmfSerialize.h | 2 +- dCommon/GeneralUtils.h | 2 +- dCommon/ZCompression.cpp | 2 +- dCommon/dClient/AssetManager.cpp | 2 +- dGame/Character.h | 2 +- dGame/Entity.cpp | 2 +- dGame/User.h | 2 +- dGame/UserManager.cpp | 4 ++-- dGame/dComponents/ActivityComponent.cpp | 2 +- dGame/dComponents/BaseCombatAIComponent.cpp | 2 +- dGame/dComponents/BouncerComponent.cpp | 2 +- dGame/dComponents/BuffComponent.cpp | 2 +- dGame/dComponents/CharacterComponent.cpp | 2 +- dGame/dComponents/Component.h | 2 +- dGame/dComponents/DestroyableComponent.cpp | 2 +- dGame/dComponents/PropertyEntranceComponent.cpp | 2 +- dGame/dComponents/QuickBuildComponent.h | 2 +- dGame/dComponents/RenderComponent.h | 2 +- dGame/dGameMessages/GameMessageHandler.cpp | 2 +- dGame/dGameMessages/GameMessages.cpp | 2 +- dNet/AuthPackets.cpp | 2 +- dNet/PacketUtils.h | 4 ++-- dNet/ZoneInstanceManager.h | 2 +- tests/dCommonTests/dCommonDependencies.h | 2 -- 27 files changed, 28 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91a26dc5..00c12e28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -243,6 +243,7 @@ set(INCLUDED_DIRECTORIES "thirdparty/recastnavigation" "thirdparty/SQLite" "thirdparty/cpplinq" + "thirdparty/cpp-httplib" "tests" "tests/dCommonTests" diff --git a/dAuthServer/AuthServer.cpp b/dAuthServer/AuthServer.cpp index 414c572f..c2cfbfcc 100644 --- a/dAuthServer/AuthServer.cpp +++ b/dAuthServer/AuthServer.cpp @@ -16,7 +16,7 @@ //RakNet includes: #include "RakNetDefines.h" -#include +#include "MessageIdentifiers.h" //Auth includes: #include "AuthPackets.h" diff --git a/dChatServer/ChatServer.cpp b/dChatServer/ChatServer.cpp index 72220d83..8e1d3adf 100644 --- a/dChatServer/ChatServer.cpp +++ b/dChatServer/ChatServer.cpp @@ -25,7 +25,7 @@ //RakNet includes: #include "RakNetDefines.h" -#include +#include "MessageIdentifiers.h" namespace Game { Logger* logger = nullptr; diff --git a/dCommon/AmfSerialize.h b/dCommon/AmfSerialize.h index 9a6f56f2..06abae74 100644 --- a/dCommon/AmfSerialize.h +++ b/dCommon/AmfSerialize.h @@ -4,7 +4,7 @@ #include "Amf3.h" // RakNet -#include +#include "BitStream.h" /*! \file AmfSerialize.h diff --git a/dCommon/GeneralUtils.h b/dCommon/GeneralUtils.h index 964a864b..37291ab8 100644 --- a/dCommon/GeneralUtils.h +++ b/dCommon/GeneralUtils.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include "BitStream.h" #include "NiPoint3.h" #include "Game.h" diff --git a/dCommon/ZCompression.cpp b/dCommon/ZCompression.cpp index d5d4c126..e5b3c8fb 100644 --- a/dCommon/ZCompression.cpp +++ b/dCommon/ZCompression.cpp @@ -1,6 +1,6 @@ #include "ZCompression.h" -#include +#include "zlib.h" namespace ZCompression { int32_t GetMaxCompressedLength(int32_t nLenSrc) { diff --git a/dCommon/dClient/AssetManager.cpp b/dCommon/dClient/AssetManager.cpp index 98a71e37..59427ee5 100644 --- a/dCommon/dClient/AssetManager.cpp +++ b/dCommon/dClient/AssetManager.cpp @@ -4,7 +4,7 @@ #include "Game.h" #include "Logger.h" -#include +#include "zlib.h" AssetManager::AssetManager(const std::filesystem::path& path) { if (!std::filesystem::is_directory(path)) { diff --git a/dGame/Character.h b/dGame/Character.h index 77a52f44..6c8ead30 100644 --- a/dGame/Character.h +++ b/dGame/Character.h @@ -3,7 +3,7 @@ #include "dCommonVars.h" #include -#include "../thirdparty/tinyxml2/tinyxml2.h" +#include "tinyxml2.h" #include #include diff --git a/dGame/Entity.cpp b/dGame/Entity.cpp index fce2aefe..aaa01e97 100644 --- a/dGame/Entity.cpp +++ b/dGame/Entity.cpp @@ -3,7 +3,7 @@ #include "CDClientManager.h" #include "Game.h" #include "Logger.h" -#include +#include "PacketUtils.h" #include #include "CDDestructibleComponentTable.h" #include "CDClientDatabase.h" diff --git a/dGame/User.h b/dGame/User.h index 5d9ea8f1..54e6ad52 100644 --- a/dGame/User.h +++ b/dGame/User.h @@ -3,7 +3,7 @@ #include #include -#include "../thirdparty/raknet/Source/RakNetTypes.h" +#include "RakNetTypes.h" #include "dCommonVars.h" #include diff --git a/dGame/UserManager.cpp b/dGame/UserManager.cpp index 1fed7907..736339a4 100644 --- a/dGame/UserManager.cpp +++ b/dGame/UserManager.cpp @@ -8,9 +8,9 @@ #include "Game.h" #include "Logger.h" #include "User.h" -#include +#include "WorldPackets.h" #include "Character.h" -#include +#include "BitStream.h" #include "PacketUtils.h" #include "ObjectIDManager.h" #include "Logger.h" diff --git a/dGame/dComponents/ActivityComponent.cpp b/dGame/dComponents/ActivityComponent.cpp index 55bc4c08..7ea7500b 100644 --- a/dGame/dComponents/ActivityComponent.cpp +++ b/dGame/dComponents/ActivityComponent.cpp @@ -7,7 +7,7 @@ #include "ZoneInstanceManager.h" #include "Game.h" #include "Logger.h" -#include +#include "WorldPackets.h" #include "EntityManager.h" #include "ChatPackets.h" #include "Player.h" diff --git a/dGame/dComponents/BaseCombatAIComponent.cpp b/dGame/dComponents/BaseCombatAIComponent.cpp index 17a2f1ea..4e969ced 100644 --- a/dGame/dComponents/BaseCombatAIComponent.cpp +++ b/dGame/dComponents/BaseCombatAIComponent.cpp @@ -1,5 +1,5 @@ #include "BaseCombatAIComponent.h" -#include +#include "BitStream.h" #include "Entity.h" #include "EntityManager.h" diff --git a/dGame/dComponents/BouncerComponent.cpp b/dGame/dComponents/BouncerComponent.cpp index 56002ac4..78ee3637 100644 --- a/dGame/dComponents/BouncerComponent.cpp +++ b/dGame/dComponents/BouncerComponent.cpp @@ -6,7 +6,7 @@ #include "Game.h" #include "Logger.h" #include "GameMessages.h" -#include +#include "BitStream.h" #include "eTriggerEventType.h" BouncerComponent::BouncerComponent(Entity* parent) : Component(parent) { diff --git a/dGame/dComponents/BuffComponent.cpp b/dGame/dComponents/BuffComponent.cpp index 1819438b..10ac4ebb 100644 --- a/dGame/dComponents/BuffComponent.cpp +++ b/dGame/dComponents/BuffComponent.cpp @@ -1,5 +1,5 @@ #include "BuffComponent.h" -#include +#include "BitStream.h" #include "CDClientDatabase.h" #include #include "DestroyableComponent.h" diff --git a/dGame/dComponents/CharacterComponent.cpp b/dGame/dComponents/CharacterComponent.cpp index efc5d9d5..702ab70f 100644 --- a/dGame/dComponents/CharacterComponent.cpp +++ b/dGame/dComponents/CharacterComponent.cpp @@ -1,5 +1,5 @@ #include "CharacterComponent.h" -#include +#include "BitStream.h" #include "tinyxml2.h" #include "Game.h" #include "Logger.h" diff --git a/dGame/dComponents/Component.h b/dGame/dComponents/Component.h index c0debb0b..d1ad0860 100644 --- a/dGame/dComponents/Component.h +++ b/dGame/dComponents/Component.h @@ -1,6 +1,6 @@ #pragma once -#include "../thirdparty/tinyxml2/tinyxml2.h" +#include "tinyxml2.h" class Entity; diff --git a/dGame/dComponents/DestroyableComponent.cpp b/dGame/dComponents/DestroyableComponent.cpp index 1ced2f54..64dca4f1 100644 --- a/dGame/dComponents/DestroyableComponent.cpp +++ b/dGame/dComponents/DestroyableComponent.cpp @@ -1,5 +1,5 @@ #include "DestroyableComponent.h" -#include +#include "BitStream.h" #include "Logger.h" #include "Game.h" #include "dConfig.h" diff --git a/dGame/dComponents/PropertyEntranceComponent.cpp b/dGame/dComponents/PropertyEntranceComponent.cpp index c49d8985..2bb6ea30 100644 --- a/dGame/dComponents/PropertyEntranceComponent.cpp +++ b/dGame/dComponents/PropertyEntranceComponent.cpp @@ -1,6 +1,6 @@ #include "PropertyEntranceComponent.h" -#include +#include "CDPropertyEntranceComponentTable.h" #include "Character.h" #include "Database.h" diff --git a/dGame/dComponents/QuickBuildComponent.h b/dGame/dComponents/QuickBuildComponent.h index feef1f74..f1106a61 100644 --- a/dGame/dComponents/QuickBuildComponent.h +++ b/dGame/dComponents/QuickBuildComponent.h @@ -1,7 +1,7 @@ #ifndef QUICKBUILDCOMPONENT_H #define QUICKBUILDCOMPONENT_H -#include +#include "BitStream.h" #include #include #include "dCommonVars.h" diff --git a/dGame/dComponents/RenderComponent.h b/dGame/dComponents/RenderComponent.h index d4d1e5c3..74f39625 100644 --- a/dGame/dComponents/RenderComponent.h +++ b/dGame/dComponents/RenderComponent.h @@ -1,7 +1,7 @@ #ifndef RENDERCOMPONENT_H #define RENDERCOMPONENT_H -#include +#include "BitStream.h" #include #include #include diff --git a/dGame/dGameMessages/GameMessageHandler.cpp b/dGame/dGameMessages/GameMessageHandler.cpp index c4ac1910..6e313ab1 100644 --- a/dGame/dGameMessages/GameMessageHandler.cpp +++ b/dGame/dGameMessages/GameMessageHandler.cpp @@ -7,7 +7,7 @@ #include "MissionComponent.h" #include "BitStreamUtils.h" #include "dServer.h" -#include "../thirdparty/raknet/Source/RakNetworkFactory.h" +#include "RakNetworkFactory.h" #include #include "User.h" #include "UserManager.h" diff --git a/dGame/dGameMessages/GameMessages.cpp b/dGame/dGameMessages/GameMessages.cpp index 8e20e3a9..eb6f11bb 100644 --- a/dGame/dGameMessages/GameMessages.cpp +++ b/dGame/dGameMessages/GameMessages.cpp @@ -50,7 +50,7 @@ #include #include "RakString.h" -#include "../thirdparty/cpp-httplib/httplib.h" //sorry not sorry. +#include "httplib.h" //sorry not sorry. //CDB includes: #include "CDClientManager.h" diff --git a/dNet/AuthPackets.cpp b/dNet/AuthPackets.cpp index b6a1f913..7feb0cc3 100644 --- a/dNet/AuthPackets.cpp +++ b/dNet/AuthPackets.cpp @@ -13,7 +13,7 @@ #include -#include +#include "BitStream.h" #include #include "Game.h" diff --git a/dNet/PacketUtils.h b/dNet/PacketUtils.h index 2afd53c7..f8558dfd 100644 --- a/dNet/PacketUtils.h +++ b/dNet/PacketUtils.h @@ -1,8 +1,8 @@ #ifndef PACKETUTILS_H #define PACKETUTILS_H -#include -#include +#include "MessageIdentifiers.h" +#include "BitStream.h" #include enum class eConnectionType : uint16_t; diff --git a/dNet/ZoneInstanceManager.h b/dNet/ZoneInstanceManager.h index a8e32c4e..3f8da1ae 100644 --- a/dNet/ZoneInstanceManager.h +++ b/dNet/ZoneInstanceManager.h @@ -7,7 +7,7 @@ #include // RakNet -#include +#include "RakNetTypes.h" class dServer; diff --git a/tests/dCommonTests/dCommonDependencies.h b/tests/dCommonTests/dCommonDependencies.h index 228c3c52..e82f4a4b 100644 --- a/tests/dCommonTests/dCommonDependencies.h +++ b/tests/dCommonTests/dCommonDependencies.h @@ -4,8 +4,6 @@ #include "Game.h" #include "Logger.h" #include "dServer.h" -#include "EntityInfo.h" -#include "EntityManager.h" #include "dConfig.h" #include