diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..589bb2ed4 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.101.1/containers/ubuntu-18.04-git +{ + "name": "Ubuntu 18.04 EQEMU", + // Moved from dockerfile to image so it builds faster + "image": "eqemu/devcontainer:0.0.2", + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + + "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ], + + // Add the IDs of extensions you want installed when the container is created. + "extensions": ["ms-vscode.cpptools", "ms-azuretools.vscode-docker"], + "mounts": ["source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind"], + "remoteEnv": { + "HOST_PROJECT_PATH": "${localWorkspaceFolder}" + } +} diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 000000000..749ab62c5 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,16 @@ +--- +kind: pipeline +type: docker +name: EQEmulator Server Linux CI + +# Limits how many of these builds can run on the drone runner at a time, this isn't about cores +concurrency: + limit: 1 + +steps: + - name: server-build + # Source build script https://github.com/Akkadius/akk-stack/blob/master/containers/eqemu-server/Dockerfile#L20 + image: akkadius/eqemu-server:latest + commands: + - sudo chown eqemu:eqemu /drone/src/ * -R + - git submodule init && git submodule update && mkdir -p build && cd build && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_BOTS=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' .. && make -j$((`nproc`-4)) \ No newline at end of file diff --git a/.gitignore b/.gitignore index fd81b92bc..1db525804 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,8 @@ *.out *.app +.bash_history + # CMake CMakeCache.txt CMakeFiles @@ -27,6 +29,28 @@ install_manifest.txt log/ logs/ vcpkg/ +perl/ .idea/* -*cbp \ No newline at end of file +*cbp + +submodules/* +cmake-build-debug/ + +.nfs.* + +# Visual Studio and CMAKE Generated Files +/.vs/ +*.vcxproj +*.vcxproj.filters +*.vcxproj.user +*.cmake +*.ilk +*.pdb +*.sln +*.dir/ +libs/ +bin/ +/Win32 +/x64 +/client_files/**/CMakeFiles/ diff --git a/.travis.yml b/.travis.yml index faed5b846..38db9d797 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,26 +1,18 @@ language: cpp compiler: gcc -dist: trusty +dist: bionic -before_install: - - sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test - - sudo apt-get update -qq - - mkdir $HOME/usr - - export PATH="$HOME/usr/bin:$PATH" - - wget https://cmake.org/files/v3.11/cmake-3.11.2-Linux-x86_64.sh - - chmod +x cmake-3.11.2-Linux-x86_64.sh - - ./cmake-3.11.2-Linux-x86_64.sh --prefix=$HOME/usr --exclude-subdir --skip-license +addons: + apt: + packages: + - libmysqlclient-dev + - libperl-dev + - libboost-dev + - liblua5.1-0-dev + - zlib1g-dev + - uuid-dev + - libssl-dev -install: - - sudo apt-get install -qq g++-7 - - sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 90 - - sudo apt-get install libmysqlclient-dev - - sudo apt-get install libperl-dev - - sudo apt-get install libboost-dev - - sudo apt-get install liblua5.1-0-dev - - sudo apt-get install zlib1g-dev - - sudo apt-get install uuid-dev - - sudo apt-get install libssl-dev script: - cmake -G "Unix Makefiles" -DEQEMU_BUILD_TESTS=ON -DEQEMU_ENABLE_BOTS=ON -DEQEMU_BUILD_LOGIN=ON - make -j2 diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 000000000..4aee577ae --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,16 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**", + "/usr/include/mysql" + ], + "defines": [], + "compilerPath": "/usr/bin/gcc", + "cStandard": "c11", + "cppStandard": "c++17" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..a955aa60c --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,164 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=733558 + // for the documentation about the tasks.json format + "version": "2.0.0", + "tasks": [ + { + "label": "make", + "type": "shell", + "command": "cd bin && make", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "make clean", + "type": "shell", + "command": "cd bin && make clean", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "cmake", + "type": "shell", + "command": "mkdir -p bin && cd bin && rm CMakeCache.txt && cmake -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_LUA=ON -G 'Unix Makefiles' ..", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher":{ + "owner": "cpp", + "fileLocation": "relative", + "pattern":[ + { + "regexp": "([\\w+|\\\\]*\\.\\w+)\\((\\d+)\\)\\: (warning|error) (.*)$", + "file": 1, + "location": 2, + "severity": 3, + "message": 4 + } + ] + } + }, + { + "label": "download maps", + "type": "shell", + "command": "mkdir -p bin && cd bin && wget https://codeload.github.com/Akkadius/EQEmuMaps/zip/master -O maps.zip && unzip -o maps.zip && rm ./maps -rf && mv EQEmuMaps-master maps && rm maps.zip", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "download quests", + "type": "shell", + "command": "mkdir -p bin && cd bin && cd server && git -C ./quests pull 2> /dev/null || git clone https://github.com/ProjectEQ/projecteqquests.git quests", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "download eqemu_config", + "type": "shell", + "command": "mkdir -p bin && cd bin && wget --no-check-certificate https://raw.githubusercontent.com/Akkadius/EQEmuInstall/master/eqemu_config_docker.json -O eqemu_config.json", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "rebuild database (mariadb must be started)", + "type": "shell", + "command": "mkdir -p bin && cd bin && docker run -i --rm --privileged -v ${HOST_PROJECT_PATH}/bin:/src --network=eqemu -it eqemu/server:0.0.3 bash -c './eqemu_server.pl source_peq_db && ./eqemu_server.pl check_db_updates && ./eqemu_server.pl linux_login_server_setup'", + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ] + }, + { + "label": "zone 7000", + "type": "shell", + "command": "docker stop zone7000 | true && docker network create eqemu | true && docker run -i --rm --name zone7000 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu -p 7000:7000/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7000:7000", + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "label": "zone 7001", + "type": "shell", + "command": "docker stop zone7001 | true && docker network create eqemu | true && docker run -i --rm --name zone7001 --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu -p 7001:7001/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./zone dynamic_zone7001:7001", + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "label": "loginserver", + "type": "shell", + "command": "docker stop loginserver | true && docker network create eqemu | true && docker run -i --rm --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 --network=eqemu --name loginserver -p 5999:5999/udp -p 5998:5998/udp -e LD_LIBRARY_PATH=/src/ eqemu/server:0.0.3 gdb -ex run --args ./loginserver", + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "label": "shared_memory, world", + "type": "shell", + "command": "docker stop sharedmemory | true && docker stop world | true && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --network=eqemu --name sharedmemory eqemu/server:0.0.3 ./shared_memory && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name world -p 9000:9000 -p 9000:9000/udp -p 9001:9001 -p 9080:9080 eqemu/server:0.0.3 gdb -ex run ./world", + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "label": "queryserv", + "type": "shell", + "command": "docker stop queryserv | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src --ulimit core=10000000 -e LD_LIBRARY_PATH=/src/ --network=eqemu --name queryserv eqemu/server:0.0.3 gdb -ex run ./queryserv", + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "label": "mariadb", + "type": "shell", + "command": "docker stop mariadb | true && cd bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin/db:/bitnami/mariadb -p 3306:3306 -e MARIADB_DATABASE=peq -e MARIADB_USER=eqemu -e MARIADB_PASSWORD=eqemupass -e ALLOW_EMPTY_PASSWORD=yes --name mariadb --network=eqemu bitnami/mariadb:latest", + "group": { + "kind": "test", + "isDefault": true + } + }, + { + "label": "ucs", + "type": "shell", + "command": "docker stop ucs | true && cd bin && docker network create eqemu | true && docker run --rm -v ${HOST_PROJECT_PATH}/bin:/src -p 7778:7778 --name ucs --network=eqemu eqemu/server:0.0.3 gdb -ex run ./ucs", + "group": { + "kind": "test", + "isDefault": true + } + } + ] +} diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 000000000..1cc3cd99b --- /dev/null +++ b/BUILD.md @@ -0,0 +1,64 @@ +# Guide To Building From Source Without Installer + +This guide is far from exhaustive, you should expect to have some experience with building C++ code before considering compiling the code from scratch. You should instead consider using the installer scripts if you don't want to hack on the code directly. + +### CMake + +EQEmu uses CMake as the build system on all platforms. You will need CMake 3.2 or higher to build from source. + +### Dependencies + +The following libraries are required to build from source: +- [boost](https://www.boost.org/ "boost") +- [zlib](https://www.zlib.net/ "zlib") (If not included the source will build [zlib-ng](https://github.com/zlib-ng/zlib-ng "zlib-ng") instead) +- [libmysql](https://dev.mysql.com/downloads/connector/c/ "libmysql") or [libmariadb](https://github.com/MariaDB/mariadb-connector-c "libmariadb") + +The following libraries are not strictly required but in many cased recommended. +- [OpenSSL](https://www.openssl.org/ "OpenSSL") or [mbedTLS](https://tls.mbed.org/ "mbedTLS") (Required for the loginserver and headless client) +- [libsodium](https://github.com/jedisct1/libsodium "libsodium") (Required for strong password hashing on the loginserver) +- [Lua 5.1](https://www.lua.org/ "Lua 5.1") or [LuaJit](http://luajit.org/ "LuaJit") (Required for Lua Quest Scripting) +- [Perl](https://www.perl.org/ "Perl") (Required for Perl Quest Scripting) + +##### Windows +For windows it is suggested you make use of [vcpkg](https://github.com/microsoft/vcpkg "vcpkg") if you wish to build your own dependencies. + +If you wish to use Perl then you should use whichever version of Perl you have installed on the target system. + +You can also download a vcpkg export from our releases section for Visual Studio [x86](https://github.com/EQEmu/Server/releases/download/v1.2/vcpkg-export-x86.zip "x86") or [x64](https://github.com/EQEmu/Server/releases/download/v1.2/vcpkg-export-x64.zip "x64") that includes a toolchain file you can pass to CMake. + +##### Linux +For Linux you simply can install the dependencies from your package manager, below is an example of doing it on Ubuntu using apt-get. + + sudo apt-get install libmysqlclient-dev libperl-dev libboost-dev liblua5.1-0-dev zlib1g-dev uuid-dev libssl-dev + +### Running CMake + +##### Windows +The following is a modified command our automated build server uses to run CMake via the release vcpkg export and its toolchain file. + +Assuming it is starting in c:/projects/eqemu and the x64 dependencies were extracted to c:/projects/eqemu/vcpkg. + + mkdir build + cd build + cmake -G "Visual Studio 15 2017 Win64" -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON -DEQEMU_BUILD_ZLIB=ON -DEQEMU_ENABLE_BOTS=ON -DCMAKE_TOOLCHAIN_FILE="c:/projects/eqemu/vcpkg/vcpkg-export-20180828-145455/scripts/buildsystems/vcpkg.cmake" .. + +##### Linux +Similarly to Windows running CMake on Linux is simple it just omits the toolchain file and uses a different generator. + + mkdir build + cd build + cmake -G "Unix Makefiles" -DEQEMU_BUILD_TESTS=ON -DEQEMU_ENABLE_BOTS=ON -DEQEMU_BUILD_LOGIN=ON .. + +### Building + +##### Windows +Inside the build directory a file EQEmu.sln should be produced by a successful run of the CMake command. You can either open this with Visual Studio or build it directly with MSBuild via the command line. + + msbuild EQEmu.sln /p:Configuration=Release + +##### Linux +From the build directory you can simply call make to build. + +For example. + + make -j4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f3a25301..526d68099 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,128 +1,28 @@ -#EQEmu CMake -#Variables used: -#EQEMU_DISABLE_CRT_SECURE_WARNINGS -#EQEMU_FAST_FLOATINGPOINT -#EQEMU_ENABLE_CRASH_LOGGING -#EQEMU_DISABLE_SAFESEH -#EQEMU_BUILD_MSVC_MP -#EQEMU_DEBUG_LEVEL -#EQEMU_LOG_LEVEL_STATUS -#EQEMU_LOG_LEVEL_NORMAL -#EQEMU_LOG_LEVEL_ERROR -#EQEMU_LOG_LEVEL_DEBUG -#EQEMU_LOG_LEVEL_QUEST -#EQEMU_LOG_LEVEL_COMMANDS -#EQEMU_LOG_LEVEL_CRASH -#EQEMU_DEPOP_INVALIDATES_CACHE -#EQEMU_ENABLE_BOTS -#EQEMU_DISABLE_LOGSYS -#EQEMU_COMMANDS_LOGGING -#EQEMU_BUILD_SERVER -#EQEMU_BUILD_LOGIN -#EQEMU_BUILD_TESTS -#EQEMU_BUILD_PERL -#EQEMU_BUILD_LUA -#EQEMU_SANITIZE_LUA_LIBS -#EQEMU_BUILD_CLIENT_FILES -#EQEMU_USE_MAP_MMFS -#EQEMU_MAP_DIR -#EQEMU_ARCH -#EQEMU_ARCH_ALT +CMAKE_MINIMUM_REQUIRED(VERSION 3.2) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) -IF(POLICY CMP0074) - cmake_policy(SET CMP0074 NEW) -ENDIF() - -#FindMySQL is located here so lets make it so CMake can find it SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH}) -#Our project name is EQEmu +IF(POLICY CMP0074) + CMAKE_POLICY(SET CMP0074 NEW) +ENDIF() + PROJECT(EQEmu) -#Default build type is set to RelWithDebInfo for generators that honor that like makefiles IF(NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE) ENDIF(NOT CMAKE_BUILD_TYPE) -SET(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/dependencies" "${CMAKE_PREFIX_PATH}") - -#Add our various windows definitions -IF(MSVC OR MINGW) - ADD_DEFINITIONS(-D_WINDOWS) - IF(CMAKE_CL_64) - ADD_DEFINITIONS(-DWIN64) - ELSE(CMAKE_CL_64) - ADD_DEFINITIONS(-DWIN32) - ENDIF(CMAKE_CL_64) -ENDIF(MSVC OR MINGW) +SET(CMAKE_CXX_STANDARD 14) +SET(CMAKE_CXX_STANDARD_REQUIRED ON) +SET(CMAKE_CXX_EXTENSIONS OFF) IF(MSVC) - IF(CMAKE_CL_64) - SET(EQEMU_ARCH "x64") - SET(EQEMU_ARCH_ALT "x64") - ELSE(CMAKE_CL_64) - SET(EQEMU_ARCH "x86") - SET(EQEMU_ARCH_ALT "Win32") - ENDIF(CMAKE_CL_64) - - SET(MYSQL_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/mysql_${EQEMU_ARCH}") - - IF(VCPKG_TOOLCHAIN) - IF(NOT MSVC_VERSION GREATER 1800) - SET(SODIUM_INCLUDE_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/include") - ENDIF() - ELSE(VCPKG_TOOLCHAIN) - SET(ZLIB_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/zlib_${EQEMU_ARCH}") - SET(LUA_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/luaj_${EQEMU_ARCH}") - SET(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/openssl_${EQEMU_ARCH}") - - SET(SODIUM_INCLUDE_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/include") - ENDIF(VCPKG_TOOLCHAIN) - - IF(SODIUM_INCLUDE_HINTS) - IF(MSVC_VERSION GREATER 1800) - SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/${EQEMU_ARCH_ALT}/Release/v140/dynamic") - ELSEIF(MSVC_VERSION EQUAL 1800) - SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/${EQEMU_ARCH_ALT}/Release/v120/dynamic") - ELSE() - SET(SODIUM_LIBRARY_HINTS "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/libsodium/${EQEMU_ARCH_ALT}/Release/v110/dynamic") - ENDIF() - ENDIF(SODIUM_INCLUDE_HINTS) - - #disable CRT warnings on windows cause they're annoying as shit and we use C functions everywhere - OPTION(EQEMU_DISABLE_CRT_SECURE_WARNINGS "Disable Secure CRT Warnings" ON) - IF(EQEMU_DISABLE_CRT_SECURE_WARNINGS) - ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) - ENDIF(EQEMU_DISABLE_CRT_SECURE_WARNINGS) - - #fast FP if you'd like it - OPTION(EQEMU_FAST_FLOATINGPOINT "Use MSVC /fp:fast option" ON) - IF(EQEMU_FAST_FLOATINGPOINT) - ADD_DEFINITIONS(/fp:fast) - ENDIF(EQEMU_FAST_FLOATINGPOINT) - - #crash logging currently only works on windows x86/x64 - OPTION(EQEMU_ENABLE_CRASH_LOGGING "Enable crash logging" ON) - IF(EQEMU_ENABLE_CRASH_LOGGING) - ADD_DEFINITIONS(-DCRASH_LOGGING) - ENDIF(EQEMU_ENABLE_CRASH_LOGGING) - - OPTION(EQEMU_BUILD_MSVC_MP "Enable build with multiple processes." ON) - IF(EQEMU_BUILD_MSVC_MP) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") - ENDIF(EQEMU_BUILD_MSVC_MP) - - #We want to compile /MT not /MD so we change that - FOREACH(flag_var CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELWITHDEBINFO) - IF(${flag_var} MATCHES "/MD") - STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") - ENDIF(${flag_var} MATCHES "/MD") - ENDFOREACH(flag_var) - + ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) ADD_DEFINITIONS(-DNOMINMAX) + ADD_DEFINITIONS(-DCRASH_LOGGING) + + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") ELSE(MSVC) - #Normally set by perl but we don't use the perl flags anymore so we set it. ADD_DEFINITIONS(-DHAS_UNION_SEMUN) ENDIF(MSVC) @@ -139,229 +39,249 @@ IF(UNIX) ENDIF(CMAKE_SYSTEM_NAME MATCHES "Darwin") ENDIF(UNIX) -#debug level, 5 is default. Most people wont ever change this but it's there if you want to -SET(EQEMU_DEBUG_LEVEL 5 CACHE STRING "EQEmu debug level: - 0 - Quiet mode Errors to file Status and Normal ignored - 1 - Status and Normal to console, Errors to logfile - 2 - Status, Normal, and Error to console and logfile - 3 - Light debug release errors and status - 4 - Moderate debug release errors and status - 5 - Maximum debug release errors and status - 10 - More errors than you ever wanted to see" -) +ADD_DEFINITIONS(-DGLM_FORCE_RADIANS) +ADD_DEFINITIONS(-DGLM_FORCE_CTOR_INIT) +ADD_DEFINITIONS(-DGLM_ENABLE_EXPERIMENTAL) -SET(EQEMU_LOG_LEVEL_STATUS 2 CACHE STRING "EQEmu logging level for [Status]: - 0 - Disabled - 1 - Ouput to File Enabled - 2 - Output to stdout Enabled - 3 - Output to File and stdout Enabled - 8 - Output to stderr Enabled - 9 - Output to File and stderr Enabled - 11 - Output to File, stdout and stderr Enabled" -) +#MSVC can fetch dependencies automatically. +IF(MSVC) + INCLUDE("${CMAKE_SOURCE_DIR}/cmake/DependencyHelperMSVC.cmake") +ENDIF() -SET(EQEMU_LOG_LEVEL_NORMAL 3 CACHE STRING "EQEmu logging level for [Normal]: - 0 - Disabled - 1 - Ouput to File Enabled - 2 - Output to stdout Enabled - 3 - Output to File and stdout Enabled - 8 - Output to stderr Enabled - 9 - Output to File and stderr Enabled - 11 - Output to File, stdout and stderr Enabled" -) +#Find everything we need +FIND_PACKAGE(Boost REQUIRED) +FIND_PACKAGE(MySQL) +FIND_PACKAGE(MariaDB) +FIND_PACKAGE(ZLIB) +FIND_PACKAGE(OpenSSL) +FIND_PACKAGE(Lua51) +FIND_PACKAGE(LuaJit) +FIND_PACKAGE(PerlLibs) +FIND_PACKAGE(Sodium) +FIND_PACKAGE(mbedTLS) -SET(EQEMU_LOG_LEVEL_ERROR 2 CACHE STRING "EQEmu logging level for [Error]: - 0 - Disabled - 1 - Ouput to File Enabled - 2 - Output to stdout Enabled - 3 - Output to File and stdout Enabled - 8 - Output to stderr Enabled - 9 - Output to File and stderr Enabled - 11 - Output to File, stdout and stderr Enabled" -) +MESSAGE(STATUS "**************************************************") +MESSAGE(STATUS "* Library Detection *") +MESSAGE(STATUS "**************************************************") -SET(EQEMU_LOG_LEVEL_DEBUG 3 CACHE STRING "EQEmu logging level for [Debug]: - 0 - Disabled - 1 - Ouput to File Enabled - 2 - Output to stdout Enabled - 3 - Output to File and stdout Enabled - 8 - Output to stderr Enabled - 9 - Output to File and stderr Enabled - 11 - Output to File, stdout and stderr Enabled" -) +IF(MYSQL_FOUND) + MESSAGE(STATUS "* MySQL: FOUND *") +ELSE() + MESSAGE(STATUS "* MySQL: MISSING *") +ENDIF() -SET(EQEMU_LOG_LEVEL_QUEST 2 CACHE STRING "EQEmu logging level for [Quest]: - 0 - Disabled - 1 - Ouput to File Enabled - 2 - Output to stdout Enabled - 3 - Output to File and stdout Enabled - 8 - Output to stderr Enabled - 9 - Output to File and stderr Enabled - 11 - Output to File, stdout and stderr Enabled" -) +IF(MARIADB_FOUND) + MESSAGE(STATUS "* MariaDB: FOUND *") +ELSE() + MESSAGE(STATUS "* MariaDB: MISSING *") +ENDIF() -SET(EQEMU_LOG_LEVEL_COMMANDS 1 CACHE STRING "EQEmu logging level for [Commands]: - 0 - Disabled - 1 - Ouput to File Enabled - 2 - Output to stdout Enabled - 3 - Output to File and stdout Enabled - 8 - Output to stderr Enabled - 9 - Output to File and stderr Enabled - 11 - Output to File, stdout and stderr Enabled" -) +IF(ZLIB_FOUND) + MESSAGE(STATUS "* ZLIB: FOUND *") +ELSE() + MESSAGE(STATUS "* ZLIB: MISSING *") +ENDIF() -SET(EQEMU_LOG_LEVEL_CRASH 3 CACHE STRING "EQEmu logging level for [Crash]: - 0 - Disabled - 1 - Ouput to File Enabled - 2 - Output to stdout Enabled - 3 - Output to File and stdout Enabled - 8 - Output to stderr Enabled - 9 - Output to File and stderr Enabled - 11 - Output to File, stdout and stderr Enabled" -) +IF(Lua51_FOUND) + MESSAGE(STATUS "* Lua: FOUND *") +ELSE() + MESSAGE(STATUS "* Lua: MISSING *") +ENDIF() -MARK_AS_ADVANCED(EQEMU_LOG_LEVEL_STATUS EQEMU_LOG_LEVEL_NORMAL EQEMU_LOG_LEVEL_ERROR EQEMU_LOG_LEVEL_DEBUG EQEMU_LOG_LEVEL_QUEST EQEMU_LOG_LEVEL_COMMANDS EQEMU_LOG_LEVEL_CRASH) +IF(LuaJit_FOUND) + MESSAGE(STATUS "* LuaJIT: FOUND *") +ELSE() + MESSAGE(STATUS "* LuaJIT: MISSING *") +ENDIF() -#NPC Types Cache Behavior +IF(PerlLibs_FOUND) + MESSAGE(STATUS "* Perl: FOUND *") +ELSE() + MESSAGE(STATUS "* Perl: MISSING *") +ENDIF() + +IF(SODIUM_FOUND) + MESSAGE(STATUS "* libsodium: FOUND *") +ELSE() + MESSAGE(STATUS "* libsodium: MISSING *") +ENDIF() + +IF(OpenSSL_FOUND) + MESSAGE(STATUS "* OpenSSL: FOUND *") +ELSE() + MESSAGE(STATUS "* OpenSSL: MISSING *") +ENDIF() + +IF(MBEDTLS_FOUND) + MESSAGE(STATUS "* mbedTLS: FOUND *") +ELSE() + MESSAGE(STATUS "* mbedTLS: MISSING *") +ENDIF() + +MESSAGE(STATUS "**************************************************") + +#options OPTION(EQEMU_DEPOP_INVALIDATES_CACHE "#repop invalidates the npc_types cache (will cause a larger database hit on #repop but is more convienent)." ON) - -#Bots are a compile time option so on/off OPTION(EQEMU_ENABLE_BOTS "Enable Bots" OFF) - -#Disable entire _mlog system (excludes trade/command logs) -OPTION(EQEMU_DISABLE_LOGSYS "Disable Logging INI System" ON) - -#Enable GM Command log system OPTION(EQEMU_COMMANDS_LOGGING "Enable GM Command logs" ON) +OPTION(EQEMU_BUILD_SERVER "Build the game server." ON) +OPTION(EQEMU_BUILD_LOGIN "Build the login server." ON) +OPTION(EQEMU_BUILD_HC "Build the headless client." OFF) +OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF) +OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON) +OPTION(EQEMU_PREFER_LUA "Build with normal Lua even if LuaJIT is found." OFF) IF(EQEMU_COMMANDS_LOGGING) ADD_DEFINITIONS(-DCOMMANDS_LOGGING) ENDIF(EQEMU_COMMANDS_LOGGING) -IF(EQEMU_DISABLE_LOGSYS) - ADD_DEFINITIONS(-DDISABLE_LOGSYS) -ENDIF(EQEMU_DISABLE_LOGSYS) - IF(EQEMU_ENABLE_BOTS) ADD_DEFINITIONS(-DBOTS) ENDIF(EQEMU_ENABLE_BOTS) -#What to build -OPTION(EQEMU_BUILD_SERVER "Build the game server." ON) -OPTION(EQEMU_BUILD_LOGIN "Build the login server." OFF) -OPTION(EQEMU_BUILD_HC "Build the headless client." OFF) -OPTION(EQEMU_BUILD_TESTS "Build utility tests." OFF) -OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON) -OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON) -OPTION(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON) - -#C++11 stuff -IF(NOT MSVC) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") - IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-reserved-user-defined-literal") - ENDIF() -ENDIF(NOT MSVC) - -#Various definitions -IF(EQEMU_BUILD_PERL) - ADD_DEFINITIONS(-DEMBPERL) - ADD_DEFINITIONS(-DEMBPERL_PLUGIN) -ENDIF(EQEMU_BUILD_PERL) -IF(EQEMU_BUILD_LUA) - ADD_DEFINITIONS(-DLUA_EQEMU) -ENDIF(EQEMU_BUILD_LUA) - -#Disabled until reevaluation performed -#OPTION(EQEMU_USE_MAP_MMFS "Create and use Zone Map MMF files." OFF) -#IF(EQEMU_USE_MAP_MMFS) -# ADD_DEFINITIONS(-DUSE_MAP_MMFS) -#ENDIF(EQEMU_USE_MAP_MMFS) - -SET(EQEMU_MAP_DIR "./Maps" CACHE STRING "The dir that maps, water maps, and paths are located in.") - -ADD_DEFINITIONS(-DEQDEBUG=${EQEMU_DEBUG_LEVEL}) -ADD_DEFINITIONS(-DINVERSEXY) -ADD_DEFINITIONS(-DFIELD_ITEMS) -ADD_DEFINITIONS(-DMAP_DIR="${EQEMU_MAP_DIR}") -ADD_DEFINITIONS(-DLOG_LEVEL_STATUS=${EQEMU_LOG_LEVEL_STATUS}) -ADD_DEFINITIONS(-DLOG_LEVEL_NORMAL=${EQEMU_LOG_LEVEL_NORMAL}) -ADD_DEFINITIONS(-DLOG_LEVEL_ERROR=${EQEMU_LOG_LEVEL_ERROR}) -ADD_DEFINITIONS(-DLOG_LEVEL_DEBUG=${EQEMU_LOG_LEVEL_DEBUG}) -ADD_DEFINITIONS(-DLOG_LEVEL_QUEST=${EQEMU_LOG_LEVEL_QUEST}) -ADD_DEFINITIONS(-DLOG_LEVEL_COMMANDS=${EQEMU_LOG_LEVEL_COMMANDS}) -ADD_DEFINITIONS(-DLOG_LEVEL_CRASH=${EQEMU_LOG_LEVEL_CRASH}) -ADD_DEFINITIONS(-DGLM_FORCE_RADIANS) -ADD_DEFINITIONS(-DGLM_FORCE_CTOR_INIT) -ADD_DEFINITIONS(-DGLM_ENABLE_EXPERIMENTAL) - -#Find everything we need -FIND_PACKAGE(ZLIB) -FIND_PACKAGE(MySQL REQUIRED) -IF(EQEMU_BUILD_PERL) - FIND_PACKAGE(PerlLibs REQUIRED) - INCLUDE_DIRECTORIES(SYSTEM "${PERL_INCLUDE_PATH}") -ENDIF(EQEMU_BUILD_PERL) - -SET(SERVER_LIBS common debug ${MySQL_LIBRARY_DEBUG} optimized ${MySQL_LIBRARY_RELEASE} uv_a fmt RecastNavigation::Detour) - -FIND_PACKAGE(Sodium REQUIRED) -IF(SODIUM_FOUND) - OPTION(EQEMU_ENABLE_SECURITY "Use Encryption For TCP Connections" ON) - IF(EQEMU_ENABLE_SECURITY) - INCLUDE_DIRECTORIES(SYSTEM "${SODIUM_INCLUDE_DIRS}") - ADD_DEFINITIONS(-DENABLE_SECURITY) - SET(SERVER_LIBS ${SERVER_LIBS} ${SODIUM_LIBRARIES}) +#database +IF(MySQL_FOUND AND MariaDB_FOUND) + SET(DATABASE_LIBRARY_SELECTION MariaDB CACHE STRING "Database library to use: + MySQL + MariaDB" + ) + + IF(DATABASE_LIBRARY_SELECTION STREQUAL "MySQL") + SET(DATABASE_LIBRARY_TYPE " MySQL") + SET(DATABASE_LIBRARY_LIBS ${MySQL_LIBRARIES}) + SET(DATABASE_LIBRARY_INCLUDE ${MySQL_INCLUDE_DIR}) + ELSEIF(DATABASE_LIBRARY_SELECTION STREQUAL "MariaDB") + SET(DATABASE_LIBRARY_TYPE "MariaDB") + SET(DATABASE_LIBRARY_LIBS ${MariaDB_LIBRARIES}) + SET(DATABASE_LIBRARY_INCLUDE ${MariaDB_INCLUDE_DIR}) + ELSE() + MESSAGE(FATAL_ERROR "Unknown database library set, should be one of: MySQL, MariaDB") ENDIF() +ELSEIF(MariaDB_FOUND) + SET(DATABASE_LIBRARY_TYPE "MariaDB") + SET(DATABASE_LIBRARY_LIBS ${MariaDB_LIBRARIES}) + SET(DATABASE_LIBRARY_INCLUDE ${MariaDB_INCLUDE_DIR}) +ELSEIF(MySQL_FOUND) + SET(DATABASE_LIBRARY_TYPE " MySQL") + SET(DATABASE_LIBRARY_LIBS ${MySQL_LIBRARIES}) + SET(DATABASE_LIBRARY_INCLUDE ${MySQL_INCLUDE_DIR}) +ELSE() + MESSAGE(FATAL_ERROR "One of MySQL or MariaDB is a required dependency.") ENDIF() -IF(ZLIB_FOUND) - OPTION(EQEMU_BUILD_ZLIB "Build internal version of zlib." OFF) +#security +#prefer openssl to mbedtls (arbitrary) +IF(OpenSSL_FOUND AND MBEDTLS_FOUND) + SET(TLS_LIBRARY_SELECTION OpenSSL CACHE STRING "TLS library to use: + OpenSSL + mbedTLS" + ) - IF(EQEMU_BUILD_ZLIB) - INCLUDE_DIRECTORIES(BEFORE SYSTEM "${CMAKE_CURRENT_BINARY_DIR}/libs/zlibng" "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng") - SET(SERVER_LIBS ${SERVER_LIBS} "zlibstatic") + IF(TLS_LIBRARY_SELECTION STREQUAL "OpenSSL") + SET(TLS_LIBRARY_TYPE " OpenSSL") + SET(TLS_LIBRARY_ENABLED ON) + SET(TLS_LIBRARY_LIBS ${OPENSSL_LIBRARIES}) + SET(TLS_LIBRARY_INCLUDE ${OPENSSL_INCLUDE_DIR}) + ADD_DEFINITIONS(-DEQEMU_USE_OPENSSL) + ELSEIF(TLS_LIBRARY_SELECTION STREQUAL "mbedTLS") + SET(TLS_LIBRARY_TYPE " mbedTLS") + SET(TLS_LIBRARY_ENABLED ON) + SET(TLS_LIBRARY_LIBS ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY}) + SET(TLS_LIBRARY_INCLUDE ${MBEDTLS_INCLUDE_DIR}) + ADD_DEFINITIONS(-DEQEMU_USE_MBEDTLS) ELSE() - INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_INCLUDE_DIRS}") - SET(SERVER_LIBS ${SERVER_LIBS} ${ZLIB_LIBRARY}) + MESSAGE(FATAL_ERROR "Unknown TLS library set, should be one of: OpenSSL, mbedTLS") + ENDIF() +ELSEIF(OpenSSL_FOUND) + SET(TLS_LIBRARY_TYPE " OpenSSL") + SET(TLS_LIBRARY_ENABLED ON) + SET(TLS_LIBRARY_LIBS ${OPENSSL_LIBRARIES}) + SET(TLS_LIBRARY_INCLUDE ${OPENSSL_INCLUDE_DIR}) + ADD_DEFINITIONS(-DEQEMU_USE_OPENSSL) +ELSEIF(MBEDTLS_FOUND) + SET(TLS_LIBRARY_TYPE " mbedTLS") + SET(TLS_LIBRARY_ENABLED ON) + SET(TLS_LIBRARY_LIBS ${MBEDTLS_LIBRARY} ${MBEDX509_LIBRARY} ${MBEDCRYPTO_LIBRARY}) + SET(TLS_LIBRARY_INCLUDE ${MBEDTLS_INCLUDE_DIR}) + ADD_DEFINITIONS(-DEQEMU_USE_MBEDTLS) +ELSE() + SET(TLS_LIBRARY_TYPE "Disabled") + SET(TLS_LIBRARY_ENABLED OFF) +ENDIF() + +IF(SODIUM_FOUND) + SET(SODIUM_LIBRARY_TYPE "Libsodium") + SET(SODIUM_LIBRARY_ENABLED ON) + SET(SODIUM_LIBRARY_LIBS ${SODIUM_LIBRARIES}) + SET(SODIUM_LIBRARY_INCLUDE ${SODIUM_INCLUDE_DIRS}) + ADD_DEFINITIONS(-DENABLE_SECURITY) +ELSE() + SET(SODIUM_LIBRARY_TYPE " Disabled") + SET(SODIUM_LIBRARY_ENABLED OFF) +ENDIF() + +IF(LUAJIT_FOUND AND NOT (EQEMU_PREFER_LUA AND Lua51_FOUND)) + SET(LUA_LIBRARY_TYPE " LuaJIT") + SET(LUA_LIBRARY_ENABLED ON) + SET(LUA_LIBRARY_LIBS ${LUAJIT_LIBRARY} luabind) + SET(LUA_LIBRARY_INCLUDE ${LUAJIT_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind") +ELSEIF(Lua51_FOUND ) + SET(LUA_LIBRARY_TYPE " Lua 5.1") + SET(LUA_LIBRARY_ENABLED ON) + SET(LUA_LIBRARY_LIBS ${LUA_LIBRARY} luabind) + SET(LUA_LIBRARY_INCLUDE ${LUA_INCLUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind") +ELSE() + SET(LUA_LIBRARY_TYPE "Disabled") + SET(LUA_LIBRARY_ENABLED OFF) +ENDIF() + +IF(PerlLibs_FOUND) + SET(PERL_LIBRARY_TYPE " Perl") + SET(PERL_LIBRARY_ENABLED ON) + SET(PERL_LIBRARY_LIBS ${PERL_LIBRARY}) + SET(PERL_LIBRARY_INCLUDE ${PERL_INCLUDE_PATH}) +ELSE() + SET(PERL_LIBRARY_TYPE "Disabled") + SET(PERL_LIBRARY_ENABLED OFF) +ENDIF() + +#use zlib if exists +IF(ZLIB_FOUND) + OPTION(EQEMU_BUILD_ZLIB "Build internal version of zlib." ON) + IF(EQEMU_BUILD_ZLIB) + SET(ZLIB_LIBRARY_TYPE "zlib-ng") + SET(ZLIB_LIBRARY_LIBS "zlibstatic") + SET(ZLIB_LIBRARY_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng") + INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_BINARY_DIR}/libs/zlibng") + ELSE() + SET(ZLIB_LIBRARY_TYPE " zlib") + SET(ZLIB_LIBRARY_LIBS ${ZLIB_LIBRARY}) + SET(ZLIB_LIBRARY_INCLUDE ${ZLIB_INCLUDE_DIRS}) ENDIF() ELSE() - MESSAGE(STATUS "Could NOT find ZLIB - using ZLIBSTATIC package.") - SET(EQEMU_BUILD_ZLIB ON) - INCLUDE_DIRECTORIES(BEFORE SYSTEM "${CMAKE_CURRENT_BINARY_DIR}/libs/zlibng" "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng") - SET(SERVER_LIBS ${SERVER_LIBS} "zlibstatic") + SET(ZLIB_LIBRARY_TYPE "zlib-ng") + SET(ZLIB_LIBRARY_LIBS "zlibstatic") + SET(ZLIB_LIBRARY_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng") ENDIF() -IF(WIN32) - SET(SERVER_LIBS ${SERVER_LIBS} "ws2_32" "psapi" "iphlpapi" "userenv") -ENDIF() +MESSAGE(STATUS "") +MESSAGE(STATUS "**************************************************") +MESSAGE(STATUS "* Library Usage *") +MESSAGE(STATUS "**************************************************") +MESSAGE(STATUS "* Database: ${DATABASE_LIBRARY_TYPE} *") +MESSAGE(STATUS "* TLS: ${TLS_LIBRARY_TYPE} *") +MESSAGE(STATUS "* Sodium: ${SODIUM_LIBRARY_TYPE} *") +MESSAGE(STATUS "* Lua: ${LUA_LIBRARY_TYPE} *") +MESSAGE(STATUS "* Perl: ${PERL_LIBRARY_TYPE} *") +MESSAGE(STATUS "* zlib: ${ZLIB_LIBRARY_TYPE} *") +MESSAGE(STATUS "**************************************************") -IF(UNIX) - SET(SERVER_LIBS ${SERVER_LIBS} ${CMAKE_DL_LIBS} "z" "m" "pthread") - IF(NOT DARWIN) - SET(SERVER_LIBS ${SERVER_LIBS} "rt") - ENDIF() - SET(SERVER_LIBS ${SERVER_LIBS} "uuid") -ENDIF() +#setup server libs and headers +SET(SERVER_LIBS common ${DATABASE_LIBRARY_LIBS} ${ZLIB_LIBRARY_LIBS} ${Boost_LIBRARIES} uv_a fmt RecastNavigation::Detour) -IF(EQEMU_BUILD_LUA) - FIND_PACKAGE(EQLua51 REQUIRED) - SET(Boost_USE_STATIC_LIBS OFF) - SET(Boost_USE_MULTITHREADED ON) - SET(Boost_USE_STATIC_RUNTIME OFF) - SET(BOOST_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/boost") - - FIND_PACKAGE(Boost REQUIRED) - INCLUDE_DIRECTORIES(SYSTEM "${LUA_INCLUDE_DIR}" "${Boost_INCLUDE_DIRS}") - INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/libs/luabind") - - OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON) - IF(EQEMU_SANITIZE_LUA_LIBS) - ADD_DEFINITIONS(-DSANITIZE_LUA_LIBS) - ENDIF(EQEMU_SANITIZE_LUA_LIBS) -ENDIF(EQEMU_BUILD_LUA) - -INCLUDE_DIRECTORIES(SYSTEM "${MySQL_INCLUDE_DIR}") +INCLUDE_DIRECTORIES(SYSTEM "${DATABASE_LIBRARY_INCLUDE}") +INCLUDE_DIRECTORIES(SYSTEM "${ZLIB_LIBRARY_INCLUDE}") +INCLUDE_DIRECTORIES(SYSTEM "${Boost_INCLUDE_DIRS}") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/glm") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/cereal/include") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/fmt/include") @@ -373,23 +293,89 @@ INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigat INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigation/Recast/Include") INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/websocketpp") +OPTION(EQEMU_BUILD_LOGGING "Build Logging (To speed up compilation)" ON) +IF(EQEMU_BUILD_LOGGING) + ADD_DEFINITIONS(-DBUILD_LOGGING) +ENDIF() + +IF(TLS_LIBRARY_ENABLED) + SET(SERVER_LIBS ${SERVER_LIBS} ${TLS_LIBRARY_LIBS}) + INCLUDE_DIRECTORIES(SYSTEM "${TLS_LIBRARY_INCLUDE}") +ENDIF() + +IF(SODIUM_LIBRARY_ENABLED) + SET(SERVER_LIBS ${SERVER_LIBS} ${SODIUM_LIBRARY_LIBS}) + INCLUDE_DIRECTORIES(SYSTEM "${SODIUM_LIBRARY_INCLUDE}") +ENDIF() + +IF(LUA_LIBRARY_ENABLED) + OPTION(EQEMU_BUILD_LUA "Build Lua parser." ON) + + IF(EQEMU_BUILD_LUA) + ADD_DEFINITIONS(-DLUA_EQEMU) + SET(ZONE_LIBS ${LUA_LIBRARY_LIBS}) + INCLUDE_DIRECTORIES(SYSTEM "${LUA_LIBRARY_INCLUDE}") + + OPTION(EQEMU_SANITIZE_LUA_LIBS "Sanitize Lua Libraries (Remove OS and IO standard libraries from being able to run)." ON) + IF(EQEMU_SANITIZE_LUA_LIBS) + ADD_DEFINITIONS(-DSANITIZE_LUA_LIBS) + ENDIF() + ENDIF() +ENDIF() + +IF(PERL_LIBRARY_ENABLED) + OPTION(EQEMU_BUILD_PERL "Build Perl parser." ON) + IF(EQEMU_BUILD_PERL) + SET(SERVER_LIBS ${SERVER_LIBS} ${PERL_LIBRARY_LIBS}) + INCLUDE_DIRECTORIES(SYSTEM "${PERL_LIBRARY_INCLUDE}") + ADD_DEFINITIONS(-DEMBPERL) + ADD_DEFINITIONS(-DEMBPERL_PLUGIN) + ENDIF() +ENDIF() + +IF(WIN32) + SET(SERVER_LIBS ${SERVER_LIBS} "ws2_32" "psapi" "iphlpapi" "userenv") +ENDIF() + +IF(UNIX) + SET(SERVER_LIBS ${SERVER_LIBS} ${CMAKE_DL_LIBS} "z" "m" "pthread") + IF(NOT DARWIN) + SET(SERVER_LIBS ${SERVER_LIBS} "rt") + ENDIF() + # Freebsd provides uuids in the C library + IF(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") + SET(SERVER_LIBS ${SERVER_LIBS} "uuid") + ENDIF() +ENDIF() + +SET(ZONE_LIBS ${ZONE_LIBS} ${SERVER_LIBS}) + +IF(EQEMU_BUILD_LOGIN AND NOT TLS_LIBRARY_ENABLED) + MESSAGE(FATAL_ERROR "Login server requires a TLS Library to build.") +ENDIF() + +IF(EQEMU_BUILD_HC AND NOT TLS_LIBRARY_ENABLED) + MESSAGE(FATAL_ERROR "Headless client requires a TLS Library to build.") +ENDIF() + IF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_HC) ADD_SUBDIRECTORY(common) ADD_SUBDIRECTORY(libs) ADD_SUBDIRECTORY(submodules/fmt) ADD_SUBDIRECTORY(submodules/libuv) - - SET(RECASTNAVIGATION_DEMO OFF CACHE BOOL "Build demo") - SET(RECASTNAVIGATION_TESTS OFF CACHE BOOL "Build tests") - SET(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "Build examples") - ADD_SUBDIRECTORY(submodules/recastnavigation) IF(EQEMU_BUILD_ZLIB) SET(ZLIB_COMPAT ON CACHE BOOL "Compile with zlib compatible API") SET(ZLIB_ENABLE_TESTS OFF CACHE BOOL "Build test binaries") ADD_SUBDIRECTORY(libs/zlibng) ENDIF() + + SET(RECASTNAVIGATION_DEMO OFF CACHE BOOL "Build demo") + SET(RECASTNAVIGATION_TESTS OFF CACHE BOOL "Build tests") + SET(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "Build examples") + ADD_SUBDIRECTORY(submodules/recastnavigation) ENDIF(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_HC) + IF(EQEMU_BUILD_SERVER) ADD_SUBDIRECTORY(shared_memory) ADD_SUBDIRECTORY(world) @@ -398,6 +384,7 @@ IF(EQEMU_BUILD_SERVER) ADD_SUBDIRECTORY(queryserv) ADD_SUBDIRECTORY(eqlaunch) ENDIF(EQEMU_BUILD_SERVER) + IF(EQEMU_BUILD_LOGIN) ADD_SUBDIRECTORY(loginserver) ENDIF(EQEMU_BUILD_LOGIN) diff --git a/README.md b/README.md index 5e4f919fe..fea2c23a4 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # EQEmulator Core Server -|Travis CI (Linux)|Appveyor w/ Bots (Windows) |Appveyor w/o Bots (Windows) | +|Travis CI (Linux)|Appveyor (Windows x86) |Appveyor (Windows x64) | |:---:|:---:|:---:| -|[![Linux CI](https://travis-ci.org/EQEmu/Server.svg?branch=master)](https://travis-ci.org/EQEmu/Server) |[![Build status](https://ci.appveyor.com/api/projects/status/scr25kmntx36c1ub/branch/master?svg=true)](https://ci.appveyor.com/project/KimLS/server-87crp/branch/master) |[![Build status](https://ci.appveyor.com/api/projects/status/mdwbr4o9l6mxqofj/branch/master?svg=true)](https://ci.appveyor.com/project/KimLS/server-w0pq2/branch/master) | +|[![Linux CI](https://travis-ci.org/EQEmu/Server.svg?branch=master)](https://travis-ci.org/EQEmu/Server) |[![Build status](https://ci.appveyor.com/api/projects/status/v3utuu0dttm2cqd0?svg=true)](https://ci.appveyor.com/project/KimLS/server) |[![Build status](https://ci.appveyor.com/api/projects/status/scr25kmntx36c1ub?svg=true)](https://ci.appveyor.com/project/KimLS/server-87crp) | *** @@ -17,9 +17,13 @@ |:---:|:---:|:---:| |**Install Count**|![Windows Install Count](http://analytics.akkadius.com/?install_count&windows_count)|![Linux Install Count](http://analytics.akkadius.com/?install_count&linux_count)| ### > Windows -* [Install](https://github.com/EQEmu/Server/wiki/Windows-Server) + +* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-windows) ### > Debian/Ubuntu/CentOS/Fedora + +* [Install Guide](https://eqemu.gitbook.io/server/categories/installation/server-installation-linux) + * You can use curl or wget to kick off the installer (whichever your OS has) > curl -O https://raw.githubusercontent.com/EQEmu/Server/master/utils/scripts/linux_installer/install.sh install.sh && chmod 755 install.sh && ./install.sh @@ -52,7 +56,7 @@ forum, although pull requests will be much quicker and easier on all parties. ## Resources - [EQEmulator Forums](http://www.eqemulator.org/forums) -- [EQEmulator Wiki](https://github.com/EQEmu/Server/wiki) +- [EQEmulator Wiki](https://eqemu.gitbook.io/) ## Related Repositories * [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests) @@ -76,3 +80,4 @@ forum, although pull requests will be much quicker and easier on all parties. + diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..0a653b06f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,3 @@ +# Security Policy - Reporting Vulnerabilities + +When reporting active hacks, exploits and other vulnerabilities, please describe how to reproduce said report and if you can provide context into a possible solution diff --git a/appveyor-bots.yml b/appveyor-bots.yml index 9edb00593..540d9b3df 100644 --- a/appveyor-bots.yml +++ b/appveyor-bots.yml @@ -16,6 +16,6 @@ build: verbosity: minimal after_build: - cmd: >- - 7z a build_x64-bots.zip C:\projects\eqemu\build\bin\RelWithDebInfo\*.exe C:\projects\eqemu\build\bin\RelWithDebInfo\*.dll C:\projects\eqemu\build\bin\RelWithDebInfo\*.pdb + 7z a build_x64-bots.zip C:\projects\eqemu\build\bin\RelWithDebInfo\*.exe C:\projects\eqemu\build\bin\RelWithDebInfo\*.dll C:\projects\eqemu\build\bin\RelWithDebInfo\*.pdb C:\projects\eqemu\build\libs\zlibng\RelWithDebInfo\*.dll - appveyor PushArtifact build_x64-bots.zip \ No newline at end of file + appveyor PushArtifact build_x64-bots.zip diff --git a/appveyor-no-bots.yml b/appveyor-no-bots.yml index 7aea00332..0b0f5b8a2 100644 --- a/appveyor-no-bots.yml +++ b/appveyor-no-bots.yml @@ -16,6 +16,6 @@ build: verbosity: minimal after_build: - cmd: >- - 7z a build_x64-no-bots.zip C:\projects\eqemu\build\bin\RelWithDebInfo\*.exe C:\projects\eqemu\build\bin\RelWithDebInfo\*.dll C:\projects\eqemu\build\bin\RelWithDebInfo\*.pdb + 7z a build_x64-no-bots.zip C:\projects\eqemu\build\bin\RelWithDebInfo\*.exe C:\projects\eqemu\build\bin\RelWithDebInfo\*.dll C:\projects\eqemu\build\bin\RelWithDebInfo\*.pdb C:\projects\eqemu\build\libs\zlibng\RelWithDebInfo\*.dll - appveyor PushArtifact build_x64-no-bots.zip \ No newline at end of file + appveyor PushArtifact build_x64-no-bots.zip diff --git a/changelog.txt b/changelog.txt index 6b9d00a80..955a0a2e8 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,34 @@ +############################################ +# Deprecated +############################################ +# +# New changelog can be found here +# https://eqemu.gitbook.io/changelog/ +# +############################################ +# Deprecated +############################################ + EQEMu Changelog (Started on Sept 24, 2003 15:50) ------------------------------------------------------- +== 8/16/2019 == +Akkadius: Simplified the use of roamboxes and improved the AI for roambox pathing https://i.imgur.com/z33u7y9.gif +Akkadius: Implemented command #roambox set [move_delay] +Akkadius: Implemented command #roambox remove +Akkadius: Implemented LUA NPC:SetSimpleRoamBox(box_size, [move_distance], [move_delay]); +Akkadius: Implemented Perl $npc->SetSimpleRoamBox(box_size, [move_distance], [move_delay]); +Akkadius: Spawngroup data now hot reloads on #repop +Akkadius: Command #npceditmass now lists column options when one isn't properly specified +Akkadius: Implemented command #spawneditmass