Skip to content

Commit

Permalink
Merge branch 'main' into custom-pvp-system
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbesiren authored Sep 15, 2023
2 parents f64cb2f + 41ec6bb commit 6279804
Show file tree
Hide file tree
Showing 69 changed files with 2,862 additions and 2,224 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
text eol=lf
298 changes: 149 additions & 149 deletions cmake/modules/BaseConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,149 +1,149 @@
# *****************************************************************************
# CMake Features
# *****************************************************************************
set(CMAKE_CXX_STANDARD 20)
set(GNUCXX_MINIMUM_VERSION 11)
set(MSVC_MINIMUM_VERSION "19.32")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(Boost_NO_WARN_NEW_VERSIONS ON)

# Make will print more details
set(CMAKE_VERBOSE_MAKEFILE OFF)

# Generate compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# *****************************************************************************
# Packages / Libs
# *****************************************************************************
find_package(CURL CONFIG REQUIRED)
find_package(GMP REQUIRED)
find_package(LuaJIT REQUIRED)
find_package(MySQL REQUIRED)
find_package(Protobuf REQUIRED)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(asio CONFIG REQUIRED)
find_package(eventpp CONFIG REQUIRED)
find_package(jsoncpp CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)
find_package(mio REQUIRED)
find_package(pugixml CONFIG REQUIRED)
find_package(spdlog REQUIRED)
find_package(unofficial-argon2 CONFIG REQUIRED)
find_package(unofficial-libmariadb CONFIG REQUIRED)

find_path(BOOST_DI_INCLUDE_DIRS "boost/di.hpp")

# *****************************************************************************
# Sanity Checks
# *****************************************************************************
# === GCC Minimum Version ===
if (CMAKE_COMPILER_IS_GNUCXX)
message("-- Compiler: GCC - Version: ${CMAKE_CXX_COMPILER_VERSION}")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS GNUCXX_MINIMUM_VERSION)
message(FATAL_ERROR "GCC version must be at least ${GNUCXX_MINIMUM_VERSION}!")
endif()
endif()

# === Minimum required version for visual studio ===
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message("-- Compiler: Visual Studio - Version: ${CMAKE_CXX_COMPILER_VERSION}")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MSVC_MINIMUM_VERSION)
message(FATAL_ERROR "Visual Studio version must be at least ${MSVC_MINIMUM_VERSION}")
endif()
endif()

# *****************************************************************************
# Sanity Checks
# *****************************************************************************
option(TOGGLE_BIN_FOLDER "Use build/bin folder for generate compilation files" ON)
option(OPTIONS_ENABLE_OPENMP "Enable Open Multi-Processing support." ON)
option(DEBUG_LOG "Enable Debug Log" OFF)
option(ASAN_ENABLED "Build this target with AddressSanitizer" OFF)
option(BUILD_STATIC_LIBRARY "Build using static libraries" OFF)
option(SPEED_UP_BUILD_UNITY "Compile using build unity for speed up build" ON)

# === ASAN ===
if(ASAN_ENABLED)
log_option_enabled("asan")
if(MSVC)
add_compile_options(/fsanitize=address)
else()
add_compile_options(-fsanitize=address)
link_libraries(-fsanitize=address)
endif()
else()
log_option_disabled("asan")
endif()

# Build static libs
if(BUILD_STATIC_LIBRARY)
log_option_enabled("STATIC_LIBRARY")

