Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Apr 5, 2024
1 parent 62ff7ef commit fa81a9c
Show file tree
Hide file tree
Showing 41 changed files with 865 additions and 548 deletions.
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
# VCPKG
# cmake -DCMAKE_TOOLCHAIN_FILE=/opt/workspace/vcpkg/scripts/buildsystems/vcpkg.cmake ..
# Needed libs is in file vcpkg.json
# Windows required libs: .\vcpkg install --triplet x64-windows asio pugixml spdlog curl jsoncpp protobuf parallel-hashmap magic-enum mio luajit libmariadb mpir abseil
# Windows required libs: .\vcpkg install --triplet x64-windows asio pugixml spdlog curl protobuf parallel-hashmap magic-enum mio luajit libmariadb mpir abseil
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
CACHE STRING "")
Expand Down Expand Up @@ -48,11 +48,18 @@ include(LoggingHelper)
option(OPTIONS_ENABLE_CCACHE "Enable ccache" OFF)
option(OPTIONS_ENABLE_SCCACHE "Use sccache to speed up compilation process" OFF)
option(OPTIONS_ENABLE_IPO "Check and Enable interprocedural optimization (IPO/LTO)" ON)
option(FEATURE_METRICS "Enable metrics feature" OFF)

# *****************************************************************************
# Options Code
# *****************************************************************************

if(FEATURE_METRIC)
log_option_enabled("metrics")
else ()
log_option_disabled("metrics")
endif ()

# === CCACHE ===
if(OPTIONS_ENABLE_CCACHE)
find_program(CCACHE ccache)
Expand Down
7 changes: 4 additions & 3 deletions cmake/modules/BaseConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ 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(opentelemetry-cpp CONFIG REQUIRED)
find_package(prometheus-cpp CONFIG REQUIRED)
if(FEATURE_METRICS)
find_package(opentelemetry-cpp CONFIG REQUIRED)
find_package(prometheus-cpp CONFIG REQUIRED)
endif()
find_package(mio REQUIRED)
find_package(pugixml CONFIG REQUIRED)
find_package(spdlog REQUIRED)
Expand Down
28 changes: 17 additions & 11 deletions cmake/modules/CanaryLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -105,17 +105,25 @@ target_link_libraries(${PROJECT_NAME}_lib
unofficial::argon2::libargon2
unofficial::libmariadb
unofficial::mariadbclient
opentelemetry-cpp::common
opentelemetry-cpp::metrics
opentelemetry-cpp::api
opentelemetry-cpp::ext
opentelemetry-cpp::sdk
opentelemetry-cpp::logs
opentelemetry-cpp::ostream_metrics_exporter
opentelemetry-cpp::prometheus_exporter
protobuf
)

if(FEATURE_METRICS)
add_definitions(-DFEATURE_METRICS)

target_link_libraries(${PROJECT_NAME}_lib
PUBLIC
opentelemetry-cpp::common
opentelemetry-cpp::metrics
opentelemetry-cpp::api
opentelemetry-cpp::ext
opentelemetry-cpp::sdk
opentelemetry-cpp::logs
opentelemetry-cpp::ostream_metrics_exporter
opentelemetry-cpp::prometheus_exporter
)
endif()

if(CMAKE_BUILD_TYPE MATCHES Debug)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC ${ZLIB_LIBRARY_DEBUG})
else()
Expand All @@ -124,16 +132,14 @@ endif()

if (MSVC)
if(BUILD_STATIC_LIBRARY)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC jsoncpp_static)
set(VCPKG_TARGET_TRIPLET "x64-windows-static" CACHE STRING "")
else()
target_link_libraries(${PROJECT_NAME}_lib PUBLIC jsoncpp_lib)
set(VCPKG_TARGET_TRIPLET "x64-windows" CACHE STRING "")
endif()

target_link_libraries(${PROJECT_NAME}_lib PUBLIC ${CMAKE_THREAD_LIBS_INIT} ${MYSQL_CLIENT_LIBS})
else()
target_link_libraries(${PROJECT_NAME}_lib PUBLIC jsoncpp_static Threads::Threads)
target_link_libraries(${PROJECT_NAME}_lib PUBLIC Threads::Threads)
endif (MSVC)

# === OpenMP ===
Expand Down
4 changes: 2 additions & 2 deletions data/XML/events.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<events>
<event name="Example Event 1" startdate="11/03/2020" enddate="12/30/2023" script="example.lua" >
<ingame exprate="100" lootrate="100" spawnrate="100" skillrate="100" />
<ingame exprate="100" lootrate="100" bosslootrate="100" spawnrate="100" skillrate="100" />
<description description="Otserver br example 1 description double exp and a half, double loot !chance!, regular spawn and double skill" />
<colors colordark="#235c00" colorlight="#2d7400" />
<details displaypriority="6" isseasonal="0" specialevent="0" />
</event>
<event name="Example Event 2" startdate="2/2/2022" enddate="12/31/2023" script="" >
<ingame exprate="100" lootrate="100" spawnrate="100" skillrate="100" />
<ingame exprate="100" lootrate="100" bosslootrate="100" spawnrate="100" skillrate="100" />
<description description="Otserver br example 2 description 50% less exp, triple loot !chance!, 50% faster spawn and regular skill" />
<colors colordark="#735D10" colorlight="#8B6D05" />
<details displaypriority="6" isseasonal="0" specialevent="0" />
Expand Down
2 changes: 1 addition & 1 deletion data/items/items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34797,7 +34797,7 @@
<attribute key="showduration" value="1"/>
<attribute key="showAttributes" value="1"/>
<attribute key="absorbpercentphysical" value="10"/>
<attribute key="absorbpercentpoison" value="8"/>
<attribute key="absorbpercentenergy" value="8"/>
<attribute key="duration" value="3600"/>
<attribute key="transformdeequipto" value="16114"/>
<attribute key="decayTo" value="0"/>
Expand Down
10 changes: 4 additions & 6 deletions data/modules/scripts/daily_reward/daily_reward.lua
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,12 @@ function Player.selectDailyReward(self, msg)
local description = ""
for k, v in ipairs(items) do
if dailyTable.itemCharges then
for i = 1, rewardCount do
local inboxItem = inbox:addItem(v.itemId, dailyTable.itemCharges) -- adding charges for each item
if inboxItem then
inboxItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime())
end
local inboxItem = inbox:addItem(v.itemId, dailyTable.itemCharges) -- adding charges for each item
if inboxItem then
inboxItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime())
end
else
local inboxItem = inbox:addItem(v.itemId, rewardCount) -- adding single item w/o charges
local inboxItem = inbox:addItem(v.itemId, v.count) -- adding single item w/o charges
if inboxItem then
inboxItem:setAttribute(ITEM_ATTRIBUTE_STORE, systemTime())
end
Expand Down
Loading

0 comments on commit fa81a9c

Please sign in to comment.