Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/core_codestyle.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
name: Codestyle Checks

permissions:
contents: read

on:
push:
branches: [ master ]
branches: [master, devel]
pull_request:
branches: [ master ]
branches: [master]

concurrency:
group: codestyle-${{ github.ref }}
cancel-in-progress: true

jobs:
check-codestyle:
Expand All @@ -15,7 +21,8 @@ jobs:
runs-on: ubuntu-latest
name: Check Codestyling
steps:
- uses: actions/checkout@v2
# v2 runs on a long-deprecated Node runtime.
- uses: actions/checkout@v4

- name: Check Codestyling
run: source ./apps/ci/ci-codestyle.sh
36 changes: 26 additions & 10 deletions .github/workflows/core_linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ name: Linux Build (GCC + Clang)

on:
push:
branches: [ master, devel ]
branches: [master, devel]
pull_request:
branches: [ master ]
branches: [master]

permissions:
contents: read

# A second push to the same branch makes the first run's result worthless.
concurrency:
group: linux-build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -34,21 +39,25 @@ jobs:
submodules: recursive
fetch-depth: 1

- name: Cache CMake build
# ccache, not a cached build directory: actions/checkout rewrites every source file,
# so restored objects are always older than their sources and make rebuilds everything.
# ccache keys on translation-unit content instead. github.sha keeps the key unique so
# the cache is always re-saved; restore-keys seeds it from the newest previous run.
- name: Cache ccache
uses: actions/cache@v4
with:
path: _build
key: ${{ runner.os }}-${{ matrix.name }}-cmake-${{ hashFiles('**/CMakeLists.txt') }}
path: ~/.cache/ccache
key: ${{ runner.os }}-${{ matrix.name }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ matrix.name }}-cmake-
${{ runner.os }}-${{ matrix.name }}-ccache-

- name: Install build dependencies
run: |
sudo apt-get update -qq
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
git cmake make build-essential \
git cmake make build-essential ccache \
libssl-dev libbz2-dev default-libmysqlclient-dev \
libace-dev libreadline-dev \
libreadline-dev \
${{ matrix.pkg }}

