mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-03 23:03:51 +00:00
[Expeditions] Move member compass updates to dz (#1371)
This commit is contained in:
parent
5b3ab59b7c
commit
b61cc85b5f
@ -209,8 +209,17 @@ void DynamicZone::HandleWorldMessage(ServerPacket* pack)
|
||||
void DynamicZone::ProcessCompassChange(const DynamicZoneLocation& location)
|
||||
{
|
||||
DynamicZoneBase::ProcessCompassChange(location);
|
||||
if (m_on_compass_change)
|
||||
SendCompassUpdateToZoneMembers();
|
||||
}
|
||||
|
||||
void DynamicZone::SendCompassUpdateToZoneMembers()
|
||||
{
|
||||
for (const auto& member : m_members)
|
||||
{
|
||||
m_on_compass_change();
|
||||
Client* member_client = entity_list.GetClientByCharID(member.id);
|
||||
if (member_client)
|
||||
{
|
||||
member_client->SendDzCompassUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
|
||||
#include "../common/dynamic_zone_base.h"
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
@ -47,7 +46,6 @@ public:
|
||||
void SetSecondsRemaining(uint32_t seconds_remaining) override;
|
||||
|
||||
bool IsCurrentZoneDzInstance() const;
|
||||
void RegisterOnCompassChange(const std::function<void()>& on_change) { m_on_compass_change = on_change; }
|
||||
void SetUpdatedDuration(uint32_t seconds);
|
||||
|
||||
protected:
|
||||
@ -61,8 +59,7 @@ protected:
|
||||
|
||||
private:
|
||||
static void StartAllClientRemovalTimers();
|
||||
|
||||
std::function<void()> m_on_compass_change;
|
||||
void SendCompassUpdateToZoneMembers();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@ -62,7 +62,6 @@ void Expedition::SetDynamicZone(DynamicZone&& dz)
|
||||
dz.SetLeader(GetLeader());
|
||||
|
||||
m_dynamiczone = std::move(dz);
|
||||
m_dynamiczone.RegisterOnCompassChange([this]() { SendCompassUpdateToZoneMembers(); });
|
||||
}
|
||||
|
||||
Expedition* Expedition::TryCreate(
|
||||
@ -1840,18 +1839,6 @@ void Expedition::HandleWorldMessage(ServerPacket* pack)
|
||||
}
|
||||
}
|
||||
|
||||
void Expedition::SendCompassUpdateToZoneMembers()
|
||||
{
|
||||
for (const auto& member : GetDynamicZone().GetMembers())
|
||||
{
|
||||
Client* member_client = entity_list.GetClientByCharID(member.id);
|
||||
if (member_client)
|
||||
{
|
||||
member_client->SendDzCompassUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool Expedition::CanClientLootCorpse(Client* client, uint32_t npc_type_id, uint32_t spawn_id)
|
||||
{
|
||||
if (client && m_dynamiczone.IsCurrentZoneDzInstance())
|
||||
|
||||
@ -150,7 +150,6 @@ private:
|
||||
void SendMemberStatusToZoneMembers(uint32_t update_character_id, DynamicZoneMemberStatus status);
|
||||
void SendMembersExpireWarning(uint32_t minutes);
|
||||
void SendUpdatesToZoneMembers(bool clear = false, bool message_on_clear = true);
|
||||
void SendCompassUpdateToZoneMembers();
|
||||
void SendWorldExpeditionUpdate(uint16_t server_opcode);
|
||||
void SendWorldAddPlayerInvite(const std::string& inviter_name, const std::string& swap_remove_name,
|
||||
const std::string& add_name, bool pending = false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user