if(MSVC)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
elseif(UNIX AND NOT APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
elseif(APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dylib")
endif()
else()
log_option_disabled("STATIC_LIBRARY")
endif()

# === DEBUG LOG ===
# cmake -DDEBUG_LOG=ON ..
if(DEBUG_LOG)
add_definitions(-DDEBUG_LOG=ON)
log_option_enabled("DEBUG LOG")
else()
log_option_disabled("DEBUG LOG")
endif(DEBUG_LOG)

# *****************************************************************************
# Compiler Options
# *****************************************************************************
if (MSVC)
foreach(type RELEASE DEBUG RELWITHDEBINFO MINSIZEREL)
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_${type} "${CMAKE_CXX_FLAGS_${type}}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_${type} "${CMAKE_C_FLAGS_${type}}")
endforeach(type)

add_compile_options(/MP /FS /Zf /EHsc)
endif (MSVC)

## Link compilation files to build/bin folder, else link to the main dir
function(set_output_directory target_name)
if (TOGGLE_BIN_FOLDER)
set_target_properties(${target_name}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
else()
set_target_properties(${target_name}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/"
)
endif()
endfunction()

## Setup shared target basic configurations
function(setup_target TARGET_NAME)
if (MSVC AND BUILD_STATIC_LIBRARY)
set_property(TARGET ${TARGET_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endfunction()

# *****************************************************************************
# DEBUG: Print cmake variables
# *****************************************************************************
#get_cmake_property(_variableNames VARIABLES)
#list (SORT _variableNames)
#foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()
# *****************************************************************************
# CMake Features
# *****************************************************************************
set(CMAKE_CXX_STANDARD 20)
set(GNUCXX_MINIMUM_VERSION 11)
set(MSVC_MINIMUM_VERSION "19.32")
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(Boost_NO_WARN_NEW_VERSIONS ON)

# Make will print more details
set(CMAKE_VERBOSE_MAKEFILE OFF)

# Generate compile_commands.json
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

# *****************************************************************************
# Packages / Libs
# *****************************************************************************
find_package(CURL CONFIG REQUIRED)
find_package(GMP REQUIRED)
find_package(LuaJIT REQUIRED)
find_package(MySQL REQUIRED)
find_package(Protobuf REQUIRED)
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_package(absl CONFIG REQUIRED)
find_package(asio CONFIG REQUIRED)
find_package(eventpp CONFIG REQUIRED)
find_package(jsoncpp CONFIG REQUIRED)
find_package(magic_enum CONFIG REQUIRED)
find_package(mio REQUIRED)
find_package(pugixml CONFIG REQUIRED)
find_package(spdlog REQUIRED)
find_package(unofficial-argon2 CONFIG REQUIRED)
find_package(unofficial-libmariadb CONFIG REQUIRED)

find_path(BOOST_DI_INCLUDE_DIRS "boost/di.hpp")

# *****************************************************************************
# Sanity Checks
# *****************************************************************************
# === GCC Minimum Version ===
if (CMAKE_COMPILER_IS_GNUCXX)
message("-- Compiler: GCC - Version: ${CMAKE_CXX_COMPILER_VERSION}")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS GNUCXX_MINIMUM_VERSION)
message(FATAL_ERROR "GCC version must be at least ${GNUCXX_MINIMUM_VERSION}!")
endif()
endif()

# === Minimum required version for visual studio ===
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
message("-- Compiler: Visual Studio - Version: ${CMAKE_CXX_COMPILER_VERSION}")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS MSVC_MINIMUM_VERSION)
message(FATAL_ERROR "Visual Studio version must be at least ${MSVC_MINIMUM_VERSION}")
endif()
endif()

# *****************************************************************************
# Sanity Checks
# *****************************************************************************
option(TOGGLE_BIN_FOLDER "Use build/bin folder for generate compilation files" ON)
option(OPTIONS_ENABLE_OPENMP "Enable Open Multi-Processing support." ON)
option(DEBUG_LOG "Enable Debug Log" OFF)
option(ASAN_ENABLED "Build this target with AddressSanitizer" OFF)
option(BUILD_STATIC_LIBRARY "Build using static libraries" OFF)
option(SPEED_UP_BUILD_UNITY "Compile using build unity for speed up build" ON)

# === ASAN ===
if(ASAN_ENABLED)
log_option_enabled("asan")
if(MSVC)
add_compile_options(/fsanitize=address)
else()
add_compile_options(-fsanitize=address)
link_libraries(-fsanitize=address)
endif()
else()
log_option_disabled("asan")
endif()

# Build static libs
if(BUILD_STATIC_LIBRARY)
log_option_enabled("STATIC_LIBRARY")

if(MSVC)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".lib")
elseif(UNIX AND NOT APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
elseif(APPLE)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".dylib")
endif()
else()
log_option_disabled("STATIC_LIBRARY")
endif()

# === DEBUG LOG ===
# cmake -DDEBUG_LOG=ON ..
if(DEBUG_LOG)
add_definitions(-DDEBUG_LOG=ON)
log_option_enabled("DEBUG LOG")
else()
log_option_disabled("DEBUG LOG")
endif(DEBUG_LOG)

# *****************************************************************************
# Compiler Options
# *****************************************************************************
if (MSVC)
foreach(type RELEASE DEBUG RELWITHDEBINFO MINSIZEREL)
string(REPLACE "/Zi" "/Z7" CMAKE_CXX_FLAGS_${type} "${CMAKE_CXX_FLAGS_${type}}")
string(REPLACE "/Zi" "/Z7" CMAKE_C_FLAGS_${type} "${CMAKE_C_FLAGS_${type}}")
endforeach(type)

add_compile_options(/MP /FS /Zf /EHsc)
endif (MSVC)

## Link compilation files to build/bin folder, else link to the main dir
function(set_output_directory target_name)
if (TOGGLE_BIN_FOLDER)
set_target_properties(${target_name}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
)
else()
set_target_properties(${target_name}
PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/"
)
endif()
endfunction()

## Setup shared target basic configurations
function(setup_target TARGET_NAME)
if (MSVC AND BUILD_STATIC_LIBRARY)
set_property(TARGET ${TARGET_NAME} PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
endif()
endfunction()

# *****************************************************************************
# DEBUG: Print cmake variables
# *****************************************************************************
#get_cmake_property(_variableNames VARIABLES)
#list (SORT _variableNames)
#foreach (_variableName ${_variableNames})
# message(STATUS "${_variableName}=${${_variableName}}")
#endforeach()
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,6 @@ monster.flags = {
canWalkOnPoison = true,
}

monster.events = {
"Evaporate",
}

monster.events = {
"Evaporate",
}

monster.light = {
level = 0,
color = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ monster.flags = {
canWalkOnPoison = true,
}

monster.events = {
"Splash",
}

monster.events = {
"Splash",
}

monster.light = {
level = 0,
color = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ monster.light = {
color = 0,
}

monster.events = {
"EnergyPrism",
}

monster.voices = {
interval = 5000,
chance = 10,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,6 @@ monster.flags = {
canWalkOnPoison = true,
}

monster.events = {
"AnomalyTransform",
"HeartBossDeath",
}

monster.events = {
"AnomalyTransform",
"HeartBossDeath",
}

monster.light = {
level = 0,
color = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ monster.flags = {
canWalkOnPoison = true,
}

monster.events = {
"GrandChaplainGaunderDeath",
}

monster.light = {
level = 0,
color = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ monster.flags = {
canWalkOnPoison = true,
}

monster.events = {
"GrandCommanderSoerenDeath",
}

monster.light = {
level = 0,
color = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ monster.flags = {
canWalkOnPoison = true,
}

monster.events = {
"gorzindelDeath",
}

monster.light = {
level = 0,
color = 0,
Expand Down
Loading

0 comments on commit 6279804

Please sign in to comment.