Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mattyx14 committed Dec 13, 2023
1 parent 9519cee commit 91a7124
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 14 deletions.
2 changes: 2 additions & 0 deletions cmake/modules/BaseConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ 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)
find_package(mio REQUIRED)
find_package(pugixml CONFIG REQUIRED)
find_package(spdlog REQUIRED)
Expand Down
8 changes: 8 additions & 0 deletions cmake/modules/CanaryLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ 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
)

if(CMAKE_BUILD_TYPE MATCHES Debug)
Expand Down
18 changes: 17 additions & 1 deletion config.lua.dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ maintainModeMessage = ""

-- Combat settings
-- NOTE: valid values for worldType are: "pvp", "no-pvp" and "pvp-enforced"
-- NOTE: removeBeginningWeaponAmmunition: spears, arrows, bolt have endless ammo (allows training for paladins)
-- NOTE: refundManaOnBeginningWeapons: wand of vortex and snakebite refund mana used (allows training for mages)
worldType = "pvp"
hotkeyAimbotEnabled = true
protectionLevel = 7
Expand All @@ -31,6 +33,8 @@ removeChargesFromRunes = true
removeChargesFromPotions = true
removeWeaponAmmunition = true
removeWeaponCharges = true
removeBeginningWeaponAmmunition = true
refundBeginningWeaponMana = false
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 15 * 60 * 1000
stairJumpExhaustion = 2 * 1000
Expand Down Expand Up @@ -58,12 +62,13 @@ statusProtocolPort = 7171
maxPlayers = 0
serverName = "OTXServer"
serverMotd = "Welcome to The OTX Server"
onePlayerOnlinePerAccount = true
statusTimeout = 5 * 1000
replaceKickOnLogin = true
maxPacketsPerSecond = 25
maxItem = 2000
maxContainer = 100
maxPlayersOnlinePerAccount = 1
maxPlayersOutsidePZPerAccount = 1

-- Packet Compression
-- Minimize network bandwith and reduce ping
Expand Down Expand Up @@ -203,6 +208,7 @@ onlyPremiumAccount = false
-- NOTE: buyBlessCommandFee will add fee when player buy bless by command (!bless), active changing value between 1 and 100 (fee percent. ex: 3 = 3%, 30 = 30%)
-- NOTE: teleportPlayerToVocationRoom will enable oressa to teleport player to his/her room vocation
-- NOTE: toggleReceiveReward = true, will enable players to choose one of reward exercise weapon by command !reward
-- NOTE: randomMonsterSpawn = true, will enable monsters from the same spawn to be randomized between them, thus making a variable hunt
weatherRain = false
thunderEffect = false
allConsoleLog = false
Expand All @@ -218,6 +224,7 @@ buyAolCommandFee = 0
buyBlessCommandFee = 0
teleportPlayerToVocationRoom = true
toggleReceiveReward = false
randomMonsterSpawn = false

-- Teleport summon
-- Set to true will never remove the summon
Expand Down Expand Up @@ -486,3 +493,12 @@ vipKeepHouse = false
-- NOTE set rewardChestMaxCollectItems max items per collect action
rewardChestCollectEnabled = true
rewardChestMaxCollectItems = 200

-- Metrics
--- Prometheus
metricsEnablePrometheus = false
metricsPrometheusAddress = "0.0.0.0:9464"

