From 94016fb436814bde200c7dd79e2a751f4b396efa Mon Sep 17 00:00:00 2001 From: yamashi Date: Fri, 22 Apr 2022 18:18:32 +0200 Subject: [PATCH] fix: spdlog 1.10 build & regex bug --- Code/client/Services/Generic/CharacterService.cpp | 2 +- Code/client/Services/Generic/MagicService.cpp | 4 ++-- Code/client/Utils.cpp | 2 +- Code/server/Services/OverlayService.cpp | 2 +- Libraries/xmake.lua | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Code/client/Services/Generic/CharacterService.cpp b/Code/client/Services/Generic/CharacterService.cpp index 7754d01b1..12ecfae3f 100644 --- a/Code/client/Services/Generic/CharacterService.cpp +++ b/Code/client/Services/Generic/CharacterService.cpp @@ -1087,7 +1087,7 @@ void CharacterService::RequestServerAssignment(entt::registry& aRegistry, const message.LatestAction = pExtension->LatestAnimation; pActor->SaveAnimationVariables(message.LatestAction.Variables); - spdlog::info("Request id: {:X}, cookie: {:X}, {:X}", formIdComponent.Id, sCookieSeed, aEntity); + spdlog::info("Request id: {:X}, cookie: {:X}, {:X}", formIdComponent.Id, sCookieSeed, to_integral(aEntity)); if (m_transport.Send(message)) { diff --git a/Code/client/Services/Generic/MagicService.cpp b/Code/client/Services/Generic/MagicService.cpp index 3e0faf84d..d48e77ce8 100644 --- a/Code/client/Services/Generic/MagicService.cpp +++ b/Code/client/Services/Generic/MagicService.cpp @@ -318,13 +318,13 @@ void MagicService::OnAddTargetEvent(const AddTargetEvent& acEvent) noexcept if (!m_world.GetModSystem().GetServerModId(acEvent.SpellID, request.SpellId.ModId, request.SpellId.BaseId)) { - spdlog::error("{s}: Could not find spell with form {:X}", __FUNCTION__, acEvent.SpellID); + spdlog::error("{}: Could not find spell with form {:X}", __FUNCTION__, acEvent.SpellID); return; } if (!m_world.GetModSystem().GetServerModId(acEvent.EffectID, request.EffectId.ModId, request.EffectId.BaseId)) { - spdlog::error("{s}: Could not find effect with form {:X}", __FUNCTION__, acEvent.EffectID); + spdlog::error("{}: Could not find effect with form {:X}", __FUNCTION__, acEvent.EffectID); return; } diff --git a/Code/client/Utils.cpp b/Code/client/Utils.cpp index b3e7a7b4f..0dd58fb61 100644 --- a/Code/client/Utils.cpp +++ b/Code/client/Utils.cpp @@ -21,7 +21,7 @@ std::optional GetServerId(entt::entity aEntity) noexcept else { const auto* pFormIdComponent = World::Get().try_get(aEntity); - spdlog::warn("This entity has neither a local or remote component: {:X}, form id: {:X}", aEntity, pFormIdComponent ? pFormIdComponent->Id : 0); + spdlog::warn("This entity has neither a local or remote component: {:X}, form id: {:X}", to_integral(aEntity), pFormIdComponent ? pFormIdComponent->Id : 0); return std::nullopt; } diff --git a/Code/server/Services/OverlayService.cpp b/Code/server/Services/OverlayService.cpp index f227d0da0..415fdbdfc 100644 --- a/Code/server/Services/OverlayService.cpp +++ b/Code/server/Services/OverlayService.cpp @@ -33,7 +33,7 @@ void OverlayService::HandleChatMessage(const PacketEvent notifyMessage.PlayerName = acMessage.pPlayer->GetUsername(); // TODO: std regex is slow - std::regex escapeHtml{"<[^>]+>\s+(?=<)|<[^>]+>"}; + std::regex escapeHtml{"<[^>]+>\\s+(?=<)|<[^>]+>"}; notifyMessage.ChatMessage = std::regex_replace(acMessage.Packet.ChatMessage, escapeHtml, ""); GameServer::Get()->SendToPlayers(notifyMessage); diff --git a/Libraries/xmake.lua b/Libraries/xmake.lua index 400db2bab..6f8176d2d 100644 --- a/Libraries/xmake.lua +++ b/Libraries/xmake.lua @@ -6,7 +6,7 @@ add_requireconfs("cpp-httplib", {configs = {ssl = true}}) add_requires( "tiltedcore", "cryptopp", - "spdlog 1.9", + "spdlog", "cpp-httplib", "gtest", "mem")