Compare commits

...

32 Commits

Author SHA1 Message Date
80d0cd68f9 Merge branch 'main' into windows-clang-fixes 2024-12-19 22:27:18 +00:00
8e8d0153c8 update CMAKE_BUILD_TYPE setter 2024-12-11 19:51:37 +00:00
badde23d1c fix a few more warnings 2024-12-11 19:45:36 +00:00
bb9b2597e5 save all artifacts test 2024-12-11 19:26:53 +00:00
92d086c10b replace some silly warnings 2024-12-11 19:25:54 +00:00
a0f2aebb4d fix names of workflows 2024-12-11 16:36:45 +00:00
9ea616bd9b hardcoded docker change test 2024-12-11 16:32:20 +00:00
ba2c692565 switch to using compat 2024-12-11 15:39:57 +00:00
4133008d9c Clean up warnings, fix errors related to testes and how MariaDB moves around 2024-12-11 15:18:45 +00:00
1f5982ed0e learning to fucking read 2024-12-09 19:12:37 +00:00
5e73fa5e4c actually configure 2024-12-09 19:10:29 +00:00
fff7bf879f workflow changes 2024-12-09 19:07:18 +00:00
c20e1fbcf0 urgh 2024-12-09 19:05:34 +00:00
1f8ec6e295 I'm just trying stuff at this point 2024-12-09 18:56:32 +00:00
51070d475d remove default configure step from build 2024-12-09 18:55:04 +00:00
5a05622eca append configureType to matrix 2024-12-09 18:53:19 +00:00
3760ffa349 presets and workflow changes 2024-12-09 18:47:26 +00:00
jadebenn
9be88b3083 ci fix 2024-12-08 17:05:34 -06:00
jadebenn
0772e563c1 remove workflow presets (for now) and try another CI fix 2024-12-08 16:54:37 -06:00
jadebenn
4b99b984af attempted CI fix (feel free to revert) 2024-12-08 16:42:41 -06:00
jadebenn
628f6b4101 Merge remote-tracking branch 'upstream/main' into windows-clang-fixes 2024-12-08 16:30:12 -06:00
0d45403e8c last CI test for tonight 2024-12-08 20:58:25 +00:00
fa017b6db9 Merge branch 'main' into windows-clang-fixes 2024-12-08 20:53:57 +00:00
10e64a5d20 re-add testPresets 2024-12-08 20:48:36 +00:00
83e08f63bc remove test and workflow presets 2024-12-08 20:31:27 +00:00
ece0e29577 I made this mistake years ago, my bad 2024-12-05 20:03:17 +00:00
6eea3f3662 Fix up ZLib a little more and remove more configuration into CMakeLists 2024-12-05 19:45:21 +00:00
6c8bb743af Remove user-specific clang configurations
Also replace zlib with zlib-ng
2024-12-04 22:38:05 +00:00
jadebenn
f4082cc538 formatting 2024-12-03 21:18:31 -06:00
jadebenn
edc7109e19 update presets 2024-12-03 21:14:24 -06:00
jadebenn
da45152b43 clang cl toolset 2024-12-03 20:41:23 -06:00
jadebenn
8b9a0768a2 trying to enable clang for windows msvc 2024-12-03 20:30:09 -06:00
20 changed files with 156 additions and 652 deletions

View File

@@ -1,4 +1,4 @@
name: CI
name: Build and Update Docker
on:
push:

View File

