#include #include #include #include #include #include MapService::MapService(World& aWorld, entt::dispatcher& aDispatcher) noexcept : m_world(aWorld) { m_playerSetWaypointConnection = aDispatcher.sink>().connect<&MapService::OnSetWaypointRequest>(this); m_playerRemoveWaypointConnection = aDispatcher.sink>().connect<&MapService::OnRemoveWaypointRequest>(this); } void MapService::OnSetWaypointRequest(const PacketEvent& acMessage) const noexcept { auto& message = acMessage.Packet; NotifySetWaypoint notify{}; notify.Position = message.Position; notify.WorldSpaceFormID = message.WorldSpaceFormID; const auto& partyComponent = acMessage.pPlayer->GetParty(); if (!partyComponent.JoinedPartyId.has_value()) return; GameServer::Get()->SendToParty(notify, partyComponent, acMessage.GetSender()); } void MapService::OnRemoveWaypointRequest(const PacketEvent& acMessage) const noexcept { NotifyRemoveWaypoint notify{}; const auto& partyComponent = acMessage.pPlayer->GetParty(); if (!partyComponent.JoinedPartyId.has_value()) return; GameServer::Get()->SendToParty(notify, partyComponent, acMessage.GetSender()); }