Skip to content

Commit

Permalink
fix: spdlog 1.10 build & regex bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamashi committed Apr 22, 2022
1 parent 6c19df0 commit 94016fb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Code/client/Services/Generic/CharacterService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
4 changes: 2 additions & 2 deletions Code/client/Services/Generic/MagicService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Code/client/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ std::optional<uint32_t> GetServerId(entt::entity aEntity) noexcept
else
{
const auto* pFormIdComponent = World::Get().try_get<FormIdComponent>(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;
}

Expand Down
2 changes: 1 addition & 1 deletion Code/server/Services/OverlayService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void OverlayService::HandleChatMessage(const PacketEvent<SendChatMessageRequest>
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);
Expand Down
2 changes: 1 addition & 1 deletion Libraries/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ add_requireconfs("cpp-httplib", {configs = {ssl = true}})
add_requires(
"tiltedcore",
"cryptopp",
"spdlog 1.9",
"spdlog",
"cpp-httplib",
"gtest",
"mem")
Expand Down

0 comments on commit 94016fb

Please sign in to comment.