@@ -1,4 +1,4 @@
name: CI
name: Build And Test
on:
push:
@@ -14,6 +14,13 @@ jobs:
strategy:
matrix:
os: [ windows-2022, ubuntu-22.04, macos-13 ]
include:
- os: windows-2022
configureType: windows-msvc
- os: ubuntu-22.04
configureType: linux-gnu
- os: macos-13
configureType: macos
steps:
- uses: actions/checkout@v4
@@ -33,20 +40,13 @@ jobs:
- name: cmake
uses: lukka/run-cmake@v10
with:
workflowPreset: "ci-${{matrix.os}}"
configurePreset: "${{matrix.configureType}}"
buildPreset: "ci-${{matrix.os}}"
testPreset: "ci-${{matrix.os}}"
- name: artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{matrix.os}}
path: |
build/*/*Server*
build/*/*.ini
build/*/*.so
build/*/*.dll
build/*/*.dylib
build/*/vanity/
build/*/navmeshes/
build/*/migrations/
build/*/*.dcf
!build/*/*.pdb
!build/*/d*/
build/*

2
.gitignore vendored
View File

@@ -113,6 +113,8 @@ CMakeFiles/TargetDirectories.txt
*.sln
*.recipe
CMakeUserPresets.json
# clangd
.cache
thirdparty/zlib-1.2.11/

View File

@@ -19,6 +19,14 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Export the compile commands for debuggi
set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) # Set CMAKE visibility policy to NEW on project and subprojects
set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C and C++ symbol visibility to hide inlined functions
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug, Release, RelWithDebInfo, MinSizeRel")
if (${CMAKE_BUILD_TYPE} MATCHES "") # CI likes to set CMAKE_BUILD_TYPE to an empty string
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
set(DLU_CONFIG_DIR ${CMAKE_SOURCE_DIR}/build CACHE PATH "The directory where the server configuration files are stored")
# Read variables from file
FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables)
@@ -72,7 +80,7 @@ if(UNIX)
# For all except Clang and Apple Clang
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options("-static-libgcc" "-lstdc++fs")
add_compile_options("-static-libgcc" "-lstdc++fs" "-Wno-error=implicit-function-declaration" "-Wno-error=int-conversion")
endif()
if(${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
@@ -90,10 +98,11 @@ elseif(WIN32)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
# Our output dir
#set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) # unfortunately, forces all libraries to be built in series, which will slow down the build process
# Set the output directories
# ./build/<platform + architecture (x64, x86, aarch64)>/<compiler>/<build_mode>/
set(CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR}/${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}/${CMAKE_CXX_COMPILER_ID}/${CMAKE_BUILD_TYPE})
# TODO make this not have to override the build type directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
@@ -108,6 +117,15 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
# Get DLU config directory
if(DEFINED ENV{DLU_CONFIG_DIR})
set(DLU_CONFIG_DIR $ENV{DLU_CONFIG_DIR})
else()
set(DLU_CONFIG_DIR ${CMAKE_BINARY_DIR})
endif()
message(STATUS "Configuration Directory is ${DLU_CONFIG_DIR}, and the build directory is ${CMAKE_BINARY_DIR}")
find_package(MariaDB)
# Create a /resServer directory
@@ -116,18 +134,11 @@ make_directory(${CMAKE_BINARY_DIR}/resServer)
# Create a /logs directory
make_directory(${CMAKE_BINARY_DIR}/logs)
# Get DLU config directory
if(DEFINED ENV{DLU_CONFIG_DIR})
set(DLU_CONFIG_DIR $ENV{DLU_CONFIG_DIR})
else()
set(DLU_CONFIG_DIR ${PROJECT_BINARY_DIR})
endif()
message(STATUS "Variable: DLU_CONFIG_DIR = ${DLU_CONFIG_DIR}")
# Copy resource files on first build
set(RESOURCE_FILES "sharedconfig.ini" "authconfig.ini" "chatconfig.ini" "worldconfig.ini" "masterconfig.ini" "blocklist.dcf")
message(STATUS "Checking resource file integrity")
include(Utils)
UpdateConfigOption(${DLU_CONFIG_DIR}/authconfig.ini "port" "auth_server_port")
UpdateConfigOption(${DLU_CONFIG_DIR}/chatconfig.ini "port" "chat_server_port")
@@ -196,15 +207,15 @@ endforeach()
message(STATUS "Resource file integrity check complete")
# if navmeshes directory does not exist, create it
if(NOT EXISTS ${PROJECT_BINARY_DIR}/navmeshes)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/navmeshes)
if(NOT EXISTS ${CMAKE_BINARY_DIR}/navmeshes)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/navmeshes)
endif()
# Copy navmesh data on first build and extract it
configure_file(${CMAKE_SOURCE_DIR}/resources/navmeshes.zip ${PROJECT_BINARY_DIR}/navmeshes.zip COPYONLY)
configure_file(${CMAKE_SOURCE_DIR}/resources/navmeshes.zip ${CMAKE_BINARY_DIR}/navmeshes.zip COPYONLY)
file(ARCHIVE_EXTRACT INPUT ${PROJECT_BINARY_DIR}/navmeshes.zip DESTINATION ${PROJECT_BINARY_DIR}/navmeshes)
file(REMOVE ${PROJECT_BINARY_DIR}/navmeshes.zip)
file(ARCHIVE_EXTRACT INPUT ${CMAKE_BINARY_DIR}/navmeshes.zip DESTINATION ${CMAKE_BINARY_DIR}/navmeshes)
file(REMOVE ${CMAKE_BINARY_DIR}/navmeshes.zip)
# Copy vanity files on first build
set(VANITY_FILES "CREDITS.md" "INFO.md" "TESTAMENT.md" "root.xml" "dev-tribute.xml" "atm.xml" "demo.xml")
@@ -214,20 +225,20 @@ foreach(file ${VANITY_FILES})
endforeach()
# Move our migrations for MasterServer to run
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/dlu/)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/migrations/dlu/)
file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/dlu/*.sql)
foreach(file ${SQL_FILES})
get_filename_component(file ${file} NAME)
configure_file(${CMAKE_SOURCE_DIR}/migrations/dlu/${file} ${PROJECT_BINARY_DIR}/migrations/dlu/${file})
configure_file(${CMAKE_SOURCE_DIR}/migrations/dlu/${file} ${CMAKE_BINARY_DIR}/migrations/dlu/${file})
endforeach()
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/cdserver/)
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/migrations/cdserver/)
file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/cdserver/*.sql)
foreach(file ${SQL_FILES})
get_filename_component(file ${file} NAME)
configure_file(${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${PROJECT_BINARY_DIR}/migrations/cdserver/${file})
configure_file(${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${CMAKE_BINARY_DIR}/migrations/cdserver/${file})
endforeach()
# Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux)

View File

@@ -11,72 +11,37 @@
"displayName": "Default configure step",
"description": "Use 'build' dir and Unix makefiles",
"binaryDir": "${sourceDir}/build",
"generator": "Unix Makefiles"
},
{
"name": "debug-config",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "relwithdebinfo-config",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "release-config",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "clang-config",
"hidden": true,
"toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake"
},
{
"name": "gnu-config",
"hidden": true,
"toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake"
},
{
"name": "windows-msvc",
"inherits": "default",
"displayName": "[Multi] Windows (MSVC)",
"description": "Set architecture to 64-bit (b/c RakNet)",
"generator": "Visual Studio 17 2022",
"binaryDir": "${sourceDir}/build/msvc",
"architecture": {
"value": "x64"
},
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
"generator": "Unix Makefiles",
"hidden": true
},
{
"name": "windows-default",
"inherits": "windows-msvc",
"displayName": "Windows only Configure Settings",
"inherits": "default",
"displayName": "Windows Default Configure Settings",
"description": "Sets build and install directories",
"generator": "Ninja",
"generator": "Visual Studio 17 2022",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"architecture": {
"value": "x64"
}
"hidden": true
},
{
"name": "linux-config",
"name": "windows-msvc",
"inherits": "windows-default",
"displayName": "Windows (MSVC)",
"description": "Create a build using MSVC"
},
{
"name": "windows-clang",
"inherits": "windows-default",
"displayName": "EXPERIMENTAL - Windows (Clang)",
"description": "Create a build using Clang",
"toolset": "ClangCL"
},
{
"name": "linux-default",
"inherits": "default",
"hidden": true,
"condition": {
@@ -86,553 +51,74 @@
}
},
{
"name": "linux-clang-debug",
"inherits": [
"linux-config",
"clang-config",
"debug-config"
],
"displayName": "EXPERIMENTAL - [Debug] Linux (Clang)",
"description": "Create a debug build using the Clang toolchain for Linux",
"binaryDir": "${sourceDir}/build/clang-debug"
"name": "linux-clang",
"inherits": "linux-default",
"toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake",
"displayName": "Linux (Clang)",
"description": "Create a build using the Clang toolchain for Linux"
},
{
"name": "linux-clang-relwithdebinfo",
"inherits": [
"linux-config",
"clang-config",
"relwithdebinfo-config"
],
"displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)",
"description": "Create a release build with debug info using the Clang toolchain for Linux",
"binaryDir": "${sourceDir}/build/clang-relwithdebinfo"
},
{
"name": "linux-clang-release",
"inherits": [
"linux-config",
"clang-config",
"release-config"
],
"displayName": "EXPERIMENTAL - [Release] Linux (Clang)",
"description": "Create a release build using the Clang toolchain for Linux",
"binaryDir": "${sourceDir}/build/clang-release"
},
{
"name": "linux-gnu-debug",
"inherits": [
"linux-config",
"gnu-config",
"debug-config"
],
"displayName": "[Debug] Linux (GNU)",
"description": "Create a debug build using the GNU toolchain for Linux",
"binaryDir": "${sourceDir}/build/gnu-debug"
},
{
"name": "linux-gnu-relwithdebinfo",
"inherits": [
"linux-config",
"gnu-config",
"relwithdebinfo-config"
],
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "Create a release build with debug info using the GNU toolchain for Linux",
"binaryDir": "${sourceDir}/build/gnu-relwithdebinfo"
},
{
"name": "linux-gnu-release",
"inherits": [
"linux-config",
"gnu-config",
"release-config"
],
"displayName": "[Release] Linux (GNU)",
"description": "Create a release build using the GNU toolchain for Linux",
"binaryDir": "${sourceDir}/build/gnu-release"
"name": "linux-gnu",
"inherits": "linux-default",
"toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake",
"displayName": "Linux (GNU)",
"description": "Create a build using the GNU toolchain for Linux"
},
{
"name": "macos",
"inherits": "default",
"displayName": "[Multi] MacOS",
"displayName": "MacOS",
"description": "Create a build for MacOS",
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
},
"binaryDir": "${sourceDir}/build/macos"
}
}
],
"buildPresets": [
{
"name": "default",
"configurePreset": "default",
"displayName": "Default Build",
"description": "Default Build",
"jobs": 2
},
{
"name": "windows-msvc-debug",
"inherits": "default",
"configurePreset": "windows-msvc",
"displayName": "[Debug] Windows (MSVC)",
"description": "This preset is used to build in debug mode using the MSVC toolchain on Windows",
"configuration": "Debug"
},
{
"name": "windows-msvc-relwithdebinfo",
"inherits": "default",
"configurePreset": "windows-msvc",
"displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "This preset is used to build in debug mode using the MSVC toolchain on Windows",
"configuration": "RelWithDebInfo"
},
{
"name": "windows-msvc-release",
"inherits": "default",
"configurePreset": "windows-msvc",
"displayName": "[Release] Windows (MSVC)",
"description": "This preset is used to build in release mode using the MSVC toolchain on Windows",
"configuration": "Release"
},
{
"name": "linux-clang-debug",
"inherits": "default",
"configurePreset": "linux-clang-debug",
"displayName": "EXPERIMENTAL - [Debug] Linux (Clang)",
"description": "This preset is used to build in debug mode using the Clang toolchain on Linux",
"configuration": "Debug"
},
{
"name": "linux-clang-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-clang-relwithdebinfo",
"displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)",
"description": "This preset is used to build in release mode with debug info using the Clang toolchain on Linux",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-clang-release",
"inherits": "default",
"configurePreset": "linux-clang-release",
"displayName": "EXPERIMENTAL - [Release] Linux (Clang)",
"description": "This preset is used to build in release mode using the Clang toolchain on Linux",
"configuration": "Release"
},
{
"name": "linux-gnu-debug",
"inherits": "default",
"configurePreset": "linux-gnu-debug",
"displayName": "[Debug] Linux (GNU)",
"description": "This preset is used to build in debug mode using the GNU toolchain on Linux",
"configuration": "Debug"
},
{
"name": "linux-gnu-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "This preset is used to build in release mode with debug info using the GNU toolchain on Linux",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-gnu-release",
"inherits": "default",
"configurePreset": "linux-gnu-release",
"displayName": "[Release] Linux (GNU)",
"description": "This preset is used to build in release mode using the GNU toolchain on Linux",
"configuration": "Release"
},
{
"name": "macos-debug",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[Debug] MacOS",
"description": "This preset is used to build in debug mode on MacOS",
"configuration": "Debug"
},
{
"name": "macos-relwithdebinfo",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[RelWithDebInfo] MacOS",
"description": "This preset is used to build in release mode with debug info on MacOS",
"configuration": "RelWithDebInfo"
},
{
"name": "macos-release",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[Release] MacOS",
"description": "This preset is used to build in release mode on MacOS",
"configuration": "Release"
}
{ "name": "ci-ubuntu-22.04", "configurePreset": "linux-gnu" },
{ "name": "ci-macos-13", "configurePreset": "macos" },
{ "name": "ci-windows-2022", "configurePreset": "windows-msvc" }
],
"testPresets": [
{
"name": "default",
"hidden": true,
"execution": {
"jobs": 2
},
"output": {
"outputOnFailure": true
}
},
{
"name": "default",
"configurePreset": "default",
"execution": {
"jobs": 2
},
"output": {
"outputOnFailure": true
}
"name": "ci-ubuntu-22.04",
"configurePreset": "linux-gnu",
"displayName": "CI Tests on Linux",
"inherits": "default"
},
{
"name": "windows-msvc-test",
"inherits": "default",
"name": "ci-macos-13",
"configurePreset": "macos",
"displayName": "CI Tests on MacOS",
"inherits": "default"
},
{
"name": "ci-windows-2022",
"configurePreset": "windows-msvc",
"hidden": true,
"displayName": "CI Tests on windows",
"inherits": "default",
"configuration": "RelWithDebInfo",
"filter": {
"exclude": {
"name": "((example)|(minigzip))+"
}
}
},
{
"name": "windows-msvc-debug",
"inherits": "windows-msvc-test",
"configurePreset": "windows-msvc",
"displayName": "[Debug] Windows (MSVC)",
"description": "Runs all tests on a Windows configuration",
"configuration": "Debug"
},
{
"name": "windows-msvc-relwithdebinfo",
"inherits": "windows-msvc-test",
"configurePreset": "windows-msvc",
"displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "Runs all tests on a Windows configuration",
"configuration": "RelWithDebInfo"
},
{
"name": "windows-msvc-release",
"inherits": "windows-msvc-test",
"configurePreset": "windows-msvc",
"displayName": "[Release] Windows (MSVC)",
"description": "Runs all tests on a Windows configuration",
"configuration": "Release"
},
{
"name": "linux-clang-debug",
"inherits": "default",
"configurePreset": "linux-clang-debug",
"displayName": "EXPERIMENTAL - [Debug] Linux (Clang)",
"description": "Runs all tests on a Linux Clang configuration",
"configuration": "Release"
},
{
"name": "linux-clang-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-clang-relwithdebinfo",
"displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)",
"description": "Runs all tests on a Linux Clang configuration",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-clang-release",
"inherits": "default",
"configurePreset": "linux-clang-release",
"displayName": "EXPERIMENTAL - [Release] Linux (Clang)",
"description": "Runs all tests on a Linux Clang configuration",
"configuration": "Release"
},
{
"name": "linux-gnu-debug",
"inherits": "default",
"configurePreset": "linux-gnu-debug",
"displayName": "[Debug] Linux (GNU)",
"description": "Runs all tests on a Linux GNU configuration",
"configuration": "Release"
},
{
"name": "linux-gnu-relwithdebinfo",
"inherits": "default",
"configurePreset": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "Runs all tests on a Linux GNU configuration",
"configuration": "RelWithDebInfo"
},
{
"name": "linux-gnu-release",
"inherits": "default",
"configurePreset": "linux-gnu-release",
"displayName": "[Release] Linux (GNU)",
"description": "Runs all tests on a Linux GNU configuration",
"configuration": "Release"
},
{
"name": "macos-debug",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[Debug] MacOS",
"description": "Runs all tests on a MacOS configuration",
"configuration": "Debug"
},
{
"name": "macos-relwithdebinfo",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[RelWithDebInfo] MacOS",
"description": "Runs all tests on a MacOS configuration",
"configuration": "RelWithDebInfo"
},
{
"name": "macos-release",
"inherits": "default",
"configurePreset": "macos",
"displayName": "[Release] MacOS",
"description": "Runs all tests on a MacOS configuration",
"configuration": "Release"
}
],
"workflowPresets": [
{
"name": "default",
"steps": [
{
"type": "configure",
"name": "default"
},
{
"type": "build",
"name": "default"
},
{
"type": "test",
"name": "default"
}
]
},
{
"name": "windows-msvc-debug",
"displayName": "[Debug] Windows (MSVC)",
"description": "MSVC debug workflow preset for Windows",
"steps": [
{
"type": "configure",
"name": "windows-msvc"
},
{
"type": "build",
"name": "windows-msvc-debug"
},
{
"type": "test",
"name": "windows-msvc-debug"
}
]
},
{
"name": "windows-msvc-relwithdebinfo",
"displayName": "[RelWithDebInfo] Windows (MSVC)",
"description": "MSVC release with debug info workflow preset for Windows",
"steps": [
{
"type": "configure",
"name": "windows-msvc"
},
{
"type": "build",
"name": "windows-msvc-relwithdebinfo"
},
{
"type": "test",
"name": "windows-msvc-relwithdebinfo"
}
]
},
{
"name": "ci-windows-2022",
"displayName": "[Release] Windows (MSVC)",
"description": "CI workflow preset for Windows",
"steps": [
{
"type": "configure",
"name": "windows-msvc"
},
{
"type": "build",
"name": "windows-msvc-release"
},
{
"type": "test",
"name": "windows-msvc-release"
}
]
},
{
"name": "linux-gnu-debug",
"displayName": "[Debug] Linux (GNU)",
"description": "GNU debug workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-gnu-debug"
},
{
"type": "build",
"name": "linux-gnu-debug"
},
{
"type": "test",
"name": "linux-gnu-debug"
}
]
},
{
"name": "linux-gnu-relwithdebinfo",
"displayName": "[RelWithDebInfo] Linux (GNU)",
"description": "GNU release with debug info workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-gnu-relwithdebinfo"
},
{
"type": "build",
"name": "linux-gnu-relwithdebinfo"
},
{
"type": "test",
"name": "linux-gnu-relwithdebinfo"
}
]
},
{
"name": "ci-ubuntu-22.04",
"displayName": "[Release] Linux (GNU)",
"description": "CI workflow preset for Ubuntu",
"steps": [
{
"type": "configure",
"name": "linux-gnu-release"
},
{
"type": "build",
"name": "linux-gnu-release"
},
{
"type": "test",
"name": "linux-gnu-release"
}
]
},
{
"name": "linux-clang-debug",
"displayName": "EXPERIMENTAL - [Debug] Linux (Clang)",
"description": "Clang debug workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-clang-debug"
},
{
"type": "build",
"name": "linux-clang-debug"
},
{
"type": "test",
"name": "linux-clang-debug"
}
]
},
{
"name": "linux-clang-relwithdebinfo",
"displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)",
"description": "Clang release with debug info workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-clang-relwithdebinfo"
},
{
"type": "build",
"name": "linux-clang-relwithdebinfo"
},
{
"type": "test",
"name": "linux-clang-relwithdebinfo"
}
]
},
{
"name": "linux-clang-release",
"displayName": "EXPERIMENTAL - [Release] Linux (Clang)",
"description": "Clang release workflow preset for Linux",
"steps": [
{
"type": "configure",
"name": "linux-clang-release"
},
{
"type": "build",
"name": "linux-clang-release"
},
{
"type": "test",
"name": "linux-clang-release"
}
]
},
{
"name": "macos-debug",
"displayName": "[Debug] MacOS",
"description": "Release workflow preset for MacOS",
"steps": [
{
"type": "configure",
"name": "macos"
},
{
"type": "build",
"name": "macos-debug"
},
{
"type": "test",
"name": "macos-debug"
}
]
},
{
"name": "macos-relwithdebinfo",
"displayName": "[RelWithDebInfo] MacOS",
"description": "Release with debug info workflow preset for MacOS",
"steps": [
{
"type": "configure",
"name": "macos"
},
{
"type": "build",
"name": "macos-relwithdebinfo"
},
{
"type": "test",
"name": "macos-relwithdebinfo"
}
]
},
{
"name": "ci-macos-13",
"displayName": "[Release] MacOS",
"description": "CI workflow preset for MacOS",
"steps": [
{
"type": "configure",
"name": "macos"
},
{
"type": "build",
"name": "macos-release"
},
{
"type": "test",
"name": "macos-release"
}
]
}
]
}

View File

@@ -23,23 +23,23 @@ RUN --mount=type=cache,id=build-apt-cache,target=/var/cache/apt \
rm -rf /var/lib/apt/lists/*
# Grab libraries and load them
COPY --from=build /app/build/mariadbcpp/libmariadbcpp.so /usr/local/lib/
COPY --from=build /app/build/Linux-x86_64/GNU/Release/mariadbcpp/libmariadbcpp.so /usr/local/lib/
RUN ldconfig
# Server bins
COPY --from=build /app/build/*Server /app/
COPY --from=build /app/build/Linux-x86_64/GNU/Release/*Server /app/
# Necessary suplimentary files
COPY --from=build /app/build/*.ini /app/configs/
COPY --from=build /app/build/vanity/*.* /app/vanity/
COPY --from=build /app/build/navmeshes /app/navmeshes
COPY --from=build /app/build/migrations /app/migrations
COPY --from=build /app/build/*.dcf /app/
COPY --from=build /app/build/Linux-x86_64/GNU/Release/*.ini /app/configs/
COPY --from=build /app/build/Linux-x86_64/GNU/Release/vanity/*.* /app/vanity/
COPY --from=build /app/build/Linux-x86_64/GNU/Release/navmeshes /app/navmeshes
COPY --from=build /app/build/Linux-x86_64/GNU/Release/migrations /app/migrations
COPY --from=build /app/build/Linux-x86_64/GNU/Release/*.dcf /app/
# backup of config and vanity files to copy to the host incase
# of a mount clobbering the copy from above
COPY --from=build /app/build/*.ini /app/default-configs/
COPY --from=build /app/build/vanity/*.* /app/default-vanity/
COPY --from=build /app/build/Linux-x86_64/GNU/Release/*.ini /app/default-configs/
COPY --from=build /app/build/Linux-x86_64/GNU/Release/vanity/*.* /app/default-vanity/
# needed as the container runs with the root user
# and therefore sudo doesn't exist

View File

@@ -2,8 +2,8 @@
# On Windows ClangCL can't compile the connector from source but can link to an msvc compiled one,
# so prefer the prebuilt binaries unless MARIADB_BUILD_SOURCE is specified
if(WIN32 AND NOT MARIADB_BUILD_SOURCE)
set(MARIADB_MSI_DIR "${PROJECT_BINARY_DIR}/msi")
set(MARIADB_CONNECTOR_DIR "${PROJECT_BINARY_DIR}/mariadbcpp")
set(MARIADB_MSI_DIR "${CMAKE_BINARY_DIR}/msi")
set(MARIADB_CONNECTOR_DIR "${CMAKE_BINARY_DIR}/mariadbcpp")
set(MARIADB_C_CONNECTOR_DIR "${MARIADB_CONNECTOR_DIR}/MariaDB/MariaDB Connector C 64-bit")
set(MARIADB_CPP_CONNECTOR_DIR "${MARIADB_CONNECTOR_DIR}/MariaDB/MariaDB C++ Connector 64-bit")
@@ -59,7 +59,7 @@ if(WIN32 AND NOT MARIADB_BUILD_SOURCE)
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${MARIADBCPP_SHARED_LIBRARY_LOCATION}"
"${MARIADBC_SHARED_LIBRARY_LOCATION}"
"${PROJECT_BINARY_DIR}")
"${CMAKE_BINARY_DIR}")
# MariaDB uses plugins that the database needs to load, the prebuilt binaries by default will try to find the libraries in system directories,
# so set this define and the servers will set the MARIADB_PLUGIN_DIR environment variable to the appropriate directory.
@@ -86,13 +86,13 @@ else() # Build from source
-DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0)
endif()
set(MARIADBCPP_INSTALL_DIR ${PROJECT_BINARY_DIR}/prefix)
set(MARIADBCPP_LIBRARY_DIR ${PROJECT_BINARY_DIR}/mariadbcpp)
set(MARIADBCPP_INSTALL_DIR ${CMAKE_BINARY_DIR}/prefix)
set(MARIADBCPP_LIBRARY_DIR ${CMAKE_BINARY_DIR}/mariadbcpp)
set(MARIADBCPP_PLUGIN_DIR ${MARIADBCPP_LIBRARY_DIR}/plugin)
set(MARIADBCPP_SOURCE_DIR ${PROJECT_SOURCE_DIR}/thirdparty/mariadb-connector-cpp)
set(MARIADB_INCLUDE_DIR "${MARIADBCPP_SOURCE_DIR}/include")
ExternalProject_Add(mariadb_connector_cpp
PREFIX "${PROJECT_BINARY_DIR}/thirdparty/mariadb-connector-cpp"
PREFIX "${CMAKE_BINARY_DIR}/thirdparty/mariadb-connector-cpp"
SOURCE_DIR ${MARIADBCPP_SOURCE_DIR}
INSTALL_DIR ${MARIADBCPP_INSTALL_DIR}
CMAKE_ARGS -Wno-dev
@@ -127,20 +127,20 @@ else() # Build from source
endif()
# Create mariadb connector library object
add_library(MariaDB::ConnCpp SHARED IMPORTED GLOBAL)
add_dependencies(MariaDB::ConnCpp mariadb_connector_cpp)
set_target_properties(MariaDB::ConnCpp PROPERTIES
add_library(mariadb_cpp_connector SHARED IMPORTED GLOBAL)
add_dependencies(mariadb_cpp_connector mariadb_connector_cpp)
set_target_properties(mariadb_cpp_connector PROPERTIES
IMPORTED_LOCATION "${MARIADBCPP_SHARED_LIBRARY_LOCATION}")
if(WIN32)
set_target_properties(MariaDB::ConnCpp PROPERTIES
set_target_properties(mariadb_cpp_connector PROPERTIES
IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}")
elseif(APPLE)
set_target_properties(MariaDB::ConnCpp PROPERTIES
set_target_properties(mariadb_cpp_connector PROPERTIES
IMPORTED_SONAME "libmariadbcpp")
endif()
# Add directories to include lists
target_include_directories(MariaDB::ConnCpp SYSTEM INTERFACE ${MARIADB_INCLUDE_DIR})
target_include_directories(mariadb_cpp_connector SYSTEM INTERFACE ${MARIADB_INCLUDE_DIR})
set(MariaDB_FOUND TRUE)
set(mariadb_found TRUE)

View File

@@ -45,11 +45,15 @@ if (UNIX)
elseif (WIN32)
include(FetchContent)
set(WITH_GTEST OFF CACHE BOOL "" FORCE)
set(ZLIB_ENABLE_TESTS OFF CACHE BOOL "" FORCE)
set(ZLIB_COMPAT ON CACHE BOOL "Enable ZLIB compatibility mode" FORCE)
# TODO Keep an eye on the zlib repository for an update to disable testing. Don't forget to update CMakePresets
FetchContent_Declare(
zlib
URL https://github.com/madler/zlib/archive/refs/tags/v1.2.11.zip
URL_HASH MD5=9d6a627693163bbbf3f26403a3a0b0b1
URL https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.2.2.zip
URL_HASH MD5=2cf9199fb785ea579a2a9905a75c38b3
)
# Disable warning about no project version.
@@ -60,7 +64,6 @@ elseif (WIN32)
FetchContent_MakeAvailable(zlib)
set(ZLIB_INCLUDE_DIRS ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR})
set_target_properties(zlib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}")
add_library(ZLIB::ZLIB ALIAS zlib)
else ()
message(

View File

@@ -9,6 +9,7 @@ namespace ZCompression {
}
int32_t Compress(const uint8_t* abSrc, int32_t nLenSrc, uint8_t* abDst, int32_t nLenDst) {
z_stream zInfo = { 0 };
zInfo.total_in = zInfo.avail_in = nLenSrc;
zInfo.total_out = zInfo.avail_out = nLenDst;

View File

@@ -4,8 +4,6 @@
#include "Game.h"
#include "Logger.h"
#include "zlib.h"
AssetManager::AssetManager(const std::filesystem::path& path) {
if (!std::filesystem::is_directory(path)) {
throw std::runtime_error("Attempted to load asset bundle (" + path.string() + ") however it is not a valid directory.");
@@ -82,7 +80,7 @@ bool AssetManager::HasFile(const char* name) {
if (fixedName.rfind("client\\res\\", 0) != 0) fixedName = "client\\res\\" + fixedName;
uint32_t crc = crc32b(0xFFFFFFFF, reinterpret_cast<uint8_t*>(const_cast<char*>(fixedName.c_str())), fixedName.size());
crc = crc32b(crc, reinterpret_cast<Bytef*>(const_cast<char*>("\0\0\0\0")), 4);
crc = crc32b(crc, reinterpret_cast<uint8_t*>(const_cast<char*>("\0\0\0\0")), 4);
for (const auto& item : this->m_PackIndex->GetPackFileIndices()) {
if (item.m_Crc == crc) {
@@ -130,7 +128,7 @@ bool AssetManager::GetFile(const char* name, char** data, uint32_t* len) {
}
int32_t packIndex = -1;
uint32_t crc = crc32b(0xFFFFFFFF, reinterpret_cast<uint8_t*>(const_cast<char*>(fixedName.c_str())), fixedName.size());
crc = crc32b(crc, reinterpret_cast<Bytef*>(const_cast<char*>("\0\0\0\0")), 4);
crc = crc32b(crc, reinterpret_cast<uint8_t*>(const_cast<char*>("\0\0\0\0")), 4);
for (const auto& item : this->m_PackIndex->GetPackFileIndices()) {
if (item.m_Crc == crc) {

View File

@@ -8,6 +8,8 @@
#define DARKFLAME_PLATFORM_IOS
#elif TARGET_OS_MAC
#define DARKFLAME_PLATFORM_MACOS
#pragma clang diagnostic push // prevent pragma messages being counted as a warning
#pragma clang diagnostic ignored "-W#pragma-messages"
#else
#error unknown Apple operating system
#endif

View File

@@ -4,7 +4,7 @@ add_subdirectory(GameDatabase)
add_library(dDatabase STATIC "MigrationRunner.cpp")
add_custom_target(conncpp_dylib
${CMAKE_COMMAND} -E copy $<TARGET_FILE:MariaDB::ConnCpp> ${PROJECT_BINARY_DIR})
${CMAKE_COMMAND} -E copy $<TARGET_FILE:mariadb_cpp_connector> ${CMAKE_BINARY_DIR})
add_dependencies(dDatabase conncpp_dylib)

View File

@@ -21,7 +21,7 @@ target_include_directories(dDatabaseGame PUBLIC "."
"${PROJECT_SOURCE_DIR}/dCommon/dEnums"
)
target_link_libraries(dDatabaseGame
PUBLIC MariaDB::ConnCpp
PUBLIC mariadb_cpp_connector
INTERFACE dCommon)
# Glob together all headers that need to be precompiled

View File

@@ -8,7 +8,8 @@ class AMFArrayValue;
/**
* @brief Sent when a player moves a Behavior A at position B to their inventory.
*/
#pragma warning("This Control Behavior Message does not have a test yet. Non-developers can ignore this warning.")
#pragma message("MoveToInventory.h This Control Behavior Message does not have a test yet. Non-developers can ignore this warning.")
class MoveToInventoryMessage : public BehaviorMessageBase {
public:
MoveToInventoryMessage(const AMFArrayValue& arguments);

View File

@@ -137,7 +137,7 @@ bool Precondition::CheckValue(Entity* player, const uint32_t value, bool evaluat
return inventoryComponent->GetLotCount(value) >= count;
case PreconditionType::DoesNotHaveItem:
return inventoryComponent->IsEquipped(value) < count;
return (inventoryComponent->IsEquipped(value) ? 1 : 0) < count;
case PreconditionType::HasAchievement:
if (missionComponent == nullptr) return false;
return missionComponent->GetMissionState(value) >= eMissionState::COMPLETE;

View File

@@ -65,13 +65,13 @@ void RandomSpawnerFin::OnStartup(Entity* self) {
};
sectionMultipliers = {
{"secA", 1},
{"secB", 1},
{"secA", 1.0f},
{"secB", 1.0f},
{"secC", 1.2f},
{"secD", 1.3f},
{"secE", 1.6f},
{"secF", 1},
{"secG", 1},
{"secF", 1.0f},
{"secG", 1.0f},
{"secH", 1.2f},
};

View File

@@ -65,7 +65,7 @@ void RandomSpawnerPit::OnStartup(Entity* self) {
};
sectionMultipliers = {
{"secA", 1},
{"secA", 1.0f},
{"secB", 1.2f},
{"secC", 1.2f},
{"secD", 1},

View File

@@ -65,8 +65,8 @@ void RandomSpawnerStr::OnStartup(Entity* self) {
};
sectionMultipliers = {
{"secA", 1},
{"secB", 1},
{"secA", 1.0f},
{"secB", 1.0f},
{"secC", 1.2f},
};

View File

@@ -21,7 +21,7 @@ add_executable(dCommonTests ${DCOMMONTEST_SOURCES})
# Needs to be in binary dir for ctest
if(APPLE)
add_custom_target(dCommonTestsLink
${CMAKE_COMMAND} -E copy $<TARGET_FILE:MariaDB::ConnCpp> ${CMAKE_CURRENT_BINARY_DIR})
${CMAKE_COMMAND} -E copy $<TARGET_FILE:mariadb_cpp_connector> ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(dCommonTests dCommonTestsLink)
endif()

View File

@@ -16,7 +16,7 @@ add_executable(dGameTests ${DGAMETEST_SOURCES})
if(APPLE)
add_custom_target(dGameTestsLink
${CMAKE_COMMAND} -E copy $<TARGET_FILE:MariaDB::ConnCpp> ${CMAKE_CURRENT_BINARY_DIR})
${CMAKE_COMMAND} -E copy $<TARGET_FILE:mariadb_cpp_connector> ${CMAKE_CURRENT_BINARY_DIR})
add_dependencies(dGameTests dGameTestsLink)
endif()