From 91a7124e3459a95cae14e1f20053c296e8044c43 Mon Sep 17 00:00:00 2001 From: Matt Gomez Date: Wed, 13 Dec 2023 10:26:07 -0600 Subject: [PATCH] update : https://github.com/opentibiabr/canary/commit/e570944aee0fa517a9167aa8771d69b8075b70ba --- cmake/modules/BaseConfig.cmake | 2 ++ cmake/modules/CanaryLib.cmake | 8 ++++++++ config.lua.dist | 18 +++++++++++++++++- docker/Dockerfile.arm | 1 + docker/Dockerfile.dev | 1 + docker/Dockerfile.x86 | 1 + schema.sql | 3 +-- tests/fixture/kv/in_memory_kv.hpp | 3 +++ vcpkg.json | 25 +++++++++++++++---------- vcproj/otxserver.vcxproj | 10 +++++++++- vcproj/settings.props | 18 ++++++++++++++++++ 11 files changed, 76 insertions(+), 14 deletions(-) diff --git a/cmake/modules/BaseConfig.cmake b/cmake/modules/BaseConfig.cmake index 86b2890d1..b79167ed6 100644 --- a/cmake/modules/BaseConfig.cmake +++ b/cmake/modules/BaseConfig.cmake @@ -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) diff --git a/cmake/modules/CanaryLib.cmake b/cmake/modules/CanaryLib.cmake index 4b7d69d2b..d5fdd782b 100644 --- a/cmake/modules/CanaryLib.cmake +++ b/cmake/modules/CanaryLib.cmake @@ -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) diff --git a/config.lua.dist b/config.lua.dist index aaabedcb2..d15166d74 100644 --- a/config.lua.dist +++ b/config.lua.dist @@ -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 @@ -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 @@ -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 @@ -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 @@ -218,6 +224,7 @@ buyAolCommandFee = 0 buyBlessCommandFee = 0 teleportPlayerToVocationRoom = true toggleReceiveReward = false +randomMonsterSpawn = false -- Teleport summon -- Set to true will never remove the summon @@ -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 diff --git a/docker/Dockerfile.arm b/docker/Dockerfile.arm index a9d0cc476..c9ee9efa0 100644 --- a/docker/Dockerfile.arm +++ b/docker/Dockerfile.arm @@ -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/* diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index 6dc18d437..acbd6f52b 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -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/* diff --git a/docker/Dockerfile.x86 b/docker/Dockerfile.x86 index a08105aa8..b0e0533af 100644 --- a/docker/Dockerfile.x86 +++ b/docker/Dockerfile.x86 @@ -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/* diff --git a/schema.sql b/schema.sql index 3ba4e35ef..756339fd9 100644 --- a/schema.sql +++ b/schema.sql @@ -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` ( @@ -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 diff --git a/tests/fixture/kv/in_memory_kv.hpp b/tests/fixture/kv/in_memory_kv.hpp index b738a9847..84a84ba8d 100644 --- a/tests/fixture/kv/in_memory_kv.hpp +++ b/tests/fixture/kv/in_memory_kv.hpp @@ -35,6 +35,9 @@ class KVMemory final : public KVStore { } protected: + std::vector loadPrefix(const std::string &prefix = "") override { + return {}; + } std::optional load(const std::string &key) override { return std::nullopt; } diff --git a/vcpkg.json b/vcpkg.json index be553722c..990d90c34 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -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", @@ -31,5 +36,5 @@ "platform": "windows" } ], - "builtin-baseline": "c9fa965c2a1b1334469b4539063f3ce95383653c" + "builtin-baseline": "98a562a04cd03728f399e79e1b37bcccb5a69b37" } diff --git a/vcproj/otxserver.vcxproj b/vcproj/otxserver.vcxproj index 00da63152..8bcd7d281 100644 --- a/vcproj/otxserver.vcxproj +++ b/vcproj/otxserver.vcxproj @@ -108,6 +108,7 @@ + @@ -128,6 +129,7 @@ + @@ -136,6 +138,7 @@ + @@ -303,6 +306,7 @@ + @@ -325,6 +329,7 @@ + @@ -502,6 +507,8 @@ true true true + Default + /Zc:__cplusplus %(AdditionalOptions) Console @@ -534,6 +541,7 @@ true true true + /Zc:__cplusplus %(AdditionalOptions) Console @@ -551,4 +559,4 @@ - + \ No newline at end of file diff --git a/vcproj/settings.props b/vcproj/settings.props index 9f01a7890..1f7471f48 100644 --- a/vcproj/settings.props +++ b/vcproj/settings.props @@ -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 comctl32.lib; @@ -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