From 049385ba16807a70e2ecb192b43a75c74fd263df Mon Sep 17 00:00:00 2001 From: David Parra Date: Sun, 10 Mar 2024 13:17:44 +0000 Subject: [PATCH] Replace submodule with fetchcontent (#97) --- .gitmodules | 3 --- CMakeLists.txt | 21 +++++++++------------ cmake/options.cmake | 2 +- cmake/showoptions.cmake | 6 ------ src/game/CMakeLists.txt | 6 +++--- src/game/Entities/CharacterHandler.cpp | 1 - src/game/Server/WorldSession.h | 1 - src/mangosd/CMakeLists.txt | 6 +++++- src/modules/Bots | 1 - src/modules/CMakeLists.txt | 24 ------------------------ 10 files changed, 18 insertions(+), 53 deletions(-) delete mode 160000 src/modules/Bots delete mode 100644 src/modules/CMakeLists.txt diff --git a/.gitmodules b/.gitmodules index 939f8c9ed2..e69de29bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "src/modules/Bots"] - path = src/modules/Bots - url = https://github.com/celguar/mangosbot-bots.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 5eefb2935b..605b657122 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -380,19 +380,16 @@ if(BUILD_PLAYERBOTS) endif() endif() -if(NOT BUILD_GAME_SERVER AND BUILD_IKE3_BOTS) - set(BUILD_IKE3_BOTS OFF) - message(STATUS "BUILD_PLAYERBOTS forced to OFF due to BUILD_GAME_SERVER is not set") -endif() - -if(BUILD_IKE3_BOTS) - set(BUILD_PLAYERBOT OFF) - message(STATUS "CMaNGOS bots DISABLED because Ike3 bots enabled") -endif() +if(BUILD_PLAYERBOTS) + if(BUILD_DEPRECATED_PLAYERBOT) + set(BUILD_DEPRECATED_PLAYERBOT OFF) + message(STATUS "BUILD_DEPRECATED_PLAYERBOT forced to OFF because BUILD_PLAYERBOTS is set") + endif() -if(BUILD_PLAYERBOT) - set(BUILD_IKE3_BOTS OFF) - message(STATUS "Ike3 bots DISABLED because CMaNGOS bots enabled") + if(NOT BUILD_GAME_SERVER) + set(BUILD_PLAYERBOTS OFF) + message(STATUS "BUILD_PLAYERBOTS forced to OFF due to BUILD_GAME_SERVER is not set") + endif() endif() if(BUILD_MODULES AND NOT BUILD_GAME_SERVER) diff --git a/cmake/options.cmake b/cmake/options.cmake index 291832715d..7557242a2f 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -10,7 +10,7 @@ option(BUILD_PLAYERBOTS "Build Playerbots mod" option(BUILD_AHBOT "Build Auction House Bot mod" OFF) # Modules -option(BUILD_MODULES "Build module system" OFF) +option(BUILD_MODULES "Build module system" OFF) foreach(MODULE_NAME ${MODULE_NAMES}) if(NOT ${MODULE_NAME} STREQUAL "MODULES") string(TOLOWER ${MODULE_NAME} LOWER_MODULE_NAME) diff --git a/cmake/showoptions.cmake b/cmake/showoptions.cmake index d8a76fce6c..eecca19876 100644 --- a/cmake/showoptions.cmake +++ b/cmake/showoptions.cmake @@ -73,12 +73,6 @@ else() message(STATUS "Build Playerbots : No (default)") endif() -if(BUILD_IKE3_BOTS) - message(STATUS "Build ike3 Playerbots : Yes") -else() - message(STATUS "Build ike3 Playerbots : No (default)") -endif() - # Modules if(BUILD_MODULES) message(STATUS "Build Modules : Yes") diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 54e4b20d54..1d4f3e4a49 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -53,7 +53,7 @@ endif() if(NOT BUILD_PLAYERBOTS) # exclude Playerbots folder - set (EXCLUDE_DIR "Bots/") + set (EXCLUDE_DIR "PlayerBots/") foreach (TMP_PATH ${LIBRARY_SRCS}) string (FIND ${TMP_PATH} ${EXCLUDE_DIR} EXCLUDE_DIR_FOUND) if (NOT ${EXCLUDE_DIR_FOUND} EQUAL -1) @@ -184,8 +184,8 @@ if (BUILD_PLAYERBOTS) add_definitions(-DENABLE_PLAYERBOTS) endif() -# Define Ike3 Bots ENABLE_PLAYERBOTS if need -if (BUILD_IKE3_BOTS) +# Define ENABLE_PLAYERBOTS if need +if (BUILD_PLAYERBOTS) add_definitions(-DENABLE_PLAYERBOTS) endif() diff --git a/src/game/Entities/CharacterHandler.cpp b/src/game/Entities/CharacterHandler.cpp index f1bf5497ad..4a44745677 100644 --- a/src/game/Entities/CharacterHandler.cpp +++ b/src/game/Entities/CharacterHandler.cpp @@ -256,7 +256,6 @@ class CharacterHandler session->HandlePlayerLogin((LoginQueryHolder*)holder); #endif } - #ifdef BUILD_DEPRECATED_PLAYERBOT // This callback is different from the normal HandlePlayerLoginCallback in that it // sets up the bot's world session and also stores the pointer to the bot player in the master's diff --git a/src/game/Server/WorldSession.h b/src/game/Server/WorldSession.h index 1e72f5f058..d9add49a31 100644 --- a/src/game/Server/WorldSession.h +++ b/src/game/Server/WorldSession.h @@ -243,7 +243,6 @@ class WorldSession const std::string GetRemoteAddress() const { return m_socket ? m_socket->GetRemoteAddress() : "disconnected/bot"; } #else const std::string GetRemoteAddress() const { return m_socket ? m_socket->GetRemoteAddress() : "disconnected"; } -#endif #endif const std::string& GetLocalAddress() const { return m_localAddress; } diff --git a/src/mangosd/CMakeLists.txt b/src/mangosd/CMakeLists.txt index 7baa18bb6f..abc4a585fd 100644 --- a/src/mangosd/CMakeLists.txt +++ b/src/mangosd/CMakeLists.txt @@ -89,11 +89,15 @@ if(WIN32) add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/src/game/Anticheat/module/warden_modules/ $/warden_modules DEPENDS ${EXECUTABLE_NAME}) - if(BUILD_DEPRECATED_PLAYERBOT) add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different \"${CMAKE_SOURCE_DIR}/src/game/PlayerBot/playerbot.conf.dist.in\" \"$/playerbot.conf.dist\") endif() + + if(BUILD_PLAYERBOTS) + add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different \"${CMAKE_SOURCE_DIR}/src/modules/playerbots/playerbot/aiplayerbot.conf.dist.in\" \"$/aiplayerbot.conf.dist\") + endif() if(BUILD_PLAYERBOTS) add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD diff --git a/src/modules/Bots b/src/modules/Bots deleted file mode 160000 index f1720edd6c..0000000000 --- a/src/modules/Bots +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1720edd6ca54eed57a140b6a42ad87486ec3f60 diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt deleted file mode 100644 index 10efa42e94..0000000000 --- a/src/modules/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -# MaNGOS is a full featured server for World of Warcraft, supporting -# the following clients: 1.12.x, 2.4.3, 3.3.5a, 4.3.4a and 5.4.8 -# -# Copyright (C) 2005-2018 MaNGOS project -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -# Include Player Bots if enabled -if(BUILD_IKE3_BOTS) - add_subdirectory(Bots) -endif() \ No newline at end of file