From 4cd3a3dabd53e27d3d2e0e2cd31f9d1b92747fe6 Mon Sep 17 00:00:00 2001 From: dongresource Date: Fri, 12 Mar 2021 18:50:21 +0100 Subject: [PATCH] [refactor] src/contrib, src/mingw -> vendor --- CMakeLists.txt | 4 +-- Makefile | 32 +++++++++---------- src/CNLoginServer.cpp | 2 +- src/Database.cpp | 4 +-- src/MissionManager.hpp | 2 +- src/MobManager.hpp | 2 +- src/NPCManager.cpp | 2 +- src/NPCManager.hpp | 2 +- src/TableData.cpp | 2 +- src/TableData.hpp | 2 +- src/settings.cpp | 2 +- {src/contrib => vendor}/INIReader.hpp | 0 {src/contrib => vendor}/JSON.hpp | 0 {src/contrib => vendor}/bcrypt/BCrypt.hpp | 0 {src/contrib => vendor}/bcrypt/bcrypt.c | 0 {src/contrib => vendor}/bcrypt/bcrypt.h | 0 {src/contrib => vendor}/bcrypt/crypt.h | 0 .../bcrypt/crypt_blowfish.c | 0 .../bcrypt/crypt_blowfish.h | 0 .../contrib => vendor}/bcrypt/crypt_gensalt.c | 0 .../contrib => vendor}/bcrypt/crypt_gensalt.h | 0 {src/contrib => vendor}/bcrypt/ow-crypt.h | 0 {src/contrib => vendor}/bcrypt/winbcrypt.h | 0 {src/contrib => vendor}/bcrypt/wrapper.c | 0 {src/contrib => vendor}/bcrypt/x86.S | 0 {src => vendor}/mingw/mingw.invoke.h | 0 {src => vendor}/mingw/mingw.mutex.h | 0 {src => vendor}/mingw/mingw.shared_mutex.h | 0 {src => vendor}/mingw/mingw.thread.h | 0 29 files changed, 28 insertions(+), 28 deletions(-) rename {src/contrib => vendor}/INIReader.hpp (100%) rename {src/contrib => vendor}/JSON.hpp (100%) rename {src/contrib => vendor}/bcrypt/BCrypt.hpp (100%) rename {src/contrib => vendor}/bcrypt/bcrypt.c (100%) rename {src/contrib => vendor}/bcrypt/bcrypt.h (100%) rename {src/contrib => vendor}/bcrypt/crypt.h (100%) rename {src/contrib => vendor}/bcrypt/crypt_blowfish.c (100%) rename {src/contrib => vendor}/bcrypt/crypt_blowfish.h (100%) rename {src/contrib => vendor}/bcrypt/crypt_gensalt.c (100%) rename {src/contrib => vendor}/bcrypt/crypt_gensalt.h (100%) rename {src/contrib => vendor}/bcrypt/ow-crypt.h (100%) rename {src/contrib => vendor}/bcrypt/winbcrypt.h (100%) rename {src/contrib => vendor}/bcrypt/wrapper.c (100%) rename {src/contrib => vendor}/bcrypt/x86.S (100%) rename {src => vendor}/mingw/mingw.invoke.h (100%) rename {src => vendor}/mingw/mingw.mutex.h (100%) rename {src => vendor}/mingw/mingw.shared_mutex.h (100%) rename {src => vendor}/mingw/mingw.thread.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2610d97..97703b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,9 +33,9 @@ else() set(BIN_NAME fusion) endif() -include_directories(src) +include_directories(src vendor) -file(GLOB_RECURSE SOURCES src/**.cpp src/**.hpp src/**.c src/**.h version.h) +file(GLOB_RECURSE SOURCES src/**.[ch]pp vendor/**.[ch]pp vendor/**.[ch] version.h) configure_file(version.h.in ${CMAKE_SOURCE_DIR}/version.h @ONLY) diff --git a/Makefile b/Makefile index 9690dc9..a169d74 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ CXX=clang++ # -w suppresses all warnings (the part that's commented out helps me find memory leaks, it ruins performance though!) # If compiling with ASAN, invoke like this: $ LSAN_OPTIONS=suppressions=suppr.txt bin/fusion CFLAGS=-O3 #-g3 -fsanitize=address -CXXFLAGS=-Wall -Wno-unknown-pragmas -std=c++17 -O2 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) -DGIT_VERSION=\"$(GIT_VERSION)\" #-g3 -fsanitize=address +CXXFLAGS=-Wall -Wno-unknown-pragmas -std=c++17 -O2 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) -DGIT_VERSION=\"$(GIT_VERSION)\" -I./vendor #-g3 -fsanitize=address LDFLAGS=-lpthread -lsqlite3 #-g3 -fsanitize=address # specifies the name of our exectuable SERVER=bin/fusion @@ -18,15 +18,15 @@ PROTOCOL_VERSION?=104 WIN_CC=x86_64-w64-mingw32-gcc WIN_CXX=x86_64-w64-mingw32-g++ WIN_CFLAGS=-O3 #-g3 -fsanitize=address -WIN_CXXFLAGS=-D_WIN32_WINNT=0x0601 -Wall -Wno-unknown-pragmas -std=c++17 -O3 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) -DGIT_VERSION=\"$(GIT_VERSION)\" #-g3 -fsanitize=address +WIN_CXXFLAGS=-D_WIN32_WINNT=0x0601 -Wall -Wno-unknown-pragmas -std=c++17 -O3 -DPROTOCOL_VERSION=$(PROTOCOL_VERSION) -DGIT_VERSION=\"$(GIT_VERSION)\" -I./vendor #-g3 -fsanitize=address WIN_LDFLAGS=-static -lws2_32 -lwsock32 -lsqlite3 #-g3 -fsanitize=address WIN_SERVER=bin/winfusion.exe CSRC=\ - src/contrib/bcrypt/bcrypt.c\ - src/contrib/bcrypt/crypt_blowfish.c\ - src/contrib/bcrypt/crypt_gensalt.c\ - src/contrib/bcrypt/wrapper.c\ + vendor/bcrypt/bcrypt.c\ + vendor/bcrypt/crypt_blowfish.c\ + vendor/bcrypt/crypt_gensalt.c\ + vendor/bcrypt/wrapper.c\ CXXSRC=\ src/ChatManager.cpp\ @@ -54,16 +54,16 @@ CXXSRC=\ # headers (for timestamp purposes) CHDR=\ - src/contrib/bcrypt/bcrypt.h\ - src/contrib/bcrypt/crypt_blowfish.h\ - src/contrib/bcrypt/crypt_gensalt.h\ - src/contrib/bcrypt/ow-crypt.h\ - src/contrib/bcrypt/winbcrypt.h\ + vendor/bcrypt/bcrypt.h\ + vendor/bcrypt/crypt_blowfish.h\ + vendor/bcrypt/crypt_gensalt.h\ + vendor/bcrypt/ow-crypt.h\ + vendor/bcrypt/winbcrypt.h\ CXXHDR=\ - src/contrib/bcrypt/BCrypt.hpp\ - src/contrib/INIReader.hpp\ - src/contrib/JSON.hpp\ + vendor/bcrypt/BCrypt.hpp\ + vendor/INIReader.hpp\ + vendor/JSON.hpp\ src/ChatManager.hpp\ src/CNLoginServer.hpp\ src/CNProtocol.hpp\ @@ -72,8 +72,8 @@ CXXHDR=\ src/CNStructs.hpp\ src/Database.hpp\ src/Defines.hpp\ - src/contrib/INIReader.hpp\ - src/contrib/JSON.hpp\ + vendor/INIReader.hpp\ + vendor/JSON.hpp\ src/MissionManager.hpp\ src/MobManager.hpp\ src/NanoManager.hpp\ diff --git a/src/CNLoginServer.cpp b/src/CNLoginServer.cpp index d67860e..069d2b7 100644 --- a/src/CNLoginServer.cpp +++ b/src/CNLoginServer.cpp @@ -5,7 +5,7 @@ #include "PlayerManager.hpp" #include "ItemManager.hpp" #include -#include "contrib/bcrypt/BCrypt.hpp" +#include "bcrypt/BCrypt.hpp" #include "settings.hpp" diff --git a/src/Database.cpp b/src/Database.cpp index 16dff95..1083a17 100644 --- a/src/Database.cpp +++ b/src/Database.cpp @@ -6,8 +6,8 @@ #include "CNStructs.hpp" #include "MissionManager.hpp" -#include "contrib/JSON.hpp" -#include "contrib/bcrypt/BCrypt.hpp" +#include "JSON.hpp" +#include "bcrypt/BCrypt.hpp" #include #include diff --git a/src/MissionManager.hpp b/src/MissionManager.hpp index fa46155..419f71b 100644 --- a/src/MissionManager.hpp +++ b/src/MissionManager.hpp @@ -3,7 +3,7 @@ #include "CNShardServer.hpp" #include "Player.hpp" -#include "contrib/JSON.hpp" +#include "JSON.hpp" struct Reward { int32_t id; diff --git a/src/MobManager.hpp b/src/MobManager.hpp index 3555362..d564d14 100644 --- a/src/MobManager.hpp +++ b/src/MobManager.hpp @@ -5,7 +5,7 @@ #include "CNShardServer.hpp" #include "NPC.hpp" -#include "contrib/JSON.hpp" +#include "JSON.hpp" #include #include diff --git a/src/NPCManager.cpp b/src/NPCManager.cpp index 239a345..712f124 100644 --- a/src/NPCManager.cpp +++ b/src/NPCManager.cpp @@ -18,7 +18,7 @@ #include #include -#include "contrib/JSON.hpp" +#include "JSON.hpp" std::map NPCManager::NPCs; std::map NPCManager::Warps; diff --git a/src/NPCManager.hpp b/src/NPCManager.hpp index da6ea8c..601ba6f 100644 --- a/src/NPCManager.hpp +++ b/src/NPCManager.hpp @@ -4,7 +4,7 @@ #include "PlayerManager.hpp" #include "NPC.hpp" -#include "contrib/JSON.hpp" +#include "JSON.hpp" #include #include diff --git a/src/TableData.cpp b/src/TableData.cpp index 6a63b11..b05f689 100644 --- a/src/TableData.cpp +++ b/src/TableData.cpp @@ -9,7 +9,7 @@ #include "NanoManager.hpp" #include "RacingManager.hpp" -#include "contrib/JSON.hpp" +#include "JSON.hpp" #include #include diff --git a/src/TableData.hpp b/src/TableData.hpp index 876f72a..12b7f62 100644 --- a/src/TableData.hpp +++ b/src/TableData.hpp @@ -1,7 +1,7 @@ #pragma once #include -#include "contrib/JSON.hpp" +#include "JSON.hpp" #include "NPCManager.hpp" namespace TableData { diff --git a/src/settings.cpp b/src/settings.cpp index 2856697..1c77c2f 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1,6 +1,6 @@ #include #include "settings.hpp" -#include "contrib/INIReader.hpp" +#include "INIReader.hpp" #include "CNStructs.hpp" // for ACADEMY // defaults :) diff --git a/src/contrib/INIReader.hpp b/vendor/INIReader.hpp similarity index 100% rename from src/contrib/INIReader.hpp rename to vendor/INIReader.hpp diff --git a/src/contrib/JSON.hpp b/vendor/JSON.hpp similarity index 100% rename from src/contrib/JSON.hpp rename to vendor/JSON.hpp diff --git a/src/contrib/bcrypt/BCrypt.hpp b/vendor/bcrypt/BCrypt.hpp similarity index 100% rename from src/contrib/bcrypt/BCrypt.hpp rename to vendor/bcrypt/BCrypt.hpp diff --git a/src/contrib/bcrypt/bcrypt.c b/vendor/bcrypt/bcrypt.c similarity index 100% rename from src/contrib/bcrypt/bcrypt.c rename to vendor/bcrypt/bcrypt.c diff --git a/src/contrib/bcrypt/bcrypt.h b/vendor/bcrypt/bcrypt.h similarity index 100% rename from src/contrib/bcrypt/bcrypt.h rename to vendor/bcrypt/bcrypt.h diff --git a/src/contrib/bcrypt/crypt.h b/vendor/bcrypt/crypt.h similarity index 100% rename from src/contrib/bcrypt/crypt.h rename to vendor/bcrypt/crypt.h diff --git a/src/contrib/bcrypt/crypt_blowfish.c b/vendor/bcrypt/crypt_blowfish.c similarity index 100% rename from src/contrib/bcrypt/crypt_blowfish.c rename to vendor/bcrypt/crypt_blowfish.c diff --git a/src/contrib/bcrypt/crypt_blowfish.h b/vendor/bcrypt/crypt_blowfish.h similarity index 100% rename from src/contrib/bcrypt/crypt_blowfish.h rename to vendor/bcrypt/crypt_blowfish.h diff --git a/src/contrib/bcrypt/crypt_gensalt.c b/vendor/bcrypt/crypt_gensalt.c similarity index 100% rename from src/contrib/bcrypt/crypt_gensalt.c rename to vendor/bcrypt/crypt_gensalt.c diff --git a/src/contrib/bcrypt/crypt_gensalt.h b/vendor/bcrypt/crypt_gensalt.h similarity index 100% rename from src/contrib/bcrypt/crypt_gensalt.h rename to vendor/bcrypt/crypt_gensalt.h diff --git a/src/contrib/bcrypt/ow-crypt.h b/vendor/bcrypt/ow-crypt.h similarity index 100% rename from src/contrib/bcrypt/ow-crypt.h rename to vendor/bcrypt/ow-crypt.h diff --git a/src/contrib/bcrypt/winbcrypt.h b/vendor/bcrypt/winbcrypt.h similarity index 100% rename from src/contrib/bcrypt/winbcrypt.h rename to vendor/bcrypt/winbcrypt.h diff --git a/src/contrib/bcrypt/wrapper.c b/vendor/bcrypt/wrapper.c similarity index 100% rename from src/contrib/bcrypt/wrapper.c rename to vendor/bcrypt/wrapper.c diff --git a/src/contrib/bcrypt/x86.S b/vendor/bcrypt/x86.S similarity index 100% rename from src/contrib/bcrypt/x86.S rename to vendor/bcrypt/x86.S diff --git a/src/mingw/mingw.invoke.h b/vendor/mingw/mingw.invoke.h similarity index 100% rename from src/mingw/mingw.invoke.h rename to vendor/mingw/mingw.invoke.h diff --git a/src/mingw/mingw.mutex.h b/vendor/mingw/mingw.mutex.h similarity index 100% rename from src/mingw/mingw.mutex.h rename to vendor/mingw/mingw.mutex.h diff --git a/src/mingw/mingw.shared_mutex.h b/vendor/mingw/mingw.shared_mutex.h similarity index 100% rename from src/mingw/mingw.shared_mutex.h rename to vendor/mingw/mingw.shared_mutex.h diff --git a/src/mingw/mingw.thread.h b/vendor/mingw/mingw.thread.h similarity index 100% rename from src/mingw/mingw.thread.h rename to vendor/mingw/mingw.thread.h