diff --git a/.devcontainer/.gitignore b/.devcontainer/.gitignore
index a58f289c3..cdb408d2d 100644
--- a/.devcontainer/.gitignore
+++ b/.devcontainer/.gitignore
@@ -1,6 +1,5 @@
-!Makefile
-base/*.sql
-base/*.zip
-base/db/
-base/maps/
-!base/expansion/Makefile
+base/
+!base/*.json
+override/
+repo/
+cache/
diff --git a/.devcontainer/Makefile b/.devcontainer/Makefile
index 53f06232c..65bda74af 100644
--- a/.devcontainer/Makefile
+++ b/.devcontainer/Makefile
@@ -1,196 +1,127 @@
+# Build binaries: make cmake, make build
+# One time initial setup (or to reset db): make prep, make inject-mariadb, make maps
+# Update custom db edits: make inject-custom
+# Start up server: make shared, make login, make world, make zone
+# in game, stop combat spam #logs set gmsay 79 0
+# in game, stop loot spam #logs set gmsay 69 0
NAME := eqemu-server
-.ONESHELL:
-
-DOCKER_ARGS := --rm --name ${NAME} -v $$PWD:/src -w /src ${NAME}
-DOCKER_ARM64_ARGS := --rm --platform linux/arm64 --name ${NAME}-arm64 -v $$PWD:/src -w /src ${NAME}-arm64
-
-.PHONY: build
-build:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile build --no-print-directory
- exit
-endif
- cd build$$BUILD_SUFFIX && cmake --build . --config Release --target all --
-
-.PHONY: cmake
-cmake:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile cmake --no-print-directory
- exit
-endif
- @echo "working directory: $$PWD"
- mkdir -p build$$BUILD_SUFFIX
- @cd build$$BUILD_SUFFIX && cmake -DEQEMU_BUILD_LOGIN=ON \
- -DEQEMU_BUILD_TESTS=ON \
- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -G Ninja ..
-
-clean:
-ifneq (,$(findstring .devcontainer,$$PWD))
- @make -C ../ -f .devcontainer/Makefile clean --no-print-directory
-endif
- rm -rf build
-
-docker-cmake:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile docker-cmake --no-print-directory
- exit
-endif
- @echo "working directory: $$PWD"
- git submodule update --init --recursive
- docker run ${DOCKER_ARGS} make cmake
-
-docker-build:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile docker-build --no-print-directory
- exit
-endif
- docker run ${DOCKER_ARGS} make build
-
-# Build image if it doesn't exist
-docker-image-build:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile docker-image-build --no-print-directory
- exit
-endif
-ifeq ($(shell docker images -q ${NAME} 2> /dev/null),)
- @echo "Docker image not found. Building..."
- docker build -f Dockerfile.debian.dev -t ${NAME} .
-endif
-
-docker-arm-cmake: docker-arm-image-build
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile docker-arm-cmake --no-print-directory
- exit
-endif
- git submodule update --init --recursive
- docker run ${DOCKER_ARM64_ARGS} make cmake BUILD_SUFFIX=arm64
-
-docker-arm-build: docker-arm-image-build
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile docker-arm-build --no-print-directory
- exit
-endif
- docker run ${DOCKER_ARM64_ARGS} make build BUILD_SUFFIX=arm64
-
-docker-arm-image-build:
-ifeq ($(shell docker images -q ${NAME}-arm64 2> /dev/null),)
- @echo "Docker image not found. Building..."
- docker build -f Dockerfile.debian.arm.dev -t ${NAME}-arm64 .
-endif
-
-docker-clean: clean
.PHONY: prep
-prep:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile prep --no-print-directory
- exit
-endif
+prep: is-vscode
@echo "Preparing build/bin for usage..."
- mkdir -p build/bin/assets/patches
- cp -R -u -p .devcontainer/base/eqemu_config.json build/bin/eqemu_config.json
- cp -R -u -p .devcontainer/base/login.json build/bin/login.json
- cp -R -u -p loginserver/login_util/* build/bin/assets/patches/
- mkdir -p build/bin/assets
- cp -R -u -p utils/patches build/bin/assets/
- -unlink build/bin/lua_modules
- cd build/bin && ln -s quests/lua_modules lua_modules
- -unlink build/bin/mods
- cd build/bin && ln -s quests/mods mods
- -unlink build/bin/maps
- cd build/bin && ln -s ../../base/maps maps
- mkdir -p build/bin/logs
- mkdir -p build/bin/shared
+
+ @echo "Prepping folders..."
+ @mkdir -p .devcontainer/override
+ @mkdir -p .devcontainer/repo
+ @mkdir -p .devcontainer/cache
+ @mkdir -p build/bin/logs
+ @mkdir -p build/bin/shared
+ @mkdir -p build/bin/assets
+
+ @echo "Applying overrides..."
+ @if [ ! -f .devcontainer/override/eqemu_config.json ]; then cp .devcontainer/base/eqemu_config.json .devcontainer/override/eqemu_config.json; fi
+ @if [ -f build/bin/eqemu_config.json ]; then unlink build/bin/eqemu_config.json; fi
+ cd build/bin && ln -s ../../.devcontainer/override/eqemu_config.json eqemu_config.json
+ @if [ ! -f .devcontainer/override/login.json ]; then cp .devcontainer/base/login.json .devcontainer/override/login.json; fi
+ @if [ -f build/bin/login.json ]; then unlink build/bin/login.json; fi
+ cd build/bin && ln -s ../../.devcontainer/override/login.json login.json
+
+ @echo "Cloning repositories..."
+ cd .devcontainer/repo && if [ ! -d "quests" ]; then cd ../../.devcontainer/repo/ && git clone https://github.com/ProjectEQ/projecteqquests.git quests; fi
+ cd .devcontainer/repo && if [ ! -d "eqemu-definitions" ]; then cd ../../.devcontainer/repo/ && git clone https://github.com/xackery/eqemu-definitions.git eqemu-definitions; fi
+ cd .devcontainer/repo && if [ ! -d "maps" ]; then cd ../../ && make maps; fi
+ @if [ -d build/bin/quests ]; then unlink build/bin/quests; fi
+ cd build/bin && ln -s ../../.devcontainer/repo/quests quests
+ @if [ -d build/bin/maps ]; then unlink build/bin/maps; fi
+ cd build/bin && ln -s ../../.devcontainer/repo/maps maps
+ @if [ -d build/bin/eqemu-definitions ]; then unlink build/bin/eqemu-definitions; fi
+ cd build/bin && ln -s ../../.devcontainer/repo/eqemu-definitions eqemu-definitions
+ @mkdir -p build/bin/quests/mods
+
+ @echo "Applying base links..."
+ cp -R -u -p utils/patches .devcontainer/base/
+ @if [ -d build/bin/assets/patches ]; then unlink build/bin/assets/patches; fi
+ cd build/bin/assets && ln -s ../../../.devcontainer/base/patches patches
+ @if [ -d build/bin/lua_modules ]; then unlink build/bin/lua_modules; fi
+ cd build/bin && ln -s ../../.devcontainer/repo/quests/lua_modules lua_modules
+ @if [ -d build/bin/mods ]; then unlink build/bin/mods; fi
+ cd build/bin && ln -s ../../.devcontainer/repo/quests/mods mods
+ @if [ -d build/bin/plugins ]; then unlink build/bin/plugins; fi
+ cd build/bin && ln -s ../../.devcontainer/repo/quests/plugins plugins
+
@echo "Eqemu is prepared. Edit build/bin/eqemu_config.json to configure."
-maps:
- @echo "Downloading maps..."
- @mkdir -p base/maps
- @cd base/maps && wget -nc https://github.com/Akkadius/eqemu-maps/archive/refs/heads/master.zip
- @cd base/maps && unzip -o master.zip
- @cd base/maps && mv eqemu-maps-master/* .
- @cd base/maps && rm -rf eqemu-maps-master
- @echo "Maps downloaded."
+is-vscode:
+ @if [ -z "$$REMOTE_CONTAINERS" ]; then \
+ echo "Not running in VS Code devcontainer"; \
+ exit 1; \
+ fi
-quests:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile quests --no-print-directory
- exit
-endif
- @cd build/bin && git clone https://github.com/ProjectEQ/projecteqquests.git quests
+clean: is-vscode
+ rm -rf build
+
+.PHONY: maps
+maps: is-vscode
+ @echo "Downloading maps..."
+ @mkdir -p .devcontainer/repo/maps
+ @cd .devcontainer/repo/maps && wget -nc https://github.com/EQEmu/maps/archive/refs/heads/master.zip
+ @cd .devcontainer/repo/maps && unzip -o master.zip
+ @cd .devcontainer/repo/maps && mv maps-master/* .
+ @cd .devcontainer/repo/maps && rm -rf maps-master
+ @echo "Maps downloaded."
# Runs tests
.PHONY: test
-test:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile test --no-print-directory
- exit
-endif
+test: is-vscode
cd build/bin && ./tests
# Runs login binary
.PHONY: login
-login:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile login --no-print-directory
- exit
-endif
+login: is-vscode check-mariadb
cd build/bin && ./loginserver
+.PHONY: hotfix
+hotfix: shared
+
# Runs shared_memory binary
.PHONY: shared
-shared:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile shared --no-print-directory
- exit
-endif
+shared: is-vscode check-mariadb
cd build/bin && ./shared_memory
# Runs zone binary
.PHONY: zone
-zone:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile zone --no-print-directory
- exit
-endif
- @-rm build/bin/logs/zone/zone*.log
+zone: is-vscode check-mariadb
+ @find build/bin/logs/zone/ -type f -name 'zone*.log' -exec rm -f {} +
cd build/bin && ./zone
+check-mariadb: is-vscode
+ @if ! sudo service mariadb status | grep -q 'active (running)'; then \
+ sudo service mariadb start; \
+ fi
+
# Runs world binary
.PHONY: world
-world:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile world --no-print-directory
- exit
-endif
- @-rm build/bin/logs/world*.log
+world: is-vscode check-mariadb
+ @find build/bin/logs/ -type f -name 'world*.log' -exec rm -f {} +
cd build/bin && ./world
# Runs ucs binary
.PHONY: ucs
-ucs:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile ucs --no-print-directory
- exit
-endif
- @-rm build/bin/logs/ucs*.log
+ucs: is-vscode check-mariadb
+ @find build/bin/logs/ -type f -name 'ucs*.log' -exec rm -f {} +
cd build/bin && ./ucs
# Runs queryserv binary
.PHONY: queryserv
-queryserv:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile queryserv --no-print-directory
- exit
-endif
- @-rm build/bin/logs/query_server*.log
+queryserv: is-vscode check-mariadb
+ @find build/bin/logs/ -type f -name 'query_server*.log' -exec rm -f {} +
cd build/bin && ./queryserv
-valgrind-%:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile valgrind --no-print-directory
- exit
-endif
+reset-content:
+ @echo "Resetting content tables in database peq..."
+ cd .devcontainer/cache/db/peq-dump && sudo mariadb --database peq -e "source create_tables_content.sql"
+
+valgrind-%: is-vscode
cd build/bin && valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --verbose --log-file=logs/$*.valgrind.log ./$*
# Start mariaDB standalone
@@ -201,30 +132,33 @@ mariadb:
.PHONY: inject-mariadb
inject-mariadb:
-sudo service mariadb start
- -mkdir -p base/db/
+ -mkdir -p .devcontainer/cache/db/
-sudo mariadb -e 'DROP DATABASE IF EXISTS peq;'
-sudo mariadb -e 'CREATE DATABASE peq;'
- -sudo mariadb -e "CREATE USER 'peq'@'127.0.0.1' IDENTIFIED BY 'peqpass';"
+ -sudo mariadb -e "CREATE USER IF NOT EXISTS 'peq'@'127.0.0.1' IDENTIFIED BY 'peqpass';"
-sudo mariadb -e "GRANT ALL PRIVILEGES ON *.* TO 'peq'@'127.0.0.1';"
-ifeq (,$(wildcard base/db/db.sql.zip))
- @echo "base/db.sql.zip not found. Downloading latest from https://db.projecteq.net/"
- wget -nc https://db.projecteq.net/latest -O base/db/db.sql.zip
- -cd base/db && unzip db.sql.zip
+ifeq (,$(wildcard .devcontainer/cache/db/db.sql.zip))
+ @echo ".devcontainer/cache/db.sql.zip not found. Downloading database from https://db.eqemu.dev/latest"
+ wget -nc https://db.eqemu.dev/latest -O .devcontainer/cache/db/db.sql.zip
+ -cd .devcontainer/cache/db && unzip db.sql.zip
endif
@echo "Sourcing db may take a while, please wait..."
- @cd base/db/peq-dump && sudo mariadb --database peq -e "source create_all_tables.sql"
+
+ @cd .devcontainer/cache/db/peq-dump && sudo mariadb --database peq -e "source create_tables_content.sql"
+ @cd .devcontainer/cache/db/peq-dump && sudo mariadb --database peq -e "source create_tables_login.sql"
+ @cd .devcontainer/cache/db/peq-dump && sudo mariadb --database peq -e "source create_tables_player.sql"
+ @# deprecated cd .devcontainer/cache/db/peq-dump && sudo mariadb --database peq -e "source create_tables_queryserv.sql"
+ @cd .devcontainer/cache/db/peq-dump && sudo mariadb --database peq -e "source create_tables_state.sql"
+ @cd .devcontainer/cache/db/peq-dump && sudo mariadb --database peq -e "source create_tables_system.sql"
+
@echo "MariaDB is now injected."
.PHONY: gm-%
-gm-%:
+gm-%: is-vscode
sudo mariadb --database peq -e "UPDATE account SET status=255 WHERE name = '$*';"
@echo "Account $* is now a GM. /camp to have it go into effect."
-depends:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile depends --no-print-directory
- exit
-endif
+depends: is-vscode
sudo apt install graphviz pip time
pip3 install graphviz
mkdir -p build/depends
@@ -241,44 +175,54 @@ endif
@echo "Common..."
time python3 build/depends/dependency_graph.py -f png common build/depends/common.dot
-backup:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile backup --no-print-directory
- exit
-endif
+backup: is-vscode
@mkdir -p build/bin/backup
cd build/bin && ./world database:dump --compress --player-tables --state-tables --system-tables --query-serv-tables
-cpu-zone:
+restore-%: is-vscode
+ @if [ -z "$*" ]; then \
+ echo "Please provide a backup file to restore from. Example: make restore-backup.sql"; \
+ exit 1; \
+ fi
+ @echo "Restoring from backup $*"
+ @sudo mariadb --database peq -e "$*"
+
+
+cpu-zone: is-vscode
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile cpu-zone --no-print-directory
+ @echo "This makefile is not intended to be run from the .devcontainer directory."
exit
endif
@cd build/bin && mkdir -p tmp
cd build/bin && CPUPROFILE=prof.out ./zone
-pprof-zone:
+pprof-zone: is-vscode
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile pprof-zone --no-print-directory
+ @echo "This makefile is not intended to be run from the .devcontainer directory."
exit
endif
cd build/bin && google-pprof --pdf zone prof.out > prof.pdf
-pprof-web-zone:
+
+pprof-gv-zone: is-vscode
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile pprof-web-zone --no-print-directory
- exit
-endif
- cd build/bin && google-pprof --web zone prof.out
-pprof-gv-zone:
-ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile pprof-gv-zone --no-print-directory
+ @echo "This makefile is not intended to be run from the .devcontainer directory."
exit
endif
cd build/bin && google-pprof --gv zone prof.out > prof.gv
-heap-zone:
+
+heap-zone: is-vscode
ifeq ($(findstring .devcontainer,$(CURDIR)),.devcontainer)
- @make -C ../ -f .devcontainer/Makefile heap-zone --no-print-directory
+ @echo "This makefile is not intended to be run from the .devcontainer directory."
exit
endif
@cd build/bin && mkdir -p tmp
cd build/bin && HEAPPROFILE=prof.out ./zone
+
+
+.PHONY: pull
+pull:
+ git pull
+ @if [ ! -d "quests" ]; then git clone https://github.com/rebuildeq/quests.git quests; fi
+ cd quests && git pull
+ @if [ ! -d "eqemu-definitions" ]; then git clone https://github.com/xackery/eqemu-definitions.git eqemu-definitions; fi
+ cd eqemu-definitions && git pull
\ No newline at end of file
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index d6ccc7265..90ec8234c 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -40,10 +40,41 @@
"GitHub.copilot",
"xackery.make-magic",
"Gruntfuggly.todo-tree",
- "ms-vscode.cmake-tools"
- ]
+ "ms-vscode.cmake-tools",
+ "sumneko.lua"
+ ],
+ "settings": {
+ "Lua.runtime.version": "Lua 5.1",
+ "Lua.workspace.library": [
+ "/src/repo/eqemu-definitions"
+ ],
+ "Lua.diagnostics.disable": [
+ "lowercase-global"
+ ],
+ "cmake.statusbar.advanced": {
+ "kit": {
+ "visibility": "hidden"
+ },
+ "debug": {
+ "visibility": "hidden"
+ },
+ "buildTarget": {
+ "visibility": "compact"
+ },
+ "launch": {
+ "visibility": "hidden"
+ },
+ "ctest": {
+ "visibility": "icon"
+ }
+ }
+ }
}
},
+ "mounts": [
+ "source=${localWorkspaceFolder}/.devcontainer/Makefile,target=/src/Makefile,type=bind,consistency=cached"
+ ],
+
"workspaceFolder": "/src",
"workspaceMount": "source=${localWorkspaceFolder},target=/src,type=bind,consistency=cached"
}
\ No newline at end of file
diff --git a/.drone.yml b/.drone.yml
deleted file mode 100644
index 7a5443d4c..000000000
--- a/.drone.yml
+++ /dev/null
@@ -1,98 +0,0 @@
----
-
-kind: pipeline
-type: docker
-name: Build Linux
-
-# Limits how many of these builds can run on the drone runner at a time, this isn't about cores
-concurrency:
- limit: 1
-
-volumes:
- - name: cache
- host:
- path: /var/lib/cache-release
-
-steps:
- - name: Build Linux X64
- image: akkadius/eqemu-server:v14
- environment:
- GITHUB_TOKEN:
- from_secret: GH_RELEASE_GITHUB_API_TOKEN
- RCLONE_CONFIG_REMOTE_TYPE: ftp
- RCLONE_FTP_HOST: drone.akkadius.com
- RCLONE_FTP_USER: artifacts
- RCLONE_FTP_PASS:
- from_secret: RCLONE_FTP_PASS
- commands:
- - ./utils/scripts/build/linux-build.sh
- volumes:
- - name: cache
- path: /home/eqemu/.ccache/
-
----
-
-kind: pipeline
-type: exec
-name: Build Windows
-
-# Limits how many of these builds can run on the drone runner at a time, this isn't about cores
-concurrency:
- limit: 1
-
-platform:
- os: windows
- arch: amd64
-
-steps:
- - name: Build Windows X64
- environment:
- RCLONE_CONFIG_REMOTE_TYPE: ftp
- RCLONE_FTP_HOST: drone.akkadius.com
- RCLONE_FTP_USER: artifacts
- RCLONE_FTP_PASS:
- from_secret: RCLONE_FTP_PASS
- GITHUB_TOKEN:
- from_secret: GH_RELEASE_GITHUB_API_TOKEN
- commands:
- - .\utils\scripts\build\windows-build.ps1
-
----
-
-kind: pipeline
-type: docker
-name: Publish Artifacts to Github
-
-steps:
- - name: Upload Artifacts
- image: akkadius/eqemu-build-releaser:v3
- environment:
- RCLONE_CONFIG_REMOTE_TYPE: ftp
- RCLONE_FTP_HOST: drone.akkadius.com
- RCLONE_FTP_USER: artifacts
- RCLONE_FTP_PASS:
- from_secret: RCLONE_FTP_PASS
- GH_RELEASE_GITHUB_API_TOKEN:
- from_secret: GH_RELEASE_GITHUB_API_TOKEN
- GITHUB_TOKEN:
- from_secret: GH_RELEASE_GITHUB_API_TOKEN
- commands:
- - ./utils/scripts/build/should-release/should-release
- - rclone config create remote ftp env_auth true > /dev/null
- - |
- rclone copy remote: --include "eqemu-server*.zip" .
- - gh-release --assets=eqemu-server-linux-x64.zip,eqemu-server-windows-x64.zip -y
- - |
- rclone delete remote: --include "eqemu-server*.zip"
-
-trigger:
- branch:
- - master
- event:
- - push
-
-depends_on:
- - Build Windows
- - Build Linux
-
-
diff --git a/.editorconfig b/.editorconfig
index 03f782494..e181959dc 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -3,9 +3,7 @@
# top-most EditorConfig file
root = true
-# Unix-style newlines with a newline ending every file
[*]
-end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
@@ -20,4 +18,4 @@ indent_style = tab
# Tab indentation (no size specified)
[Makefile]
-indent_style = tab
\ No newline at end of file
+indent_style = tab
diff --git a/.gitattributes b/.gitattributes
index c89cdbf70..1202f6415 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -20,7 +20,3 @@
*.css text
*.js text
*.types text
-
-*.vcproj text merge=union
-*.csproj text merge=union
-*.sln text merge=union eol=crlf
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
new file mode 100644
index 000000000..adcdf726a
--- /dev/null
+++ b/.github/workflows/build.yaml
@@ -0,0 +1,81 @@
+name: Build
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+
+jobs:
+ linux:
+ name: Linux
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout source
+ uses: actions/checkout@v5
+ with:
+ submodules: recursive
+
+ - name: Setup ccache
+ uses: hendrikmuhs/ccache-action@v1.2
+ with:
+ key: ${{ runner.os }}-ccache
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y build-essential ninja-build ccache uuid-dev
+
+ - name: Configure
+ run: |
+ cmake -S . -B build -G Ninja \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
+ -DEQEMU_BUILD_TESTS=ON \
+ -DEQEMU_BUILD_LOGIN=ON \
+ -DEQEMU_BUILD_LUA=ON \
+ -DEQEMU_BUILD_PERL=ON \
+ -DEQEMU_BUILD_CLIENT_FILES=ON
+
+ - name: Build
+ run: cmake --build build --parallel
+
+ - name: Test
+ working-directory: build
+ run: ./bin/tests
+
+ windows:
+ name: Windows
+ runs-on: windows-latest
+ steps:
+ - name: Checkout source
+ uses: actions/checkout@v5
+ with:
+ submodules: recursive
+
+ - name: Enable long paths
+ run: git config --global core.longpaths true
+
+ - name: Setup MSVC environment
+ uses: ilammy/msvc-dev-cmd@v1
+ with:
+ arch: x64
+
+ - name: Configure
+ shell: pwsh
+ run: |
+ cmake -S . -B build -G "Visual Studio 17 2022" -A x64 `
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo `
+ -DEQEMU_BUILD_TESTS=ON `
+ -DEQEMU_BUILD_LOGIN=ON `
+ -DEQEMU_BUILD_LUA=ON `
+ -DEQEMU_BUILD_ZLIB=ON `
+ -DEQEMU_BUILD_CLIENT_FILES=ON
+
+ - name: Build
+ shell: pwsh
+ run: cmake --build build --config RelWithDebInfo --target ALL_BUILD -- /m
+
+ - name: Test
+ working-directory: build
+ run: ./bin/RelWithDebInfo/tests.exe
diff --git a/.gitmodules b/.gitmodules
index c9c3988cb..b7f3564e5 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,18 +1,6 @@
-[submodule "submodules/glm"]
- path = submodules/glm
- url = https://github.com/g-truc/glm.git
-[submodule "submodules/fmt"]
- path = submodules/fmt
- url = https://github.com/fmtlib/fmt.git
-[submodule "submodules/libuv"]
- path = submodules/libuv
- url = https://github.com/libuv/libuv.git
-[submodule "submodules/cereal"]
- path = submodules/cereal
- url = https://github.com/USCiLab/cereal.git
[submodule "submodules/websocketpp"]
path = submodules/websocketpp
url = https://github.com/zaphoyd/websocketpp.git
-[submodule "submodules/recastnavigation"]
- path = submodules/recastnavigation
- url = https://github.com/EQEmu/recastnavigation.git
+[submodule "submodules/vcpkg"]
+ path = submodules/vcpkg
+ url = https://github.com/microsoft/vcpkg.git
diff --git a/.vscode/settings.json b/.vscode/settings.json
index bf5c79fae..8bdf6f6fa 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -21,14 +21,6 @@
"${workspaceFolder}/dependencies/zlibng"
],
"telemetry.enableTelemetry": false,
- "cmake.buildDirectory": "${workspaceFolder}/build",
- "cmake.configureArgs": [
- "-DEQEMU_BUILD_LOGIN=ON",
- "-DEQEMU_BUILD_TESTS=ON",
- "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache",
- "-DEQEMU_ADD_PROFILER=ON",
- "Ninja"
- ],
"cmake.skipConfigureIfCachePresent": true,
"cmake.configureOnOpen": false,
"files.associations": {
@@ -115,22 +107,5 @@
"format": "cpp",
"ranges": "cpp",
"span": "cpp"
- },
- "cmake.statusbar.advanced": {
- "kit": {
- "visibility": "hidden",
- },
- "debug": {
- "visibility": "hidden",
- },
- "buildTarget": {
- "visibility": "hidden",
- },
- "launch": {
- "visibility": "hidden",
- },
- "ctest": {
- "visibility": "icon",
- }
}
}
\ No newline at end of file
diff --git a/BUILD.md b/BUILD.md
index c1051f2b6..a49192a96 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -4,46 +4,35 @@ This guide is far from exhaustive, you should expect to have some experience wit
### CMake
-EQEmu uses CMake as the build system on all platforms. You will need CMake 3.2 or higher to build from source.
+EQEmu uses CMake as the build system on all platforms. You will need CMake 3.20 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")
+- uuid (unix)
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
+ sudo apt-get install libperl-dev uuid-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 -DCMAKE_TOOLCHAIN_FILE="c:/projects/eqemu/vcpkg/vcpkg-export-20180828-145455/scripts/buildsystems/vcpkg.cmake" ..
+ cmake -G "Visual Studio 15 2022 Win64" -DEQEMU_BUILD_TESTS=ON -DEQEMU_BUILD_LOGIN=ON ..
##### Linux
-Similarly to Windows running CMake on Linux is simple it just omits the toolchain file and uses a different generator.
+Similarly to Windows running CMake on Linux is simple it just uses a different generator.
mkdir build
cd build
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 59279caa8..a831e2126 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,490 +1,187 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
+cmake_minimum_required(VERSION 3.20.0)
-SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
+set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/" ${CMAKE_MODULE_PATH})
-IF(POLICY CMP0074)
- CMAKE_POLICY(SET CMP0074 NEW)
-ENDIF()
+if(NOT CMAKE_TOOLCHAIN_FILE)
+ if(DEFINED ENV{VCPKG_ROOT})
+ message(STATUS "Using vcpkg from VCPKG_ROOT")
+ set(CMAKE_TOOLCHAIN_FILE
+ "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
+ CACHE FILEPATH "Vcpkg toolchain file"
+ )
+ else()
+ message(STATUS "Using vcpkg submodule")
+ set(CMAKE_TOOLCHAIN_FILE
+ "${CMAKE_CURRENT_SOURCE_DIR}/submodules/vcpkg/scripts/buildsystems/vcpkg.cmake"
+ CACHE FILEPATH "Vcpkg toolchain file"
+ )
+ endif()
+endif()
-PROJECT(EQEmu)
+project(EQEmu
+ VERSION 24.10.3
+ LANGUAGES CXX
+)
-IF(NOT CMAKE_BUILD_TYPE)
- SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build." FORCE)
-ENDIF(NOT CMAKE_BUILD_TYPE)
+set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-SET(CMAKE_CXX_STANDARD 20)
-SET(CMAKE_CXX_STANDARD_REQUIRED ON)
-SET(CMAKE_CXX_EXTENSIONS OFF)
+#explicitly set CMP0167 for Find Boost
+if(POLICY CMP0167)
+ cmake_policy(SET CMP0167 NEW)
+endif()
-OPTION(EQEMU_BUILD_STATIC "Build with static linking" OFF)
-OPTION(EQEMU_BUILD_PCH "Build with precompiled headers (Windows)" ON)
+if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build type")
+endif()
-IF (EQEMU_BUILD_STATIC)
- SET(BUILD_SHARED_LIBS OFF)
- SET(CMAKE_FIND_LIBRARY_SUFFIXES ".lib" ".a")
- MESSAGE(STATUS "Building with static linking")
- SET(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
- IF (UNIX)
- SET(PERL_LIBRARY "/opt/eqemu-perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/libperl.so")
- SET(PERL_INCLUDE_PATH "/opt/eqemu-perl/lib/5.32.1/x86_64-linux-thread-multi/CORE/")
- SET(PERL_EXECUTABLE "/opt/eqemu-perl/bin/perl")
- ENDIF ()
-ENDIF (EQEMU_BUILD_STATIC)
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+option(EQEMU_BUILD_PCH "Build with precompiled headers (Windows)" ON)
-# Requires libgoogle-perftools-dev google-perftools packages for linux (debian)
-IF(EQEMU_ADD_PROFILER)
- SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed,-lprofiler,--as-needed")
-ENDIF(EQEMU_ADD_PROFILER)
-
-IF(USE_MAP_MMFS)
- ADD_DEFINITIONS(-DUSE_MAP_MMFS)
-ENDIF (USE_MAP_MMFS)
-
-IF(MSVC)
+if(MSVC)
add_compile_options(/bigobj)
- ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
- ADD_DEFINITIONS(-DNOMINMAX)
- ADD_DEFINITIONS(-DCRASH_LOGGING)
- ADD_DEFINITIONS(-D_HAS_AUTO_PTR_ETC) # for Luabind on C++17
+ add_compile_definitions(_CRT_SECURE_NO_WARNINGS NOMINMAX CRASH_LOGGING _HAS_AUTO_PTR_ETC)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
- SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
+ option(EQEMU_DISABLE_MSVC_WARNINGS "Disable MSVC compile warnings." ON)
+ if(EQEMU_DISABLE_MSVC_WARNINGS)
+ add_compile_options(/W0 /wd4005 /wd4996 /nologo /Os)
+ endif()
- OPTION(EQEMU_DISABLE_MSVC_WARNINGS "Disable MSVC compile warnings." ON)
- IF(EQEMU_DISABLE_MSVC_WARNINGS)
- ADD_DEFINITIONS( "/W0 /D_CRT_SECURE_NO_WARNINGS /wd4005 /wd4996 /nologo /Os")
- ENDIF(EQEMU_DISABLE_MSVC_WARNINGS)
-ELSE(MSVC)
- ADD_DEFINITIONS(-DHAS_UNION_SEMUN)
-ENDIF(MSVC)
+ option(EQEMU_MSVC_DEBUG_CRT "Use the debug CRT on MSVC debug builds" OFF)
+ if(EQEMU_MSVC_DEBUG_CRT)
+ add_compile_definitions(_CRT_DBG_MAP_ALLOC)
+ endif()
+else()
+ add_compile_definitions(HAS_UNION_SEMUN)
+endif()
#FreeBSD support
-IF(UNIX)
- IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
- ADD_DEFINITIONS(-DFREEBSD)
- ADD_DEFINITIONS(-D_GLIBCXX_USE_C99)
- SET(FREEBSD TRUE)
- ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
- IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
- ADD_DEFINITIONS(-DDARWIN)
- SET(DARWIN TRUE)
- ENDIF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
-ENDIF(UNIX)
+if(UNIX)
+ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ add_compile_definitions(FREEBSD)
+ add_compile_definitions(_GLIBCXX_USE_C99)
+ set(FREEBSD TRUE)
+ endif()
+ if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ add_compile_definitions(DARWIN)
+ set(DARWIN TRUE)
+ endif()
+endif()
-ADD_DEFINITIONS(-DGLM_FORCE_RADIANS)
-ADD_DEFINITIONS(-DGLM_FORCE_CTOR_INIT)
-ADD_DEFINITIONS(-DGLM_ENABLE_EXPERIMENTAL)
+find_package(Boost REQUIRED COMPONENTS dynamic_bitset foreach tuple)
+find_package(cereal CONFIG REQUIRED)
+find_package(fmt CONFIG REQUIRED)
+find_package(glm CONFIG REQUIRED)
+find_package(unofficial-libmariadb CONFIG REQUIRED)
+find_package(libuv CONFIG REQUIRED)
+find_package(OpenSSL REQUIRED)
+find_package(recastnavigation CONFIG REQUIRED)
+find_package(ZLIB REQUIRED)
+find_package(LuaJit REQUIRED)
+find_package(unofficial-sodium CONFIG REQUIRED)
+find_package(PerlLibs)
-#MSVC can fetch dependencies automatically.
-IF(MSVC)
- INCLUDE("${CMAKE_SOURCE_DIR}/cmake/DependencyHelperMSVC.cmake")
-ENDIF()
+message(STATUS "**************************************************")
+message(STATUS "* Library Detection *")
+message(STATUS "**************************************************")
-#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)
+if(MARIADB_FOUND)
+ message(STATUS "* MariaDB: FOUND *")
+else()
+ message(STATUS "* MariaDB: MISSING *")
+endif()
-MESSAGE(STATUS "**************************************************")
-MESSAGE(STATUS "* Library Detection *")
-MESSAGE(STATUS "**************************************************")
+if(ZLIB_FOUND)
+ message(STATUS "* ZLIB: FOUND *")
+else()
+ message(STATUS "* ZLIB: MISSING *")
+endif()
-IF(MYSQL_FOUND)
- MESSAGE(STATUS "* MySQL: FOUND *")
-ELSE()
- MESSAGE(STATUS "* MySQL: MISSING *")
-ENDIF()
+if(LuaJit_FOUND)
+ message(STATUS "* LuaJIT: FOUND *")
+else()
+ message(STATUS "* LuaJIT: MISSING *")
+endif()
-IF(MARIADB_FOUND)
- MESSAGE(STATUS "* MariaDB: FOUND *")
-ELSE()
- MESSAGE(STATUS "* MariaDB: MISSING *")
-ENDIF()
+if(PerlLibs_FOUND)
+ message(STATUS "* Perl: FOUND *")
+else()
+ message(STATUS "* Perl: MISSING *")
+endif()
-IF(ZLIB_FOUND)
- MESSAGE(STATUS "* ZLIB: FOUND *")
-ELSE()
- MESSAGE(STATUS "* ZLIB: MISSING *")
-ENDIF()
+if(OpenSSL_FOUND)
+ message(STATUS "* OpenSSL: FOUND *")
+else()
+ message(STATUS "* OpenSSL: MISSING *")
+endif()
-IF(Lua51_FOUND)
- MESSAGE(STATUS "* Lua: FOUND *")
-ELSE()
- MESSAGE(STATUS "* Lua: MISSING *")
-ENDIF()
-
-IF(LuaJit_FOUND)
- MESSAGE(STATUS "* LuaJIT: FOUND *")
-ELSE()
- MESSAGE(STATUS "* LuaJIT: MISSING *")
-ENDIF()
-
-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 "PERL_INCLUDE_PATH: ${PERL_INCLUDE_PATH}")
-MESSAGE(STATUS "PERL_LIBRARY: ${PERL_LIBRARY}")
-MESSAGE(STATUS "PERL_INCLUDE_DIR: ${PERL_INCLUDE_DIR}")
-MESSAGE(STATUS "PERL_INCLUDE_DIRS: ${PERL_INCLUDE_DIRS}")
-MESSAGE(STATUS "PERL_LIBRARIES: ${PERL_LIBRARIES}")
-MESSAGE(STATUS "PERL_VERSION: ${PERL_VERSION}")
-
-MESSAGE(STATUS "**************************************************")
+message(STATUS "PERL_INCLUDE_PATH: ${PERL_INCLUDE_PATH}")
+message(STATUS "PERL_LIBRARY: ${PERL_LIBRARY}")
+message(STATUS "PERL_INCLUDE_DIR: ${PERL_INCLUDE_DIR}")
+message(STATUS "PERL_INCLUDE_DIRS: ${PERL_INCLUDE_DIRS}")
+message(STATUS "PERL_LIBRARIES: ${PERL_LIBRARIES}")
+message(STATUS "PERL_VERSION: ${PERL_VERSION}")
+message(STATUS "**************************************************")
#options
-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)
+option(EQEMU_BUILD_SERVER "Build the game server." ON)
+option(EQEMU_BUILD_LOGIN "Build the login server." ON)
+option(EQEMU_BUILD_TESTS "Build utility tests." OFF)
+option(EQEMU_BUILD_CLIENT_FILES "Build Client Import/Export Data Programs." ON)
-#PRNG options
-OPTION(EQEMU_ADDITIVE_LFIB_PRNG "Use Additive LFib for PRNG." OFF)
-MARK_AS_ADVANCED(EQEMU_ADDITIVE_LFIB_PRNG)
-OPTION(EQEMU_BIASED_INT_DIST "Use biased int dist instead of uniform." OFF)
-MARK_AS_ADVANCED(EQEMU_BIASED_INT_DIST)
-SET(EQEMU_CUSTOM_PRNG_ENGINE "" CACHE STRING "Custom random engine. (ex. std::default_random_engine)")
-MARK_AS_ADVANCED(EQEMU_CUSTOM_PRNG_ENGINE)
+if(PerlLibs_FOUND)
+ option(EQEMU_BUILD_PERL "Build Perl parser." ON)
-IF(CMAKE_COMPILER_IS_GNUCXX)
- OPTION(EQEMU_SFMT19937 "Use GCC's extention for SIMD Fast MT19937." OFF)
- MARK_AS_ADVANCED(EQEMU_SFMT19937)
-ENDIF()
+ if(EQEMU_BUILD_PERL)
+ set(PERL_LIBRARY_TYPE " Perl")
+ else()
+ set(PERL_LIBRARY_TYPE " Missing")
+ endif()
+else()
+ set(PERL_LIBRARY_TYPE "Disabled")
+endif()
-IF(EQEMU_ADDITIVE_LFIB_PRNG)
- ADD_DEFINITIONS(-DUSE_ADDITIVE_LFIB_PRNG)
- IF(EQEMU_SFMT19937)
- MESSAGE(STATUS "SFMT19937 and ADDITITVE_LFIB_PRNG both set, SFMT19937 ignored.")
- SET(EQEMU_SFMT19937 OFF)
- ENDIF()
- IF(NOT EQEMU_CUSTOM_PRNG_ENGINE STREQUAL "")
- MESSAGE(STATUS "CUSTOM_PRNG_ENGINE and ADDITITVE_LFIB_PRNG both set, CUSTOM_PRNG_ENGINE ignored.")
- SET(EQEMU_CUSTOM_PRNG_ENGINE "")
- ENDIF()
-ENDIF()
+message(STATUS "")
+message(STATUS "**************************************************")
+message(STATUS "* Library Usage *")
+message(STATUS "**************************************************")
+message(STATUS "* Database: MariaDB *")
+message(STATUS "* TLS: OpenSSL *")
+message(STATUS "* Lua: LuaJIT *")
+message(STATUS "* Perl: ${PERL_LIBRARY_TYPE} *")
+message(STATUS "* zlib: ZLIB *")
+message(STATUS "**************************************************")
-IF(EQEMU_SFMT19937)
- ADD_DEFINITIONS(-DUSE_SFMT19937)
- IF(NOT EQEMU_CUSTOM_PRNG_ENGINE STREQUAL "")
- MESSAGE(STATUS "CUSTOM_PRNG_ENGINE and SFMT19937 both set, CUSTOM_PRNG_ENGINE ignored.")
- SET(EQEMU_CUSTOM_PRNG_ENGINE "")
- ENDIF()
-ENDIF()
-IF(NOT EQEMU_CUSTOM_PRNG_ENGINE STREQUAL "")
- ADD_DEFINITIONS(-DUSE_CUSTOM_PRNG_ENGINE=${EQEMU_CUSTOM_PRNG_ENGINE})
-ENDIF()
+option(EQEMU_BUILD_LUA "Build Lua parser." ON)
-IF(EQEMU_BIASED_INT_DIST)
- ADD_DEFINITIONS(-DBIASED_INT_DIST)
-ENDIF()
+if(EQEMU_BUILD_SERVER OR EQEMU_BUILD_LOGIN OR EQEMU_BUILD_TESTS OR EQEMU_BUILD_CLIENT_FILES)
+ add_subdirectory(common)
+ add_subdirectory(libs)
+else()
+ message(FATAL_ERROR "No targets were selected to build, we must build at least one target.")
+endif()
-IF(EQEMU_COMMANDS_LOGGING)
- ADD_DEFINITIONS(-DCOMMANDS_LOGGING)
-ENDIF(EQEMU_COMMANDS_LOGGING)
+if(EQEMU_BUILD_SERVER)
+ add_subdirectory(shared_memory)
+ add_subdirectory(world)
+ add_subdirectory(zone)
+ add_subdirectory(ucs)
+ add_subdirectory(queryserv)
+ add_subdirectory(eqlaunch)
+endif()
-#database
-IF(MySQL_FOUND AND MariaDB_FOUND)
- SET(DATABASE_LIBRARY_SELECTION MariaDB CACHE STRING "Database library to use:
- MySQL
- MariaDB"
- )
+if(EQEMU_BUILD_LOGIN)
+ add_subdirectory(loginserver)
+endif()
- 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(EQEMU_BUILD_TESTS)
+ add_subdirectory(tests)
+endif()
-#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(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)
- IF(${OPENSSL_VERSION} VERSION_GREATER_EQUAL "1.1.1")
- ADD_DEFINITIONS(-DCPPHTTPLIB_OPENSSL_SUPPORT)
- ENDIF()
- 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()
- 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)
- IF(${OPENSSL_VERSION} VERSION_GREATER_EQUAL "1.1.1")
- ADD_DEFINITIONS(-DCPPHTTPLIB_OPENSSL_SUPPORT)
- ENDIF()
-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()
- SET(ZLIB_LIBRARY_TYPE "zlib-ng")
- SET(ZLIB_LIBRARY_LIBS "zlibstatic")
- SET(ZLIB_LIBRARY_INCLUDE "${CMAKE_CURRENT_SOURCE_DIR}/libs/zlibng")
-ENDIF()
-
-IF (EQEMU_BUILD_STATIC)
- SET(ZLIB_LIBRARY_LIBS libz.a)
-ENDIF(EQEMU_BUILD_STATIC)
-
-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 "**************************************************")
-
-#setup server libs and headers
-SET(SERVER_LIBS common ${DATABASE_LIBRARY_LIBS} ${ZLIB_LIBRARY_LIBS} ${Boost_LIBRARIES} uv_a fmt RecastNavigation::Detour)
-
-set(FMT_HEADER_ONLY OFF)
-
-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")
-INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/libuv/include" )
-INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigation/DebugUtils/Include")
-INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigation/Detour/Include")
-INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigation/DetourCrowd/Include")
-INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigation/DetourTileCache/Include")
-INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/recastnavigation/Recast/Include")
-INCLUDE_DIRECTORIES(SYSTEM "${CMAKE_CURRENT_SOURCE_DIR}/submodules/websocketpp")
-
-# silence obnoxious deprecation message
-ADD_DEFINITIONS(-DBOOST_BIND_GLOBAL_PLACEHOLDERS)
-
-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} perlbind)
- INCLUDE_DIRECTORIES(SYSTEM "${PERL_LIBRARY_INCLUDE}")
- ADD_DEFINITIONS(-DEMBPERL)
- ADD_DEFINITIONS(-DEMBPERL_PLUGIN)
- ADD_DEFINITIONS(-DPERLBIND_NO_STRICT_SCALAR_TYPES)
- IF (UNIX AND EQEMU_BUILD_STATIC)
- SET(SERVER_LIBS ${SERVER_LIBS} libcrypt.a)
- ENDIF ()
- 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)
-
- 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)
- ADD_SUBDIRECTORY(zone)
- ADD_SUBDIRECTORY(ucs)
- ADD_SUBDIRECTORY(queryserv)
- ADD_SUBDIRECTORY(eqlaunch)
-ENDIF(EQEMU_BUILD_SERVER)
-
-IF(EQEMU_BUILD_LOGIN)
- ADD_SUBDIRECTORY(loginserver)
-ENDIF(EQEMU_BUILD_LOGIN)
-
-IF(EQEMU_BUILD_HC)
- ADD_SUBDIRECTORY(hc)
-ENDIF(EQEMU_BUILD_HC)
-
-IF(EQEMU_BUILD_TESTS)
- ADD_SUBDIRECTORY(tests)
-ENDIF(EQEMU_BUILD_TESTS)
-
-IF(EQEMU_BUILD_CLIENT_FILES)
- ADD_SUBDIRECTORY(client_files)
-ENDIF(EQEMU_BUILD_CLIENT_FILES)
+if(EQEMU_BUILD_CLIENT_FILES)
+ add_subdirectory(client_files)
+endif()
diff --git a/CMakePresets.json b/CMakePresets.json
new file mode 100644
index 000000000..aa1a29453
--- /dev/null
+++ b/CMakePresets.json
@@ -0,0 +1,49 @@
+{
+ "version": 3,
+ "cmakeMinimumRequired": {
+ "major": 3,
+ "minor": 19,
+ "patch": 0
+ },
+ "configurePresets": [
+ {
+ "name": "linux-debug",
+ "displayName": "Linux Debug",
+ "generator": "Ninja",
+ "binaryDir": "${sourceDir}/build",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Debug",
+ "CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
+ "CMAKE_C_COMPILER_LAUNCHER": "ccache",
+ "CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
+ "EQEMU_BUILD_LOGIN": "ON",
+ "EQEMU_BUILD_TESTS": "ON",
+ "EQEMU_ADD_PROFILER": "ON"
+ }
+ },
+ {
+ "name": "linux-release",
+ "displayName": "Linux Release",
+ "generator": "Ninja",
+ "binaryDir": "${sourceDir}/build/release",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Release",
+ "CMAKE_C_COMPILER_LAUNCHER": "ccache",
+ "CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
+ "EQEMU_BUILD_LOGIN": "ON"
+ }
+ },
+ {
+ "name": "win-msvc",
+ "displayName": "Windows MSVC (VS 2022)",
+ "generator": "Visual Studio 17 2022",
+ "binaryDir": "${sourceDir}/build/{presetName}",
+ "architecture": { "value": "x64" },
+ "cacheVariables": {
+ "CMAKE_CONFIGURATION_TYPES": "Debug;Release",
+ "EQEMU_BUILD_LOGIN": "ON",
+ "EQEMU_BUILD_TESTS": "ON"
+ }
+ }
+ ]
+}
\ No newline at end of file
diff --git a/README.md b/README.md
index 033fcccab..b2ad64e4c 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
EQEmulator Server Platform
-
+
@@ -9,17 +9,17 @@
-
+
+
-
-
-
-
-
-
+
+
+
+
+
-
+
@@ -121,30 +121,30 @@ Every system, packet, opcode, and game mechanic has been reconstructed through c
| Resource | Badges | Link |
|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|
-| **EQEmulator Docs** | [](https://docs.eqemu.io) | [docs.eqemu.io](https://docs.eqemu.io/) |
+| **EQEmulator Docs** | [](https://docs.eqemu.dev) | [docs.eqemu.dev](https://docs.eqemu.dev/) |
| **Discord Community**| [](https://discord.gg/QHsm7CD) | [Join Discord](https://discord.gg/QHsm7CD) |
-| **Latest Release** | [](https://github.com/eqemu/server/releases)
[](https://github.com/EQEmu/Server/releases)
[](https://github.com/eqemu/server/releases) | [View Releases](https://github.com/eqemu/server/releases) |
-| **License** | [](./LICENSE) | [View License](./LICENSE) |
-| **Build Status** | [](http://drone.akkadius.com/EQEmu/Server) | [View Build Status](http://drone.akkadius.com/EQEmu/Server) |
+| **Latest Release** | [](https://github.com/EQEmu/EQEmu/releases)
[](https://github.com/EQEmu/EQEmu/releases)
[](https://github.com/EQEmu/EQEmu/releases) | [View Releases](https://github.com/EQEmu/EQEmu/releases) |
+| **License** | [](./LICENSE) | [View License](./LICENSE) |
+| **Build Status** | [](https://github.com/EQEmu/EQEmu/actions/workflows/build.yaml) | [View Build Status](https://github.com/EQEmu/EQEmu/actions/workflows/build.yaml) |
| **Docker Pulls** | [](https://hub.docker.com/r/akkadius/eqemu-server) | [Docker Hub](https://hub.docker.com/r/akkadius/eqemu-server) |
-| **Contributions** | [](https://github.com/eqemu/server/pulls?q=is%3Apr+is%3Aclosed) | [Closed PRs & Issues](https://github.com/eqemu/server/pulls?q=is%3Apr+is%3Aclosed) |
+| **Contributions** | [](https://github.com/EQEmu/EQEmu/pulls?q=is%3Apr+is%3Aclosed) | [Closed PRs & Issues](https://github.com/EQEmu/EQEmu/pulls?q=is%3Apr+is%3Aclosed) |
## 🛠️ Getting Started
-If you want to set up your own EQEmulator server, please refer to the current [server installation guides](https://docs.eqemu.io/#server-installation). We've had 100,000s of players and developers use our guides to set up their own servers, and we hope you will too!
+If you want to set up your own EQEmulator server, please refer to the current [server installation guides](https://docs.eqemu.dev/#server-installation). We've had 100,000s of players and developers use our guides to set up their own servers, and we hope you will too!
## 🗂️ Related Repositories
| Repository | Description |
|--------------------|----------------------------------------------------------------------------------|
| [ProjectEQ Quests](https://github.com/ProjectEQ/projecteqquests) | Official quests and event scripts for ProjectEQ |
-| [Maps](https://github.com/Akkadius/EQEmuMaps) | EQEmu-compatible zone maps |
+| [Maps](https://github.com/EQEmu/maps) | EQEmu-compatible zone maps |
| [Installer Resources](https://github.com/Akkadius/EQEmuInstall) | Scripts and assets for setting up EQEmu servers |
| [Zone Utilities](https://github.com/EQEmu/zone-utilities) | Utilities for parsing, rendering, and manipulating EQ zone files |
## Contributors
-
-
+
+
diff --git a/client_files/CMakeLists.txt b/client_files/CMakeLists.txt
index d4b5962e3..2fec654cf 100644
--- a/client_files/CMakeLists.txt
+++ b/client_files/CMakeLists.txt
@@ -1,4 +1,4 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
+cmake_minimum_required(VERSION 3.20)
add_subdirectory(import)
add_subdirectory(export)
diff --git a/client_files/export/CMakeLists.txt b/client_files/export/CMakeLists.txt
index b7f15dddb..c81977fb0 100644
--- a/client_files/export/CMakeLists.txt
+++ b/client_files/export/CMakeLists.txt
@@ -1,16 +1,18 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
+cmake_minimum_required(VERSION 3.20.0)
-SET(export_sources
+set(export_sources
main.cpp
)
-SET(export_headers
+set(export_headers
)
-ADD_EXECUTABLE(export_client_files ${export_sources} ${export_headers})
+add_executable(export_client_files ${export_sources} ${export_headers})
-INSTALL(TARGETS export_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+install(TARGETS export_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
-TARGET_LINK_LIBRARIES(export_client_files ${SERVER_LIBS})
+target_link_libraries(export_client_files common)
+target_include_directories(export_client_files PRIVATE ../..)
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set_property(TARGET export_client_files PROPERTY FOLDER executables/tools)
diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp
index 8d0a27a3c..333528b64 100644
--- a/client_files/export/main.cpp
+++ b/client_files/export/main.cpp
@@ -16,27 +16,26 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include
+#include "common/content/world_content_service.h"
+#include "common/crash.h"
+#include "common/eqemu_config.h"
+#include "common/eqemu_logsys.h"
+#include "common/events/player_event_logs.h"
+#include "common/evolving_items.h"
+#include "common/file.h"
+#include "common/path_manager.h"
+#include "common/platform.h"
+#include "common/repositories/base_data_repository.h"
+#include "common/repositories/db_str_repository.h"
+#include "common/repositories/skill_caps_repository.h"
+#include "common/repositories/spells_new_repository.h"
+#include "common/rulesys.h"
+#include "common/shareddb.h"
+#include "common/skill_caps.h"
+#include "common/strings.h"
+#include "common/zone_store.h"
-#include "../../common/eqemu_logsys.h"
-#include "../../common/global_define.h"
-#include "../../common/shareddb.h"
-#include "../../common/eqemu_config.h"
-#include "../../common/platform.h"
-#include "../../common/crash.h"
-#include "../../common/rulesys.h"
-#include "../../common/strings.h"
-#include "../../common/content/world_content_service.h"
-#include "../../common/zone_store.h"
-#include "../../common/path_manager.h"
-#include "../../common/repositories/base_data_repository.h"
-#include "../../common/repositories/db_str_repository.h"
-#include "../../common/repositories/skill_caps_repository.h"
-#include "../../common/repositories/spells_new_repository.h"
-#include "../../common/file.h"
-#include "../../common/events/player_event_logs.h"
-#include "../../common/skill_caps.h"
-#include "../../common/evolving_items.h"
+#include
void ExportSpells(SharedDatabase *db);
void ExportSkillCaps(SharedDatabase *db);
diff --git a/client_files/import/CMakeLists.txt b/client_files/import/CMakeLists.txt
index da08cda6e..7966eb3b3 100644
--- a/client_files/import/CMakeLists.txt
+++ b/client_files/import/CMakeLists.txt
@@ -1,16 +1,18 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
+cmake_minimum_required(VERSION 3.20.0)
-SET(import_sources
+set(import_sources
main.cpp
)
-SET(import_headers
+set(import_headers
)
-ADD_EXECUTABLE(import_client_files ${import_sources} ${import_headers})
+add_executable(import_client_files ${import_sources} ${import_headers})
-INSTALL(TARGETS import_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
+install(TARGETS import_client_files RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
-TARGET_LINK_LIBRARIES(import_client_files ${SERVER_LIBS})
+target_link_libraries(import_client_files common)
+target_include_directories(import_client_files PRIVATE ../..)
-SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set_property(TARGET import_client_files PROPERTY FOLDER executables/tools)
diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp
index b7be706d7..b09eba064 100644
--- a/client_files/import/main.cpp
+++ b/client_files/import/main.cpp
@@ -16,21 +16,20 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "../../common/eqemu_logsys.h"
-#include "../../common/global_define.h"
-#include "../../common/shareddb.h"
-#include "../../common/eqemu_config.h"
-#include "../../common/platform.h"
-#include "../../common/crash.h"
-#include "../../common/rulesys.h"
-#include "../../common/strings.h"
-#include "../../common/content/world_content_service.h"
-#include "../../common/zone_store.h"
-#include "../../common/path_manager.h"
-#include "../../common/repositories/base_data_repository.h"
-#include "../../common/file.h"
-#include "../../common/events/player_event_logs.h"
-#include "../../common/evolving_items.h"
+#include "common/content/world_content_service.h"
+#include "common/crash.h"
+#include "common/eqemu_config.h"
+#include "common/eqemu_logsys.h"
+#include "common/events/player_event_logs.h"
+#include "common/evolving_items.h"
+#include "common/file.h"
+#include "common/path_manager.h"
+#include "common/platform.h"
+#include "common/repositories/base_data_repository.h"
+#include "common/rulesys.h"
+#include "common/shareddb.h"
+#include "common/strings.h"
+#include "common/zone_store.h"
void ImportSpells(SharedDatabase *db);
void ImportSkillCaps(SharedDatabase *db);
diff --git a/cmake/DependencyHelperMSVC.cmake b/cmake/DependencyHelperMSVC.cmake
deleted file mode 100644
index 33f92e41b..000000000
--- a/cmake/DependencyHelperMSVC.cmake
+++ /dev/null
@@ -1,94 +0,0 @@
-OPTION(EQEMU_FETCH_MSVC_DEPENDENCIES_VCPKG "Automatically fetch vcpkg dependencies for MSCV" ON)
-OPTION(EQEMU_FETCH_MSVC_DEPENDENCIES_PERL "Automatically fetch perl dependencies for MSCV" ON)
-
-MARK_AS_ADVANCED(EQEMU_FETCH_MSVC_DEPENDENCIES_VCPKG)
-MARK_AS_ADVANCED(EQEMU_FETCH_MSVC_DEPENDENCIES_PERL)
-
-SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X86 "https://github.com/EQEmu/Server/releases/download/v1.2/vcpkg-export-x86.zip")
-SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X64 "https://github.com/EQEmu/Server/releases/download/v1.2/vcpkg-export-x64.zip")
-SET(EQEMU_MSVC_DEPENDENCIES_PERL_X86 "http://strawberryperl.com/download/5.24.4.1/strawberry-perl-5.24.4.1-32bit-portable.zip")
-SET(EQEMU_MSVC_DEPENDENCIES_PERL_X64 "http://strawberryperl.com/download/5.24.4.1/strawberry-perl-5.24.4.1-64bit-portable.zip")
-SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X86_ZIP "vcpkg-export-x86.zip")
-SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X64_ZIP "vcpkg-export-x64.zip")
-SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X86_DIR "vcpkg-export-x86")
-SET(EQEMU_MSVC_DEPENDENCIES_VCPKG_X64_DIR "vcpkg-export-x64")
-SET(EQEMU_MSVC_DEPENDENCIES_PERL_X86_ZIP "strawberry-perl-5.24.4.1-32bit-portable.zip")
-SET(EQEMU_MSVC_DEPENDENCIES_PERL_X64_ZIP "strawberry-perl-5.24.4.1-64bit-portable.zip")
-SET(EQEMU_MSVC_DEPENDENCIES_PERL_X86_DIR "x86")
-SET(EQEMU_MSVC_DEPENDENCIES_PERL_X64_DIR "x64")
-
-IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
- SET(EQEMU_VCPKG_URL ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X64})
- SET(EQEMU_PERL_URL ${EQEMU_MSVC_DEPENDENCIES_PERL_X64})
- SET(EQEMU_VCPKG_ZIP ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X64_ZIP})
- SET(EQEMU_VCPKG_DIR ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X64_DIR})
- SET(EQEMU_PERL_ZIP ${EQEMU_MSVC_DEPENDENCIES_PERL_X64_ZIP})
- SET(EQEMU_PERL_DIR ${EQEMU_MSVC_DEPENDENCIES_PERL_X64_DIR})
-ELSE()
- SET(EQEMU_VCPKG_URL ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X86})
- SET(EQEMU_PERL_URL ${EQEMU_MSVC_DEPENDENCIES_PERL_X86})
- SET(EQEMU_VCPKG_ZIP ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X86_ZIP})
- SET(EQEMU_VCPKG_DIR ${EQEMU_MSVC_DEPENDENCIES_VCPKG_X86_DIR})
- SET(EQEMU_PERL_ZIP ${EQEMU_MSVC_DEPENDENCIES_PERL_X86_ZIP})
- SET(EQEMU_PERL_DIR ${EQEMU_MSVC_DEPENDENCIES_PERL_X86_DIR})
-ENDIF()
-
-IF(EQEMU_FETCH_MSVC_DEPENDENCIES_VCPKG)
- MESSAGE(STATUS "Resolving vcpkg dependencies...")
-
- IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/vcpkg/${EQEMU_VCPKG_ZIP})
- EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/vcpkg)
-
- MESSAGE(STATUS "Downloading existing vcpkg dependencies from releases...")
- FILE(DOWNLOAD ${EQEMU_VCPKG_URL} ${PROJECT_SOURCE_DIR}/vcpkg/${EQEMU_VCPKG_ZIP}
- SHOW_PROGRESS
- STATUS DOWNLOAD_STATUS)
-
- LIST(GET DOWNLOAD_STATUS 0 STATUS_CODE)
- IF(NOT STATUS_CODE EQUAL 0)
- MESSAGE(FATAL_ERROR "Was unable to download dependencies from ${EQEMU_VCPKG_URL}")
- ENDIF()
-
- MESSAGE(STATUS "Extracting files...")
- EXECUTE_PROCESS(
- COMMAND ${CMAKE_COMMAND} -E tar xzf ${PROJECT_SOURCE_DIR}/vcpkg/${EQEMU_VCPKG_ZIP}
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vcpkg
- )
- ENDIF()
-
- INCLUDE(${PROJECT_SOURCE_DIR}/vcpkg/${EQEMU_VCPKG_DIR}/scripts/buildsystems/vcpkg.cmake)
-ENDIF()
-
-IF(EQEMU_FETCH_MSVC_DEPENDENCIES_PERL)
- #Try to find perl first, (so you can use your active install first)
- FIND_PACKAGE(PerlLibs)
-
- IF(NOT PerlLibs_FOUND)
- MESSAGE(STATUS "Resolving perl dependencies...")
-
- IF(NOT EXISTS ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_ZIP})
- EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/perl)
- EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR})
-
- MESSAGE(STATUS "Downloading portable perl...")
- FILE(DOWNLOAD ${EQEMU_PERL_URL} ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_ZIP}
- SHOW_PROGRESS
- STATUS DOWNLOAD_STATUS)
-
- LIST(GET DOWNLOAD_STATUS 0 STATUS_CODE)
- IF(NOT STATUS_CODE EQUAL 0)
- MESSAGE(FATAL_ERROR "Was unable to download dependencies from ${EQEMU_PERL_URL}")
- ENDIF()
-
- MESSAGE(STATUS "Extracting files...")
- EXECUTE_PROCESS(
- COMMAND ${CMAKE_COMMAND} -E tar xzf ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_ZIP}
- WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR}
- )
- ENDIF()
-
- SET(PERL_EXECUTABLE ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR}/perl/bin/perl.exe CACHE FILEPATH "Path to perl program" FORCE)
- SET(PERL_INCLUDE_PATH ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR}/perl/lib/CORE CACHE PATH "Path to perl include files" FORCE)
- SET(PERL_LIBRARY ${PROJECT_SOURCE_DIR}/perl/${EQEMU_PERL_DIR}/perl/lib/CORE/libperl524.a CACHE FILEPATH "Path to perl library" FORCE)
- ENDIF()
-ENDIF()
\ No newline at end of file
diff --git a/cmake/FindLua51.cmake b/cmake/FindLua51.cmake
deleted file mode 100644
index 0aab2bb82..000000000
--- a/cmake/FindLua51.cmake
+++ /dev/null
@@ -1,91 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-# Modified from the FindLua51 that comes with CMake
-
-#[=======================================================================[.rst:
-FindLua51
----------
-
-
-
-Locate Lua51 library This module defines
-
-::
-
- LUA51_FOUND, if false, do not try to link to Lua
- LUA_LIBRARIES
- LUA_INCLUDE_DIR, where to find lua.h
- LUA_VERSION_STRING, the version of Lua found (since CMake 2.8.8)
-
-
-
-Note that the expected include convention is
-
-::
-
- #include "lua.h"
-
-and not
-
-::
-
- #include
-
-This is because, the lua location is not standardized and may exist in
-locations other than lua/
-#]=======================================================================]
-
-find_path(LUA_INCLUDE_DIR lua.h
- HINTS
- ENV LUA_DIR
- PATH_SUFFIXES include/lua51 include/lua5.1 include/lua-5.1 include/lua include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
-)
-
-find_library(LUA_LIBRARY
- NAMES lua51 lua5.1 lua-5.1 lua
- HINTS
- ENV LUA_DIR
- PATH_SUFFIXES lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
-)
-
-if(LUA_LIBRARY)
- # include the math library for Unix
- if(UNIX AND NOT APPLE AND NOT BEOS AND NOT HAIKU)
- find_library(LUA_MATH_LIBRARY m)
- set( LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}" CACHE STRING "Lua Libraries")
- # For Windows and Mac, don't need to explicitly include the math library
- else()
- set( LUA_LIBRARIES "${LUA_LIBRARY}" CACHE STRING "Lua Libraries")
- endif()
-endif()
-
-if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
- file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
-
- string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
- unset(lua_version_str)
-endif()
-
-include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
-# handle the QUIETLY and REQUIRED arguments and set LUA51_FOUND to TRUE if
-# all listed variables are TRUE
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51
- REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
- VERSION_VAR LUA_VERSION_STRING)
-
-mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
-
diff --git a/cmake/FindLuaJit.cmake b/cmake/FindLuaJit.cmake
index a7376dee1..188074339 100644
--- a/cmake/FindLuaJit.cmake
+++ b/cmake/FindLuaJit.cmake
@@ -88,4 +88,3 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJit
VERSION_VAR LUAJIT_VERSION_STRING)
mark_as_advanced(LUAJIT_INCLUDE_DIR LUAJIT_LIBRARIES LUAJIT_LIBRARY LUAJIT_MATH_LIBRARY)
-
diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake
deleted file mode 100644
index 14f54734d..000000000
--- a/cmake/FindMariaDB.cmake
+++ /dev/null
@@ -1,87 +0,0 @@
-# - Find mariadbclient
-#
-# -*- cmake -*-
-#
-# Find the native MariaDB includes and library
-#
-# MariaDB_INCLUDE_DIR - where to find mysql.h, etc.
-# MariaDB_LIBRARIES - List of libraries when using MariaDB.
-# MariaDB_FOUND - True if MariaDB found.
-# The following can be used as a hint as to where to search:
-# MARIADB_ROOT
-
-IF (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARIES)
- # Already in cache, be silent
- SET(MariaDB_FIND_QUIETLY TRUE)
-ENDIF (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARIES)
-
-# Include dir
-IF(MARIADB_ROOT)
- FIND_PATH(MariaDB_INCLUDE_DIR
- NAMES mariadb_version.h
- PATHS ${MARIADB_ROOT}/include
- PATH_SUFFIXES mysql mariadb
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- )
- FIND_PATH(MariaDB_INCLUDE_DIR
- NAMES mariadb_version.h
- PATH_SUFFIXES mysql mariadb
- )
-ELSE(MARIADB_ROOT)
- FIND_PATH(MariaDB_INCLUDE_DIR
- NAMES mariadb_version.h
- PATH_SUFFIXES mysql mariadb
- )
-ENDIF(MARIADB_ROOT)
-
-# Library
-SET(MariaDB_NAMES libmariadb)
-IF(MARIADB_ROOT)
- FIND_LIBRARY(MariaDB_LIBRARY
- NAMES ${MariaDB_NAMES}
- PATHS ${MARIADB_ROOT}/lib
- PATH_SUFFIXES mysql mariadb
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- )
-
- FIND_LIBRARY(MariaDB_LIBRARY
- NAMES ${MariaDB_NAMES}
- PATH_SUFFIXES mysql mariadb
- )
-ELSE(MARIADB_ROOT)
- FIND_LIBRARY(MariaDB_LIBRARY
- NAMES ${MariaDB_NAMES} mariadbclient_r mariadbclient
- PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
- PATH_SUFFIXES mysql mariadb
- )
-ENDIF(MARIADB_ROOT)
-
-IF (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARY)
- SET(MariaDB_FOUND TRUE)
- SET(MariaDB_LIBRARIES ${MariaDB_LIBRARY})
-ELSE (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARY)
- SET(MariaDB_FOUND FALSE)
- SET(MariaDB_LIBRARIES)
-ENDIF (MariaDB_INCLUDE_DIR AND MariaDB_LIBRARY)
-
-
-# handle the QUIETLY and REQUIRED arguments and set MariaDB_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(MariaDB DEFAULT_MSG MariaDB_LIBRARY MariaDB_INCLUDE_DIR)
-
-IF(MariaDB_FOUND)
- SET( MariaDB_LIBRARY_RELEASE ${MariaDB_LIBRARY} )
- SET( MariaDB_LIBRARY_DEBUG ${MariaDB_LIBRARY} )
- SET( MariaDB_LIBRARIES ${MariaDB_LIBRARY_RELEASE} ${MariaDB_LIBRARY_DEBUG} )
-ELSE(MariaDB_FOUND)
- SET( MariaDB_LIBRARIES )
-ENDIF(MariaDB_FOUND)
-
-MARK_AS_ADVANCED(
- MariaDB_LIBRARY_DEBUG
- MariaDB_LIBRARY_RELEASE
- MariaDB_INCLUDE_DIR
- )
diff --git a/cmake/FindMySQL.cmake b/cmake/FindMySQL.cmake
deleted file mode 100644
index 5a7927552..000000000
--- a/cmake/FindMySQL.cmake
+++ /dev/null
@@ -1,87 +0,0 @@
-# - Find mysqlclient
-#
-# -*- cmake -*-
-#
-# Find the native MySQL includes and library
-#
-# MySQL_INCLUDE_DIR - where to find mysql.h, etc.
-# MySQL_LIBRARIES - List of libraries when using MySQL.
-# MySQL_FOUND - True if MySQL found.
-# The following can be used as a hint as to where to search:
-# MYSQL_ROOT
-
-IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARIES)
- # Already in cache, be silent
- SET(MySQL_FIND_QUIETLY TRUE)
-ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARIES)
-
-# Include dir
-IF(MYSQL_ROOT)
- FIND_PATH(MySQL_INCLUDE_DIR
- NAMES mysql.h
- PATHS ${MYSQL_ROOT}/include
- PATH_SUFFIXES mysql
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- )
- FIND_PATH(MySQL_INCLUDE_DIR
- NAMES mysql.h
- PATH_SUFFIXES mysql
- )
-ELSE(MYSQL_ROOT)
- FIND_PATH(MySQL_INCLUDE_DIR
- NAMES mysql.h
- PATH_SUFFIXES mysql
- )
-ENDIF(MYSQL_ROOT)
-
-# Library
-SET(MySQL_NAMES libmysql)
-IF(MYSQL_ROOT)
- FIND_LIBRARY(MySQL_LIBRARY
- NAMES ${MySQL_NAMES}
- PATHS ${MYSQL_ROOT}/lib
- PATH_SUFFIXES mysql
- NO_DEFAULT_PATH
- NO_SYSTEM_ENVIRONMENT_PATH
- )
-
- FIND_LIBRARY(MySQL_LIBRARY
- NAMES ${MySQL_NAMES}
- PATH_SUFFIXES mysql
- )
-ELSE(MYSQL_ROOT)
- FIND_LIBRARY(MySQL_LIBRARY
- NAMES ${MySQL_NAMES} mysqlclient_r mysqlclient
- PATHS /usr/lib /usr/local/lib /usr/lib64 /usr/local/lib64
- PATH_SUFFIXES mysql
- )
-ENDIF(MYSQL_ROOT)
-
-IF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
- SET(MySQL_FOUND TRUE)
- SET( MySQL_LIBRARIES ${MySQL_LIBRARY} )
-ELSE (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
- SET(MySQL_FOUND FALSE)
- SET( MySQL_LIBRARIES )
-ENDIF (MySQL_INCLUDE_DIR AND MySQL_LIBRARY)
-
-
-# handle the QUIETLY and REQUIRED arguments and set MySQL_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(MySQL DEFAULT_MSG MySQL_LIBRARY MySQL_INCLUDE_DIR)
-
-IF(MySQL_FOUND)
- SET( MySQL_LIBRARY_RELEASE ${MySQL_LIBRARY} )
- SET( MySQL_LIBRARY_DEBUG ${MySQL_LIBRARY} )
- SET( MySQL_LIBRARIES ${MySQL_LIBRARY_RELEASE} ${MySQL_LIBRARY_DEBUG} )
-ELSE(MySQL_FOUND)
- SET( MySQL_LIBRARIES )
-ENDIF(MySQL_FOUND)
-
-MARK_AS_ADVANCED(
- MySQL_LIBRARY_DEBUG
- MySQL_LIBRARY_RELEASE
- MySQL_INCLUDE_DIR
- )
diff --git a/cmake/FindSodium.cmake b/cmake/FindSodium.cmake
deleted file mode 100644
index 3c5ae3467..000000000
--- a/cmake/FindSodium.cmake
+++ /dev/null
@@ -1,30 +0,0 @@
-if (NOT MSVC)
-include(FindPkgConfig)
-pkg_check_modules(PC_SODIUM "libsodium")
-if (NOT PC_SODIUM_FOUND)
- pkg_check_modules(PC_SODIUM "sodium")
-endif (NOT PC_SODIUM_FOUND)
-if (PC_SODIUM_FOUND)
- set(SODIUM_INCLUDE_HINTS ${PC_SODIUM_INCLUDE_DIRS} ${PC_SODIUM_INCLUDE_DIRS}/*)
- set(SODIUM_LIBRARY_HINTS ${PC_SODIUM_LIBRARY_DIRS} ${PC_SODIUM_LIBRARY_DIRS}/*)
-endif()
-endif (NOT MSVC)
-
-# some libraries install the headers is a subdirectory of the include dir
-# returned by pkg-config, so use a wildcard match to improve chances of finding
-# headers and libraries.
-find_path(
- SODIUM_INCLUDE_DIRS
- NAMES sodium.h
- HINTS ${SODIUM_INCLUDE_HINTS}
-)
-
-find_library(
- SODIUM_LIBRARIES
- NAMES libsodium sodium
- HINTS ${SODIUM_LIBRARY_HINTS}
-)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(SODIUM DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS)
-mark_as_advanced(SODIUM_FOUND SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS)
diff --git a/cmake/FindmbedTLS.cmake b/cmake/FindmbedTLS.cmake
deleted file mode 100644
index d2a3ce3b9..000000000
--- a/cmake/FindmbedTLS.cmake
+++ /dev/null
@@ -1,93 +0,0 @@
-# - Try to find mbedTLS
-# Once done this will define
-#
-# Read-Only variables
-# MBEDTLS_FOUND - system has mbedTLS
-# MBEDTLS_INCLUDE_DIR - the mbedTLS include directory
-# MBEDTLS_LIBRARY_DIR - the mbedTLS library directory
-# MBEDTLS_LIBRARIES - Link these to use mbedTLS
-# MBEDTLS_LIBRARY - path to mbedTLS library
-# MBEDX509_LIBRARY - path to mbedTLS X.509 library
-# MBEDCRYPTO_LIBRARY - path to mbedTLS Crypto library
-#
-# Hint
-# MBEDTLS_ROOT_DIR can be pointed to a local mbedTLS installation.
-
-SET(_MBEDTLS_ROOT_HINTS
- ${MBEDTLS_ROOT_DIR}
- ENV MBEDTLS_ROOT_DIR
-)
-
-SET(_MBEDTLS_ROOT_HINTS_AND_PATHS
- HINTS ${_MBEDTLS_ROOT_HINTS}
- PATHS ${_MBEDTLS_ROOT_PATHS}
-)
-
-FIND_PATH(MBEDTLS_INCLUDE_DIR
- NAMES mbedtls/version.h
- ${_MBEDTLS_ROOT_HINTS_AND_PATHS}
- PATH_SUFFIXES include
-)
-
-IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARIES)
- # Already in cache, be silent
- SET(MBEDTLS_FIND_QUIETLY TRUE)
-ENDIF()
-
-FIND_LIBRARY(MBEDTLS_LIBRARY
- NAMES mbedtls libmbedtls
- ${_MBEDTLS_ROOT_HINTS_AND_PATHS}
- PATH_SUFFIXES library
-)
-FIND_LIBRARY(MBEDX509_LIBRARY
- NAMES mbedx509 libmbedx509
- ${_MBEDTLS_ROOT_HINTS_AND_PATHS}
- PATH_SUFFIXES library
-)
-FIND_LIBRARY(MBEDCRYPTO_LIBRARY
- NAMES mbedcrypto libmbedcrypto
- ${_MBEDTLS_ROOT_HINTS_AND_PATHS}
- PATH_SUFFIXES library
-)
-
-IF(MBEDTLS_INCLUDE_DIR AND MBEDTLS_LIBRARY AND MBEDX509_LIBRARY AND MBEDCRYPTO_LIBRARY)
- SET(MBEDTLS_FOUND TRUE)
-ENDIF()
-
-IF(MBEDTLS_FOUND)
- # split mbedTLS into -L and -l linker options, so we can set them for pkg-config
- GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_DIR ${MBEDTLS_LIBRARY} PATH)
- GET_FILENAME_COMPONENT(MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY} NAME_WE)
- GET_FILENAME_COMPONENT(MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY} NAME_WE)
- GET_FILENAME_COMPONENT(MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY} NAME_WE)
- STRING(REGEX REPLACE "^lib" "" MBEDTLS_LIBRARY_FILE ${MBEDTLS_LIBRARY_FILE})
- STRING(REGEX REPLACE "^lib" "" MBEDX509_LIBRARY_FILE ${MBEDX509_LIBRARY_FILE})
- STRING(REGEX REPLACE "^lib" "" MBEDCRYPTO_LIBRARY_FILE ${MBEDCRYPTO_LIBRARY_FILE})
- SET(MBEDTLS_LIBRARIES "-L${MBEDTLS_LIBRARY_DIR} -l${MBEDTLS_LIBRARY_FILE} -l${MBEDX509_LIBRARY_FILE} -l${MBEDCRYPTO_LIBRARY_FILE}")
-
- IF(NOT MBEDTLS_FIND_QUIETLY)
- MESSAGE(STATUS "Found mbedTLS:")
- FILE(READ ${MBEDTLS_INCLUDE_DIR}/mbedtls/version.h MBEDTLSCONTENT)
- STRING(REGEX MATCH "MBEDTLS_VERSION_STRING +\"[0-9|.]+\"" MBEDTLSMATCH ${MBEDTLSCONTENT})
- IF (MBEDTLSMATCH)
- STRING(REGEX REPLACE "MBEDTLS_VERSION_STRING +\"([0-9|.]+)\"" "\\1" MBEDTLS_VERSION ${MBEDTLSMATCH})
- MESSAGE(STATUS " version ${MBEDTLS_VERSION}")
- ENDIF(MBEDTLSMATCH)
- MESSAGE(STATUS " TLS: ${MBEDTLS_LIBRARY}")
- MESSAGE(STATUS " X509: ${MBEDX509_LIBRARY}")
- MESSAGE(STATUS " Crypto: ${MBEDCRYPTO_LIBRARY}")
- ENDIF(NOT MBEDTLS_FIND_QUIETLY)
-ELSE(MBEDTLS_FOUND)
- IF(MBEDTLS_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "Could not find mbedTLS")
- ENDIF(MBEDTLS_FIND_REQUIRED)
-ENDIF(MBEDTLS_FOUND)
-
-MARK_AS_ADVANCED(
- MBEDTLS_INCLUDE_DIR
- MBEDTLS_LIBRARY_DIR
- MBEDTLS_LIBRARIES
- MBEDTLS_LIBRARY
- MBEDX509_LIBRARY
- MBEDCRYPTO_LIBRARY
-)
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 45af7b94d..3f8b29934 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -1,6 +1,6 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 3.12)
+cmake_minimum_required(VERSION 3.20.0)
-SET(common_sources
+set(common_sources
base_packet.cpp
bazaar.cpp
bodytypes.cpp
@@ -9,54 +9,54 @@ SET(common_sources
compression.cpp
condition.cpp
content/world_content_service.cpp
- discord/discord.cpp
crash.cpp
crc16.cpp
crc32.cpp
- database/database_dump_service.cpp
+ data_bucket.cpp
database.cpp
- database_instances.cpp
- database/database_update_manifest.cpp
- database/database_update_manifest_custom.cpp
- database/database_update_manifest_bots.cpp
+ database/database_dump_service.cpp
database/database_update.cpp
+ database_instances.cpp
dbcore.cpp
deity.cpp
+ discord/discord.cpp
+ discord/discord_manager.cpp
dynamic_zone_base.cpp
dynamic_zone_lockout.cpp
emu_constants.cpp
emu_limits.cpp
emu_opcodes.cpp
emu_versions.cpp
- eqdb.cpp
- eqdb_res.cpp
- eqemu_exception.cpp
- eqemu_config.cpp
- eqemu_logsys.cpp
eq_limits.cpp
eq_packet.cpp
eq_stream_ident.cpp
eq_stream_proxy.cpp
+ eqdb.cpp
+ eqdb_res.cpp
+ eqemu_config.cpp
+ eqemu_exception.cpp
+ eqemu_logsys.cpp
eqtime.cpp
event_sub.cpp
- events/player_event_logs.cpp
events/player_event_discord_formatter.cpp
+ events/player_event_logs.cpp
evolving_items.cpp
extprofile.cpp
- discord/discord_manager.cpp
faction.cpp
file.cpp
guild_base.cpp
- guilds.cpp
inventory_profile.cpp
inventory_slot.cpp
- ipc_mutex.cpp
ip_util.cpp
+ ipc_mutex.cpp
item_data.cpp
item_instance.cpp
+ json/json.hpp
+ json/jsoncpp.cpp
json_config.cpp
light_source.cpp
md5.cpp
+ memory/ksm.hpp
memory_buffer.cpp
memory_mapped_file.cpp
misc.cpp
@@ -65,42 +65,6 @@ SET(common_sources
mysql_request_result.cpp
mysql_request_row.cpp
mysql_stmt.cpp
- opcode_map.cpp
- opcodemgr.cpp
- packet_dump.cpp
- packet_dump_file.cpp
- packet_functions.cpp
- path_manager.cpp
- perl_eqdb.cpp
- perl_eqdb_res.cpp
- process/process.cpp
- process.cpp
- proc_launcher.cpp
- profanity_manager.cpp
- ptimer.cpp
- races.cpp
- rdtsc.cpp
- rulesys.cpp
- say_link.cpp
- serialize_buffer.cpp
- server_event_scheduler.cpp
- serverinfo.cpp
- shared_tasks.cpp
- shareddb.cpp
- skills.cpp
- skill_caps.cpp
- spdat.cpp
- spdat_bot.cpp
- strings.cpp
- struct_strategy.cpp
- textures.cpp
- timer.cpp
- unix.cpp
- platform.cpp
- json/json.hpp
- json/jsoncpp.cpp
- zone_store.cpp
- memory/ksm.hpp
net/console_server.cpp
net/console_server_connection.cpp
net/crc32.cpp
@@ -115,70 +79,111 @@ SET(common_sources
net/tcp_server.cpp
net/websocket_server.cpp
net/websocket_server_connection.cpp
+ opcode_map.cpp
+ opcodemgr.cpp
+ packet_dump.cpp
+ packet_dump_file.cpp
+ packet_functions.cpp
patches/patches.cpp
+ patches/rof.cpp
+ patches/rof2.cpp
+ patches/rof2_limits.cpp
+ patches/rof_limits.cpp
patches/sod.cpp
patches/sod_limits.cpp
patches/sof.cpp
patches/sof_limits.cpp
- patches/rof.cpp
- patches/rof_limits.cpp
- patches/rof2.cpp
- patches/rof2_limits.cpp
patches/titanium.cpp
patches/titanium_limits.cpp
patches/uf.cpp
patches/uf_limits.cpp
+ path_manager.cpp
+ perl_eqdb.cpp
+ perl_eqdb_res.cpp
+ platform.cpp
+ platform/inet.h
+ platform/platform.h
+ platform/posix/include_inet.h
+ platform/posix/include_pthreads.h
+ platform/win/include_windows.h
+ platform/win/include_winsock2.h
+ proc_launcher.cpp
+ process.cpp
+ process/process.cpp
+ profanity_manager.cpp
+ ptimer.cpp
+ races.cpp
+ rdtsc.cpp
+ rulesys.cpp
+ say_link.cpp
+ serialize_buffer.cpp
+ server_event_scheduler.cpp
+ serverinfo.cpp
+ shared_tasks.cpp
+ shareddb.cpp
+ skill_caps.cpp
+ skills.cpp
+ spdat.cpp
+ spdat_bot.cpp
StackWalker/StackWalker.cpp
+ strings.cpp
+ strings_legacy.cpp
+ strings_misc.cpp
+ struct_strategy.cpp
+ textures.cpp
+ timer.cpp
+ unix.cpp
util/directory.cpp
- util/uuid.cpp)
-
-SET(repositories
+ util/uuid.cpp
+ zone_store.cpp
+)
+set(repositories
# Criteria
repositories/criteria/content_filter_criteria.h
- repositories/base/base_grid_repository.h
- repositories/base/base_grid_entries_repository.h
-
# Base Repositories
repositories/base/base_aa_ability_repository.h
- repositories/base/base_aa_ranks_repository.h
repositories/base/base_aa_rank_effects_repository.h
repositories/base/base_aa_rank_prereqs_repository.h
- repositories/base/base_account_repository.h
+ repositories/base/base_aa_ranks_repository.h
repositories/base/base_account_flags_repository.h
repositories/base/base_account_ip_repository.h
+ repositories/base/base_account_repository.h
repositories/base/base_account_rewards_repository.h
repositories/base/base_adventure_details_repository.h
repositories/base/base_adventure_members_repository.h
repositories/base/base_adventure_stats_repository.h
- repositories/base/base_adventure_template_repository.h
- repositories/base/base_adventure_template_entry_repository.h
repositories/base/base_adventure_template_entry_flavor_repository.h
+ repositories/base/base_adventure_template_entry_repository.h
+ repositories/base/base_adventure_template_repository.h
repositories/base/base_alternate_currency_repository.h
repositories/base/base_auras_repository.h
repositories/base/base_base_data_repository.h
repositories/base/base_blocked_spells_repository.h
repositories/base/base_books_repository.h
- repositories/base/base_bugs_repository.h
repositories/base/base_bug_reports_repository.h
+ repositories/base/base_bugs_repository.h
repositories/base/base_buyer_repository.h
repositories/base/base_buyer_trade_items_repository.h
+ repositories/base/base_char_create_combinations_repository.h
+ repositories/base/base_char_create_point_allocations_repository.h
+ repositories/base/base_char_recipe_list_repository.h
repositories/base/base_character_activities_repository.h
- repositories/base/base_character_alternate_abilities_repository.h
repositories/base/base_character_alt_currency_repository.h
+ repositories/base/base_character_alternate_abilities_repository.h
repositories/base/base_character_auras_repository.h
repositories/base/base_character_bandolier_repository.h
repositories/base/base_character_bind_repository.h
repositories/base/base_character_buffs_repository.h
- repositories/base/base_character_corpses_repository.h
repositories/base/base_character_corpse_items_repository.h
+ repositories/base/base_character_corpses_repository.h
repositories/base/base_character_currency_repository.h
repositories/base/base_character_data_repository.h
repositories/base/base_character_disciplines_repository.h
repositories/base/base_character_evolving_items_repository.h
- repositories/base/base_character_expedition_lockouts_repository.h
repositories/base/base_character_exp_modifiers_repository.h
+ repositories/base/base_character_expedition_lockouts_repository.h
repositories/base/base_character_inspect_messages_repository.h
repositories/base/base_character_instance_safereturns_repository.h
repositories/base/base_character_item_recast_repository.h
@@ -186,8 +191,8 @@ SET(repositories
repositories/base/base_character_leadership_abilities_repository.h
repositories/base/base_character_material_repository.h
repositories/base/base_character_memmed_spells_repository.h
- repositories/base/base_character_parcels_repository.h
repositories/base/base_character_parcels_containers_repository.h
+ repositories/base/base_character_parcels_repository.h
repositories/base/base_character_peqzone_flags_repository.h
repositories/base/base_character_pet_buffs_repository.h
repositories/base/base_character_pet_info_repository.h
@@ -195,16 +200,13 @@ SET(repositories
repositories/base/base_character_potionbelt_repository.h
repositories/base/base_character_skills_repository.h
repositories/base/base_character_spells_repository.h
- repositories/base/base_character_tasks_repository.h
repositories/base/base_character_task_timers_repository.h
- repositories/base/base_char_create_combinations_repository.h
- repositories/base/base_char_create_point_allocations_repository.h
- repositories/base/base_char_recipe_list_repository.h
- repositories/base/base_chatchannels_repository.h
+ repositories/base/base_character_tasks_repository.h
repositories/base/base_chatchannel_reserved_names_repository.h
- repositories/base/base_completed_shared_tasks_repository.h
+ repositories/base/base_chatchannels_repository.h
repositories/base/base_completed_shared_task_activity_state_repository.h
repositories/base/base_completed_shared_task_members_repository.h
+ repositories/base/base_completed_shared_tasks_repository.h
repositories/base/base_completed_tasks_repository.h
repositories/base/base_content_flags_repository.h
repositories/base/base_damageshieldtypes_repository.h
@@ -213,14 +215,14 @@ SET(repositories
repositories/base/base_discord_webhooks_repository.h
repositories/base/base_discovered_items_repository.h
repositories/base/base_doors_repository.h
- repositories/base/base_dynamic_zones_repository.h
repositories/base/base_dynamic_zone_lockouts_repository.h
repositories/base/base_dynamic_zone_members_repository.h
repositories/base/base_dynamic_zone_templates_repository.h
+ repositories/base/base_dynamic_zones_repository.h
repositories/base/base_faction_association_repository.h
repositories/base/base_faction_base_data_repository.h
- repositories/base/base_faction_list_repository.h
repositories/base/base_faction_list_mod_repository.h
+ repositories/base/base_faction_list_repository.h
repositories/base/base_faction_values_repository.h
repositories/base/base_fishing_repository.h
repositories/base/base_forage_repository.h
@@ -228,23 +230,25 @@ SET(repositories
repositories/base/base_global_loot_repository.h
repositories/base/base_gm_ips_repository.h
repositories/base/base_graveyard_repository.h
+ repositories/base/base_grid_entries_repository.h
+ repositories/base/base_grid_repository.h
repositories/base/base_ground_spawns_repository.h
repositories/base/base_group_id_repository.h
repositories/base/base_group_leaders_repository.h
- repositories/base/base_guilds_repository.h
- repositories/base/base_guild_ranks_repository.h
- repositories/base/base_guild_permissions_repository.h
- repositories/base/base_guild_members_repository.h
repositories/base/base_guild_bank_repository.h
+ repositories/base/base_guild_members_repository.h
+ repositories/base/base_guild_permissions_repository.h
+ repositories/base/base_guild_ranks_repository.h
repositories/base/base_guild_relations_repository.h
+ repositories/base/base_guilds_repository.h
repositories/base/base_horses_repository.h
- repositories/base/base_instance_list_repository.h
repositories/base/base_instance_list_player_repository.h
+ repositories/base/base_instance_list_repository.h
repositories/base/base_inventory_repository.h
repositories/base/base_inventory_snapshots_repository.h
repositories/base/base_ip_exemptions_repository.h
- repositories/base/base_items_repository.h
repositories/base/base_items_evolving_details_repository.h
+ repositories/base/base_items_repository.h
repositories/base/base_ldon_trap_entries_repository.h
repositories/base/base_ldon_trap_templates_repository.h
repositories/base/base_level_exp_mods_repository.h
@@ -255,47 +259,47 @@ SET(repositories
repositories/base/base_login_server_list_types_repository.h
repositories/base/base_login_world_servers_repository.h
repositories/base/base_logsys_categories_repository.h
- repositories/base/base_lootdrop_repository.h
repositories/base/base_lootdrop_entries_repository.h
- repositories/base/base_loottable_repository.h
+ repositories/base/base_lootdrop_repository.h
repositories/base/base_loottable_entries_repository.h
+ repositories/base/base_loottable_repository.h
repositories/base/base_mail_repository.h
repositories/base/base_merchantlist_repository.h
repositories/base/base_merchantlist_temp_repository.h
repositories/base/base_name_filter_repository.h
repositories/base/base_npc_emotes_repository.h
- repositories/base/base_npc_faction_repository.h
repositories/base/base_npc_faction_entries_repository.h
+ repositories/base/base_npc_faction_repository.h
repositories/base/base_npc_scale_global_base_repository.h
- repositories/base/base_npc_spells_repository.h
- repositories/base/base_npc_spells_effects_repository.h
repositories/base/base_npc_spells_effects_entries_repository.h
+ repositories/base/base_npc_spells_effects_repository.h
repositories/base/base_npc_spells_entries_repository.h
+ repositories/base/base_npc_spells_repository.h
repositories/base/base_npc_types_repository.h
repositories/base/base_npc_types_tint_repository.h
- repositories/base/base_object_repository.h
repositories/base/base_object_contents_repository.h
+ repositories/base/base_object_repository.h
repositories/base/base_perl_event_export_settings_repository.h
repositories/base/base_petitions_repository.h
- repositories/base/base_pets_repository.h
repositories/base/base_pets_beastlord_data_repository.h
- repositories/base/base_pets_equipmentset_repository.h
repositories/base/base_pets_equipmentset_entries_repository.h
- repositories/base/base_player_titlesets_repository.h
+ repositories/base/base_pets_equipmentset_repository.h
+ repositories/base/base_pets_repository.h
repositories/base/base_player_event_aa_purchase_repository.h
- repositories/base/base_player_event_killed_npc_repository.h
repositories/base/base_player_event_killed_named_npc_repository.h
+ repositories/base/base_player_event_killed_npc_repository.h
repositories/base/base_player_event_killed_raid_npc_repository.h
repositories/base/base_player_event_log_settings_repository.h
repositories/base/base_player_event_logs_repository.h
repositories/base/base_player_event_loot_items_repository.h
repositories/base/base_player_event_merchant_purchase_repository.h
repositories/base/base_player_event_merchant_sell_repository.h
- repositories/base/base_player_event_npc_handin_repository.h
repositories/base/base_player_event_npc_handin_entries_repository.h
+ repositories/base/base_player_event_npc_handin_repository.h
repositories/base/base_player_event_speech_repository.h
- repositories/base/base_player_event_trade_repository.h
repositories/base/base_player_event_trade_entries_repository.h
+ repositories/base/base_player_event_trade_repository.h
+ repositories/base/base_player_titlesets_repository.h
repositories/base/base_quest_globals_repository.h
repositories/base/base_raid_details_repository.h
repositories/base/base_raid_members_repository.h
@@ -305,76 +309,79 @@ SET(repositories
repositories/base/base_rule_values_repository.h
repositories/base/base_saylink_repository.h
repositories/base/base_server_scheduled_events_repository.h
- repositories/base/base_shared_tasks_repository.h
repositories/base/base_shared_task_activity_state_repository.h
repositories/base/base_shared_task_dynamic_zones_repository.h
repositories/base/base_shared_task_members_repository.h
+ repositories/base/base_shared_tasks_repository.h
repositories/base/base_skill_caps_repository.h
repositories/base/base_spawn2_repository.h
+ repositories/base/base_spawn_condition_values_repository.h
+ repositories/base/base_spawn_conditions_repository.h
+ repositories/base/base_spawn_events_repository.h
repositories/base/base_spawnentry_repository.h
repositories/base/base_spawngroup_repository.h
- repositories/base/base_spawn_conditions_repository.h
- repositories/base/base_spawn_condition_values_repository.h
- repositories/base/base_spawn_events_repository.h
- repositories/base/base_spells_new_repository.h
repositories/base/base_spell_buckets_repository.h
repositories/base/base_spell_globals_repository.h
- repositories/base/base_starting_items_repository.h
+ repositories/base/base_spells_new_repository.h
repositories/base/base_start_zones_repository.h
+ repositories/base/base_starting_items_repository.h
+ repositories/base/base_task_activities_repository.h
repositories/base/base_tasks_repository.h
repositories/base/base_tasksets_repository.h
- repositories/base/base_task_activities_repository.h
repositories/base/base_timers_repository.h
repositories/base/base_titles_repository.h
repositories/base/base_trader_repository.h
- repositories/base/base_tradeskill_recipe_repository.h
repositories/base/base_tradeskill_recipe_entries_repository.h
+ repositories/base/base_tradeskill_recipe_repository.h
repositories/base/base_traps_repository.h
- repositories/base/base_tributes_repository.h
repositories/base/base_tribute_levels_repository.h
+ repositories/base/base_tributes_repository.h
repositories/base/base_veteran_reward_templates_repository.h
- repositories/base/base_zone_repository.h
repositories/base/base_zone_points_repository.h
+ repositories/base/base_zone_repository.h
# Extended Repositories
repositories/aa_ability_repository.h
- repositories/aa_ranks_repository.h
repositories/aa_rank_effects_repository.h
repositories/aa_rank_prereqs_repository.h
- repositories/account_repository.h
+ repositories/aa_ranks_repository.h
repositories/account_flags_repository.h
repositories/account_ip_repository.h
+ repositories/account_repository.h
repositories/account_rewards_repository.h
repositories/adventure_details_repository.h
repositories/adventure_members_repository.h
repositories/adventure_stats_repository.h
- repositories/adventure_template_repository.h
- repositories/adventure_template_entry_repository.h
repositories/adventure_template_entry_flavor_repository.h
+ repositories/adventure_template_entry_repository.h
+ repositories/adventure_template_repository.h
repositories/alternate_currency_repository.h
repositories/auras_repository.h
repositories/base_data_repository.h
repositories/blocked_spells_repository.h
repositories/books_repository.h
- repositories/bugs_repository.h
repositories/bug_reports_repository.h
+ repositories/bugs_repository.h
repositories/buyer_buy_lines_repository.h
repositories/buyer_trade_items_repository.h
+ repositories/char_create_combinations_repository.h
+ repositories/char_create_point_allocations_repository.h
+ repositories/char_recipe_list_repository.h
repositories/character_activities_repository.h
- repositories/character_alternate_abilities_repository.h
repositories/character_alt_currency_repository.h
+ repositories/character_alternate_abilities_repository.h
repositories/character_auras_repository.h
repositories/character_bandolier_repository.h
repositories/character_bind_repository.h
repositories/character_buffs_repository.h
- repositories/character_corpses_repository.h
repositories/character_corpse_items_repository.h
+ repositories/character_corpses_repository.h
repositories/character_currency_repository.h
repositories/character_data_repository.h
repositories/character_disciplines_repository.h
repositories/character_evolving_items_repository.h
- repositories/character_expedition_lockouts_repository.h
repositories/character_exp_modifiers_repository.h
+ repositories/character_expedition_lockouts_repository.h
repositories/character_inspect_messages_repository.h
repositories/character_instance_safereturns_repository.h
repositories/character_item_recast_repository.h
@@ -382,8 +389,8 @@ SET(repositories
repositories/character_leadership_abilities_repository.h
repositories/character_material_repository.h
repositories/character_memmed_spells_repository.h
- repositories/character_parcels_repository.h
repositories/character_parcels_containers_repository.h
+ repositories/character_parcels_repository.h
repositories/character_peqzone_flags_repository.h
repositories/character_pet_buffs_repository.h
repositories/character_pet_info_repository.h
@@ -391,16 +398,13 @@ SET(repositories
repositories/character_potionbelt_repository.h
repositories/character_skills_repository.h
repositories/character_spells_repository.h
- repositories/character_tasks_repository.h
repositories/character_task_timers_repository.h
- repositories/char_create_combinations_repository.h
- repositories/char_create_point_allocations_repository.h
- repositories/char_recipe_list_repository.h
- repositories/chatchannels_repository.h
+ repositories/character_tasks_repository.h
repositories/chatchannel_reserved_names_repository.h
- repositories/completed_shared_tasks_repository.h
+ repositories/chatchannels_repository.h
repositories/completed_shared_task_activity_state_repository.h
repositories/completed_shared_task_members_repository.h
+ repositories/completed_shared_tasks_repository.h
repositories/completed_tasks_repository.h
repositories/content_flags_repository.h
repositories/damageshieldtypes_repository.h
@@ -409,14 +413,14 @@ SET(repositories
repositories/discord_webhooks_repository.h
repositories/discovered_items_repository.h
repositories/doors_repository.h
- repositories/dynamic_zones_repository.h
repositories/dynamic_zone_lockouts_repository.h
repositories/dynamic_zone_members_repository.h
repositories/dynamic_zone_templates_repository.h
+ repositories/dynamic_zones_repository.h
repositories/faction_association_repository.h
repositories/faction_base_data_repository.h
- repositories/faction_list_repository.h
repositories/faction_list_mod_repository.h
+ repositories/faction_list_repository.h
repositories/faction_values_repository.h
repositories/fishing_repository.h
repositories/forage_repository.h
@@ -427,20 +431,20 @@ SET(repositories
repositories/ground_spawns_repository.h
repositories/group_id_repository.h
repositories/group_leaders_repository.h
- repositories/guilds_repository.h
- repositories/guild_ranks_repository.h
- repositories/guild_permissions_repository.h
- repositories/guild_members_repository.h
repositories/guild_bank_repository.h
+ repositories/guild_members_repository.h
+ repositories/guild_permissions_repository.h
+ repositories/guild_ranks_repository.h
repositories/guild_relations_repository.h
+ repositories/guilds_repository.h
repositories/horses_repository.h
- repositories/instance_list_repository.h
repositories/instance_list_player_repository.h
+ repositories/instance_list_repository.h
repositories/inventory_repository.h
repositories/inventory_snapshots_repository.h
repositories/ip_exemptions_repository.h
- repositories/items_repository.h
repositories/items_evolving_details_repository.h
+ repositories/items_repository.h
repositories/ldon_trap_entries_repository.h
repositories/ldon_trap_templates_repository.h
repositories/level_exp_mods_repository.h
@@ -451,47 +455,47 @@ SET(repositories
repositories/login_server_list_types_repository.h
repositories/login_world_servers_repository.h
repositories/logsys_categories_repository.h
- repositories/lootdrop_repository.h
repositories/lootdrop_entries_repository.h
- repositories/loottable_repository.h
+ repositories/lootdrop_repository.h
repositories/loottable_entries_repository.h
+ repositories/loottable_repository.h
repositories/mail_repository.h
repositories/merchantlist_repository.h
repositories/merchantlist_temp_repository.h
repositories/name_filter_repository.h
repositories/npc_emotes_repository.h
- repositories/npc_faction_repository.h
repositories/npc_faction_entries_repository.h
+ repositories/npc_faction_repository.h
repositories/npc_scale_global_base_repository.h
- repositories/npc_spells_repository.h
- repositories/npc_spells_effects_repository.h
repositories/npc_spells_effects_entries_repository.h
+ repositories/npc_spells_effects_repository.h
repositories/npc_spells_entries_repository.h
+ repositories/npc_spells_repository.h
repositories/npc_types_repository.h
repositories/npc_types_tint_repository.h
- repositories/object_repository.h
repositories/object_contents_repository.h
+ repositories/object_repository.h
repositories/perl_event_export_settings_repository.h
repositories/petitions_repository.h
- repositories/pets_repository.h
repositories/pets_beastlord_data_repository.h
- repositories/pets_equipmentset_repository.h
repositories/pets_equipmentset_entries_repository.h
- repositories/player_titlesets_repository.h
+ repositories/pets_equipmentset_repository.h
+ repositories/pets_repository.h
repositories/player_event_aa_purchase_repository.h
- repositories/player_event_killed_npc_repository.h
repositories/player_event_killed_named_npc_repository.h
+ repositories/player_event_killed_npc_repository.h
repositories/player_event_killed_raid_npc_repository.h
repositories/player_event_log_settings_repository.h
repositories/player_event_logs_repository.h
repositories/player_event_loot_items_repository.h
repositories/player_event_merchant_purchase_repository.h
repositories/player_event_merchant_sell_repository.h
- repositories/player_event_npc_handin_repository.h
repositories/player_event_npc_handin_entries_repository.h
+ repositories/player_event_npc_handin_repository.h
repositories/player_event_speech_repository.h
- repositories/player_event_trade_repository.h
repositories/player_event_trade_entries_repository.h
+ repositories/player_event_trade_repository.h
+ repositories/player_titlesets_repository.h
repositories/quest_globals_repository.h
repositories/raid_details_repository.h
repositories/raid_members_repository.h
@@ -501,44 +505,47 @@ SET(repositories
repositories/rule_values_repository.h
repositories/saylink_repository.h
repositories/server_scheduled_events_repository.h
- repositories/shared_tasks_repository.h
repositories/shared_task_activity_state_repository.h
repositories/shared_task_dynamic_zones_repository.h
repositories/shared_task_members_repository.h
+ repositories/shared_tasks_repository.h
repositories/skill_caps_repository.h
repositories/spawn2_repository.h
+ repositories/spawn_condition_values_repository.h
+ repositories/spawn_conditions_repository.h
+ repositories/spawn_events_repository.h
repositories/spawnentry_repository.h
repositories/spawngroup_repository.h
- repositories/spawn_conditions_repository.h
- repositories/spawn_condition_values_repository.h
- repositories/spawn_events_repository.h
- repositories/spells_new_repository.h
repositories/spell_buckets_repository.h
repositories/spell_globals_repository.h
- repositories/starting_items_repository.h
+ repositories/spells_new_repository.h
repositories/start_zones_repository.h
+ repositories/starting_items_repository.h
+ repositories/task_activities_repository.h
repositories/tasks_repository.h
repositories/tasksets_repository.h
- repositories/task_activities_repository.h
repositories/timers_repository.h
repositories/titles_repository.h
repositories/trader_repository.h
- repositories/tradeskill_recipe_repository.h
repositories/tradeskill_recipe_entries_repository.h
+ repositories/tradeskill_recipe_repository.h
repositories/traps_repository.h
- repositories/tributes_repository.h
repositories/tribute_levels_repository.h
+ repositories/tributes_repository.h
repositories/veteran_reward_templates_repository.h
- repositories/zone_repository.h
repositories/zone_points_repository.h
-
+ repositories/zone_repository.h
)
-SET(common_headers
+set(common_headers
+ StackWalker/StackWalker.h
additive_lagged_fibonacci_engine.h
- bazaar.h
base_packet.h
+ bazaar.h
bodytypes.h
+ cli/argh.h
+ cli/eqemu_command_handler.h
+ cli/terminal_color.hpp
classes.h
compression.h
condition.h
@@ -546,15 +553,16 @@ SET(common_headers
crash.h
crc16.h
crc32.h
- cli/argh.h
- cli/eqemu_command_handler.h
- cli/terminal_color.hpp
cron/croncpp.h
- database/database_dump_service.h
+ data_bucket.cpp
data_verification.h
database.h
- database_schema.h
+ database/database_dump_service.h
database/database_update.h
+ database/database_update_manifest.h
+ database/database_update_manifest_bots.h
+ database/database_update_manifest_custom.h
+ database_schema.h
dbcore.h
deity.h
discord/discord.h
@@ -567,43 +575,48 @@ SET(common_headers
emu_oplist.h
emu_versions.h
eq_constants.h
- eq_packet_structs.h
- eqdb.h
- eqdb_res.h
- eqemu_exception.h
- eqemu_config.h
- eqemu_config_elements.h
- eqemu_logsys.h
- eqemu_logsys_log_aliases.h
eq_limits.h
eq_packet.h
+ eq_packet_structs.h
eq_stream_ident.h
eq_stream_intf.h
eq_stream_locator.h
eq_stream_proxy.h
+ eqdb.h
+ eqdb_res.h
+ eqemu_config.h
+ eqemu_config_elements.h
+ eqemu_exception.h
+ eqemu_logsys.h
+ eqemu_logsys_log_aliases.h
eqtime.h
- events/player_event_logs.h
- events/player_event_discord_formatter.h
- events/player_events.h
+ event/event_loop.h
+ event/task.h
+ event/timer.h
event_sub.h
+ events/player_event_discord_formatter.h
+ events/player_event_logs.h
+ events/player_events.h
evolving_items.h
extprofile.h
faction.h
- file.h
features.h
+ file.h
fixed_memory_hash_set.h
fixed_memory_variable_hash_set.h
- global_define.h
guild_base.h
guilds.h
http/httplib.h
http/uri.h
inventory_profile.h
inventory_slot.h
- ipc_mutex.h
ip_util.h
+ ipc_mutex.h
item_data.h
item_instance.h
+ json/json-forwards.h
+ json/json.h
+ json/json_archive_single_line.h
json_config.h
light_source.h
linked_list.h
@@ -618,17 +631,65 @@ SET(common_headers
mysql_request_result.h
mysql_request_row.h
mysql_stmt.h
+ net/console_server.h
+ net/console_server_connection.h
+ net/crc32.h
+ net/dns.h
+ net/endian.h
+ net/eqstream.h
+ net/packet.h
+ net/reliable_stream_connection.h
+ net/reliable_stream_pooling.h
+ net/reliable_stream_structs.h
+ net/servertalk_client_connection.h
+ net/servertalk_common.h
+ net/servertalk_legacy_client_connection.h
+ net/servertalk_server.h
+ net/servertalk_server_connection.h
+ net/tcp_connection.h
+ net/tcp_connection_pooling.h
+ net/tcp_server.h
+ net/websocket_server.h
+ net/websocket_server_connection.h
op_codes.h
opcode_dispatch.h
opcodemgr.h
packet_dump.h
packet_dump_file.h
packet_functions.h
+ patches/patches.h
+ patches/rof.h
+ patches/rof2.h
+ patches/rof2_limits.h
+ patches/rof2_ops.h
+ patches/rof2_structs.h
+ patches/rof_limits.h
+ patches/rof_ops.h
+ patches/rof_structs.h
+ patches/sod.h
+ patches/sod_limits.h
+ patches/sod_ops.h
+ patches/sod_structs.h
+ patches/sof.h
+ patches/sof_limits.h
+ patches/sof_ops.h
+ patches/sof_structs.h
+ patches/ss_declare.h
+ patches/ss_define.h
+ patches/ss_register.h
+ patches/titanium.h
+ patches/titanium_limits.h
+ patches/titanium_ops.h
+ patches/titanium_structs.h
+ patches/uf.h
+ patches/uf_limits.h
+ patches/uf_ops.h
+ patches/uf_structs.h
path_manager.cpp
platform.h
- process/process.h
- process.h
proc_launcher.h
+ process.h
+ process/process.h
profanity_manager.h
profiler.h
ptimer.h
@@ -643,210 +704,124 @@ SET(common_headers
seperator.h
serialize_buffer.h
server_event_scheduler.h
+ server_reload_types.h
serverinfo.h
servertalk.h
- server_reload_types.h
shared_tasks.h
shareddb.h
- skills.h
skill_caps.h
+ skills.h
spdat.h
+ stacktrace/backward.hpp
strings.h
struct_strategy.h
tasks.h
+ termcolor/rang.hpp
textures.h
timer.h
types.h
unix.h
useperl.h
+ util/directory.h
+ util/memory_stream.h
+ util/uuid.h
version.h
zone_store.h
- event/event_loop.h
- event/task.h
- event/timer.h
- json/json_archive_single_line.h
- json/json.h
- json/json-forwards.h
- net/console_server.h
- net/console_server_connection.h
- net/crc32.h
- net/dns.h
- net/endian.h
- net/eqstream.h
- net/packet.h
- net/reliable_stream_connection.h
- net/reliable_stream_pooling.h
- net/reliable_stream_structs.h
- net/servertalk_client_connection.h
- net/servertalk_legacy_client_connection.h
- net/servertalk_common.h
- net/servertalk_server.h
- net/servertalk_server_connection.h
- net/tcp_connection.h
- net/tcp_connection_pooling.h
- net/tcp_server.h
- net/websocket_server.h
- net/websocket_server_connection.h
- patches/patches.h
- patches/sod.h
- patches/sod_limits.h
- patches/sod_ops.h
- patches/sod_structs.h
- patches/sof.h
- patches/sof_limits.h
- patches/sof_ops.h
- patches/sof_structs.h
- patches/ss_declare.h
- patches/ss_define.h
- patches/ss_register.h
- patches/rof.h
- patches/rof_limits.h
- patches/rof_ops.h
- patches/rof_structs.h
- patches/rof2.h
- patches/rof2_limits.h
- patches/rof2_ops.h
- patches/rof2_structs.h
- patches/titanium.h
- patches/titanium_limits.h
- patches/titanium_ops.h
- patches/titanium_structs.h
- patches/uf.h
- patches/uf_limits.h
- patches/uf_ops.h
- patches/uf_structs.h
- termcolor/rang.hpp
- stacktrace/backward.hpp
- StackWalker/StackWalker.h
- util/memory_stream.h
- util/directory.h
- util/uuid.h
)
-SOURCE_GROUP(Event FILES
- event/event_loop.h
- event/timer.h
- event/task.h
-)
+# Source Groups (Regex based for automatic subdirectory handling)
+source_group("CLI" REGULAR_EXPRESSION "^cli/")
+source_group("Content" REGULAR_EXPRESSION "^content/")
+source_group("Cron" REGULAR_EXPRESSION "^cron/")
+source_group("Database" REGULAR_EXPRESSION "^database/")
+source_group("Discord" REGULAR_EXPRESSION "^discord/")
+source_group("Event" REGULAR_EXPRESSION "^event/")
+source_group("Events" REGULAR_EXPRESSION "^events/")
+source_group("Http" REGULAR_EXPRESSION "^http/")
+source_group("Json" REGULAR_EXPRESSION "^json/")
+source_group("Memory" REGULAR_EXPRESSION "^memory/")
+source_group("Net" REGULAR_EXPRESSION "^net/")
+source_group("Patches" REGULAR_EXPRESSION "^patches/")
+source_group("Process" REGULAR_EXPRESSION "^process/")
+source_group("Repositories" REGULAR_EXPRESSION "^repositories/")
+source_group("StackWalker" REGULAR_EXPRESSION "^StackWalker/")
+source_group("Stacktrace" REGULAR_EXPRESSION "^stacktrace/")
+source_group("Termcolor" REGULAR_EXPRESSION "^termcolor/")
+source_group("Util" REGULAR_EXPRESSION "^util/")
-SOURCE_GROUP(Json FILES
- json/json.h
- json/jsoncpp.cpp
- json/json-forwards.h
-)
+option(EQEMU_ADD_PROFILER "Link with Google perftools profiler" OFF)
+#PRNG options
+option(EQEMU_ADDITIVE_LFIB_PRNG "Use Additive LFib for PRNG." OFF)
+mark_as_advanced(EQEMU_ADDITIVE_LFIB_PRNG)
+option(EQEMU_BIASED_INT_DIST "Use biased int dist instead of uniform." OFF)
+mark_as_advanced(EQEMU_BIASED_INT_DIST)
+set(EQEMU_CUSTOM_PRNG_ENGINE "" CACHE STRING "Custom random engine. (ex. std::default_random_engine)")
+mark_as_advanced(EQEMU_CUSTOM_PRNG_ENGINE)
-SOURCE_GROUP(Net FILES
- net/console_server.cpp
- net/console_server.h
- net/console_server_connection.cpp
- net/console_server_connection.h
- net/crc32.cpp
- net/crc32.h
- net/dns.h
- net/endian.h
- net/eqmq.cpp
- net/eqmq.h
- net/eqstream.cpp
- net/eqstream.h
- net/packet.cpp
- net/packet.h
- net/reliable_stream_connection.cpp
- net/reliable_stream_connection.h
- net/reliable_stream_pooling.h
- net/reliable_stream_structs.h
- net/servertalk_client_connection.cpp
- net/servertalk_client_connection.h
- net/servertalk_legacy_client_connection.cpp
- net/servertalk_legacy_client_connection.h
- net/servertalk_common.h
- net/servertalk_server.cpp
- net/servertalk_server.h
- net/servertalk_server_connection.cpp
- net/servertalk_server_connection.h
- net/tcp_connection.cpp
- net/tcp_connection.h
- net/tcp_connection_pooling.h
- net/tcp_server.cpp
- net/tcp_server.h
- net/websocket_server.cpp
- net/websocket_server.h
- net/websocket_server_connection.cpp
- net/websocket_server_connection.h
-)
+if(CMAKE_COMPILER_IS_GNUCXX)
+ option(EQEMU_SFMT19937 "Use GCC's extention for SIMD Fast MT19937." OFF)
+ mark_as_advanced(EQEMU_SFMT19937)
+endif()
-SOURCE_GROUP(Patches FILES
- patches/patches.h
- patches/sod.h
- patches/sod_limits.h
- patches/sod_ops.h
- patches/sod_structs.h
- patches/sof.h
- patches/sof_limits.h
- patches/sof_ops.h
- patches/sof_structs.h
- patches/ss_declare.h
- patches/ss_define.h
- patches/ss_register.h
- patches/rof.h
- patches/rof_limits.h
- patches/rof_ops.h
- patches/rof_structs.h
- patches/rof2.h
- patches/rof2_limits.h
- patches/rof2_ops.h
- patches/rof2_structs.h
- patches/titanium.h
- patches/titanium_limits.h
- patches/titanium_ops.h
- patches/titanium_structs.h
- patches/uf.h
- patches/uf_limits.h
- patches/uf_ops.h
- patches/uf_structs.h
- patches/patches.cpp
- patches/sod.cpp
- patches/sod_limits.cpp
- patches/sof.cpp
- patches/sof_limits.cpp
- patches/rof.cpp
- patches/rof_limits.cpp
- patches/rof2.cpp
- patches/rof2_limits.cpp
- patches/titanium.cpp
- patches/titanium_limits.cpp
- patches/uf.cpp
- patches/uf_limits.cpp
-)
+include_directories(Patches StackWalker)
-SOURCE_GROUP(StackWalker FILES
- StackWalker/StackWalker.h
- StackWalker/StackWalker.cpp
-)
+add_library(common ${common_sources} ${common_headers} ${repositories})
-SOURCE_GROUP(Util FILES
- util/memory_stream.h
- util/directory.cpp
- util/directory.h
- util/uuid.cpp
- util/uuid.h
-)
+target_compile_definitions(common PUBLIC BOOST_BIND_GLOBAL_PLACEHOLDERS GLM_FORCE_RADIANS GLM_FORCE_CTOR_INIT GLM_ENABLE_EXPERIMENTAL ENABLE_SECURITY)
+target_include_directories(common PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../submodules/websocketpp")
+target_include_directories(common PRIVATE ..)
+target_link_libraries(common PUBLIC cereal::cereal fmt::fmt unofficial::libmariadb $,libuv::uv_a,libuv::uv> OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB unofficial-sodium::sodium)
-INCLUDE_DIRECTORIES(Patches SocketLib StackWalker)
+# Requires libgoogle-perftools-dev google-perftools packages for linux (debian)
+if(EQEMU_ADD_PROFILER)
+ set(CMAKE_EXE_LINKER_FLAGS "-Wl,--no-as-needed,-lprofiler,--as-needed")
+endif()
-ADD_LIBRARY(common ${common_sources} ${common_headers} ${repositories})
+if(EQEMU_ADDITIVE_LFIB_PRNG)
+ target_compile_definitions(common PUBLIC USE_ADDITIVE_LFIB_PRNG)
+ if(EQEMU_SFMT19937)
+ message(STATUS "SFMT19937 and ADDITITVE_LFIB_PRNG both set, SFMT19937 ignored.")
+ set(EQEMU_SFMT19937 OFF)
+ endif()
+ if(NOT EQEMU_CUSTOM_PRNG_ENGINE STREQUAL "")
+ message(STATUS "CUSTOM_PRNG_ENGINE and ADDITITVE_LFIB_PRNG both set, CUSTOM_PRNG_ENGINE ignored.")
+ set(EQEMU_CUSTOM_PRNG_ENGINE "")
+ endif()
+endif()
-IF (UNIX)
- SET_SOURCE_FILES_PROPERTIES("SocketLib/Mime.cpp" PROPERTY COMPILE_FLAGS -Wno-unused-result)
- SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
-ENDIF (UNIX)
+if(EQEMU_SFMT19937)
+ target_compile_definitions(common PUBLIC USE_SFMT19937)
+ if(NOT EQEMU_CUSTOM_PRNG_ENGINE STREQUAL "")
+ message(STATUS "CUSTOM_PRNG_ENGINE and SFMT19937 both set, CUSTOM_PRNG_ENGINE ignored.")
+ set(EQEMU_CUSTOM_PRNG_ENGINE "")
+ endif()
+endif()
-IF (EQEMU_BUILD_PCH)
+if(NOT EQEMU_CUSTOM_PRNG_ENGINE STREQUAL "")
+ target_compile_definitions(common PUBLIC USE_CUSTOM_PRNG_ENGINE=${EQEMU_CUSTOM_PRNG_ENGINE})
+endif()
+
+if(EQEMU_BIASED_INT_DIST)
+ target_compile_definitions(common PUBLIC BIASED_INT_DIST)
+endif()
+
+if(${OPENSSL_VERSION} VERSION_GREATER_EQUAL "1.1.1")
+ target_compile_definitions(common PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT)
+endif()
+
+if(UNIX)
+ target_link_libraries(common PUBLIC uuid)
+ set_source_files_properties("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES COMPILE_FLAGS -O0)
+endif()
+
+if(EQEMU_BUILD_PCH)
TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h)
# Avoid PCH/__OPTIMIZE__ mismatch when compiling certain patch sources with -O0
# These files are compiled with -O0 on UNIX (see COMPILE_FLAGS above), which
# disables the __OPTIMIZE__ predefined macro. Disabling PCH for them prevents
# Clang from erroring due to macro state differences between the PCH and TU.
- SET_SOURCE_FILES_PROPERTIES("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
-ENDIF ()
+ set_source_files_properties("patches/sod.cpp" "patches/sof.cpp" "patches/rof.cpp" "patches/rof2.cpp" "patches/uf.cpp" PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
+endif()
-SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
+set_property(TARGET common PROPERTY FOLDER libraries)
diff --git a/common/SocketLib/Base64.cpp b/common/SocketLib/Base64.cpp
deleted file mode 100644
index eb6a2fd0a..000000000
--- a/common/SocketLib/Base64.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/** \file Base64.cpp
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004,2005 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-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 "Base64.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-const char *Base64::bstr =
- "ABCDEFGHIJKLMNOPQ"
- "RSTUVWXYZabcdefgh"
- "ijklmnopqrstuvwxy"
- "z0123456789+/";
-
-const char Base64::rstr[] = {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0,
- 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0};
-
-
-void Base64::encode(FILE *fil, std::string& output, bool add_crlf)
-{
- size_t remain;
- size_t i = 0;
- size_t o = 0;
- char input[4];
-
- output = "";
- remain = fread(input,1,3,fil);
- while (remain > 0)
- {
- if (add_crlf && o && o % 76 == 0)
- output += "\n";
- switch (remain)
- {
- case 1:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) ];
- output += "==";
- break;
- case 2:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) ];
- output += "=";
- break;
- default:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ];
- output += bstr[ (input[i + 2] & 0x3f) ];
- }
- o += 4;
- //
- remain = fread(input,1,3,fil);
- }
-}
-
-
-void Base64::encode(const std::string& str_in, std::string& str_out, bool add_crlf)
-{
- encode(str_in.c_str(), str_in.size(), str_out, add_crlf);
-}
-
-
-void Base64::encode(const char* input,size_t l,std::string& output, bool add_crlf)
-{
- size_t i = 0;
- size_t o = 0;
-
- output = "";
- while (i < l)
- {
- size_t remain = l - i;
- if (add_crlf && o && o % 76 == 0)
- output += "\n";
- switch (remain)
- {
- case 1:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) ];
- output += "==";
- break;
- case 2:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) ];
- output += "=";
- break;
- default:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ];
- output += bstr[ (input[i + 2] & 0x3f) ];
- }
- o += 4;
- i += 3;
- }
-}
-
-
-void Base64::encode(unsigned char* input,size_t l,std::string& output,bool add_crlf)
-{
- size_t i = 0;
- size_t o = 0;
-
- output = "";
- while (i < l)
- {
- size_t remain = l - i;
- if (add_crlf && o && o % 76 == 0)
- output += "\n";
- switch (remain)
- {
- case 1:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) ];
- output += "==";
- break;
- case 2:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) ];
- output += "=";
- break;
- default:
- output += bstr[ ((input[i] >> 2) & 0x3f) ];
- output += bstr[ ((input[i] << 4) & 0x30) + ((input[i + 1] >> 4) & 0x0f) ];
- output += bstr[ ((input[i + 1] << 2) & 0x3c) + ((input[i + 2] >> 6) & 0x03) ];
- output += bstr[ (input[i + 2] & 0x3f) ];
- }
- o += 4;
- i += 3;
- }
-}
-
-
-void Base64::decode(const std::string& input,std::string& output)
-{
- size_t i = 0;
- size_t l = input.size();
-
- output = "";
- while (i < l)
- {
- while (i < l && (input[i] == 13 || input[i] == 10))
- i++;
- if (i < l)
- {
- char b1 = (char)((rstr[(int)input[i]] << 2 & 0xfc) +
- (rstr[(int)input[i + 1]] >> 4 & 0x03));
- output += b1;
- if (input[i + 2] != '=')
- {
- char b2 = (char)((rstr[(int)input[i + 1]] << 4 & 0xf0) +
- (rstr[(int)input[i + 2]] >> 2 & 0x0f));
- output += b2;
- }
- if (input[i + 3] != '=')
- {
- char b3 = (char)((rstr[(int)input[i + 2]] << 6 & 0xc0) +
- rstr[(int)input[i + 3]]);
- output += b3;
- }
- i += 4;
- }
- }
-}
-
-
-void Base64::decode(const std::string& input, unsigned char *output, size_t& sz)
-{
- size_t i = 0;
- size_t l = input.size();
- size_t j = 0;
-
- while (i < l)
- {
- while (i < l && (input[i] == 13 || input[i] == 10))
- i++;
- if (i < l)
- {
- unsigned char b1 = (unsigned char)((rstr[(int)input[i]] << 2 & 0xfc) +
- (rstr[(int)input[i + 1]] >> 4 & 0x03));
- if (output)
- {
- output[j] = b1;
- }
- j++;
- if (input[i + 2] != '=')
- {
- unsigned char b2 = (unsigned char)((rstr[(int)input[i + 1]] << 4 & 0xf0) +
- (rstr[(int)input[i + 2]] >> 2 & 0x0f));
- if (output)
- {
- output[j] = b2;
- }
- j++;
- }
- if (input[i + 3] != '=')
- {
- unsigned char b3 = (unsigned char)((rstr[(int)input[i + 2]] << 6 & 0xc0) +
- rstr[(int)input[i + 3]]);
- if (output)
- {
- output[j] = b3;
- }
- j++;
- }
- i += 4;
- }
- }
- sz = j;
-}
-
-
-size_t Base64::decode_length(const std::string& str64)
-{
- if (!str64.size() || str64.size() % 4)
- return 0;
- size_t l = 3 * (str64.size() / 4 - 1) + 1;
- if (str64[str64.size() - 2] != '=')
- l++;
- if (str64[str64.size() - 1] != '=')
- l++;
- return l;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/common/SocketLib/Base64.h b/common/SocketLib/Base64.h
deleted file mode 100644
index 95608e30a..000000000
--- a/common/SocketLib/Base64.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/** \file Base64.h
- ** \date 2004-02-13
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004,2005 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-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.
-*/
-#ifndef _BASE64_H
-#define _BASE64_H
-
-#include
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-/** \defgroup util Utilities */
-
-/** Base64 encode/decode.
- \ingroup util */
-class Base64 {
-public:
-
- static void encode(FILE *, std::string& , bool add_crlf = true);
- static void encode(const std::string&, std::string& , bool add_crlf = true);
- static void encode(const char *, size_t, std::string& , bool add_crlf = true);
- static void encode(unsigned char *, size_t, std::string& , bool add_crlf = true);
-
- static void decode(const std::string&, std::string& );
- static void decode(const std::string& in, unsigned char *out, size_t&);
-
- static size_t decode_length(const std::string& );
-
-private:
-static const char *bstr;
-static const char rstr[128];
-};
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _BASE64_H
diff --git a/common/SocketLib/File.cpp b/common/SocketLib/File.cpp
deleted file mode 100644
index a49e6caad..000000000
--- a/common/SocketLib/File.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/** \file File.cpp
- ** \date 2005-04-25
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004,2005 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-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
-#include
-#include
-#include
-#ifndef _WIN32
-#include
-#endif
-
-#include "File.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-File::File()
-:m_fil(nullptr)
-{
-}
-
-
-File::~File()
-{
-}
-
-
-bool File::fopen(const std::string& path, const std::string& mode)
-{
- m_path = path;
- m_mode = mode;
- m_fil = ::fopen(path.c_str(), mode.c_str());
- return m_fil ? true : false;
-}
-
-
-void File::fclose()
-{
- if (m_fil)
- ::fclose(m_fil);
-}
-
-
-
-size_t File::fread(char *ptr, size_t size, size_t nmemb)
-{
- return m_fil ? ::fread(ptr, size, nmemb, m_fil) : 0;
-}
-
-
-size_t File::fwrite(const char *ptr, size_t size, size_t nmemb)
-{
- return m_fil ? ::fwrite(ptr, size, nmemb, m_fil) : 0;
-}
-
-
-
-char *File::fgets(char *s, int size)
-{
- return m_fil ? ::fgets(s, size, m_fil) : nullptr;
-}
-
-
-void File::fprintf(char *format, ...)
-{
- va_list ap;
- va_start(ap, format);
- vfprintf(m_fil, format, ap);
- va_end(ap);
-}
-
-
-off_t File::size()
-{
- struct stat st;
- if (stat(m_path.c_str(), &st) == -1)
- {
- return 0;
- }
- return st.st_size;
-}
-
-
-bool File::eof()
-{
- if (m_fil)
- {
- if (feof(m_fil))
- return true;
- }
- return false;
-}
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/common/SocketLib/File.h b/common/SocketLib/File.h
deleted file mode 100644
index a575d0973..000000000
--- a/common/SocketLib/File.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/** \file File.h
- ** \date 2005-04-25
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004,2005 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-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.
-*/
-#ifndef _FILE_H
-#define _FILE_H
-
-#include "IFile.h"
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-/** IFile implementation of a disk file.
- \ingroup file */
-class File : public IFile
-{
-public:
- File();
- ~File();
-
- bool fopen(const std::string&, const std::string&);
- void fclose();
-
- size_t fread(char *, size_t, size_t);
- size_t fwrite(const char *, size_t, size_t);
-
- char *fgets(char *, int);
- void fprintf(char *format, ...);
-
- off_t size();
- bool eof();
-
-private:
- File(const File& ) {} // copy constructor
- File& operator=(const File& ) { return *this; } // assignment operator
-
- std::string m_path;
- std::string m_mode;
- FILE *m_fil;
-};
-
-
-
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
-#endif // _FILE_H
diff --git a/common/SocketLib/HTTPSocket.cpp b/common/SocketLib/HTTPSocket.cpp
deleted file mode 100644
index da4f2264c..000000000
--- a/common/SocketLib/HTTPSocket.cpp
+++ /dev/null
@@ -1,366 +0,0 @@
-/* EQEMu: Everquest Server Emulator
- *
- * This code originated from `C++ Sockets Library` referenced below.
- * Taken and stripped/modified to remove dependancies on parts of
- * the library which we are not using, and to suit other needs.
- * 2006 - EQEMu Development Team (http://eqemulator.net)
- *
- *
- */
-
-/** \file HTTPSocket.cpp
- ** \date 2004-04-06
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004,2005 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-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.
-*/
-#ifdef _WIN32
-#pragma warning(disable:4786)
-#endif
-#include "../global_define.h"
-#include
-#include
-#include
-#include "Parse.h"
-#include "HTTPSocket.h"
-#include "../tcp_connection.h"
-#include
-#include
-
-#ifdef SOCKETS_NAMESPACE
-namespace SOCKETS_NAMESPACE {
-#endif
-
-
-
-
-HTTPSocket::HTTPSocket(uint32 ID, SOCKET in_socket, uint32 irIP, uint16 irPort)
-:TCPConnection(ID,in_socket,irIP,irPort)
-,m_first(true)
-,m_header(true)
-,m_http_version("HTTP/1.0")
-,m_request(false)
-,m_response(false)
-{
-}
-
-
-HTTPSocket::~HTTPSocket()
-{
-}
-
-/*
- * eqemu stuff
- */
-
-bool HTTPSocket::ProcessReceivedData(char *errbuf)
-{
- if (errbuf)
- errbuf[0] = 0;
- if (!recvbuf)
- return true;
-
- char *buff=(char *)recvbuf;
- unsigned long bufflen=recvbuf_used;
-
- while(1) {
- if (m_header) {
- char *ptr=(char *)memchr(buff,'\n',bufflen);
- if (!ptr)
- break;
- int length=(ptr-buff)+1;
- std::string line;
- line.append(buff,length-2);
- OnLine(line);
-
- buff+=length;
- bufflen-=length;
- } else {
- OnData(buff,bufflen);
- buff+=bufflen;
- bufflen=0;
- break;
- }
- }
-
- if (bufflen) {
- memmove(recvbuf,buff,bufflen);
- recvbuf_used=bufflen;
- } else {
- safe_delete_array(recvbuf);
- }
-}
-
-bool HTTPSocket::SendString(const char *str) {
- return(TCPConnection::Send((const uchar *) str, strlen(str)));
-}
-
-bool HTTPSocket::SendBuf(const char *dat, unsigned int len) {
- return(TCPConnection::Send((const uchar *) dat, len));
-}
-
-/*
- * /eqemu stuff
- */
-
-void HTTPSocket::OnLine(const std::string& line)
-{
- if (m_first)
- {
- Parse pa(line);
- std::string str = pa.getword();
- if (str.substr(0,4) == "HTTP") // response
- {
- m_http_version = str;
- m_status = pa.getword();
- m_status_text = pa.getrest();
- m_response = true;
- }
- else // request
- {
- m_method = str;
- m_url = pa.getword();
- size_t spl = m_url.find("?");
- if (spl != std::string::npos)
- {
- m_uri = m_url.substr(0,spl);
- m_query_string = m_url.substr(spl + 1);
- }
- else
- {
- m_uri = m_url;
- }
- m_http_version = pa.getword();
- m_request = true;
- }
- m_first = false;
- OnFirst();
- return;
- }
- if (!line.size())
- {
-// SetLineProtocol(false);
- m_header = false;
- OnHeaderComplete();
- return;
- }
- Parse pa(line,":");
- std::string key = pa.getword();
- std::string value = pa.getrest();
- OnHeader(key,value);
- /* If remote end tells us to keep connection alive, and we're operating
- in http/1.1 mode (not http/1.0 mode), then we mark the socket to be
- retained. */
-/* if (!strcasecmp(key.c_str(), "connection") &&
- !strcasecmp(value.c_str(), "keep-alive") )
- {
- SetRetain();
- }*/
-}
-
-
-void HTTPSocket::SendResponse()
-{
- std::string msg;
- msg = m_http_version + " " + m_status + " " + m_status_text + "\r\n";
- for (string_m::iterator it = m_response_header.begin(); it != m_response_header.end(); it++)
- {
- std::string key = (*it).first;
- std::string val = (*it).second;
- msg += key + ": " + val + "\r\n";
- }
- msg += "\r\n";
- SendString( msg.c_str() );
-}
-
-
-void HTTPSocket::AddResponseHeader(const std::string& header, const char *format, ...)
-{
- static char slask[5000];
- va_list ap;
-
- va_start(ap, format);
-#ifdef _WIN32
- vsprintf(slask, format, ap);
-#else
- vsnprintf(slask, 5000, format, ap);
-#endif
- va_end(ap);
-
- m_response_header[header] = slask;
-}
-
-
-void HTTPSocket::SendRequest()
-{
- std::string msg;
- msg = m_method + " " + m_url + " " + m_http_version + "\r\n";
- for (string_m::iterator it = m_response_header.begin(); it != m_response_header.end(); it++)
- {
- std::string key = (*it).first;
- std::string val = (*it).second;
- msg += key + ": " + val + "\r\n";
- }
- msg += "\r\n";
- SendString( msg.c_str() );
-}
-
-
-std::string HTTPSocket::MyUseragent()
-{
- std::string version = "C++Sockets/";
-#ifdef _VERSION
- version += _VERSION;
-#endif
- return version;
-}
-
-
-void HTTPSocket::Reset()
-{
- m_first = true;
- m_header = true;
- m_request = false;
- m_response = false;
-// SetLineProtocol(true);
- while (m_response_header.size())
- {
- string_m::iterator it = m_response_header.begin();
- m_response_header.erase(it);
- }
-
-}
-
-
-const std::string& HTTPSocket::GetMethod()
-{
- return m_method;
-}
-
-
-void HTTPSocket::SetMethod(const std::string& x)
-{
- m_method = x;
-}
-
-
-const std::string& HTTPSocket::GetUrl()
-{
- return m_url;
-}
-
-
-void HTTPSocket::SetUrl(const std::string& x)
-{
- m_url = x;
-}
-
-
-const std::string& HTTPSocket::GetUri()
-{
- return m_uri;
-}
-
-
-const std::string& HTTPSocket::GetQueryString()
-{
- return m_query_string;
-}
-
-
-const std::string& HTTPSocket::GetHttpVersion()
-{
- return m_http_version;
-}
-
-
-const std::string& HTTPSocket::GetStatus()
-{
- return m_status;
-}
-
-
-const std::string& HTTPSocket::GetStatusText()
-{
- return m_status_text;
-}
-
-
-bool HTTPSocket::IsRequest()
-{
- return m_request;
-}
-
-
-bool HTTPSocket::IsResponse()
-{
- return m_response;
-}
-
-
-void HTTPSocket::SetHttpVersion(const std::string& x)
-{
- m_http_version = x;
-}
-
-
-void HTTPSocket::SetStatus(const std::string& num, const std::string& text) {
- m_status = num;
- m_status_text = text;
-}
-
-void HTTPSocket::SetStatus(const std::string& x)
-{
- m_status = x;
-}
-
-
-void HTTPSocket::SetStatusText(const std::string& x)
-{
- m_status_text = x;
-}
-
-
-void HTTPSocket::AddResponseHeader(const std::string& x,const std::string& y)
-{
- m_response_header[x] = y;
-}
-
-
-void HTTPSocket::SetUri(const std::string& x)
-{
- m_uri = x;
-}
-
-void HTTPSocket::SendResponse(const std::string& status_num, const std::string& status_text) {
- SetStatus(status_num, status_text);
- SendResponse();
-}
-
-#ifdef SOCKETS_NAMESPACE
-}
-#endif
-
diff --git a/common/SocketLib/HTTPSocket.h b/common/SocketLib/HTTPSocket.h
deleted file mode 100644
index 409c90bce..000000000
--- a/common/SocketLib/HTTPSocket.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* EQEMu: Everquest Server Emulator
- *
- * This code originated from `C++ Sockets Library` referenced below.
- * Taken and stripped/modified to remove dependancies on parts of
- * the library which we are not using, and to suit other needs.
- * 2006 - EQEMu Development Team (http://eqemulator.net)
- *
- *
- */
-
-/** \file HTTPSocket.h Class HTTPSocket definition.
- ** \date 2004-04-06
- ** \author grymse@alhem.net
-**/
-/*
-Copyright (C) 2004,2005 Anders Hedstrom
-
-This library is made available under the terms of the GNU GPL.
-
-If you would like to use this library in a closed-source application,
-a separate license agreement is available. For information about
-the closed-source license agreement for the C++ sockets library,
-please visit http://www.alhem.net/Sockets/license.html and/or
-email license@alhem.net.
-
-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.
-*/
-#ifndef _HTTPSOCKET_H
-#define _HTTPSOCKET_H
-
-#include