- name: Configure project
Expand All @@ -60,16 +69,19 @@ jobs:
-DCMAKE_INSTALL_PREFIX=../_install \
-DCMAKE_C_COMPILER=${{ matrix.cc }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_TOOLS=1 \
-DBUILD_MANGOSD=1 \
-DBUILD_REALMD=1 \
-DSOAP=1 \
-DSCRIPT_LIB_ELUNA=1 \
-DSCRIPT_LIB_SD3_GATE=1 \
-DSCRIPT_LIB_SD3=1 \
-DPLAYERBOTS=1 \
-DUSE_STORMLIB=1 \
-DBUILD_AH_SERVICE=1 \
-DPCH=0
-DPCH=0 \
--warn-uninitialized

- name: Build and install
run: |
Expand All @@ -86,3 +98,7 @@ jobs:
echo "$out"
echo "$out" | grep -q "intent codec selftest OK" || { echo "MISSING: intent codec selftest OK"; exit 1; }
echo "$out" | grep -q "ipc selftest OK" || { echo "MISSING: ipc selftest OK"; exit 1; }

- name: ccache statistics
if: always()
run: ccache -s
24 changes: 12 additions & 12 deletions .github/workflows/core_windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ permissions:

on:
push:
branches: [ master , devel ]
branches: [master, devel]
pull_request:
branches: [ master ]
branches: [master]

# Supersede an in-flight run when the branch moves on: its result is already stale.
concurrency:
group: windows-build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
Expand All @@ -24,14 +29,15 @@ jobs:
fetch-depth: 1


# Bump the -vN suffix to force a re-install of OpenSSL.
- name: Cache OpenSSL
id: cache-openssl
uses: actions/cache@v4
with:
path: |
C:\Program Files\OpenSSL
C:\Program Files\OpenSSL-Win64
key: ${{ runner.os }}-openssl-full
key: ${{ runner.os }}-openssl-v1


- name: Install full OpenSSL (developer)
Expand Down Expand Up @@ -63,18 +69,12 @@ jobs:
echo "OPENSSL_INCLUDE_DIR=C:/Program Files/OpenSSL-Win64/include" >> $GITHUB_ENV
echo "OPENSSL_CRYPTO_LIBRARY=C:/Program Files/OpenSSL-Win64/lib/VC/libcrypto64MT.lib" >> $GITHUB_ENV
echo "OPENSSL_SSL_LIBRARY=C:/Program Files/OpenSSL-Win64/lib/VC/libssl64MT.lib" >> $GITHUB_ENV
else
echo "::error::OpenSSL not found in either expected location"
exit 1
fi


- name: Cache CMake build
uses: actions/cache@v4
with:
path: build
key: ${{ runner.os }}-cmake-${{ hashFiles('**/CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-cmake-


- name: Configure CMake project
shell: bash
run: |
Expand Down
48 changes: 34 additions & 14 deletions .github/workflows/docker_build.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,51 @@
name: Docker Build

# Only builds images and pushes nothing, so read is all the token ever needs.
permissions:
contents: read

on:
push:
branches: [ master , devel ]
branches: [master, devel]
pull_request:
branches: [ master ]
branches: [master]

concurrency:
group: docker-build-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
# v2 runs on a deprecated Node runtime.
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout Submodules
shell: bash
run: |
git submodule init && git submodule update
submodules: recursive
fetch-depth: 1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

# Layer caching across runs.
- name: Build Mangosd Docker image
run: |
docker build -t mangosd:latest -f dockercontainer/DockerFile-mangosd .
uses: docker/build-push-action@v6
with:
context: .
file: dockercontainer/DockerFile-mangosd
tags: mangosd:latest
push: false
cache-from: type=gha,scope=mangosd
cache-to: type=gha,mode=max,scope=mangosd

- name: Build Realmd Docker image
run: |
docker build -t realmd:latest -f dockercontainer/DockerFile-realmd .
uses: docker/build-push-action@v6
with:
context: .
file: dockercontainer/DockerFile-realmd
tags: realmd:latest
push: false
cache-from: type=gha,scope=realmd
cache-to: type=gha,mode=max,scope=realmd
26 changes: 0 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ Thumbs.db
_build
build
/dep/libmpq/autom4te.cache/
/ACE_wrappers/*
/ACE*.tar.bz2

# Generated files
*.ncb
Expand All @@ -84,31 +82,7 @@ ipch
cmake.cmd
msbuild.cmd

# cmake generated files in sources
/dep/ACE_wrappers/ace/ACE_vc8.vcxproj*
/dep/ACE_wrappers/ace/Backup*
/dep/ACE_wrappers/ace/Debug*
/dep/ACE_wrappers/ace/ETCL/ACE_ETCL_Parser_vc8.vcxproj*
/dep/ACE_wrappers/ace/ETCL/ACE_ETCL_vc8.vcxproj*
/dep/ACE_wrappers/ace/ETCL/Debug*
/dep/ACE_wrappers/ace/ETCL/Release*
/dep/ACE_wrappers/ace/Monitor_Control/Debug*
/dep/ACE_wrappers/ace/Monitor_Control/Monitor_Control_vc8.vcxproj*
/dep/ACE_wrappers/ace/Monitor_Control/Release*
/dep/ACE_wrappers/ace/QoS/Debug*
/dep/ACE_wrappers/ace/QoS/QoS_vc8.vcxproj*
/dep/ACE_wrappers/ace/QoS/Release*
/dep/ACE_wrappers/ace/UpgradeLog*
/dep/ACE_wrappers/ace/Release*
/dep/ACE_wrappers/ace/_UpgradeReport_Files*
/dep/ACE_wrappers/lib/*
/dep/ACE_wrappers/ace/config.h

# ned files from excluded dirs
!/dep/ACE_wrappers/ace/ace_message_table.bin
!/dep/ACE_wrappers/bin/GNUmakefile.bin
!/dep/ACE_wrappers/configure.ac~
!/dep/ACE_wrappers/lib/.empty
!/dep/tbb/src/Makefile

# recastnavigation directory needs exception
Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ this repo. Humans: also read [`doc/CodingStandard.md`](doc/CodingStandard.md).
```sh
git clone --recursive https://github.com/mangoszero/server.git && cd server
sudo apt-get install -y git cmake make build-essential \
libssl-dev libbz2-dev default-libmysqlclient-dev libace-dev libreadline-dev # Debian/Ubuntu deps
libssl-dev libbz2-dev default-libmysqlclient-dev libreadline-dev # Debian/Ubuntu deps
mkdir -p _build _install && cd _build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../_install \
-DBUILD_TOOLS=1 -DBUILD_MANGOSD=1 -DBUILD_REALMD=1 -DSOAP=1 \
-DSCRIPT_LIB_ELUNA=1 -DSCRIPT_LIB_SD3_GATE=1 -DPLAYERBOTS=1 \
-DSCRIPT_LIB_ELUNA=1 -DSCRIPT_LIB_SD3=1 -DPLAYERBOTS=1 \
-DUSE_STORMLIB=1 -DBUILD_AH_SERVICE=1 -DPCH=0
make -j"$(nproc)" && make install -j"$(nproc)"
```
Expand Down
57 changes: 56 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,17 @@ else()
set(CONF_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}")
endif()

# =============================================================================
# Runtime library search path (RPATH)
# =============================================================================
if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path/../lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
elseif(UNIX)
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()

# =============================================================================
# Dependencies
# =============================================================================
Expand All @@ -134,12 +145,56 @@ if(NOT WITHOUT_GIT)
endif()

find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(OpenSSL 3.0 REQUIRED)
find_package(MySQL REQUIRED)

# =============================================================================
# OpenSSL policy
#
# OpenSSL 3.x is the baseline: there are no version conditionals left in src/.
# Every OpenSSL decision lives here, in two interface targets:
#
# mangos_openssl - what to link against and where the headers live.
# Linked PUBLIC by anything exposing OpenSSL types in
# its own headers (`shared`), so consumers inherit it.
#
# mangos_openssl_strict - the API level we hold ourselves to. Together these
# two definitions delete the *declarations* of
# everything OpenSSL deprecated up to 3.0 -- the
# low-level MD5_*, SHA1_*, HMAC_CTX and SSLeay_*
# families. Reaching for the old API is then a
# compile error rather than a warning nobody reads.
#
# Link it PRIVATE, always: it must not leak into the
# vendored code under dep/, which still uses the old API.
# =============================================================================
add_library(mangos_openssl INTERFACE)
target_link_libraries(mangos_openssl
INTERFACE
OpenSSL::SSL
OpenSSL::Crypto
)

add_library(mangos_openssl_strict INTERFACE)
target_compile_definitions(mangos_openssl_strict
INTERFACE
OPENSSL_API_COMPAT=0x30000000L
OPENSSL_NO_DEPRECATED
)

find_package(ZLIB QUIET)
find_package(BZip2 QUIET)

# dep/lualib (the Lua build used by Eluna) links against readline by its bare
# library name and is not itself touched here; find_package(Readline) below
# declares a GLOBAL IMPORTED target literally named `readline` (see
# cmake/FindReadline.cmake) before that subdirectory is added, so its
# existing bare-name references resolve to a properly-detected library
# instead of an unqualified linker search. Readline has no Windows build and
# is only needed when Eluna is being built.
if(NOT WIN32 AND SCRIPT_LIB_ELUNA)
find_package(Readline REQUIRED)
endif()

include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/GenRevision.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/EnsureVersion.cmake)
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,14 @@ their systems package management instead of source packages.**

* **[Git][34] / [Github for Windows][35]**: This version control software allows you to get the source files in the first place.
* **[MySQL][40]** / **[MariaDB][41]**: These databases are used to store content and user data.
* **[ACE][43]**: aka Adaptive Communication Environment, provides us with a solid cross-platform framework for abstracting operating system specific details.
* **[Recast][44]**: In order to create navigation data from the client's map files, Recast is used to do the dirty work. It provides functions for rendering, pathing, etc.
* **[G3D][45]**: This engine provides the basic framework for handling 3D data and is used to handle basic map data.
* **[Stormlib][46]**: Provides an abstraction layer for reading from the client's data files.
* **[Zlib][53]/[Zlib for Windows][51]** provides compression algorithms used in both MPQ archive handling and the client/server protocol.
* **[Bzip2][54]/[Bzip2 for Windows][52]** provides compression algorithms used in MPQ archives.
* **[OpenSSL][48]/[OpenSSL for Windows][55]** provides encryption algorithms used when authenticating clients.

**ACE**, **Recast**, **G3D**, **Stormlib**, **Zlib** and **Bzip2** are included in the standard distribution as
**Recast**, **G3D**, **Stormlib**, **Zlib** and **Bzip2** are included in the standard distribution as
we rely on specific versions.

Optional dependencies
Expand Down Expand Up @@ -199,7 +198,6 @@ World of Warcraft, and all related art, images, and lore are copyright [Blizzard
[35]: http://windows.github.com/ "github - windows client"
[40]: https://dev.mysql.com/downloads/ "MySQL - The world's most popular open source database"
[41]: https://mariadb.org/download/ "MariaDB - An enhanced, drop-in replacement for MySQL"
[43]: http://www.dre.vanderbilt.edu/~schmidt/ACE.html "ACE - The ADAPTIVE Communication Environment"
[44]: http://github.com/memononen/recastnavigation "Recast - Navigation-mesh Toolset for Games"
[45]: http://sourceforge.net/projects/g3d/ "G3D - G3D Innovation Engine"
[46]: http://zezula.net/en/mpq/stormlib.html "Stormlib - A library for reading data from MPQ archives"
Expand Down
Loading
Loading