diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 000000000..c18754917 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,46 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** + + +**To Reproduce** +Steps to reproduce the behavior: +1. +2. +3. +4. + +**Expected behavior** + + +**Screenshots** + + +**Branch** + + +**Eluna** +- [ ] Enabled +- [ ] Disabled + +**Script** + + +**Crash** + + +**Additional context** + + +**HASH/COMMIT:** + + + diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 000000000..1903bc9dd --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -0,0 +1,65 @@ + +name: linux build + +on: + push: + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '.github/ISSUE_TEMPLATE.md' + - '.github/PULL_REQUEST_TEMPLATE.md' + - 'sql/**' + - '.drone.yml' + - 'README.md' + - 'LICENSE' + - '.gitignore' + - 'CONTRIBUTING.md' + + pull_request: + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '.github/ISSUE_TEMPLATE.md' + - '.github/PULL_REQUEST_TEMPLATE.md' + - 'sql/**' + - '.drone.yml' + - 'README.md' + - 'LICENSE' + - '.gitignore' + - 'CONTRIBUTING.md' + + +# This is what will cancel the previous workflow +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + #matrix declaration + matrix: + os: [ubuntu-latest] + compiler: [gcc, clang] + + steps: + + #git checkout + - uses: actions/checkout@v2 + + - name: ubuntu dependencies + #ubuntu dependencies + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get -qq install libmysql++-dev libace-dev libtbb-dev + sudo apt-get -qq install cmake build-essential cppcheck git make libiberty-dev openssl libssl-dev + + #build and install + #ubuntu + - name: ubuntu build & install + run: | + mkdir build + mkdir _install + cd build + cmake ../ -DCMAKE_INSTALL_PREFIX=../_install -DWITH_WARNINGS=0 -DUSE_EXTRACTORS=0 -DACE_USE_EXTERNAL=1 -DTBB_USE_EXTERNAL=1 + make -j2 + make install diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml new file mode 100644 index 000000000..7439b6c39 --- /dev/null +++ b/.github/workflows/windows-build.yml @@ -0,0 +1,91 @@ + +name: windows build + +on: + push: + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '.github/ISSUE_TEMPLATE.md' + - '.github/PULL_REQUEST_TEMPLATE.md' + - 'sql/**' + - '.drone.yml' + - 'README.md' + - 'LICENSE' + - '.gitignore' + - 'CONTRIBUTING.md' + + pull_request: + paths-ignore: + - '.github/ISSUE_TEMPLATE/**' + - '.github/ISSUE_TEMPLATE.md' + - '.github/PULL_REQUEST_TEMPLATE.md' + - 'sql/**' + - '.drone.yml' + - 'README.md' + - 'LICENSE' + - '.gitignore' + - 'CONTRIBUTING.md' + +# This is what will cancel the previous workflow +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + #matrix declaration + matrix: + include: + - os: windows-2019 + + steps: + + #git checkout + - uses: actions/checkout@v2 + + #windows dependencies + - name: windows dependencies + #Sets versions for ACE/TBB + env: + ACE_VERSION: 6.5.11 + ACE_VERSION2: 6_5_11 + TBB_VERSION: 2020.3 + + run: | + #directory variables + export ACE_ROOT=$GITHUB_WORKSPACE/ACE_wrappers + export TBB_ROOT_DIR=$GITHUB_WORKSPACE/tbb + #wget + choco install -y wget --version 1.20 + #ACE package download + wget http://github.com/DOCGroup/ACE_TAO/releases/download/ACE%2BTAO-$ACE_VERSION2/ACE-$ACE_VERSION.zip + unzip ACE-$ACE_VERSION.zip + rm ACE-$ACE_VERSION.zip + #configuration of ACE header + echo "#include \"ace/config-win32.h\"" >> $ACE_ROOT/ace/config.h + #TBB package download + wget https://github.com/oneapi-src/oneTBB/releases/download/v$TBB_VERSION/tbb-$TBB_VERSION-win.zip + unzip tbb-$TBB_VERSION-win.zip + rm tbb-$TBB_VERSION-win.zip + #openssl + choco install -y openssl --version=1.1.1.500 + #git bash shell + shell: bash + + #build and install + #windows + - name: windows build & install + run: | + #directory variables + export ACE_ROOT=$GITHUB_WORKSPACE/ACE_wrappers + cd $GITHUB_WORKSPACE/ACE_wrappers + /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2019/Enterprise/MSBuild/Current/Bin/MSBuild.exe "ACE_wrappers_vs2019.sln" //p:Configuration=Release //p:Platform=x64 //t:ACE //m:2 + cd $GITHUB_WORKSPACE + mkdir build + cd build + cmake -D TBB_ROOT_DIR=$GITHUB_WORKSPACE/tbb -DWITH_WARNINGS=0 -DUSE_EXTRACTORS=0 -G "Visual Studio 16 2019" -A x64 .. + /c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2019/Enterprise/MSBuild/Current/Bin/MSBuild.exe "HellfireCore.sln" //p:Platform=x64 //p:Configuration=Release //m:2 + #git bash shell + shell: bash diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..c43320101 --- /dev/null +++ b/.gitignore @@ -0,0 +1,117 @@ +# +# NOTE! Don't add files that are generated in specific +# subdirectories here. Add them in the ".gitignore" file +# in that subdirectory instead. +# +# NOTE! Please use 'git-ls-files -i --exclude-standard' +# command after changing this file, to see if there are +# any tracked files which get ignored after the change. +# +# Normal rules +# +.* +*.o +*.o.* + +*.so +*.so.dbg +*.bin +*.gz + +# Visual studio solution files +*.tlog +*.vcxproj +*.vcxproj.filters +*.sln +*.db +*.opendb +*.exp +*.res +CMakeSettings.json +/out/ + +# CLion files +cmake-build-debug + +# +# Top-level generic files +# +bin +build +tags +TAGS +!.gitignore +!.gitattributes + +# +# Build generated files +# +autom4te.cache + +# +# Editors / debuggers / other output files +# +*~ +*.bak +*.orig +*.patch +callgrind.out.* + +# +# Git stuff +# +# stgit directories +patches-* + +# +# Github stuff +# +!.github/ + +# +# VS binaries output +# +bin/* +win/* + +# +# VS temporary files +# +*.ncb +*.suo +*.sdf +*.opensdf +*.sln.cache +*.vsp +ipch +*.user + + +# +# CMake temporary files +# +CMakeFiles +CMakeCache.txt +cmake_install.cmake + +# +# OS specific +# +# MacOS +.DS_Store + +# Nostalrius +newsletter +patch +php + +sql/migrations/*.py +sql/migrations/characters_db_updates.sql +sql/migrations/logon_db_updates.sql +sql/migrations/logs_db_updates.sql +sql/migrations/world_db_updates.sql + +# Generating by CMake +revision.h +migrations_list.h +Progression.h diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..bf85c720b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,540 @@ +# Copyright (C) 2005-2011 MaNGOS +# Copyright (C) 2009-2011 MaNGOSZero +# +# 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 + +project(HellfireCore) + +# CMake policies +cmake_minimum_required(VERSION 3.1...3.20) + +# Allow -DACE_ROOT, -DTBB_ROOT, etc. +if(${CMAKE_VERSION} VERSION_GREATER "3.11") + cmake_policy(SET CMP0074 NEW) +endif() + +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + ${CMAKE_SOURCE_DIR}/cmake +) + +set(SUPPORTED_CLIENT_BUILD "CLIENT_BUILD_2_4_3" CACHE STRING "Client version the core will support") +option(USE_STD_MALLOC "Use standard malloc instead of TBB" OFF) +option(TBB_DEBUG "Use TBB debug librairies" OFF) +option(ACE_USE_EXTERNAL "Use external ACE" 1) +option(USE_ANTICHEAT "Use anticheat" OFF) +option(USE_SCRIPTS "Compile scripts" ON) +option(USE_EXTRACTORS "Compile extractors" OFF) +option(USE_LIBCURL "Compile with libcurl for email support" OFF) +option(USING_CM_MAP "Use cmangos map" OFF) +option(USING_VM_MAP "Use vmangos map" OFF) + +if(UNIX) + option(DEBUG_SYMBOLS "Include Debug Symbols" ON) +endif() + +find_package(PCHSupport) +if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16") + option(USE_PCH "Use precompiled headers" ON) +endif() + +if(PCHSupport_FOUND AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16")) + if(MSVC) + option(USE_PCH_OLD "Use old precompiled headers implementation" ON) + else() + option(USE_PCH_OLD "Use old precompiled headers implementation" OFF) + endif() +else() + unset(USE_PCH_OLD CACHE) +endif() + +if(USE_LIBCURL) + find_package(CURL REQUIRED) + #add_definitions(-D_HAS_AUTO_PTR_ETC) # for VS2017 ACE support, won't do any harm to other compilers + #set(CMAKE_CXX_STANDARD 17) + #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17") +endif() + +# Force out-of-source build +string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" BUILDING_IN_SOURCE) +if(BUILDING_IN_SOURCE) + message(FATAL_ERROR + "This project requires an out of source build. Remove the file 'CMakeCache.txt' found in this directory before continuing, create a separate build directory and run 'cmake [options]' from there." + ) +endif() + +if(WIN32) + if(MSVC) + if(MSVC_VERSION LESS 1900) + message(FATAL_ERROR "Only Visual Studio 2015 or newer is supported") + endif() + endif() + + # Added by Giperion, in WIN32 output all compiled files in one directory + set( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin ) + set( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib ) + # Allow creating folders in solution + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +endif() + +find_package(Platform REQUIRED) +find_package(Git) + +# Output description of this script +message(STATUS + "\nThis script builds the MaNGOS server. + Options that can be used in order to configure the process: + PREFIX: Path where the server should be installed to + USE_PCH: Use precompiled headers + To set an option simply type -D