mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-12 05:42:26 +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)
|
void DynamicZone::ProcessCompassChange(const DynamicZoneLocation& location)
|
||||||
{
|
{
|
||||||
DynamicZoneBase::ProcessCompassChange(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 "../common/dynamic_zone_base.h"
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <functional>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -47,7 +46,6 @@ public:
|
|||||||
void SetSecondsRemaining(uint32_t seconds_remaining) override;
|
void SetSecondsRemaining(uint32_t seconds_remaining) override;
|
||||||
|
|
||||||
bool IsCurrentZoneDzInstance() const;
|
bool IsCurrentZoneDzInstance() const;
|
||||||
void RegisterOnCompassChange(const std::function<void()>& on_change) { m_on_compass_change = on_change; }
|
|
||||||
void SetUpdatedDuration(uint32_t seconds);
|
void SetUpdatedDuration(uint32_t seconds);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -61,8 +59,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
static void StartAllClientRemovalTimers();
|
static void StartAllClientRemovalTimers();
|
||||||
|
void SendCompassUpdateToZoneMembers();
|
||||||
std::function<void()> m_on_compass_change;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -62,7 +62,6 @@ void Expedition::SetDynamicZone(DynamicZone&& dz)
|
|||||||
dz.SetLeader(GetLeader());
|
dz.SetLeader(GetLeader());
|
||||||
|
|
||||||
m_dynamiczone = std::move(dz);
|
m_dynamiczone = std::move(dz);
|
||||||
m_dynamiczone.RegisterOnCompassChange([this]() { SendCompassUpdateToZoneMembers(); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Expedition* Expedition::TryCreate(
|
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)
|
bool Expedition::CanClientLootCorpse(Client* client, uint32_t npc_type_id, uint32_t spawn_id)
|
||||||
{
|
{
|
||||||
if (client && m_dynamiczone.IsCurrentZoneDzInstance())
|
if (client && m_dynamiczone.IsCurrentZoneDzInstance())
|
||||||
|
|||||||
@ -150,7 +150,6 @@ private:
|
|||||||
void SendMemberStatusToZoneMembers(uint32_t update_character_id, DynamicZoneMemberStatus status);
|
void SendMemberStatusToZoneMembers(uint32_t update_character_id, DynamicZoneMemberStatus status);
|
||||||
void SendMembersExpireWarning(uint32_t minutes);
|
void SendMembersExpireWarning(uint32_t minutes);
|
||||||
void SendUpdatesToZoneMembers(bool clear = false, bool message_on_clear = true);
|
void SendUpdatesToZoneMembers(bool clear = false, bool message_on_clear = true);
|
||||||
void SendCompassUpdateToZoneMembers();
|
|
||||||
void SendWorldExpeditionUpdate(uint16_t server_opcode);
|
void SendWorldExpeditionUpdate(uint16_t server_opcode);
|
||||||
void SendWorldAddPlayerInvite(const std::string& inviter_name, const std::string& swap_remove_name,
|
void SendWorldAddPlayerInvite(const std::string& inviter_name, const std::string& swap_remove_name,
|
||||||
const std::string& add_name, bool pending = false);
|
const std::string& add_name, bool pending = false);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user