--- OStream
metricsEnableOstream = false
metricsOstreamInterval = 1000
1 change: 1 addition & 0 deletions docker/Dockerfile.arm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM ubuntu:23.04 AS dependencies
RUN apt-get update && apt-get install -y --no-install-recommends cmake git \
unzip build-essential ca-certificates curl zip unzip tar \
pkg-config ninja-build autoconf automake libtool libluajit-5.1-dev libluajit-5.1-common \
python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends cmake git \
unzip build-essential ca-certificates curl zip unzip tar \
pkg-config ninja-build autoconf automake libtool \
python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.x86
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM ubuntu:23.04 AS dependencies
RUN apt-get update && apt-get install -y --no-install-recommends cmake git \
unzip build-essential ca-certificates curl zip unzip tar \
pkg-config ninja-build autoconf automake libtool \
python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
3 changes: 1 addition & 2 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE IF NOT EXISTS `server_config` (
CONSTRAINT `server_config_pk` PRIMARY KEY (`config`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `server_config` (`config`, `value`) VALUES ('db_version', '41'), ('motd_hash', ''), ('motd_num', '0'), ('players_record', '0');
INSERT INTO `server_config` (`config`, `value`) VALUES ('db_version', '43'), ('motd_hash', ''), ('motd_num', '0'), ('players_record', '0');

-- Table structure `accounts`
CREATE TABLE IF NOT EXISTS `accounts` (
Expand Down Expand Up @@ -331,7 +331,6 @@ CREATE TABLE IF NOT EXISTS `guildwar_kills` (
`time` bigint(15) NOT NULL,
INDEX `warid` (`warid`),
CONSTRAINT `guildwar_kills_pk` PRIMARY KEY (`id`),
CONSTRAINT `guildwar_kills_unique` UNIQUE (`warid`),
CONSTRAINT `guildwar_kills_warid_fk`
FOREIGN KEY (`warid`) REFERENCES `guild_wars` (`id`)
ON DELETE CASCADE
Expand Down
3 changes: 3 additions & 0 deletions tests/fixture/kv/in_memory_kv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class KVMemory final : public KVStore {
}

protected:
std::vector<std::string> loadPrefix(const std::string &prefix = "") override {
return {};
}
std::optional<ValueWrapper> load(const std::string &key) override {
return std::nullopt;
}
Expand Down
25 changes: 15 additions & 10 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,30 @@
"name": "otxserver",
"version-string": "6.2.0",
"dependencies": [
"abseil",
"argon2",
"asio",
"bext-di",
"bext-ut",
"eventpp",
"pugixml",
"spdlog",
"curl",
"eventpp",
"jsoncpp",
"protobuf",
"parallel-hashmap",
"luajit",
"magic-enum",
"zlib",
"mio",
"luajit",
"abseil",
{
"name": "opentelemetry-cpp",
"default-features": true,
"features": ["otlp-http", "prometheus"]
},
"parallel-hashmap",
"protobuf",
"pugixml",
"spdlog",
"zlib",
{
"name": "libmariadb",
"features": [ "mariadbclient" ]
"features": ["mariadbclient"]
},
{
"name": "gmp",
Expand All @@ -31,5 +36,5 @@
"platform": "windows"
}
],
"builtin-baseline": "c9fa965c2a1b1334469b4539063f3ce95383653c"
"builtin-baseline": "98a562a04cd03728f399e79e1b37bcccb5a69b37"
}
10 changes: 9 additions & 1 deletion vcproj/otxserver.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
<ClInclude Include="..\src\lib\di\soft_singleton.hpp" />
<ClInclude Include="..\src\lib\logging\logger.hpp" />
<ClInclude Include="..\src\lib\logging\log_with_spd_log.hpp" />
<ClInclude Include="..\src\lib\metrics\metrics.hpp" />
<ClInclude Include="..\src\lib\thread\thread_pool.hpp" />
<ClInclude Include="..\src\lib\messaging\command.hpp" />
<ClInclude Include="..\src\lib\messaging\event.hpp" />
Expand All @@ -128,6 +129,7 @@
<ClInclude Include="..\src\lua\functions\core\game\global_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\game\bank_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\game\zone_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\game\zone_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\game\lua_enums.hpp" />
<ClInclude Include="..\src\lua\functions\core\game\modal_window_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\libs\bit_functions.hpp" />
Expand All @@ -136,6 +138,7 @@
<ClInclude Include="..\src\lua\functions\core\libs\db_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\libs\result_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\libs\logger_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\libs\metrics_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\network\core_network_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\network\network_message_functions.hpp" />
<ClInclude Include="..\src\lua\functions\core\network\webhook_functions.hpp" />
Expand Down Expand Up @@ -303,6 +306,7 @@
<ClCompile Include="..\src\kv\kv.cpp" />
<ClCompile Include="..\src\lib\di\soft_singleton.cpp" />
<ClCompile Include="..\src\lib\logging\log_with_spd_log.cpp" />
<ClCompile Include="..\src\lib\metrics\metrics.cpp" />
<ClCompile Include="..\src\lib\thread\thread_pool.cpp" />
<ClCompile Include="..\src\lua\callbacks\creaturecallback.cpp" />
<ClCompile Include="..\src\lua\callbacks\event_callback.cpp" />
Expand All @@ -325,6 +329,7 @@
<ClCompile Include="..\src\lua\functions\core\libs\db_functions.cpp" />
<ClCompile Include="..\src\lua\functions\core\libs\result_functions.cpp" />
<ClCompile Include="..\src\lua\functions\core\libs\logger_functions.cpp" />
<ClCompile Include="..\src\lua\functions\core\libs\metrics_functions.cpp" />
<ClCompile Include="..\src\lua\functions\core\network\network_message_functions.cpp" />
<ClCompile Include="..\src\lua\functions\core\network\webhook_functions.cpp" />
<ClCompile Include="..\src\lua\functions\creatures\combat\combat_functions.cpp" />
Expand Down Expand Up @@ -502,6 +507,8 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<IncludeInUnityFile>true</IncludeInUnityFile>
<OpenMPSupport>true</OpenMPSupport>
<LanguageStandard_C>Default</LanguageStandard_C>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand Down Expand Up @@ -534,6 +541,7 @@
<WholeProgramOptimization>true</WholeProgramOptimization>
<IncludeInUnityFile>true</IncludeInUnityFile>
<OpenMPSupport>true</OpenMPSupport>
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
Expand All @@ -551,4 +559,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
18 changes: 18 additions & 0 deletions vcproj/settings.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@
jsoncpp.lib;
abseil_dll.lib;
argon2.lib;
opentelemetry_common.lib;
opentelemetry_resources.lib;
opentelemetry_metrics.lib;
opentelemetry_exporter_ostream_metrics.lib;
opentelemetry_exporter_prometheus.lib;
prometheus-cpp-core.lib;
prometheus-cpp-pull.lib;
civetweb.lib;
civetweb-cpp.lib
</CANARY_LIBDEPS>
<CANARY_LIBDEPS_D>
comctl32.lib;
Expand All @@ -41,6 +50,15 @@
jsoncpp.lib;
abseil_dll.lib;
argon2.lib;
opentelemetry_common.lib;
opentelemetry_resources.lib;
opentelemetry_metrics.lib;
opentelemetry_exporter_ostream_metrics.lib;
opentelemetry_exporter_prometheus.lib;
prometheus-cpp-core.lib;
prometheus-cpp-pull.lib;
civetweb.lib;
civetweb-cpp.lib
</CANARY_LIBDEPS_D>
</PropertyGroup>
<PropertyGroup>
Expand Down

0 comments on commit 91a7124

Please sign in to comment.